Commit 43525ad6fdbcfa68c00d9a7c5221e4b6a3a1824a

Authored by mcy123
1 parent 0618c00b

mcy

src/main/java/com/bsth/controller/forms/ExportController.java
... ... @@ -13,8 +13,10 @@ import org.springframework.web.bind.annotation.RequestMethod;
13 13 import org.springframework.web.bind.annotation.RequestParam;
14 14 import org.springframework.web.bind.annotation.RestController;
15 15  
  16 +import com.bsth.data.BasicData;
16 17 import com.bsth.entity.mcy_forms.Allline;
17 18 import com.bsth.entity.mcy_forms.Changetochange;
  19 +import com.bsth.entity.mcy_forms.Daily;
18 20 import com.bsth.entity.mcy_forms.Executionrate;
19 21 import com.bsth.entity.mcy_forms.Linepasswengerflow;
20 22 import com.bsth.entity.mcy_forms.Operationservice;
... ... @@ -319,8 +321,31 @@ public class ExportController {
319 321 List<Turnoutrate> turnoutrate = formsService.turnoutrate(map);
320 322 Map<String, Object> map1 = new HashMap<String, Object>();
321 323 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  324 + /*Float xlts=0f;
  325 + Float jh=0f;
  326 + Float sj=0f;
  327 + Float qz=0f;
  328 + Float ccl=0f;
  329 + Float bcjh=0f;
  330 + Float bcsj=0f;
  331 + Float bczxl=0f;
  332 + Float gs=0f;
  333 + Float zhgs=0f;*/
  334 +
322 335 for (Turnoutrate l : turnoutrate) {
323 336 Map<String, Object> m = new HashMap<String, Object>();
  337 +
  338 + /* xlts +=l.getGs()==""?0f:Float.valueOf(l.getGs());
  339 + jh +=l.getZhgs()==""?0f:Float.valueOf(l.getZhgs());
  340 + sj +=l.getXl()==""?0f:Float.valueOf(l.getXl());
  341 + ccl +=l.getCchjh()==""?0f:Float.valueOf(l.getCchjh());
  342 + bcjh +=l.getCchsj()==""?0f:Float.valueOf(l.getCchsj());
  343 + bcsj +=l.getChl()==""?0f:Float.valueOf(l.getChl());
  344 + bczxl +=l.getBcjh()==""?0f:Float.valueOf(l.getBcjh());
  345 + gs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl());
  346 + zhgs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl());
  347 +
  348 + */
324 349 m.put("rq", l.getRq());
325 350 m.put("gs", l.getGs());
326 351 m.put("zhgs", l.getZhgs());
... ... @@ -334,6 +359,19 @@ public class ExportController {
334 359 m.put("bbzxl", l.getBbzxl());
335 360 m.put("sm", l.getSm());
336 361 resList.add(m);
  362 +
  363 + /*m=new HashMap<String,Object>();
  364 + m.put("total_xlts", jh);
  365 + m.put("total_jh", jh);
  366 + m.put("total_sj", sj);
  367 + m.put("total_qz", qz);
  368 + m.put("total_ccl", ccl);
  369 + m.put("total_bcjh", bcjh);
  370 + m.put("total_bcsj", bcsj);
  371 + m.put("total_bczxl", bczxl);
  372 + m.put("total_gs", gs);
  373 + m.put("total_zhgs", zhgs);
  374 + */
337 375 }
338 376  
339 377 try {
... ... @@ -356,8 +394,29 @@ public class ExportController {
356 394 List<Executionrate> executionrate = formsService.executionrate(map);
357 395 Map<String, Object> map1 = new HashMap<String, Object>();
358 396 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  397 + /* Float xlts=0f;
  398 + Float jh=0f;
  399 + Float sj=0f;
  400 + Float ccl=0f;
  401 + Float bcjh=0f;
  402 + Float bcsj=0f;
  403 + Float bczxl=0f;
  404 + Float gs=0f;
  405 + Float zhgs=0f;*/
  406 +
359 407 for (Executionrate l : executionrate) {
360 408 Map<String, Object> m = new HashMap<String, Object>();
  409 + /* xlts +=l.getGs()==""?0f:Float.valueOf(l.getGs());
  410 + jh +=l.getZhgs()==""?0f:Float.valueOf(l.getZhgs());
  411 + sj +=l.getXl()==""?0f:Float.valueOf(l.getXl());
  412 + ccl +=l.getCchjh()==""?0f:Float.valueOf(l.getCchjh());
  413 + bcjh +=l.getCchsj()==""?0f:Float.valueOf(l.getCchsj());
  414 + bcsj +=l.getChl()==""?0f:Float.valueOf(l.getChl());
  415 + bczxl +=l.getBcjh()==""?0f:Float.valueOf(l.getBcjh());
  416 + gs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl());
  417 + zhgs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl());
  418 +
  419 + */
361 420 m.put("rq", l.getRq());
362 421 m.put("gs", l.getGs());
363 422 m.put("zhgs", l.getZhgs());
... ... @@ -370,6 +429,19 @@ public class ExportController {
370 429 m.put("bbzxl", l.getBbzxl());
371 430 m.put("sm", l.getSm());
372 431 resList.add(m);
  432 +
  433 +
  434 + /* m=new HashMap<String,Object>();
  435 + m.put("total_xlts", jh);
  436 + m.put("total_jh", jh);
  437 + m.put("total_sj", sj);
  438 + m.put("total_ccl", ccl);
  439 + m.put("total_bcjh", bcjh);
  440 + m.put("total_bcsj", bcsj);
  441 + m.put("total_bczxl", bczxl);
  442 + m.put("total_gs", gs);
  443 + m.put("total_zhgs", zhgs);*/
  444 +
373 445 }
374 446  
375 447 try {
... ... @@ -393,12 +465,31 @@ public class ExportController {
393 465 List<Allline> allline = formsService.allline(map);
394 466 Map<String, Object> map1 = new HashMap<String, Object>();
395 467 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  468 + /* Integer jh=0;
  469 + Integer sj=0;
  470 + Integer ccl=0;
  471 + Integer bcjh=0;
  472 + Float bcsj=0f;
  473 + Integer bczxl=0;
  474 + Integer gs=0;
  475 + Float zhgs=0f;
  476 + */
396 477 for (Allline l : allline) {
397 478 Map<String, Object> m = new HashMap<String, Object>();
  479 +
  480 + /*jh +=l.getGsgs()=="" ? 0: Integer.valueOf(l.getGsgs());
  481 + sj +=l.getFgsgs()==""?0: Integer.valueOf(l.getFgsgs());
  482 + ccl +=l.getCchjh()==""?0: Integer.valueOf(l.getCchjh());
  483 + bcjh +=l.getCchsj()==""?0: Integer.valueOf(l.getCchsj());
  484 + bcsj +=l.getChl()==""?0f:Float.valueOf(l.getChl());
  485 + bczxl +=l.getBcjh()==""?0: Integer.valueOf(l.getBcjh());
  486 + gs +=l.getBbzxl()==""?0: Integer.valueOf(l.getBbzxl());
  487 + zhgs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl());
  488 + */
398 489 m.put("rq", l.getRq());
399   - m.put("gs", l.getGs());
400   - m.put("zhgs", l.getZhgs());
401   - m.put("xl", l.getXl());
  490 + m.put("gs", l.getGsgs());
  491 + m.put("zhgs", l.getFgsgs());
  492 + //m.put("xl", l.getXl());
402 493 m.put("cchjh", l.getCchjh());
403 494 m.put("cchsj", l.getCchsj());
404 495 m.put("chl", l.getChl());
... ... @@ -407,6 +498,17 @@ public class ExportController {
407 498 m.put("bbzxl", l.getBbzxl());
408 499 m.put("sm", l.getSm());
409 500 resList.add(m);
  501 +
  502 + /*m=new HashMap<String,Object>();
  503 + m.put("total_jh", jh);
  504 + m.put("total_sj", sj);
  505 + m.put("total_ccl", ccl);
  506 + m.put("total_bcjh", bcjh);
  507 + m.put("total_bcsj", bcsj);
  508 + m.put("total_bczxl", bczxl);
  509 + m.put("total_gs", gs);
  510 + m.put("total_zhgs", zhgs);
  511 + */
410 512 }
411 513  
412 514 try {
... ... @@ -422,6 +524,56 @@ public class ExportController {
422 524  
423 525  
424 526  
  527 + //班次日报表
  528 + @RequestMapping(value = "/dailyExport", method = RequestMethod.POST)
  529 + public List<Map<String, Object>> dailyExport(@RequestParam Map<String, Object> map) {
  530 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
  531 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  532 + ReportUtils ee = new ReportUtils();
  533 + List<Daily> allline = formsService.daily(map);
  534 +
  535 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  536 + Float zgl=0f;
  537 + Float ks=0f;
  538 + Float yh=0f;
  539 + Float bc=0f;
  540 + Map<String, Object> m ;
  541 + for (Daily d : allline) {
  542 + m = new HashMap<String, Object>();
  543 + zgl +=d.getZlc()==""?0f:Float.valueOf(d.getZlc());
  544 + ks +=d.getJzl1()==""?0f:Float.valueOf(d.getJzl1());
  545 + yh +=d.getYh()==""?0f:Float.valueOf(d.getYh());
  546 + bc +=d.getBc()==""?0f:Float.valueOf(d.getBc());
  547 + m.put("zbh", d.getZbh());
  548 + m.put("jgh",d.getJgh());
  549 + m.put("jName", d.getjName());
  550 + m.put("zlc", d.getZlc());
  551 + m.put("jzl1", d.getJzl1());
  552 + m.put("yh", d.getYh());
  553 + m.put("bc", d.getBc());
  554 +
  555 + resList.add(m);
  556 + }
  557 +
  558 + m=new HashMap<String,Object>();
  559 + m.put("total_zgl", zgl);
  560 + m.put("total_ks", ks);
  561 + m.put("total_yh", yh);
  562 + m.put("total_bc", bc);
  563 +
  564 + m.put("line", BasicData.lineCode2NameMap.get(map.get("line").toString()));
  565 + m.put("date", map.get("date").toString());
  566 + try {
  567 + listI.add(resList.iterator());
  568 + String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\";
  569 + ee.excelReplace(listI, new Object[] { m }, path + "mould\\daily.xls", path + "export\\班次日报表"
  570 + + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls");
  571 + } catch (Exception e) {
  572 + e.printStackTrace();
  573 + }
  574 + return resList;
  575 + }
  576 +
425 577  
426 578  
427 579 }
... ...
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
... ... @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
11 11  
12 12 import com.bsth.entity.mcy_forms.Allline;
13 13 import com.bsth.entity.mcy_forms.Changetochange;
  14 +import com.bsth.entity.mcy_forms.Daily;
14 15 import com.bsth.entity.mcy_forms.Executionrate;
15 16 import com.bsth.entity.mcy_forms.Linepasswengerflow;
16 17 import com.bsth.entity.mcy_forms.Operationservice;
... ... @@ -112,4 +113,12 @@ public class MCY_FormsController {
112 113  
113 114 return formsService.allline(map);
114 115 }
  116 +
  117 + // 营运线路名称统计表
  118 + @RequestMapping(value = "/daily", method = RequestMethod.POST)
  119 + public List<Daily> daily(@RequestParam Map<String, Object> map) {
  120 +
  121 + return formsService.daily(map);
  122 + }
  123 +
115 124 }
... ...
src/main/java/com/bsth/entity/mcy_forms/Daily.java 0 → 100644
  1 +package com.bsth.entity.mcy_forms;
  2 +
  3 +public class Daily {
  4 +
  5 + private String rq;//日期
  6 +
  7 + public String getRq() {
  8 + return rq;
  9 + }
  10 +
  11 + public void setRq(String rq) {
  12 + this.rq = rq;
  13 + }
  14 +
  15 + private String zbh;//车牌号
  16 +
  17 + private String jgh;//员工号
  18 +
  19 + private String jName;//驾驶员
  20 +
  21 + private String zlc;//里程
  22 +
  23 + private String jzl1;//空驶公里
  24 +
  25 + private String yh;//油耗
  26 +
  27 + private String bc;//班次
  28 +
  29 + public String getZbh() {
  30 + return zbh;
  31 + }
  32 +
  33 + public void setZbh(String zbh) {
  34 + this.zbh = zbh;
  35 + }
  36 +
  37 + public String getJgh() {
  38 + return jgh;
  39 + }
  40 +
  41 + public void setJgh(String jgh) {
  42 + this.jgh = jgh;
  43 + }
  44 +
  45 + public String getjName() {
  46 + return jName;
  47 + }
  48 +
  49 + public void setjName(String jName) {
  50 + this.jName = jName;
  51 + }
  52 +
  53 + public String getZlc() {
  54 + return zlc;
  55 + }
  56 +
  57 + public void setZlc(String zlc) {
  58 + this.zlc = zlc;
  59 + }
  60 +
  61 + public String getJzl1() {
  62 + return jzl1;
  63 + }
  64 +
  65 + public void setJzl1(String jzl1) {
  66 + this.jzl1 = jzl1;
  67 + }
  68 +
  69 + public String getYh() {
  70 + return yh;
  71 + }
  72 +
  73 + public void setYh(String yh) {
  74 + this.yh = yh;
  75 + }
  76 +
  77 + public String getBc() {
  78 + return bc;
  79 + }
  80 +
  81 + public void setBc(String bc) {
  82 + this.bc = bc;
  83 + }
  84 +
  85 +
  86 +
  87 +
  88 +
  89 +}
... ...
src/main/java/com/bsth/service/forms/ExportService.java
... ... @@ -2,6 +2,7 @@ package com.bsth.service.forms;
2 2  
3 3 import java.util.List;
4 4  
  5 +import com.bsth.entity.mcy_forms.Daily;
5 6 import com.bsth.entity.mcy_forms.Linepasswengerflow;
6 7 import com.bsth.entity.mcy_forms.Operationservice;
7 8 import com.bsth.entity.mcy_forms.Shifday;
... ... @@ -28,6 +29,6 @@ public interface ExportService {
28 29 public void operationservice(String startDate, String endDate, String lpName,
29 30 List<Operationservice> resList);
30 31  
31   -
  32 +
32 33  
33 34 }
... ...
src/main/java/com/bsth/service/forms/FormsService.java
... ... @@ -5,6 +5,7 @@ import java.util.Map;
5 5  
6 6 import com.bsth.entity.mcy_forms.Allline;
7 7 import com.bsth.entity.mcy_forms.Changetochange;
  8 +import com.bsth.entity.mcy_forms.Daily;
8 9 import com.bsth.entity.mcy_forms.Executionrate;
9 10 import com.bsth.entity.mcy_forms.Linepasswengerflow;
10 11 import com.bsth.entity.mcy_forms.Operationservice;
... ... @@ -39,4 +40,6 @@ public interface FormsService {
39 40 public List<Executionrate> executionrate(Map<String, Object> map);
40 41  
41 42 public List<Allline> allline(Map<String, Object> map);
  43 +
  44 + public List<Daily> daily(Map<String, Object> map);
42 45 }
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -25,6 +25,7 @@ import com.bsth.entity.mcy_forms.Vehicleloading;
25 25 import com.bsth.entity.mcy_forms.Waybillday;
26 26 import com.bsth.entity.mcy_forms.Allline;
27 27 import com.bsth.entity.mcy_forms.Changetochange;
  28 +import com.bsth.entity.mcy_forms.Daily;
28 29 import com.bsth.entity.mcy_forms.Executionrate;
29 30 import com.bsth.service.forms.CommonService;
30 31 import com.bsth.service.forms.FormsService;
... ... @@ -708,4 +709,46 @@ public class FormsServiceImpl implements FormsService {
708 709  
709 710 return list;
710 711 }
  712 +
  713 + @Override
  714 + public List<Daily> daily(Map<String, Object> map) {
  715 +
  716 + String sql ="select r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
  717 + + " from bsth_c_s_sp_info_real r LEFT JOIN bsth_c_ylb y ON r.cl_zbh = y.nbbm "
  718 + + " WHERE 1 = 1"
  719 + + " and r.xl_bm='" + map.get("line").toString() + "'"
  720 + + " and to_days(r.schedule_date)=to_days('"+map.get("date").toString()+"')"
  721 + + " AND r.gs_bm is not null";
  722 +
  723 + if(map.get("gsdmDaily").toString()!=""){
  724 + sql+=" and r.gs_bm='"+map.get("gsdmDaily").toString()+"'";
  725 + }
  726 + if(map.get("fgsdmDaily").toString()!=""){
  727 + sql+=" and r.fgs_bm='"+map.get("fgsdmDaily").toString()+"'";
  728 + }
  729 + sql += " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";
  730 +
  731 + List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() {
  732 + @Override
  733 + public Daily mapRow(ResultSet arg0, int arg1) throws SQLException {
  734 + Daily daily = new Daily();
  735 + daily.setRq(arg0.getString("schedule_date_str"));
  736 + daily.setZbh(arg0.getString("cl_zbh"));
  737 + daily.setJgh(arg0.getString("j_gh"));
  738 + daily.setjName(arg0.getString("j_name"));
  739 + daily.setYh(arg0.getString("YH"));
  740 + return daily;
  741 + }
  742 + });
  743 +
  744 + for(int i=0;i<list.size();i++){
  745 + Daily d=list.get(i);
  746 + Map<String, Object> maps = new HashMap<>();
  747 + maps = commonService.findKMBC2(d.getJgh(),d.getZbh(),d.getRq());
  748 + d.setJzl1(maps.get("ksgl").toString());
  749 + d.setZlc(maps.get("realMileage").toString());
  750 + d.setBc(maps.get("sjbc").toString());
  751 + }
  752 + return list;
  753 + }
711 754 }
... ...
src/main/resources/static/pages/forms/mould/allline.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/daily.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/daily.html
... ... @@ -26,7 +26,15 @@
26 26 <div class="col-md-12">
27 27 <div class="portlet light porttlet-fit bordered">
28 28 <div class="portlet-title">
29   - <form class="form-inline" action="">
  29 + <form class="form-inline" action="">
  30 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_daily">
  31 + <span class="item-label" style="width: 80px;">公司: </span>
  32 + <select class="form-control" name="company" id="gsdmDaily" style="width: 140px;"></select>
  33 + </div>
  34 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_daily">
  35 + <span class="item-label" style="width: 80px;">分公司: </span>
  36 + <select class="form-control" name="subCompany" id="fgsdmDaily" style="width: 140px;"></select>
  37 + </div>
30 38 <div style="display: inline-block;">
31 39 <span class="item-label" style="width: 80px;">线路: </span>
32 40 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
... ... @@ -64,15 +72,15 @@
64 72 <td>班次</td>
65 73 </tr>
66 74 </thead>
67   - <tbody class="dailyInfo">
  75 + <tbody id="tbody">
68 76  
69 77 </tbody>
70 78 <tr>
71 79 <td colspan="3">小计</td>
72 80 <td><span id="total_zgl">&nbsp;</span></td>
73   - <td><span id="total_ksgl">&nbsp;</span></td>
  81 + <td><span id="total_ks">&nbsp;</span></td>
74 82 <td><span id="total_yh">&nbsp;</span></td>
75   - <td><span id="total_bcs">&nbsp;</span></td>
  83 + <td><span id="total_bc">&nbsp;</span></td>
76 84 </tr>
77 85 </table>
78 86 </div>
... ... @@ -82,7 +90,9 @@
82 90 </div>
83 91  
84 92 <script>
85   - $(function(){
  93 + $(function(){
  94 + var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'};
  95 +
86 96 // 关闭左侧栏
87 97 if (!$('body').hasClass('page-sidebar-closed'))
88 98 $('.menu-toggler.sidebar-toggler').click();
... ... @@ -92,6 +102,42 @@
92 102 locale : 'zh-cn'
93 103 });
94 104  
  105 + var obj = [];
  106 + $.get('/user/companyData', function(result){
  107 + obj = result;
  108 + var options = '';
  109 + for(var i = 0; i < obj.length; i++){
  110 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  111 + }
  112 +
  113 + if(obj.length ==0){
  114 + $("#gsdmDiv_daily").css('display','none');
  115 + $('#gsdmDiv_daily').css('display','none');
  116 + }else if(obj.length ==1){
  117 + $("#fgsdmDiv_daily").css('display','none');
  118 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  119 + $('#fgsdmDiv_daily').css('display','none');
  120 + }
  121 + $('#gsdmDaily').html(options);
  122 + updateCompany();
  123 + });
  124 +
  125 + $("#gsdmDaily").on("change",updateCompany);
  126 + function updateCompany(){
  127 + var company = $('#gsdmDaily').val();
  128 + var options = '';
  129 + for(var i = 0; i < obj.length; i++){
  130 + if(obj[i].companyCode == company){
  131 + var children = obj[i].children;
  132 + for(var j = 0; j < children.length; j++){
  133 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  134 + }
  135 + }
  136 + }
  137 + $('#fgsdmDaily').html(options);
  138 + }
  139 +
  140 +
95 141 $.get('/basic/lineCode2Name',function(result){
96 142 var data=[];
97 143  
... ... @@ -101,50 +147,82 @@
101 147 initPinYinSelect2('#line',data,'');
102 148  
103 149 })
104   - var line;
105   - var date;
106   - $("#query").on("click",function(){
107   - line = $("#line").val();
108   - var lineName=$("#select2-line-container").html();
109   - date = $("#date").val();
110   - $get('/realSchedule/dailyInfo',{line:line,date:date,type:'query'},function(result){
111   - $("#form_line").text(lineName);
112   - $("#form_date").text(date);
113   - var total_zgl = 0,total_ksgl = 0,total_yh = 0,total_bcs = 0;
114   - $.each(result, function(i, obj) {
115   - total_zgl = Number(obj.zgl)+Number(total_zgl);
116   - total_ksgl = Number(obj.ksgl)+Number(total_ksgl);
117   - total_yh = Number(0)+Number(total_yh);
118   - total_bcs = Number(obj.bcs)+Number(total_bcs);
119   - });
120   - $("#total_zgl").text(total_zgl.toFixed(2));
121   - $("#total_ksgl").text(total_ksgl.toFixed(2));
122   - $("#total_yh").text(total_yh.toFixed(2));
123   - $("#total_bcs").text(total_bcs);
124   -
125   - // 把数据填充到模版中
126   - var tbodyHtml = template('dailyInfo',{list:result});
127   - // 把渲染好的模版html文本追加到表格中
128   - $('#forms .dailyInfo').html(tbodyHtml);
129   - });
  150 +
  151 + var line;
  152 + var date;
  153 + var gsdmDaily;
  154 + var fgsdmDaily;
  155 + $("#query").on("click",function(){
  156 +
  157 + line = $("#line").val();
  158 + var lineName=$("#select2-line-container").html();
  159 + date = $("#date").val();
  160 + gsdmDaily=$("#gsdmDaily").val();
  161 + fgsdmDaily = $("#fgsdmDaily").val();
  162 +
  163 + $post('/mcy_forms/daily',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily, line:line,date:date,type:'query'},function(result){
  164 + $("#form_line").text(lineName);
  165 + $("#form_date").text(date);
  166 + // 把数据填充到模版中
  167 + var tbodyHtml = template('dailyInfo',{list:result});
  168 + // 把渲染好的模版html文本追加到表格中
  169 + $('#tbody').html(tbodyHtml);
  170 + line = $("#line").val();
  171 +
  172 + startDate = $("#startDate").val();
  173 + endDate = $("#endDate").val();
  174 + $("#sDate").text(startDate);
  175 + $("#eDate").text(endDate);
  176 +
  177 + var total_zgl = 0,total_ks = 0;
  178 + var total_yh = 0,total_bc = 0;
  179 +
  180 + $.each(result, function(i, obj) {
  181 + total_zgl +=Number(obj.zlc);
  182 + total_ks +=Number(obj.jzl1);
  183 + total_yh += Number(obj.yh);
  184 + total_bc += Number(obj.bc);
  185 +
  186 + });
  187 + $("#total_zgl").text(total_zgl.toFixed(2));
  188 + $("#total_ks").text(total_ks.toFixed(2));
  189 + $("#total_yh").text(total_yh.toFixed(2));
  190 + $("#total_bc").text(total_bc.toFixed(2));
  191 +
  192 + var temp = {};
  193 + var today_account = 0;
  194 +
  195 + temp["line"] = $("#line").text();
  196 + $.each(result, function(i, obj) {
  197 + if(moment(obj.schedule_date_str).format("YYYY-MM-DD") == moment(obj.startDate).format("YYYY-MM-DD")){
  198 + today_account++;
  199 + }
  200 + obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss");
  201 + });
  202 + })
  203 + });
  204 +
  205 + $("#export").on("click",function(){
  206 + line = $("#line").val();
  207 + date = $("#date").val();
  208 + gsdmDaily=$("#gsdmDaily").val();
  209 + fgsdmDaily = $("#fgsdmDaily").val();
  210 + $post('/mcy_export/dailyExport',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily,line:line,date:date,type:'export'},function(result){
  211 + window.open("/downloadFile/download?fileName=班次日报表"+moment(date).format("YYYYMMDD"));
130 212 });
131   - $("#export").on("click",function(){
132   - $get('/realSchedule/dailyInfo',{line:line,date:date,type:'export'},function(result){
133   - window.open("/downloadFile/download?fileName=班次日报"+moment(date).format("YYYYMMDD"));
134   - });
135   - });
136   - });
  213 + });
  214 +});
137 215 </script>
138 216 <script type="text/html" id="dailyInfo">
139 217 {{each list as obj i}}
140 218 <tr>
141   - <td>{{obj.clZbh}}</td>
142   - <td>{{obj.jGh}}</td>
  219 + <td>{{obj.zbh}}</td>
  220 + <td>{{obj.jgh}}</td>
143 221 <td>{{obj.jName}}</td>
144   - <td>{{obj.zgl}}</td>
145   - <td>{{obj.ksgl}}</td>
146   - <td>0</td>
147   - <td>{{obj.bcs}}</td>
  222 + <td>{{obj.zlc}}</td>
  223 + <td>{{obj.jzl1}}</td>
  224 + <td>{{obj.yh}}</td>
  225 + <td>{{obj.bc}}</td>
148 226 </tr>
149 227 {{/each}}
150 228 {{if list.length == 0}}
... ...
src/main/resources/static/pages/mforms/alllines/allline.html
... ... @@ -230,8 +230,7 @@
230 230 var total_bcjh = 0, total_bcsj = 0, total_bczxl = 0;
231 231 var total_gs = 0;
232 232 var total_zhgs = 0;
233   - $
234   - .each(
  233 + $.each(
235 234 result,
236 235 function(i, obj) {
237 236 total_gs += Number(obj.gsgs);
... ...