Commit 79d1493d9fea6967f74e798ab9f1841bde5ca2b0

Authored by 娄高锋
1 parent 9f82216c

青浦调度,准点率统计报表

src/main/java/com/bsth/controller/calc/CalcMixController.java
@@ -83,5 +83,38 @@ public class CalcMixController { @@ -83,5 +83,38 @@ public class CalcMixController {
83 } 83 }
84 return service.singledatatj(line, startDate, endDate, tjtype, cont, gsdmSing, fgsdmSing); 84 return service.singledatatj(line, startDate, endDate, tjtype, cont, gsdmSing, fgsdmSing);
85 } 85 }
86 - 86 +
  87 + @RequestMapping(value="/statisticsIndex", method = RequestMethod.GET)
  88 + public List<Map<String,Object>> statisticsIndex(@RequestParam Map<String, Object> map){
  89 + String startDate="";
  90 + if(map.get("startDate")!=null){
  91 + startDate=map.get("startDate").toString().trim();
  92 + }
  93 + String endDate="";
  94 + if(map.get("endDate")!=null){
  95 + endDate=map.get("endDate").toString().trim();
  96 + }
  97 + String line="";
  98 + if(map.get("line")!=null){
  99 + line=map.get("line").toString().trim();
  100 + }
  101 + String sfyy="";
  102 + if(map.get("sfyy")!=null){
  103 + sfyy=map.get("sfyy").toString().trim();
  104 + }
  105 + String type="";
  106 + if(map.get("type")!=null){
  107 + type=map.get("type").toString().trim();
  108 + }
  109 + String gsdm="";
  110 + if(map.get("company")!=null){
  111 + gsdm=map.get("company").toString().trim();
  112 + }
  113 + String fgsdm="";
  114 + if(map.get("subCompany")!=null){
  115 + fgsdm=map.get("subCompany").toString().trim();
  116 + }
  117 + return service.statisticsIndex(startDate, endDate, line, sfyy, type, gsdm, fgsdm);
  118 + }
  119 +
87 } 120 }
src/main/java/com/bsth/entity/calc/CalcCount.java 0 → 100644
  1 +package com.bsth.entity.calc;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.GeneratedValue;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.Table;
  9 +
  10 +@Entity
  11 +@Table(name = "bsth_c_calc_count")
  12 +public class CalcCount {
  13 + /* 主键*/
  14 + @Id
  15 + @GeneratedValue
  16 + private Integer id;
  17 + /* 公司代码*/
  18 + private String gsdm;
  19 + /* 分公司代码*/
  20 + private String fgsdm;
  21 + /* 日期字符串*/
  22 + private String date;
  23 + /* 上海市线路编码*/
  24 + private String shanghailinecode;
  25 + /* 线路编码*/
  26 + private String xl;
  27 + /* 线路名称*/
  28 + private String xlName;
  29 + /*计划首站发车数*/
  30 + private String jhszfcs;
  31 + /*实际首站发车正点数*/
  32 + private String sjszfczds;
  33 + /*首站发车正点率*/
  34 + private String szfczdl;
  35 + /*计划班次*/
  36 + private String jhbc;
  37 + /*实际班次*/
  38 + private String sjbc;
  39 + /*班次执行率*/
  40 + private String bczxl;
  41 + /*计划出车*/
  42 + private String jhcc;
  43 + /*实际出车*/
  44 + private String sjcc;
  45 + /*出车率*/
  46 + private String ccl;
  47 + /*计划运营里程*/
  48 + private String jhyylc;
  49 + /*实际运营里程*/
  50 + private String sjyylc;
  51 + /*运营里程执行率*/
  52 + private String yylczxl;
  53 + /*计划车日公里*/
  54 + private String jhcrgl;
  55 + /*实际车日公里*/
  56 + private String sjcrgl;
  57 + /*车日公里执行率*/
  58 + private String crglzxl;
  59 + /*高峰班次数*/
  60 + private String gfbcs;
  61 + /*高峰达标班次数*/
  62 + private String gfdbbcs;
  63 + /*高峰达标率*/
  64 + private String gfdbl;
  65 + /*低谷班次数*/
  66 + private String dgbcs;
  67 + /*低谷达标班次数*/
  68 + private String dgdbbcs;
  69 + /*低谷达标率*/
  70 + private String dgdbl;
  71 + /*计划总公里*/
  72 + private String jhzgl;
  73 + /*实际总公里*/
  74 + private String sjzgl;
  75 +
  76 + /*
  77 + *浦交汇数据 统计的数据的计划数为已执行计划数 (班次状态为:烂班、有子任务、以执行)
  78 + *
  79 + *产研院接口 需要实时数据 计划总数据
  80 + */
  81 + /*计划总公里 总*/
  82 + private String jhzglz;
  83 + /*计划运营里程_总*/
  84 + private String jhyylcz;
  85 + /*计划出车_总 */
  86 + private String jhccz;
  87 + /*计划空驶里程*/
  88 + private String jhkslc;
  89 + /*计划空驶里程 总*/
  90 + private String jhkslcz;
  91 + /*实际空驶里程*/
  92 + private String sjkslc;
  93 + /*计划班次数据 总*/
  94 + private String jhbcz;
  95 + /*实际高峰班次数 实时*/
  96 + private String sjgfbcs;
  97 + /*实际低谷班次数 实时*/
  98 + private String sjdgbcs;
  99 + /*计划实时高峰班次数 总*/
  100 + private String jhssgfbcs;
  101 + /*计划实时低谷班次数 总*/
  102 + private String jhssdgbcs;
  103 + /*计划高峰班次数 总*/
  104 + private String jhgfbcsz;
  105 + /*计划低谷班次数 总*/
  106 + private String jhdgbcsz;
  107 +
  108 + /*计划全日驾售配置 (计划配人全日)*/
  109 + private String jhprz;
  110 + /*计划实时驾售配置(计划配人实时) */
  111 + private String jhprss;
  112 + /*实际驾售配置(实际配人)*/
  113 + private String sjpr;
  114 + /*线路最后营运时间*/
  115 + private String endtime;
  116 +
  117 + /*计划早高峰班次总数*/
  118 + private String jhzgfbcz;
  119 + /*计划早高峰班次实时数*/
  120 + private String jhzgfbcss;
  121 + /*实际早高峰班次*/
  122 + private String sjzgfbc;
  123 + /*计划晚高峰班次总数*/
  124 + private String jhwgfbcz;
  125 + /*计划晚高峰班次实时数*/
  126 + private String jhwgfbcss;
  127 + /*实际晚高峰班次*/
  128 + private String sjwgfbc;
  129 +
  130 + /*计划线路首末班次数(实时)*/
  131 + private String jhsmbcs;
  132 + /*实际线路首末班次准点数(实时)*/
  133 + private String sjsmbczds;
  134 + /*线路首末班次准点率(实时)*/
  135 + private String smbczdl;
  136 + /*计划线路首末班次数(全天总)*/
  137 + private String jhsmbcsz;
  138 + /*实际线路首末班次准点数(全天总)*/
  139 + private String sjsmbczdsz;
  140 + /*线路首末班次准点率(全天总)*/
  141 + private String smbczdlz;
  142 +
  143 + /*创建时间(更新时间)*/
  144 + private Date createDate;
  145 +
  146 +
  147 + public Integer getId() {
  148 + return id;
  149 + }
  150 + public void setId(Integer id) {
  151 + this.id = id;
  152 + }
  153 + public String getGsdm() {
  154 + return gsdm;
  155 + }
  156 + public void setGsdm(String gsdm) {
  157 + this.gsdm = gsdm;
  158 + }
  159 + public String getFgsdm() {
  160 + return fgsdm;
  161 + }
  162 + public void setFgsdm(String fgsdm) {
  163 + this.fgsdm = fgsdm;
  164 + }
  165 + public String getDate() {
  166 + return date;
  167 + }
  168 + public void setDate(String date) {
  169 + this.date = date;
  170 + }
  171 + public String getShanghailinecode() {
  172 + return shanghailinecode;
  173 + }
  174 + public void setShanghailinecode(String shanghailinecode) {
  175 + this.shanghailinecode = shanghailinecode;
  176 + }
  177 + public String getXl() {
  178 + return xl;
  179 + }
  180 + public void setXl(String xl) {
  181 + this.xl = xl;
  182 + }
  183 + public String getXlName() {
  184 + return xlName;
  185 + }
  186 + public void setXlName(String xlName) {
  187 + this.xlName = xlName;
  188 + }
  189 + public String getJhszfcs() {
  190 + return jhszfcs;
  191 + }
  192 + public void setJhszfcs(String jhszfcs) {
  193 + this.jhszfcs = jhszfcs;
  194 + }
  195 + public String getSjszfczds() {
  196 + return sjszfczds;
  197 + }
  198 + public void setSjszfczds(String sjszfczds) {
  199 + this.sjszfczds = sjszfczds;
  200 + }
  201 + public String getSzfczdl() {
  202 + return szfczdl;
  203 + }
  204 + public void setSzfczdl(String szfczdl) {
  205 + this.szfczdl = szfczdl;
  206 + }
  207 + public String getJhbc() {
  208 + return jhbc;
  209 + }
  210 + public void setJhbc(String jhbc) {
  211 + this.jhbc = jhbc;
  212 + }
  213 + public String getSjbc() {
  214 + return sjbc;
  215 + }
  216 + public void setSjbc(String sjbc) {
  217 + this.sjbc = sjbc;
  218 + }
  219 + public String getBczxl() {
  220 + return bczxl;
  221 + }
  222 + public void setBczxl(String bczxl) {
  223 + this.bczxl = bczxl;
  224 + }
  225 + public String getJhcc() {
  226 + return jhcc;
  227 + }
  228 + public void setJhcc(String jhcc) {
  229 + this.jhcc = jhcc;
  230 + }
  231 + public String getSjcc() {
  232 + return sjcc;
  233 + }
  234 + public void setSjcc(String sjcc) {
  235 + this.sjcc = sjcc;
  236 + }
  237 + public String getCcl() {
  238 + return ccl;
  239 + }
  240 + public void setCcl(String ccl) {
  241 + this.ccl = ccl;
  242 + }
  243 + public String getJhyylc() {
  244 + return jhyylc;
  245 + }
  246 + public void setJhyylc(String jhyylc) {
  247 + this.jhyylc = jhyylc;
  248 + }
  249 + public String getSjyylc() {
  250 + return sjyylc;
  251 + }
  252 + public void setSjyylc(String sjyylc) {
  253 + this.sjyylc = sjyylc;
  254 + }
  255 + public String getYylczxl() {
  256 + return yylczxl;
  257 + }
  258 + public void setYylczxl(String yylczxl) {
  259 + this.yylczxl = yylczxl;
  260 + }
  261 + public String getJhcrgl() {
  262 + return jhcrgl;
  263 + }
  264 + public void setJhcrgl(String jhcrgl) {
  265 + this.jhcrgl = jhcrgl;
  266 + }
  267 + public String getSjcrgl() {
  268 + return sjcrgl;
  269 + }
  270 + public void setSjcrgl(String sjcrgl) {
  271 + this.sjcrgl = sjcrgl;
  272 + }
  273 + public String getCrglzxl() {
  274 + return crglzxl;
  275 + }
  276 + public void setCrglzxl(String crglzxl) {
  277 + this.crglzxl = crglzxl;
  278 + }
  279 + public String getGfbcs() {
  280 + return gfbcs;
  281 + }
  282 + public void setGfbcs(String gfbcs) {
  283 + this.gfbcs = gfbcs;
  284 + }
  285 + public String getGfdbbcs() {
  286 + return gfdbbcs;
  287 + }
  288 + public void setGfdbbcs(String gfdbbcs) {
  289 + this.gfdbbcs = gfdbbcs;
  290 + }
  291 + public String getGfdbl() {
  292 + return gfdbl;
  293 + }
  294 + public void setGfdbl(String gfdbl) {
  295 + this.gfdbl = gfdbl;
  296 + }
  297 + public String getDgbcs() {
  298 + return dgbcs;
  299 + }
  300 + public void setDgbcs(String dgbcs) {
  301 + this.dgbcs = dgbcs;
  302 + }
  303 + public String getDgdbbcs() {
  304 + return dgdbbcs;
  305 + }
  306 + public void setDgdbbcs(String dgdbbcs) {
  307 + this.dgdbbcs = dgdbbcs;
  308 + }
  309 + public String getDgdbl() {
  310 + return dgdbl;
  311 + }
  312 + public void setDgdbl(String dgdbl) {
  313 + this.dgdbl = dgdbl;
  314 + }
  315 + public String getJhzgl() {
  316 + return jhzgl;
  317 + }
  318 + public void setJhzgl(String jhzgl) {
  319 + this.jhzgl = jhzgl;
  320 + }
  321 + public String getSjzgl() {
  322 + return sjzgl;
  323 + }
  324 + public void setSjzgl(String sjzgl) {
  325 + this.sjzgl = sjzgl;
  326 + }
  327 +
  328 +
  329 + /*
  330 + *产研院接口字段
  331 + */
  332 + public String getJhzglz() {
  333 + return jhzglz;
  334 + }
  335 + public void setJhzglz(String jhzglz) {
  336 + this.jhzglz = jhzglz;
  337 + }
  338 + public String getJhyylcz() {
  339 + return jhyylcz;
  340 + }
  341 + public void setJhyylcz(String jhyylcz) {
  342 + this.jhyylcz = jhyylcz;
  343 + }
  344 + public String getJhccz() {
  345 + return jhccz;
  346 + }
  347 + public void setJhccz(String jhccz) {
  348 + this.jhccz = jhccz;
  349 + }
  350 + public String getJhkslc() {
  351 + return jhkslc;
  352 + }
  353 + public void setJhkslc(String jhkslc) {
  354 + this.jhkslc = jhkslc;
  355 + }
  356 + public String getJhkslcz() {
  357 + return jhkslcz;
  358 + }
  359 + public void setJhkslcz(String jhkslcz) {
  360 + this.jhkslcz = jhkslcz;
  361 + }
  362 + public String getSjkslc() {
  363 + return sjkslc;
  364 + }
  365 + public void setSjkslc(String sjkslc) {
  366 + this.sjkslc = sjkslc;
  367 + }
  368 + public String getJhbcz() {
  369 + return jhbcz;
  370 + }
  371 + public void setJhbcz(String jhbcz) {
  372 + this.jhbcz = jhbcz;
  373 + }
  374 + public String getSjgfbcs() {
  375 + return sjgfbcs;
  376 + }
  377 + public void setSjgfbcs(String sjgfbcs) {
  378 + this.sjgfbcs = sjgfbcs;
  379 + }
  380 + public String getSjdgbcs() {
  381 + return sjdgbcs;
  382 + }
  383 + public void setSjdgbcs(String sjdgbcs) {
  384 + this.sjdgbcs = sjdgbcs;
  385 + }
  386 + public String getJhssgfbcs() {
  387 + return jhssgfbcs;
  388 + }
  389 + public void setJhssgfbcs(String jhssgfbcs) {
  390 + this.jhssgfbcs = jhssgfbcs;
  391 + }
  392 + public String getJhssdgbcs() {
  393 + return jhssdgbcs;
  394 + }
  395 + public void setJhssdgbcs(String jhssdgbcs) {
  396 + this.jhssdgbcs = jhssdgbcs;
  397 + }
  398 + public String getJhgfbcsz() {
  399 + return jhgfbcsz;
  400 + }
  401 + public void setJhgfbcsz(String jhgfbcsz) {
  402 + this.jhgfbcsz = jhgfbcsz;
  403 + }
  404 + public String getJhdgbcsz() {
  405 + return jhdgbcsz;
  406 + }
  407 + public void setJhdgbcsz(String jhdgbcsz) {
  408 + this.jhdgbcsz = jhdgbcsz;
  409 + }
  410 + public String getJhprz() {
  411 + return jhprz;
  412 + }
  413 + public void setJhprz(String jhprz) {
  414 + this.jhprz = jhprz;
  415 + }
  416 + public String getJhprss() {
  417 + return jhprss;
  418 + }
  419 + public void setJhprss(String jhprss) {
  420 + this.jhprss = jhprss;
  421 + }
  422 + public String getSjpr() {
  423 + return sjpr;
  424 + }
  425 + public void setSjpr(String sjpr) {
  426 + this.sjpr = sjpr;
  427 + }
  428 + public String getEndtime() {
  429 + return endtime;
  430 + }
  431 + public void setEndtime(String endtime) {
  432 + this.endtime = endtime;
  433 + }
  434 + public String getJhzgfbcz() {
  435 + return jhzgfbcz;
  436 + }
  437 + public void setJhzgfbcz(String jhzgfbcz) {
  438 + this.jhzgfbcz = jhzgfbcz;
  439 + }
  440 + public String getJhzgfbcss() {
  441 + return jhzgfbcss;
  442 + }
  443 + public void setJhzgfbcss(String jhzgfbcss) {
  444 + this.jhzgfbcss = jhzgfbcss;
  445 + }
  446 + public String getSjzgfbc() {
  447 + return sjzgfbc;
  448 + }
  449 + public void setSjzgfbc(String sjzgfbc) {
  450 + this.sjzgfbc = sjzgfbc;
  451 + }
  452 + public String getJhwgfbcz() {
  453 + return jhwgfbcz;
  454 + }
  455 + public void setJhwgfbcz(String jhwgfbcz) {
  456 + this.jhwgfbcz = jhwgfbcz;
  457 + }
  458 + public String getJhwgfbcss() {
  459 + return jhwgfbcss;
  460 + }
  461 + public void setJhwgfbcss(String jhwgfbcss) {
  462 + this.jhwgfbcss = jhwgfbcss;
  463 + }
  464 + public String getSjwgfbc() {
  465 + return sjwgfbc;
  466 + }
  467 + public void setSjwgfbc(String sjwgfbc) {
  468 + this.sjwgfbc = sjwgfbc;
  469 + }
  470 + public String getJhsmbcs() {
  471 + return jhsmbcs;
  472 + }
  473 + public void setJhsmbcs(String jhsmbcs) {
  474 + this.jhsmbcs = jhsmbcs;
  475 + }
  476 + public String getJhsmbcsz() {
  477 + return jhsmbcsz;
  478 + }
  479 + public void setJhsmbcsz(String jhsmbcsz) {
  480 + this.jhsmbcsz = jhsmbcsz;
  481 + }
  482 + public String getSjsmbczds() {
  483 + return sjsmbczds;
  484 + }
  485 + public void setSjsmbczds(String sjsmbczds) {
  486 + this.sjsmbczds = sjsmbczds;
  487 + }
  488 + public String getSjsmbczdsz() {
  489 + return sjsmbczdsz;
  490 + }
  491 + public void setSjsmbczdsz(String sjsmbczdsz) {
  492 + this.sjsmbczdsz = sjsmbczdsz;
  493 + }
  494 + public String getSmbczdl() {
  495 + return smbczdl;
  496 + }
  497 + public void setSmbczdl(String smbczdl) {
  498 + this.smbczdl = smbczdl;
  499 + }
  500 + public String getSmbczdlz() {
  501 + return smbczdlz;
  502 + }
  503 + public void setSmbczdlz(String smbczdlz) {
  504 + this.smbczdlz = smbczdlz;
  505 + }
  506 + public Date getCreateDate() {
  507 + return createDate;
  508 + }
  509 + public void setCreateDate(Date createDate) {
  510 + this.createDate = createDate;
  511 + }
  512 +
  513 +}
src/main/java/com/bsth/repository/calc/CalcCountRepository.java 0 → 100644
  1 +package com.bsth.repository.calc;
  2 +
  3 +import com.bsth.entity.calc.CalcCount;
  4 +import com.bsth.repository.BaseRepository;
  5 +
  6 +import java.util.List;
  7 +
  8 +import org.springframework.data.jpa.repository.Query;
  9 +import org.springframework.stereotype.Repository;
  10 +
  11 +/**
  12 + * lgf 2022/7/19
  13 + */
  14 +@Repository
  15 +public interface CalcCountRepository extends BaseRepository<CalcCount, Integer>{
  16 +
  17 + //按照时间段、公司查询
  18 + @Query(value="select DISTINCT c from CalcCount c where c.date between ?1 and ?2 and c.gsdm like %?3% and c.fgsdm like %?4% order by c.xlName")
  19 + List<CalcCount> selectByDateAndCompany(String date1,String date2,String gsdm,String fgsdm);
  20 +
  21 + //按照时间段、线路查询
  22 + @Query(value="select DISTINCT c from CalcCount c where c.date between ?1 and ?2 and c.gsdm like %?3% and c.fgsdm like %?4% and xl = ?5 order by c.xlName")
  23 + List<CalcCount> selectByDateAndLine(String date1,String date2,String gsdm,String fgsdm,String line);
  24 +}
src/main/java/com/bsth/service/calc/CalcMixService.java
@@ -12,4 +12,5 @@ public interface CalcMixService { @@ -12,4 +12,5 @@ public interface CalcMixService {
12 12
13 List<Map<String, Object>> singledatatj(String line, String startDate, String endDate, String tjtype, String cont, String gsdmSing, String fgsdmSing); 13 List<Map<String, Object>> singledatatj(String line, String startDate, String endDate, String tjtype, String cont, String gsdmSing, String fgsdmSing);
14 14
  15 + List<Map<String, Object>> statisticsIndex(String startDate, String endDate, String line, String sfyy, String type, String gsdm, String fgsdm);
15 } 16 }
src/main/java/com/bsth/service/calc/impl/CalcMixServiceImpl.java
1 package com.bsth.service.calc.impl; 1 package com.bsth.service.calc.impl;
2 2
  3 +import java.math.BigDecimal;
3 import java.sql.ResultSet; 4 import java.sql.ResultSet;
4 import java.sql.SQLException; 5 import java.sql.SQLException;
  6 +import java.text.NumberFormat;
  7 +import java.text.SimpleDateFormat;
5 import java.util.ArrayList; 8 import java.util.ArrayList;
  9 +import java.util.Date;
6 import java.util.HashMap; 10 import java.util.HashMap;
  11 +import java.util.HashSet;
  12 +import java.util.Iterator;
7 import java.util.List; 13 import java.util.List;
8 import java.util.Map; 14 import java.util.Map;
  15 +import java.util.Set;
9 16
10 import com.bsth.data.BasicData; 17 import com.bsth.data.BasicData;
  18 +import com.bsth.entity.calc.CalcCount;
  19 +import com.bsth.entity.calc.CalcInterval;
11 import com.bsth.entity.calc.CalcWaybill; 20 import com.bsth.entity.calc.CalcWaybill;
12 import com.bsth.entity.mcy_forms.Singledata; 21 import com.bsth.entity.mcy_forms.Singledata;
  22 +import com.bsth.repository.calc.CalcCountRepository;
13 import com.bsth.repository.calc.CalcWaybillRepository; 23 import com.bsth.repository.calc.CalcWaybillRepository;
  24 +import com.bsth.service.LineService;
14 import com.bsth.service.calc.CalcMixService; 25 import com.bsth.service.calc.CalcMixService;
15 import com.bsth.util.Arith; 26 import com.bsth.util.Arith;
  27 +import com.bsth.util.ReportUtils;
  28 +import com.mysql.fabric.xmlrpc.base.Array;
16 29
17 import org.slf4j.Logger; 30 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory; 31 import org.slf4j.LoggerFactory;
@@ -29,6 +42,12 @@ public class CalcMixServiceImpl implements CalcMixService { @@ -29,6 +42,12 @@ public class CalcMixServiceImpl implements CalcMixService {
29 42
30 @Autowired 43 @Autowired
31 private CalcWaybillRepository calcRepository; 44 private CalcWaybillRepository calcRepository;
  45 +
  46 + @Autowired
  47 + private CalcCountRepository calcCountRepository;
  48 +
  49 + @Autowired
  50 + private LineService lineService;
32 51
33 @Autowired 52 @Autowired
34 JdbcTemplate jdbcTemplate; 53 JdbcTemplate jdbcTemplate;
@@ -335,4 +354,163 @@ public class CalcMixServiceImpl implements CalcMixService { @@ -335,4 +354,163 @@ public class CalcMixServiceImpl implements CalcMixService {
335 return resList; 354 return resList;
336 } 355 }
337 356
  357 + @Override
  358 + public List<Map<String, Object>> statisticsIndex(String startDate, String endDate, String line, String sfyy,
  359 + String type, String gsdm, String fgsdm) {
  360 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  361 + // TODO Auto-generated method stub
  362 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  363 + NumberFormat nf = NumberFormat.getNumberInstance();
  364 + nf.setMinimumFractionDigits(2);
  365 +
  366 + String dates = "";
  367 + if(startDate.equals(endDate)){
  368 + String[] split = startDate.split("-");
  369 + dates = split[0]+"年"+split[1]+"月"+split[2]+"日";
  370 + } else {
  371 + String[] split1 = startDate.split("-");
  372 + String[] split2 = endDate.split("-");
  373 + dates = split1[0]+"年"+split1[1]+"月"+split1[2]+"日--"
  374 + +split2[0]+"年"+split2[1]+"月"+split2[2]+"日";
  375 + }
  376 +
  377 + Map<String, Boolean> lineNature = lineService.lineNature();
  378 +
  379 + String nysql="SELECT line_name, line_code FROM bsth_c_line_plate";
  380 + List<Map<String, String>> listPlate = jdbcTemplate.query(nysql, new RowMapper<Map<String, String>>() {
  381 + @Override
  382 + public Map<String, String> mapRow(ResultSet arg0, int arg1) throws SQLException {
  383 + Map<String, String> m = new HashMap<String, String>();
  384 + m.put("lineName", arg0.getString("line_name"));
  385 + m.put("lineCode", arg0.getString("line_code"));
  386 + return m;
  387 + }
  388 + });
  389 + Set<String> linePlate = new HashSet<String>();
  390 + for(Map<String, String> m : listPlate){
  391 + linePlate.add(m.get("lineName"));
  392 + }
  393 +
  394 + List<CalcCount> list = new ArrayList<CalcCount>();
  395 + if(line.length() > 0){
  396 + list = calcCountRepository.selectByDateAndLine(startDate, endDate, gsdm, fgsdm, line);
  397 + } else {
  398 + list = calcCountRepository.selectByDateAndCompany(startDate, endDate, gsdm, fgsdm);
  399 + }
  400 +
  401 + List<String> keyList = new ArrayList<String>();
  402 + Map<String, List<CalcCount>> keyMap = new HashMap<String, List<CalcCount>>();
  403 + for(CalcCount c : list){
  404 + if("1".equals(sfyy)){
  405 + if((!(lineNature.containsKey(c.getXl()))) || (!(lineNature.get(c.getXl())))){
  406 + continue;
  407 + }
  408 + } else if("2".equals(sfyy)){
  409 + if(lineNature.containsKey(c.getXl()) && lineNature.get(c.getXl())){
  410 + continue;
  411 + }
  412 + }
  413 + String key = c.getGsdm() + "/" + c.getFgsdm() + "/" + c.getXl() + "/" + c.getXlName();
  414 + if(!(keyMap.containsKey(key))){
  415 + keyMap.put(key, new ArrayList<CalcCount>());
  416 + keyList.add(key);
  417 + }
  418 + keyMap.get(key).add(c);
  419 + }
  420 + Map<String, Object> sumMap = new HashMap<String, Object>();
  421 + sumMap.put("date", "合计汇总");
  422 + sumMap.put("company", "");
  423 + sumMap.put("subCompany", "");
  424 + sumMap.put("line", "");
  425 + long jhbc_s = 0l, sjbc_s = 0l,
  426 + jhsm_s = 0l, sjsm_s = 0l,
  427 + jhfc_s = 0l, sjfc_s = 0l,
  428 + jhgp_s = 0l, sjgp_s = 0l;
  429 + for(String key : keyList){
  430 + List<CalcCount> ccList = keyMap.get(key);
  431 + Map<String, Object> m = new HashMap<String, Object>();
  432 + m.put("date", dates);
  433 + long jhbc = 0l, sjbc = 0l,
  434 + jhsm = 0l, sjsm = 0l,
  435 + jhfc = 0l, sjfc = 0l;
  436 + for(CalcCount c : ccList){
  437 + if(!(m.containsKey("company"))){
  438 + m.put("company", BasicData.businessCodeNameMap.get(c.getGsdm()));
  439 + }
  440 + if(!(m.containsKey("subCompany"))){
  441 + m.put("subCompany", BasicData.businessFgsCodeNameMap.get(c.getFgsdm()+"_"+c.getGsdm()));
  442 + }
  443 + if(!(m.containsKey("line"))){
  444 + m.put("line", c.getXlName());
  445 + }
  446 + jhbc += Long.valueOf(c.getJhsmbcs()!=null?c.getJhbc():"0");
  447 + sjbc += Long.valueOf(c.getJhsmbcs()!=null?c.getSjbc():"0");
  448 + jhsm += Long.valueOf(c.getJhsmbcs()!=null?c.getJhsmbcs():"0");
  449 + sjsm += Long.valueOf(c.getJhsmbcs()!=null?c.getSjsmbczds():"0");
  450 + jhfc += Long.valueOf(c.getJhsmbcs()!=null?c.getJhszfcs():"0");
  451 + sjfc += Long.valueOf(c.getJhsmbcs()!=null?c.getSjszfczds():"0");
  452 + }
  453 + m.put("jhbc", jhbc);
  454 + m.put("sjbc", sjbc);
  455 + m.put("jhsm", jhsm);
  456 + m.put("sjsm", sjsm);
  457 + m.put("jhfc", jhfc);
  458 + m.put("sjfc", sjfc);
  459 + m.put("bczdl", jhbc>0?new BigDecimal(sjbc*100l)
  460 + .divide(new BigDecimal(jhbc), 2, BigDecimal.ROUND_HALF_UP)+"%":"0%");
  461 + m.put("smzdl", jhsm>0?new BigDecimal(sjsm*100l)
  462 + .divide(new BigDecimal(jhsm), 2, BigDecimal.ROUND_HALF_UP)+"%":"0%");
  463 + m.put("fczdl", jhfc>0?new BigDecimal(sjfc*100l)
  464 + .divide(new BigDecimal(jhfc), 2, BigDecimal.ROUND_HALF_UP)+"%":"0%");
  465 + if(linePlate.contains(""+m.get("line"))){
  466 + m.put("gpzdl", m.get("fczdl").toString());
  467 + jhgp_s += jhfc;
  468 + sjgp_s += sjfc;
  469 + } else {
  470 + m.put("gpzdl", "");
  471 + }
  472 + jhbc_s += jhbc;
  473 + sjbc_s += sjbc;
  474 + jhsm_s += jhsm;
  475 + sjsm_s += sjsm;
  476 + jhfc_s += jhfc;
  477 + sjfc_s += sjfc;
  478 + resList.add(m);
  479 + }
  480 + if(resList.size() > 0){
  481 + sumMap.put("jhbc", jhbc_s);
  482 + sumMap.put("sjbc", sjbc_s);
  483 + sumMap.put("jhsm", jhsm_s);
  484 + sumMap.put("sjsm", sjsm_s);
  485 + sumMap.put("jhfc", jhfc_s);
  486 + sumMap.put("sjfc", sjfc_s);
  487 + sumMap.put("bczdl", jhbc_s>0?new BigDecimal(sjbc_s*100l)
  488 + .divide(new BigDecimal(jhbc_s), 2, BigDecimal.ROUND_HALF_UP)+"%":"0%");
  489 + sumMap.put("smzdl", jhsm_s>0?new BigDecimal(sjsm_s*100l)
  490 + .divide(new BigDecimal(jhsm_s), 2, BigDecimal.ROUND_HALF_UP)+"%":"0%");
  491 + sumMap.put("fczdl", jhfc_s>0?new BigDecimal(sjfc_s*100l)
  492 + .divide(new BigDecimal(jhfc_s), 2, BigDecimal.ROUND_HALF_UP)+"%":"0%");
  493 + sumMap.put("gpzdl", jhgp_s>0?new BigDecimal(sjgp_s*100l)
  494 + .divide(new BigDecimal(jhgp_s), 2, BigDecimal.ROUND_HALF_UP)+"%":"0%");
  495 + resList.add(sumMap);
  496 + }
  497 +
  498 + if(type.equals("export")){
  499 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  500 + Map<String,Object> m = new HashMap<String, Object>();
  501 + ReportUtils ee = new ReportUtils();
  502 + try {
  503 + listI.add(resList.iterator());
  504 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  505 + ee.excelReplace(listI, new Object[] { m }, path+"mould/statisticsIndex.xls",
  506 + path+"export/" + dates + "-准点率统计.xls");
  507 + } catch (Exception e) {
  508 + // TODO: handle exception
  509 + e.printStackTrace();
  510 + }
  511 + }
  512 +
  513 + return resList;
  514 + }
  515 +
338 } 516 }
src/main/resources/static/pages/forms/mould/statisticsIndex.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/statisticsIndex.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid;
  11 + text-align: center; }
  12 + .table-bordered > thead > tr > th,
  13 + .table-bordered > thead > tr > td {
  14 + border-bottom-width: 2px; }
  15 +
  16 + .table > tbody + tbody {
  17 + border-top: 1px solid; }
  18 +</style>
  19 +
  20 +<div class="page-head">
  21 + <div class="page-title">
  22 + <h1>准点率统计</h1>
  23 + </div>
  24 +</div>
  25 +
  26 +<div class="row">
  27 + <div class="col-md-12">
  28 + <div class="portlet light porttlet-fit bordered">
  29 + <div class="portlet-title">
  30 + <form id="history" class="form-inline" action="">
  31 + <div style="display: inline-block;margin-left: 33px;" id="company1">
  32 + <span class="item-label" style="width: 80px;">公司: </span>
  33 + <select class="form-control" name="company" id="company" style="width: 160px;"></select>
  34 + </div>
  35 + <div style="display: inline-block;margin-left: 19px;" id="subCompany1">
  36 + <span class="item-label" style="width: 80px;">分公司: </span>
  37 + <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
  38 + </div>
  39 + <div style="display: inline-block;margin-left: 33px;">
  40 + <span class="item-label" style="width: 80px;">线路: </span>
  41 + <select class="form-control" name="line" id="line" style="width: 160px;"></select>
  42 + </div>
  43 + <div style="margin-top: 10px"></div>
  44 + <div style="display: inline-block; margin-left: 5px">
  45 + <span class="item-label" style="width: 80px;">是否营运: </span>
  46 + <select class="form-control" name="sfyy" id="sfyy" style="width: 160px;">
  47 + <option value="0" selected="selected">全部线路</option>
  48 + <option value="1">营运线路</option>
  49 + <option value="2">非营运线路</option>
  50 + </select>
  51 + </div>
  52 + <div style="display: inline-block;margin-left: 5px;">
  53 + <span class="item-label" style="width: 80px;">开始时间: </span>
  54 + <input class="form-control" type="text" id="startDate" style="width: 160px;"/>
  55 + </div>
  56 + <div style="display: inline-block;margin-left: 5px;">
  57 + <span class="item-label" style="width: 80px;">结束时间: </span>
  58 + <input class="form-control" type="text" id="endDate" style="width: 160px;"/>
  59 + </div>
  60 + <div class="form-group" style="margin-left: 10px;">
  61 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  62 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  63 + </div>
  64 + </form>
  65 + </div>
  66 + <div class="portlet-body">
  67 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  68 + <table class="table table-bordered table-hover table-checkable" id="forms">
  69 + <thead>
  70 + <tr class="hidden">
  71 + <th width="240px">日期</th>
  72 +<!-- <th>公司</th> -->
  73 + <th>分公司</th>
  74 + <th>线路</th>
  75 + <th>班次准点率</th>
  76 + <th>首末班准点率</th>
  77 + <th>起讫站发车准点率</th>
  78 + <th>挂牌线路起讫站发车准点率</th>
  79 + </tr>
  80 + </thead>
  81 + <tbody>
  82 +
  83 + </tbody>
  84 + </table>
  85 + </div>
  86 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  87 + <input class="btn btn-default hidden" type="button" id="exportMap" value="导出明细" style="float: right;"/>
  88 + <table class="table table-bordered table-hover table-checkable" id="map">
  89 + <thead>
  90 + <tr class="hidden">
  91 + <th rowspan="2" align="center">日期</th>
  92 + <th rowspan="2">线路</th>
  93 + <th colspan="4">上行首发</th>
  94 + <th colspan="4">上行末发</th>
  95 + <th colspan="4">下行首发</th>
  96 + <th colspan="4">下行末发</th>
  97 + </tr>
  98 + <tr class="hidden">
  99 + <th align="center">站点</th>
  100 + <th>计发</th>
  101 + <th>实发</th>
  102 + <th>快慢</th>
  103 + <th>站点</th>
  104 + <th>计发</th>
  105 + <th>实发</th>
  106 + <th>快慢</th>
  107 + <th>站点</th>
  108 + <th>计发</th>
  109 + <th>实发</th>
  110 + <th>快慢</th>
  111 + <th>站点</th>
  112 + <th>计发</th>
  113 + <th>实发</th>
  114 + <th>快慢</th>
  115 + </tr>
  116 + </thead>
  117 + <tbody>
  118 +
  119 + </tbody>
  120 + </table>
  121 +
  122 + <input class="btn btn-default hidden" type="button" id="exportSumMap" value="导出明细" style="float: right;"/>
  123 + <table class="table table-bordered table-hover table-checkable" id="sumMap">
  124 + <thead>
  125 + <tr class="hidden">
  126 + <th align="center">序号</th>
  127 + <th>日期</th>
  128 + <th>分公司</th>
  129 + <th>线路</th>
  130 + <th>首末班次</th>
  131 + <th>计发</th>
  132 + <th>实发</th>
  133 + <th>误差</th>
  134 + <th>调度路单备注</th>
  135 + </tr>
  136 + </thead>
  137 + <tbody>
  138 +
  139 + </tbody>
  140 + </table>
  141 + </div>
  142 + </div>
  143 + </div>
  144 + </div>
  145 +</div>
  146 +
  147 +<script type="text/javascript" src="/pages/forms/statement/js/jquery.table2excel.min.js"></script>
  148 +<script>
  149 + $(function(){
  150 + $('#export').attr('disabled', "true");
  151 +
  152 + // 关闭左侧栏
  153 + if (!$('body').hasClass('page-sidebar-closed'))
  154 + $('.menu-toggler.sidebar-toggler').click();
  155 +
  156 +
  157 + var d = new Date();
  158 + d.setTime(d.getTime() - 1*1000*60*60*24);
  159 + var year = d.getFullYear();
  160 + var month = d.getMonth() + 1;
  161 + var day = d.getDate();
  162 + if(month < 10)
  163 + month = "0" + month;
  164 + if(day < 10)
  165 + day = "0" + day;
  166 + var dateTime = year + "-" + month + "-" + day;
  167 + $("#startDate,#endDate").datetimepicker({
  168 + format : 'YYYY-MM-DD',
  169 + locale : 'zh-cn',
  170 + maxDate : dateTime
  171 + });
  172 + $("#startDate").val(year + "-" + month + "-01");
  173 + $("#endDate").val(dateTime);
  174 +
  175 + var fage=false;
  176 + var xlList;
  177 + var obj = [];
  178 +
  179 + $.get('/report/lineList',function(result){
  180 + xlList=result;
  181 + $.get('/user/companyData', function(result){
  182 + obj = result;
  183 + var options = '';
  184 + for(var i = 0; i < obj.length; i++){
  185 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  186 + }
  187 +
  188 + if(obj.length ==0){
  189 + $("#company1").css('display','none');
  190 + }else if(obj.length ==1){
  191 + $("#company1").css('display','none');
  192 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  193 + $('#subCompany1').css('display','none');
  194 + }
  195 + $('#company').html(options);
  196 + updateCompany();
  197 + });
  198 + })
  199 + $("#company").on("change",updateCompany);
  200 + function updateCompany(){
  201 + var company = $('#company').val();
  202 + var options = '<option value="">全部分公司</option>';
  203 + for(var i = 0; i < obj.length; i++){
  204 + if(obj[i].companyCode == company){
  205 + var children = obj[i].children;
  206 + for(var j = 0; j < children.length; j++){
  207 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  208 + }
  209 + }
  210 + }
  211 + $('#subCompany').html(options);
  212 + }
  213 +
  214 + var tempData = {};
  215 + $.get('/report/lineList',function(xlList){
  216 + var data = [];
  217 + data.push({id: " ", text: "全部线路"});
  218 + $.get('/user/companyData', function(result){
  219 + for(var i = 0; i < result.length; i++){
  220 + var companyCode = result[i].companyCode;
  221 + var children = result[i].children;
  222 + for(var j = 0; j < children.length; j++){
  223 + var code = children[j].code;
  224 + for(var k=0;k < xlList.length;k++ ){
  225 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  226 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  227 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  228 + }
  229 + }
  230 + }
  231 + }
  232 + initPinYinSelect2('#line',data,'');
  233 +
  234 + });
  235 + });
  236 +
  237 + $("#line").on("change", function(){
  238 + if($("#line").val() == " "){
  239 + $("#company").attr("disabled", false);
  240 + $("#subCompany").attr("disabled", false);
  241 + } else {
  242 + var temp = tempData[$("#line").val()].split(":");
  243 + $("#company").val(temp[0]);
  244 + updateCompany();
  245 +// $("#subCompany").val(temp[1]);
  246 + $("#subCompany").val("");
  247 + $("#company").attr("disabled", true);
  248 +// $("#subCompany").attr("disabled", true);
  249 + }
  250 + });
  251 +
  252 + var list;
  253 + var tempLine;
  254 + var lineName1;
  255 + $("#forms tbody").on("click","a",function(){
  256 + var index = $(this).parent().parent().index();
  257 + if(index < list.length - 1){
  258 + $.each(list, function(i, g){
  259 + if(index == i){
  260 + tempLine = g.xlbm;
  261 + lineName1 = g.line;
  262 + var tbodyHtml = template('list_maps',{list:g.map});
  263 + $('#map tbody').html(tbodyHtml);
  264 + $("#sumMap tr").addClass("hidden");
  265 + $("#exportSumMap").addClass("hidden");
  266 + $("#map .hidden").removeClass("hidden");
  267 + $("#exportMap").removeClass("hidden");
  268 + $("html,body").animate({scrollTop:$("#map").offset().top},1000);
  269 + }
  270 + });
  271 + } else {
  272 + var tempList = [];
  273 + $.each(list, function(i, g){
  274 + if(index == i){
  275 + var tbodyHtml = template('list_sumMaps',{list:g.map});
  276 + $('#sumMap tbody').html(tbodyHtml);
  277 + $("#map tr").addClass("hidden");
  278 + $("#exportMap").addClass("hidden");
  279 + $("#sumMap .hidden").removeClass("hidden");
  280 + if(g.map.length > 0)
  281 + $("#exportSumMap").removeClass("hidden");
  282 + $("html,body").animate({scrollTop:$("#sumMap").offset().top},1000);
  283 + }
  284 + });
  285 + }
  286 + });
  287 +
  288 + $("#query").on("click",jsDoQuery);
  289 +
  290 + var sfyy = 1;
  291 + var line = $("#line").val();
  292 + var company = $("#company").val();
  293 + var subCompany = $("#subCompany").val();
  294 + var startDate = $("#startDate").val();
  295 + var endDate = $("#endDate").val();
  296 + var lineName = $('#line option:selected').text();
  297 + function jsDoQuery(pagination){
  298 + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
  299 + layer.msg("请选择时间!");
  300 + return;
  301 + }
  302 + if($("#endDate").val() == null || $("#endDate").val().trim().length == 0){
  303 + layer.msg("请选择时间!");
  304 + return;
  305 + }
  306 + var params = {};
  307 + sfyy = $("#sfyy").val();
  308 + line = $("#line").val();
  309 + company = $("#company").val();
  310 + subCompany = $("#subCompany").val();
  311 + startDate = $("#startDate").val();
  312 + endDate = $("#endDate").val();
  313 + lineName = $('#line option:selected').text();
  314 + if(lineName == "全部线路")
  315 + lineName = $('#subCompany option:selected').text();
  316 + if(line == " ")
  317 + line = "";
  318 + params['sfyy'] = sfyy;
  319 + params['line'] = line;
  320 + params['company'] = company;
  321 + params['subCompany'] = subCompany;
  322 + params['startDate'] = startDate;
  323 + params['endDate'] = endDate;
  324 + params['type'] = "query";
  325 + $("#forms .hidden").removeClass("hidden");
  326 + $("#map tr").addClass("hidden");
  327 + $("#sumMap tr").addClass("hidden");
  328 + $("#exportMap").addClass("hidden");
  329 + $("#exportSumMap").addClass("hidden");
  330 + var i = layer.load(2);
  331 + $get('/calc_mix/statisticsIndex', params, function(result){
  332 + // 把数据填充到模版中
  333 + var tbodyHtml = template('list_statisticsIndex',{list:result});
  334 + // 把渲染好的模版html文本追加到表格中
  335 + $('#forms tbody').html(tbodyHtml);
  336 + layer.close(i);
  337 +
  338 + list = result;
  339 +
  340 + if(result.length == 0)
  341 + $("#export").attr('disabled',"true");
  342 + else
  343 + $("#export").removeAttr("disabled");
  344 + });
  345 + }
  346 +
  347 + $("#export").on("click",function(){
  348 + var params = {};
  349 + params['sfyy'] = sfyy;
  350 + params['line'] = line;
  351 + params['company'] = company;
  352 + params['subCompany'] = subCompany;
  353 + params['startDate'] = startDate;
  354 + params['endDate'] = endDate;
  355 + params['type'] = "export";
  356 + params['lineName'] = lineName;
  357 + var i = layer.load(2);
  358 + $get('/calc_mix/statisticsIndex', params, function(result){
  359 + var dateTime = "";
  360 + if(startDate == endDate){
  361 + dateTime = moment(startDate).format("YYYY年MM月DD日");
  362 + } else {
  363 + dateTime = moment(startDate).format("YYYY年MM月DD日")+
  364 + "--"+moment(endDate).format("YYYY年MM月DD日");
  365 + }
  366 + window.open("/downloadFile/download?fileName="
  367 + +dateTime+"-准点率统计");
  368 + layer.close(i);
  369 + });
  370 + });
  371 +
  372 + $("#exportMap").on("click",function(){
  373 + var i = layer.load(2);
  374 + var params = {};
  375 + params['sfyy'] = sfyy;
  376 + params['line'] = tempLine;
  377 + params['company'] = company;
  378 + params['subCompany'] = subCompany;
  379 + params['startDate'] = startDate;
  380 + params['endDate'] = endDate;
  381 + params['type'] = "exportMap";
  382 + params['lineName'] = lineName1;
  383 + $get('/pcpc/firstAndLastBus_sum', params, function(result){
  384 + var dateTime = "";
  385 + if(startDate == endDate){
  386 + dateTime = moment(startDate).format("YYYYMMDD");
  387 + } else {
  388 + dateTime = moment(startDate).format("YYYYMMDD")
  389 + +"-"+moment(endDate).format("YYYYMMDD");
  390 + }
  391 + window.open("/downloadFile/download?fileName="
  392 + +dateTime+"-"+lineName1+"-线路首末班明细");
  393 + layer.close(i);
  394 + });
  395 + });
  396 +
  397 + $("#exportSumMap").on("click",function(){
  398 + var i = layer.load(2);
  399 + var params = {};
  400 + params['sfyy'] = sfyy;
  401 + params['line'] = line;
  402 + params['company'] = company;
  403 + params['subCompany'] = subCompany;
  404 + params['startDate'] = startDate;
  405 + params['endDate'] = endDate;
  406 + params['type'] = "delay_export";
  407 + params['lineName'] = lineName;
  408 + $get('/pcpc/firstAndLastBus_sum', params, function(result){
  409 + var dateTime = "";
  410 + if(startDate == endDate){
  411 + dateTime = moment(startDate).format("YYYYMMDD");
  412 + } else {
  413 + dateTime = moment(startDate).format("YYYYMMDD")
  414 + +"-"+moment(endDate).format("YYYYMMDD");
  415 + }
  416 + window.open("/downloadFile/download?fileName="
  417 + +dateTime+"-"+lineName+"-首末班误点班次");
  418 + layer.close(i);
  419 + });
  420 + });
  421 +
  422 +
  423 + });
  424 +
  425 +</script>
  426 +<script type="text/html" id="list_statisticsIndex">
  427 + {{each list as obj i}}
  428 + <tr>
  429 + {{if obj.date != '合计汇总'}}
  430 + <td>{{obj.date}}</td>
  431 + <td>{{obj.subCompany}}</td>
  432 + <td>{{obj.line}}</td>
  433 + <td>{{obj.bczdl}}</td>
  434 + <td>{{obj.smzdl}}</td>
  435 + <td>{{obj.fczdl}}</td>
  436 + <td>{{obj.gpzdl}}</td>
  437 + {{else}}
  438 + <td colspan='3'>{{obj.date}}</td>
  439 + <td>{{obj.bczdl}}</td>
  440 + <td>{{obj.smzdl}}</td>
  441 + <td>{{obj.fczdl}}</td>
  442 + <td>{{obj.gpzdl}}</td>
  443 + {{/if}}
  444 + </tr>
  445 + {{/each}}
  446 + {{if list.length == 0}}
  447 + <tr>
  448 + <td colspan="20"><h6 class="muted">没有找到相关数据</h6></td>
  449 + </tr>
  450 + {{/if}}
  451 +</script>
  452 +<script type="text/html" id="list_maps">
  453 + {{each list as obj i}}
  454 + <tr>
  455 + <td>{{obj.date}}</td>
  456 + <td>{{obj.line}}</td>
  457 + {{if obj.delayFirst0 != '/' && (obj.delayFirst0 > 1 || obj.delayFirst0 < -2)}}
  458 + <td style="background-color: #FF9999">{{obj.qdzFirst0}}</td>
  459 + <td style="background-color: #FF9999">{{obj.jhfcFirst0}}</td>
  460 + <td style="background-color: #FF9999">{{obj.sjfcFirst0}}</td>
  461 + <td style="background-color: #FF9999">{{obj.delayFirst0}}</td>
  462 + {{else}}
  463 + <td>{{obj.qdzFirst0}}</td>
  464 + <td>{{obj.jhfcFirst0}}</td>
  465 + <td>{{obj.sjfcFirst0}}</td>
  466 + <td>{{obj.delayFirst0}}</td>
  467 + {{/if}}
  468 + {{if obj.delayLast0 != '/' && (obj.delayLast0 > 1 || obj.delayLast0 < -2)}}
  469 + <td style="background-color: #FF9999">{{obj.qdzLast0}}</td>
  470 + <td style="background-color: #FF9999">{{obj.jhfcLast0}}</td>
  471 + <td style="background-color: #FF9999">{{obj.sjfcLast0}}</td>
  472 + <td style="background-color: #FF9999">{{obj.delayLast0}}</td>
  473 + {{else}}
  474 + <td>{{obj.qdzLast0}}</td>
  475 + <td>{{obj.jhfcLast0}}</td>
  476 + <td>{{obj.sjfcLast0}}</td>
  477 + <td>{{obj.delayLast0}}</td>
  478 + {{/if}}
  479 + {{if obj.delayFirst1 != '/' && (obj.delayFirst1 > 1 || obj.delayFirst1 < -2)}}
  480 + <td style="background-color: #FF9999">{{obj.qdzFirst1}}</td>
  481 + <td style="background-color: #FF9999">{{obj.jhfcFirst1}}</td>
  482 + <td style="background-color: #FF9999">{{obj.sjfcFirst1}}</td>
  483 + <td style="background-color: #FF9999">{{obj.delayFirst1}}</td>
  484 + {{else}}
  485 + <td>{{obj.qdzFirst1}}</td>
  486 + <td>{{obj.jhfcFirst1}}</td>
  487 + <td>{{obj.sjfcFirst1}}</td>
  488 + <td>{{obj.delayFirst1}}</td>
  489 + {{/if}}
  490 + {{if obj.delayLast1 != '/' && (obj.delayLast1 > 1 || obj.delayLast1 < -2)}}
  491 + <td style="background-color: #FF9999">{{obj.qdzLast1}}</td>
  492 + <td style="background-color: #FF9999">{{obj.jhfcLast1}}</td>
  493 + <td style="background-color: #FF9999">{{obj.sjfcLast1}}</td>
  494 + <td style="background-color: #FF9999">{{obj.delayLast1}}</td>
  495 + {{else}}
  496 + <td>{{obj.qdzLast1}}</td>
  497 + <td>{{obj.jhfcLast1}}</td>
  498 + <td>{{obj.sjfcLast1}}</td>
  499 + <td>{{obj.delayLast1}}</td>
  500 + {{/if}}
  501 + </tr>
  502 + {{/each}}
  503 + {{if list.length == 0}}
  504 + <tr>
  505 + <td colspan="20"><h6 class="muted">没有相关数据</h6></td>
  506 + </tr>
  507 + {{/if}}
  508 +</script>
  509 +<script type="text/html" id="list_sumMaps">
  510 + {{each list as obj i}}
  511 + <tr>
  512 + <td>{{obj.no}}</td>
  513 + <td>{{obj.date}}</td>
  514 + <td>{{obj.subCompany}}</td>
  515 + <td>{{obj.line}}</td>
  516 + <td>{{obj.firstOrLast}}</td>
  517 + <td>{{obj.jhfc}}</td>
  518 + <td>{{obj.sjfc}}</td>
  519 + <td> {{obj.delay}}</td>
  520 + <td>{{obj.remarks1}}</td>
  521 + </tr>
  522 + {{/each}}
  523 + {{if list.length == 0}}
  524 + <tr>
  525 + <td colspan="20"><h6 class="muted">没有相关数据</h6></td>
  526 + </tr>
  527 + {{/if}}
  528 +</script>
0 \ No newline at end of file 529 \ No newline at end of file