Commit bafa0eaaa54304a7be0af984fcbeea6e6201167d

Authored by 游瑞烽
2 parents e14690ee 602002b9

Merge branch 'pudong' of 192.168.168.201:panzhaov5/bsth_control into pudong

Showing 89 changed files with 4938 additions and 1154 deletions
src/main/java/com/bsth/controller/calc/CalcWaybillController.java
... ... @@ -147,7 +147,11 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer>
147 147 if(map.get("type")!=null){
148 148 type=map.get("type").toString().trim();
149 149 }
150   - return calcWaybillService.calcStatisticsDaily(gsdm,fgsdm,line,date,date2,xlName,type);
  150 + String nature="0";
  151 + if(map.get("nature")!=null){
  152 + nature=map.get("nature").toString();
  153 + }
  154 + return calcWaybillService.calcStatisticsDaily(gsdm,fgsdm,line,date,date2,xlName,type,nature);
151 155 }
152 156  
153 157 @RequestMapping(value="/calcStatisticsDaily2")
... ... @@ -180,7 +184,11 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer>
180 184 if(map.get("type")!=null){
181 185 type=map.get("type").toString().trim();
182 186 }
183   - return calcWaybillService.calcStatisticsDaily2(gsdm,fgsdm,line,date,date2,xlName,type);
  187 + String nature="0";
  188 + if(map.get("nature")!=null){
  189 + nature=map.get("nature").toString();
  190 + }
  191 + return calcWaybillService.calcStatisticsDaily2(gsdm,fgsdm,line,date,date2,xlName,type,nature);
184 192 }
185 193  
186 194 @RequestMapping(value="/generateLineMileage")
... ...
src/main/java/com/bsth/controller/forms/ExportController.java
... ... @@ -469,12 +469,13 @@ public class ExportController {
469 469 for (Operationservice l : operationservice) {
470 470 Map<String, Object> m = new HashMap<String, Object>();
471 471 m.put("i", i);
472   - m.put("xlName", l.getXlName());
473   - m.put("jzl", l.getJzl());
474   - m.put("xhl", l.getXhl());
475   - m.put("xsgl", l.getXsgl());
476   - m.put("emptMileage", l.getEmptMileage());
477   - m.put("sjbc", l.getSjbc());
  472 + m.put("fgs", l.getFgs()!=null?l.getFgs():"");
  473 + m.put("xlName", l.getXlName()!=null?l.getXlName():"");
  474 + m.put("jzl", l.getJzl()!=null?l.getJzl():"");
  475 + m.put("xhl", l.getXhl()!=null?l.getXhl():"");
  476 + m.put("xsgl", l.getXsgl()!=null?l.getXsgl():"");
  477 + m.put("emptMileage", l.getEmptMileage()!=null?l.getEmptMileage():"");
  478 + m.put("sjbc", l.getSjbc()!=null?l.getSjbc():"");
478 479 resList.add(m);
479 480 i++;
480 481 }
... ...
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -417,7 +417,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
417 417 if(map.get("type")!=null){
418 418 type=map.get("type").toString();
419 419 }
420   - return scheduleRealInfoService.statisticsDailyTj(gsdm,fgsdm,line, date,date2, xlName, type);
  420 + String nature="0";
  421 + if(map.get("nature")!=null){
  422 + nature=map.get("nature").toString();
  423 + }
  424 + return scheduleRealInfoService.statisticsDailyTj(gsdm,fgsdm,line, date,date2, xlName, type,nature);
421 425 }
422 426  
423 427 /*
... ...
src/main/java/com/bsth/controller/report/CalcSheetController.java 0 → 100644
  1 +package com.bsth.controller.report;
  2 +import java.util.List;
  3 +import java.util.Map;
  4 +
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestMethod;
  8 +import org.springframework.web.bind.annotation.RequestParam;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +import com.bsth.controller.BaseController;
  11 +import com.bsth.entity.sheet.CalcSheet;
  12 +import com.bsth.entity.sheet.Sheet;
  13 +import com.bsth.service.report.CalcSheetService;
  14 +
  15 +@RestController
  16 +@RequestMapping("calcSheet")
  17 +public class CalcSheetController extends BaseController<CalcSheet, Integer>{
  18 + @Autowired
  19 + CalcSheetService calcSheetService;
  20 + //发车到站准点率统计
  21 + @RequestMapping(value = "/countList",method = RequestMethod.GET)
  22 + public List<CalcSheet> countList(@RequestParam Map<String, Object> map){
  23 + List<CalcSheet> list=calcSheetService.countListCalcSheet(map);
  24 + return list;
  25 + }
  26 + //发车到站准点率列表
  27 + @RequestMapping(value = "/calcListSheet",method = RequestMethod.GET)
  28 + public List<CalcSheet> calcListSheet(@RequestParam Map<String, Object> map){
  29 + List<CalcSheet> list=calcSheetService.calcListSheet(map);
  30 + return list;
  31 + }
  32 + //发车站点准点率详细
  33 + @RequestMapping(value = "/calcSheet",method = RequestMethod.GET)
  34 + public List<Sheet> calcSheet(@RequestParam Map<String, Object> map){
  35 + List<Sheet> list=calcSheetService.calcSheet(map);
  36 + return list;
  37 + }
  38 +
  39 + //营运线路出车率统计
  40 + @RequestMapping(value = "/calcTurnoutrate",method = RequestMethod.GET)
  41 + public List<Map<String, Object>> calcTurnoutrate(@RequestParam Map<String, Object> map){
  42 + List<Map<String, Object>> list=calcSheetService.calcTurnoutrate(map);
  43 + return list;
  44 + }
  45 +}
... ...
src/main/java/com/bsth/controller/schedule/core/EmployeeConfigInfoController.java
... ... @@ -70,6 +70,27 @@ public class EmployeeConfigInfoController extends BController&lt;EmployeeConfigInfo
70 70 return rtn;
71 71 }
72 72  
  73 + @RequestMapping(value = "/validate_jsy_config", method = RequestMethod.GET)
  74 + public Map<String, Object> validate_jsy_config(@RequestParam Map<String, Object> param) {
  75 + Map<String, Object> rtn = new HashMap<>();
  76 + try {
  77 + EmployeeConfigInfo employeeConfigInfo = new EmployeeConfigInfo(
  78 + null,
  79 + param.get("xl.id_eq"),
  80 + param.get("xl.name_eq"),
  81 + param.get("jsy.id_eq"),
  82 + null
  83 + );
  84 + employeeConfigInfoService.validate_jsy_config(employeeConfigInfo);
  85 + rtn.put("status", ResponseCode.SUCCESS);
  86 + } catch (ScheduleException exp) {
  87 + rtn.put("status", ResponseCode.ERROR);
  88 + rtn.put("msg", exp.getMessage());
  89 + }
  90 +
  91 + return rtn;
  92 + }
  93 +
73 94 @RequestMapping(value = "/validate_spy", method = RequestMethod.GET)
74 95 public Map<String, Object> validate_spy(@RequestParam Map<String, Object> param) {
75 96 Map<String, Object> rtn = new HashMap<>();
... ... @@ -89,4 +110,24 @@ public class EmployeeConfigInfoController extends BController&lt;EmployeeConfigInfo
89 110 }
90 111 return rtn;
91 112 }
  113 +
  114 + @RequestMapping(value = "/validate_spy_config", method = RequestMethod.GET)
  115 + public Map<String, Object> validate_spy_config(@RequestParam Map<String, Object> param) {
  116 + Map<String, Object> rtn = new HashMap<>();
  117 + try {
  118 + EmployeeConfigInfo employeeConfigInfo = new EmployeeConfigInfo(
  119 + null,
  120 + param.get("xl.id_eq"),
  121 + param.get("xl.name_eq"),
  122 + null,
  123 + param.get("spy.id_eq")
  124 + );
  125 + employeeConfigInfoService.validate_spy_config(employeeConfigInfo);
  126 + rtn.put("status", ResponseCode.SUCCESS);
  127 + } catch (ScheduleException exp) {
  128 + rtn.put("status", ResponseCode.ERROR);
  129 + rtn.put("msg", exp.getMessage());
  130 + }
  131 + return rtn;
  132 + }
92 133 }
... ...
src/main/java/com/bsth/data/safe_driv/SafeDrivDataLoadThread.java
... ... @@ -20,12 +20,12 @@ import java.util.List;
20 20 * Created by panzhao on 2017/4/6.
21 21 */
22 22 @Component
23   -public class SafeDrivDataLoadThread extends Thread{
  23 +public class SafeDrivDataLoadThread extends Thread {
24 24  
25 25 Logger logger = LoggerFactory.getLogger(this.getClass());
26 26  
27 27 static String url;
28   - static CloseableHttpClient httpClient = null;
  28 + static CloseableHttpClient httpClient;
29 29 static HttpGet get;
30 30 static RequestConfig requestConfig;
31 31 static CloseableHttpResponse response;
... ... @@ -51,9 +51,7 @@ public class SafeDrivDataLoadThread extends Thread{
51 51  
52 52 int statusCode = response.getStatusLine().getStatusCode();
53 53 if(statusCode != 200){
54   - get.abort();
55 54 logger.error("http client status code: " + statusCode);
56   - return;
57 55 }
58 56  
59 57 entity = response.getEntity();
... ... @@ -67,7 +65,7 @@ public class SafeDrivDataLoadThread extends Thread{
67 65  
68 66 list = JSON.parseArray(stringBuffer.toString(), SafeDriv.class);
69 67  
70   - for(SafeDriv sd : list){
  68 + for (SafeDriv sd : list) {
71 69 SafeDrivCenter.put(sd);
72 70 }
73 71 }
... ... @@ -75,7 +73,7 @@ public class SafeDrivDataLoadThread extends Thread{
75 73 if (null != response)
76 74 response.close();
77 75 } catch (Exception e) {
78   - logger.error("安全驾驶接口报错了" , e.getMessage());
  76 + logger.error("安全驾驶接口报错了", e.getMessage());
79 77 }
80 78 }
81 79 }
... ...
src/main/java/com/bsth/data/schedule/ScheduleComparator.java
... ... @@ -9,12 +9,10 @@ import java.util.HashMap;
9 9 import java.util.Map;
10 10  
11 11 /**
12   - *
13   - * @ClassName: ScheduleComparator
14   - * @Description: TODO(实际班次排序器)
15 12 * @author PanZhao
16   - * @date 2016年8月15日 下午1:53:28
17   - *
  13 + * @ClassName: ScheduleComparator
  14 + * @Description: TODO(实际班次排序器)
  15 + * @date 2016年8月15日 下午1:53:28
18 16 */
19 17 public class ScheduleComparator {
20 18  
... ... @@ -26,71 +24,62 @@ public class ScheduleComparator {
26 24 }*/
27 25  
28 26  
29   - static Map<String, Integer> bcTypeOrderMap = new HashMap<>();
  27 + static Map<String, Integer> bcTypeOrderMap = new HashMap<>();
30 28  
31   - static{
32   - bcTypeOrderMap.put("out", 0);
33   - bcTypeOrderMap.put("normal", 1);
34   - bcTypeOrderMap.put("region", 2);
35   - bcTypeOrderMap.put("major", 3);
36   - bcTypeOrderMap.put("venting", 4);
37   - bcTypeOrderMap.put("ldks", 5);
38   - bcTypeOrderMap.put("in", 6);
39   - }
40   -
41   - public static class FCSJ implements Comparator<ScheduleRealInfo>{
  29 + static {
  30 + bcTypeOrderMap.put("out", 0);
  31 + bcTypeOrderMap.put("normal", 1);
  32 + bcTypeOrderMap.put("region", 2);
  33 + bcTypeOrderMap.put("major", 3);
  34 + bcTypeOrderMap.put("venting", 4);
  35 + bcTypeOrderMap.put("ldks", 5);
  36 + bcTypeOrderMap.put("in", 6);
  37 + }
42 38  
43   - @Override
44   - public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) {
45   - int diff = (int) (s1.getFcsjT() - s2.getFcsjT());
46   - return diff!=0?diff:typeOrder(s1.getBcType()) - typeOrder(s2.getBcType());
47   - }
48   - }
  39 + public static class FCSJ implements Comparator<ScheduleRealInfo> {
49 40  
50   - private static int typeOrder(String bcType){
51   - return bcTypeOrderMap.get(bcType)!=null?bcTypeOrderMap.get(bcType):0;
52   - }
  41 + @Override
  42 + public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) {
  43 + int diff = (int) (s1.getFcsjT() - s2.getFcsjT());
  44 + return diff != 0 ? diff : typeOrder(s1.getBcType()) - typeOrder(s2.getBcType());
  45 + }
  46 + }
  47 +
  48 + private static int typeOrder(String bcType) {
  49 + return bcTypeOrderMap.get(bcType) != null ? bcTypeOrderMap.get(bcType) : 0;
  50 + }
53 51  
54   - public static class DFSJ implements Comparator<ScheduleRealInfo>{
  52 + public static class DFSJ implements Comparator<ScheduleRealInfo> {
55 53  
56 54 static Logger logger = LoggerFactory.getLogger(DFSJ.class);
57 55  
58   - @Override
59   - public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) {
60   - try{
  56 + @Override
  57 + public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) {
  58 + try {
  59 + int diff;
  60 + if (!s2.isSflj() && !s1.isSflj()) {
  61 + diff = (int) (s1.getFcsjT() - s2.getFcsjT());
61 62  
62   - if(!s1.getXlBm().equals(s2.getXlBm()) || !s1.getLpName().equals(s2.getLpName())){
63   - int diff = (int) (s1.getDfsjT() - s2.getDfsjT());
64   - return diff!=0?diff:typeOrder(s1.getBcType()) - typeOrder(s2.getBcType());
65   - }
66   - else{
67   - /**
68   - * 按时刻表发车顺序号
69   - */
70   - Integer fc1 = s1.getFcno();
71   - Integer fc2 = s2.getFcno();
72   - if(null != fc1 && null != fc2){
73   - return fc1.intValue()==fc2.intValue()?0:fc1.intValue()-fc2.intValue();
74   - }
75   - else{
76   - int diff = (int) (s1.getDfsjT() - s2.getDfsjT());
77   - return diff!=0?diff:typeOrder(s1.getBcType()) - typeOrder(s2.getBcType());
78   - }
  63 + } else {
  64 + diff = (int) (s1.getDfsjT() - s2.getDfsjT());
79 65 }
80   - }catch (Exception e){
  66 +
  67 + return diff != 0 ? diff : typeOrder(s1.getBcType()) - typeOrder(s2.getBcType());
  68 +
  69 + } catch (Exception e) {
81 70 logger.error("排序异常", e);
82   - return s1.getDfsjT() - s2.getDfsjT() > 0?1:-1;
  71 + return s1.getDfsjT() - s2.getDfsjT() > 0 ? 1 : -1;
83 72 }
84   - }
85   - }
  73 + }
  74 + }
86 75  
87   - public static class DFSJ2 implements Comparator<ScheduleRealInfo>{
  76 + public static class DFSJ2 implements Comparator<ScheduleRealInfo> {
88 77  
89 78  
90 79 @Override
91 80 public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) {
92 81 int diff = (int) (s1.getDfsjT() - s2.getDfsjT());
93   - return diff!=0?diff:typeOrder(s1.getBcType()) - typeOrder(s2.getBcType());
  82 + return diff != 0 ? diff : typeOrder(s1.getBcType()) - typeOrder(s2.getBcType());
94 83 }
95 84 }
96 85 }
... ...
src/main/java/com/bsth/entity/calc/CalcStatistics.java
... ... @@ -6,6 +6,7 @@ import javax.persistence.Entity;
6 6 import javax.persistence.GeneratedValue;
7 7 import javax.persistence.Id;
8 8 import javax.persistence.Table;
  9 +import javax.persistence.Transient;
9 10  
10 11 @Entity
11 12 @Table(name = "calc_statistics")
... ... @@ -66,6 +67,8 @@ public class CalcStatistics {
66 67 private Double qtlc;
67 68 /* 临加公里*/
68 69 private Double ljlc;
  70 + /* 临加空驶公里*/
  71 + private Double ljkslc;
69 72 /* 计划班次*/
70 73 private int jhbcq;
71 74 /* 计划班次(早高峰)*/
... ... @@ -106,8 +109,9 @@ public class CalcStatistics {
106 109 private int djgsj;
107 110 /* 备注*/
108 111 private String remark;
109   -
110   -
  112 + /*分公司名字*/
  113 + @Transient
  114 + private String fgsName;
111 115 public Long getId() {
112 116 return id;
113 117 }
... ... @@ -270,6 +274,12 @@ public class CalcStatistics {
270 274 public void setLjlc(Double ljlc) {
271 275 this.ljlc = ljlc;
272 276 }
  277 + public Double getLjkslc() {
  278 + return ljkslc;
  279 + }
  280 + public void setLjkslc(Double ljkslc) {
  281 + this.ljkslc = ljkslc;
  282 + }
273 283 public int getJhbcq() {
274 284 return jhbcq;
275 285 }
... ... @@ -390,5 +400,11 @@ public class CalcStatistics {
390 400 public void setRemark(String remark) {
391 401 this.remark = remark;
392 402 }
  403 + public String getFgsName() {
  404 + return fgsName;
  405 + }
  406 + public void setFgsName(String fgsName) {
  407 + this.fgsName = fgsName;
  408 + }
393 409  
394 410 }
... ...
src/main/java/com/bsth/entity/mcy_forms/Operationservice.java
... ... @@ -17,6 +17,10 @@ public class Operationservice {
17 17 private String jname;
18 18  
19 19 private String clzbh;
  20 +
  21 + private String gs;
  22 +
  23 + private String fgs;
20 24  
21 25 public String getJname() {
22 26 return jname;
... ... @@ -89,6 +93,22 @@ public class Operationservice {
89 93 public void setXlBm(String xlBm) {
90 94 this.xlBm = xlBm;
91 95 }
  96 +
  97 + public String getGs() {
  98 + return gs;
  99 + }
  100 +
  101 + public void setGs(String gs) {
  102 + this.gs = gs;
  103 + }
  104 +
  105 + public String getFgs() {
  106 + return fgs;
  107 + }
  108 +
  109 + public void setFgs(String fgs) {
  110 + this.fgs = fgs;
  111 + }
92 112  
93 113  
94 114 }
... ...
src/main/java/com/bsth/entity/sheet/CalcSheet.java 0 → 100644
  1 +package com.bsth.entity.sheet;
  2 +
  3 +import javax.persistence.Entity;
  4 +import javax.persistence.GeneratedValue;
  5 +import javax.persistence.Id;
  6 +import javax.persistence.Table;
  7 +import javax.persistence.Transient;
  8 +
  9 +import com.bsth.data.BasicData;
  10 +
  11 +@Entity
  12 +@Table(name = "bsth_c_calc_sheet")
  13 +public class CalcSheet {
  14 + /* 主键*/
  15 + @Id
  16 + @GeneratedValue
  17 + private Integer id;
  18 + /* 公司代码*/
  19 + private String gsdm;
  20 + /* 分公司代码*/
  21 + private String fgsdm;
  22 + /* 日期字符串*/
  23 + private String date;
  24 + /* 线路编码*/
  25 + private String xl;
  26 + /* 线路名称*/
  27 + private String xlName;
  28 + /*计划首站发车数*/
  29 + private String jhszfcs;
  30 + /*实际首站发车正点数*/
  31 + private String sjszfczds;
  32 + /*首站发车正点率*/
  33 + private String szfczdl;
  34 + /*首站发车到达正点数*/
  35 + private String sjszddzds;
  36 + /*首站发车到达正点率*/
  37 + private String szddzdl;
  38 + /*计划出车数*/
  39 + private String jhcc;
  40 + /*实际出车数*/
  41 + private String sjcc;
  42 + /*早高峰实际出车*/
  43 + private String sjcczgf;
  44 + /*晚高峰实际出车*/
  45 + private String sjccwgf;
  46 + /*计划班次数*/
  47 + private String jhbcs;
  48 + /*实际班次数*/
  49 + private String sjbcs;
  50 + /*临加班次数*/
  51 + private String ljbcs;
  52 + /*公司名字*/
  53 + @Transient
  54 + private String gsname;
  55 + /*分公司名字*/
  56 + @Transient
  57 + private String fgsname;
  58 + public Integer getId() {
  59 + return id;
  60 + }
  61 + public void setId(Integer id) {
  62 + this.id = id;
  63 + }
  64 + public String getGsdm() {
  65 + return gsdm;
  66 + }
  67 + public void setGsdm(String gsdm) {
  68 + this.gsdm = gsdm;
  69 + }
  70 + public String getFgsdm() {
  71 + return fgsdm;
  72 + }
  73 + public void setFgsdm(String fgsdm) {
  74 + this.fgsdm = fgsdm;
  75 + }
  76 + public String getDate() {
  77 + return date;
  78 + }
  79 + public void setDate(String date) {
  80 + this.date = date;
  81 + }
  82 + public String getXl() {
  83 + return xl;
  84 + }
  85 + public void setXl(String xl) {
  86 + this.xl = xl;
  87 + }
  88 + public String getXlName() {
  89 + return xlName;
  90 + }
  91 + public void setXlName(String xlName) {
  92 + this.xlName = xlName;
  93 + }
  94 + public String getJhszfcs() {
  95 + return jhszfcs;
  96 + }
  97 + public void setJhszfcs(String jhszfcs) {
  98 + this.jhszfcs = jhszfcs;
  99 + }
  100 + public String getSjszfczds() {
  101 + return sjszfczds;
  102 + }
  103 + public void setSjszfczds(String sjszfczds) {
  104 + this.sjszfczds = sjszfczds;
  105 + }
  106 + public String getSzfczdl() {
  107 + return szfczdl;
  108 + }
  109 + public void setSzfczdl(String szfczdl) {
  110 + this.szfczdl = szfczdl;
  111 + }
  112 + public String getSjszddzds() {
  113 + return sjszddzds;
  114 + }
  115 + public void setSjszddzds(String sjszddzds) {
  116 + this.sjszddzds = sjszddzds;
  117 + }
  118 + public String getSzddzdl() {
  119 + return szddzdl;
  120 + }
  121 + public void setSzddzdl(String szddzdl) {
  122 + this.szddzdl = szddzdl;
  123 + }
  124 + public String getJhcc() {
  125 + return jhcc;
  126 + }
  127 + public void setJhcc(String jhcc) {
  128 + this.jhcc = jhcc;
  129 + }
  130 + public String getSjcc() {
  131 + return sjcc;
  132 + }
  133 + public void setSjcc(String sjcc) {
  134 + this.sjcc = sjcc;
  135 + }
  136 + public String getSjcczgf() {
  137 + return sjcczgf;
  138 + }
  139 + public void setSjcczgf(String sjcczgf) {
  140 + this.sjcczgf = sjcczgf;
  141 + }
  142 + public String getSjccwgf() {
  143 + return sjccwgf;
  144 + }
  145 + public void setSjccwgf(String sjccwgf) {
  146 + this.sjccwgf = sjccwgf;
  147 + }
  148 + public String getJhbcs() {
  149 + return jhbcs;
  150 + }
  151 + public void setJhbcs(String jhbcs) {
  152 + this.jhbcs = jhbcs;
  153 + }
  154 + public String getSjbcs() {
  155 + return sjbcs;
  156 + }
  157 + public void setSjbcs(String sjbcs) {
  158 + this.sjbcs = sjbcs;
  159 + }
  160 + public String getLjbcs() {
  161 + return ljbcs;
  162 + }
  163 + public void setLjbcs(String ljbcs) {
  164 + this.ljbcs = ljbcs;
  165 + }
  166 +
  167 + public String getGsname() {
  168 + return BasicData.businessCodeNameMap.get(this.gsdm);
  169 + }
  170 +
  171 + public void setGsname(String gsname) {
  172 + this.gsname = gsname;
  173 + }
  174 +
  175 +
  176 + public String getFgsname() {
  177 + return BasicData.businessFgsCodeNameMap.get(this.fgsdm+"_"+this.gsdm);
  178 + }
  179 +
  180 + public void setFgsname(String fgsname) {
  181 + this.fgsname = fgsname;
  182 + }
  183 +}
... ...
src/main/java/com/bsth/repository/LsStationRouteRepository.java
1 1 package com.bsth.repository;
2 2  
3 3 import java.util.List;
  4 +import java.util.Map;
4 5  
5 6 import org.springframework.data.jpa.repository.EntityGraph;
6 7 import org.springframework.data.jpa.repository.Modifying;
... ... @@ -52,4 +53,21 @@ public interface LsStationRouteRepository extends BaseRepository&lt;LsStationRoute,
52 53 @Modifying
53 54 @Query(value="UPDATE bsth_c_ls_stationroute set destroy = 1 where line = ?1 and directions = ?2 and versions = ?3", nativeQuery=true)
54 55 public void batchDestroy(Integer sectionRouteLine, Integer directions, Integer versions);
  56 +
  57 + /**
  58 + * 按线路编码查询各站点的顺序号
  59 + * @param lineCode 线路编码
  60 + * @param lineVersion 版本号
  61 + * @return
  62 + */
  63 + @Query("SELECT new map(" +
  64 + "lineCode as lineCode,directions as directions,stationName as stationName,stationCode as stationCode," +
  65 + "line.linePlayType as linePlayType,s.stationMark as stationMark) " +
  66 + "FROM " +
  67 + "LsStationRoute s " +
  68 + "WHERE " +
  69 + "s.destroy = 0 AND s.lineCode = ?1 AND s.versions = ?2 " +
  70 + "ORDER BY " +
  71 + "lineCode,directions,stationRouteCode")
  72 + List<Map<String, String>> findLineWithLineCode4Ygc(String lineCode,Integer lineVersion);
55 73 }
... ...
src/main/java/com/bsth/repository/calc/CalcStatisticsRepository.java
... ... @@ -6,8 +6,10 @@ import javax.transaction.Transactional;
6 6  
7 7 import com.bsth.entity.calc.CalcStatistics;
8 8 import com.bsth.entity.calc.CalcWaybill;
  9 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
9 10 import com.bsth.repository.BaseRepository;
10 11  
  12 +import org.springframework.data.jpa.repository.EntityGraph;
11 13 import org.springframework.data.jpa.repository.Modifying;
12 14 import org.springframework.data.jpa.repository.Query;
13 15 import org.springframework.stereotype.Repository;
... ... @@ -19,11 +21,11 @@ import org.springframework.stereotype.Repository;
19 21 public interface CalcStatisticsRepository extends BaseRepository<CalcStatistics, Integer>{
20 22  
21 23 //按照时间段统计,公司下线路
22   - @Query(value="select DISTINCT c from CalcStatistics c where c.xl like %?1% and c.dateStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% order by c.xl")
  24 + @Query(value="select DISTINCT c from CalcStatistics c where c.xl like %?1% and c.dateStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% order by c.fgsdm,c.xl")
23 25 List<CalcStatistics> selectByDateAndLineTj(String line,String date,String date2,String gsdm,String fgsdm);
24 26  
25 27 //按照时间段统计,单条线路
26   - @Query(value="select DISTINCT c from CalcStatistics c where c.xl = ?1 and c.dateStr between ?2 and ?3 order by c.xl")
  28 + @Query(value="select DISTINCT c from CalcStatistics c where c.xl = ?1 and c.dateStr between ?2 and ?3 order by c.fgsdm,c.xl")
27 29 List<CalcStatistics> selectByDateAndLineTj2(String line,String date,String date2);
28 30  
29 31 //按照日期和线路删除数据
... ... @@ -38,4 +40,8 @@ public interface CalcStatisticsRepository extends BaseRepository&lt;CalcStatistics,
38 40 @Query(value = "delete CalcStatistics c where c.dateStr=?1")
39 41 void deleteByDate(String date);
40 42  
  43 + //按照时间段查询实际排班(分公司条件不可为空)
  44 + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
  45 + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and s.scheduleDateStr between ?2 and ?3 and gsBm = ?4 and fgsBm = ?5 order by s.fgsBm, s.xlBm")
  46 + List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date,String date2,String gsdm,String fgsdm);
41 47 }
... ...
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
... ... @@ -180,12 +180,12 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
180 180  
181 181 //按照时间段统计
182 182 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
183   - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and s.scheduleDateStr between ?2 and ?3 and gsBm = ?4 and fgsBm = ?5 order by s.xlBm")
  183 + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and s.scheduleDateStr between ?2 and ?3 and gsBm = ?4 and fgsBm like %?5% order by s.fgsBm, s.xlBm")
184 184 List<ScheduleRealInfo> scheduleByDateAndLineTj(String line,String date,String date2,String gsdm,String fgsdm);
185 185  
186 186 //按照时间段统计
187 187 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
188   - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr >= ?2 and s.scheduleDateStr<= ?3 order by s.xlBm")
  188 + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr >= ?2 and s.scheduleDateStr<= ?3 order by s.fgsBm,s.xlBm")
189 189 List<ScheduleRealInfo> scheduleByDateAndLineTj2(String line,String date,String date2);
190 190 //月报表
191 191 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
... ...
src/main/java/com/bsth/repository/sheet/CalcSheetRepository.java 0 → 100644
  1 +package com.bsth.repository.sheet;
  2 +
  3 +import com.bsth.entity.sheet.CalcSheet;
  4 +import com.bsth.repository.BaseRepository;
  5 +
  6 +import org.springframework.stereotype.Repository;
  7 +
  8 +/**
  9 + *
  10 + */
  11 +@Repository
  12 +public interface CalcSheetRepository extends BaseRepository<CalcSheet, Integer>{
  13 +
  14 +}
... ...
src/main/java/com/bsth/repository/sys/ResourceRepository.java
... ... @@ -10,5 +10,5 @@ import com.bsth.repository.BaseRepository;
10 10 @Repository
11 11 public interface ResourceRepository extends BaseRepository<Resource, Integer> {
12 12  
13   - List<Resource> findByRolesId(Integer roleId);
  13 + List<Resource> findByRolesId(Integer roleId);
14 14 }
... ...
src/main/java/com/bsth/service/LineService.java
... ... @@ -37,4 +37,6 @@ public interface LineService extends BaseService&lt;Line, Integer&gt; {
37 37 Map<String, Object> update(Line l);
38 38  
39 39 Map<String,Object> remove(Integer id);
  40 +
  41 + Map<String, Boolean> lineNature();
40 42 }
... ...
src/main/java/com/bsth/service/calc/CalcWaybillService.java
... ... @@ -30,9 +30,9 @@ public interface CalcWaybillService extends BaseService&lt;CalcWaybill, Integer&gt; {
30 30 */
31 31 String calcDaily(String rq, String line) throws Exception;
32 32  
33   - List<CalcStatistics> calcStatisticsDaily(String gsdm,String fgsdm, String line, String date, String date2, String xlName, String type);
  33 + List<CalcStatistics> calcStatisticsDaily(String gsdm,String fgsdm, String line, String date, String date2, String xlName, String type,String nature);
34 34  
35   - List<Map<String, Object>> calcStatisticsDaily2(String gsdm,String fgsdm, String line, String date, String date2, String xlName, String type);
  35 + List<Map<String, Object>> calcStatisticsDaily2(String gsdm,String fgsdm, String line, String date, String date2, String xlName, String type,String nature);
36 36  
37 37 Map<String, Object> calcLineMileage(String date, String line);
38 38  
... ...
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
... ... @@ -20,6 +20,7 @@ import java.util.Set;
20 20 import javax.transaction.Transactional;
21 21  
22 22 import com.bsth.common.ResponseCode;
  23 +import com.bsth.data.BasicData;
23 24 import com.bsth.entity.Line;
24 25 import com.bsth.entity.calc.CalcBusMileage;
25 26 import com.bsth.entity.calc.CalcInterval;
... ... @@ -36,6 +37,7 @@ import com.bsth.repository.calc.CalcLineMileageRepository;
36 37 import com.bsth.repository.calc.CalcStatisticsRepository;
37 38 import com.bsth.repository.calc.CalcWaybillRepository;
38 39 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  40 +import com.bsth.service.LineService;
39 41 import com.bsth.service.calc.CalcToolService;
40 42 import com.bsth.service.calc.CalcWaybillService;
41 43 import com.bsth.service.impl.BaseServiceImpl;
... ... @@ -91,7 +93,8 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
91 93  
92 94 @Autowired
93 95 private LineRepository lineRepository;
94   -
  96 + @Autowired
  97 + private LineService lineService;
95 98 @Autowired
96 99 private ReportService reportService;
97 100  
... ... @@ -550,7 +553,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
550 553  
551 554 //查询所有线路
552 555 for(Map<String, String> m : gsList){
553   - list.addAll(scheduleRealInfoRepository.scheduleByDateAndLineTj(line, rq, rq, m.get("gsdm"), m.get("fgsdm")));
  556 + list.addAll(calcStatisticsRepository.scheduleByDateAndLine(line, rq, rq, m.get("gsdm"), m.get("fgsdm")));
554 557 }
555 558  
556 559 for (int i = 0; i < list.size(); i++) {
... ... @@ -641,6 +644,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
641 644 double sjyygl= culateService.culateSjgl(lists);
642 645 double zyygl= Arith.add(sjyygl,ljgl);
643 646  
  647 + double ljksgl= culateService.culateLjksgl(lists);
644 648 double sjjccgl=culateService.culateJccgl(lists);
645 649 double sjksgl=culateService.culateKsgl(lists);
646 650 double zksgl=Arith.add(sjjccgl, sjksgl);
... ... @@ -648,6 +652,8 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
648 652 s.setSjkslc(zksgl);
649 653 s.setSjzlc(Arith.add(zyygl, zksgl));
650 654  
  655 + s.setLjkslc(ljksgl);
  656 +
651 657 s.setSslc(culateService.culateLbgl(list));
652 658 s.setSsbc(culateService.culateLbbc(list));
653 659  
... ... @@ -733,28 +739,51 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
733 739  
734 740 @Override
735 741 public List<CalcStatistics> calcStatisticsDaily(String gsdm, String fgsdm,
736   - String line, String date, String date2, String xlName, String type) {
  742 + String line, String date, String date2, String xlName, String type,String nature) {
737 743 // TODO Auto-generated method stub
738   - List<CalcStatistics> list = new ArrayList<CalcStatistics>();
  744 + List<CalcStatistics> listAll = new ArrayList<CalcStatistics>();
739 745 if(line.length() > 0){
740   - list = calcStatisticsRepository.selectByDateAndLineTj2(line, date, date2);
  746 + listAll = calcStatisticsRepository.selectByDateAndLineTj2(line, date, date2);
741 747 } else {
742   - list = calcStatisticsRepository.selectByDateAndLineTj(line, date, date2, gsdm, fgsdm);
  748 + listAll = calcStatisticsRepository.selectByDateAndLineTj(line, date, date2, gsdm, fgsdm);
  749 + }
  750 + Map<String, Boolean> lineMap=lineService.lineNature();
  751 + List<CalcStatistics> list = new ArrayList<CalcStatistics>();
  752 + if(nature.equals("0")){
  753 + list=listAll;
  754 + }else{
  755 + for (int i = 0; i < listAll.size(); i++) {
  756 + CalcStatistics c=listAll.get(i);
  757 + if(nature.equals("1")){
  758 + if(lineMap.get(c.getXl())){
  759 + list.add(c);
  760 + }
  761 + }else{
  762 + if(!lineMap.get(c.getXl())){
  763 + list.add(c);
  764 + }
  765 + }
  766 + }
743 767 }
744   -
745 768 List<CalcStatistics> resList = new ArrayList<CalcStatistics>();
746 769 Map<String, List<CalcStatistics>> keyMap = new HashMap<String, List<CalcStatistics>>();
747 770 List<String> keyList = new ArrayList<String>();
748 771  
749 772 for(CalcStatistics s : list){
750 773 try {
751   - String key = PinyinHelper.convertToPinyinString(s.getXlName(), "" , PinyinFormat.WITHOUT_TONE);
752   - if(!keyMap.containsKey(key)){
  774 +// String key = PinyinHelper.convertToPinyinString(s.getXl(), "" , PinyinFormat.WITHOUT_TONE);
  775 + String key =s.getFgsdm()+s.getXl();
  776 +// if(line.equals("")){
  777 +// key =s.getFgsdm()+s.getXl();
  778 +// }else{
  779 +// key =s.getXl();
  780 +// }
  781 + if(!keyMap.containsKey(key)){
753 782 keyMap.put(key, new ArrayList<CalcStatistics>());
754 783 keyList.add(key);
755 784 }
756 785 keyMap.get(key).add(s);
757   - } catch (PinyinException e) {
  786 + } catch (Exception e) {
758 787 // TODO Auto-generated catch block
759 788 e.printStackTrace();
760 789 }
... ... @@ -769,6 +798,13 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
769 798 CalcStatistics s_ = keyMap.get(key).get(i);
770 799 s = addStatistics(s, s_);
771 800 }
  801 +// if(line.equals("")){
  802 + s.setFgsName(BasicData.businessFgsCodeNameMap.get(s.getFgsdm()+"_"+s.getGsdm()));
  803 + /*}else{
  804 + List<Line> l=lineRepository.findLineByCode(line);
  805 + if(l.size()>0)
  806 + s.setFgsName(BasicData.businessFgsCodeNameMap.get(l.get(0).getBrancheCompany()+"_"+l.get(0).getCompany()));
  807 + }*/
772 808 resList.add(s);
773 809 }
774 810 }
... ... @@ -776,6 +812,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
776 812 if(resList.size() > 0){
777 813 CalcStatistics temp = new CalcStatistics();
778 814 temp.setXlName("合计");
  815 + temp.setFgsName("");
779 816 for(CalcStatistics s : resList){
780 817 temp = addStatistics(temp, s);
781 818 }
... ... @@ -785,6 +822,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
785 822 List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
786 823 for(CalcStatistics c : resList){
787 824 Map<String, Object> m = new HashMap<String, Object>();
  825 + m.put("fgsName", c.getFgsName());
788 826 m.put("xlName", c.getXlName());
789 827 m.put("jhzlc", c.getJhzlc());
790 828 m.put("jhlc", c.getJhyylc());
... ... @@ -806,6 +844,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
806 844 m.put("ssgl_yw", c.getYwlc());
807 845 m.put("ssgl_other", c.getQtlc());
808 846 m.put("ljgl", c.getLjlc());
  847 + m.put("ljks", c.getLjkslc());
809 848 m.put("jhbc", c.getJhbcq());
810 849 m.put("jhbc_m", c.getJhbcz());
811 850 m.put("jhbc_a", c.getJhbcw());
... ... @@ -859,7 +898,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
859 898  
860 899 @Override
861 900 public List<Map<String, Object>> calcStatisticsDaily2(String gsdm, String fgsdm,
862   - String line, String date, String date2, String xlName, String type) {
  901 + String line, String date, String date2, String xlName, String type,String nature) {
863 902 // TODO Auto-generated method stub
864 903 SimpleDateFormat dft = new SimpleDateFormat("yyyy-MM-dd");
865 904 Date beginDate = new Date();
... ... @@ -899,26 +938,48 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
899 938 }
900 939  
901 940  
902   - List<CalcStatistics> list = new ArrayList<CalcStatistics>();
  941 + List<CalcStatistics> listAll = new ArrayList<CalcStatistics>();
903 942 if(line.length() > 0){
904   - list = calcStatisticsRepository.selectByDateAndLineTj2(line, d1, d2);
  943 + listAll = calcStatisticsRepository.selectByDateAndLineTj2(line, d1, d2);
905 944 } else {
906   - list = calcStatisticsRepository.selectByDateAndLineTj(line, d1, d2, gsdm, fgsdm);
  945 + listAll = calcStatisticsRepository.selectByDateAndLineTj(line, d1, d2, gsdm, fgsdm);
907 946 }
  947 + Map<String, Boolean> lineMap=lineService.lineNature();
  948 + List<CalcStatistics> list=new ArrayList<CalcStatistics>();
908 949  
  950 + for (int i = 0; i < listAll.size(); i++) {
  951 + CalcStatistics s=listAll.get(i);
  952 + if(nature.equals("0")){
  953 + list.add(s);
  954 + }else if(nature.equals("1")){
  955 + if(lineMap.containsKey(s.getXl()) && lineMap.get(s.getXl())){
  956 + list.add(s);
  957 + }
  958 + }else{
  959 + if(lineMap.containsKey(s.getXl()) && !lineMap.get(s.getXl())){
  960 + list.add(s);
  961 + }
  962 + }
  963 + }
909 964 List<CalcStatistics> resList = new ArrayList<CalcStatistics>();
910 965 Map<String, List<CalcStatistics>> keyMap = new HashMap<String, List<CalcStatistics>>();
911 966 List<String> keyList = new ArrayList<String>();
912 967  
913 968 for(CalcStatistics s : list){
914 969 try {
915   - String key = PinyinHelper.convertToPinyinString(s.getXlName(), "" , PinyinFormat.WITHOUT_TONE);
916   - if(!keyMap.containsKey(key)){
  970 +// String key = PinyinHelper.convertToPinyinString(s.getXlName(), "" , PinyinFormat.WITHOUT_TONE);
  971 + String key =s.getFgsdm()+s.getXl();
  972 +// if(line.equals("")){
  973 +// key =s.getFgsdm()+s.getXl();
  974 +// }else{
  975 +// key =s.getXl();
  976 +// }
  977 + if(!keyMap.containsKey(key)){
917 978 keyMap.put(key, new ArrayList<CalcStatistics>());
918 979 keyList.add(key);
919 980 }
920 981 keyMap.get(key).add(s);
921   - } catch (PinyinException e) {
  982 + } catch (Exception e) {
922 983 // TODO Auto-generated catch block
923 984 e.printStackTrace();
924 985 }
... ... @@ -950,6 +1011,13 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
950 1011 List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
951 1012 for(CalcStatistics c : resList){
952 1013 Map<String, Object> m = new HashMap<String, Object>();
  1014 + if(c.getXl().equals("hj")){
  1015 + m.put("fgsName", "");
  1016 + m.put("fgsBm", "");
  1017 + }else{
  1018 + m.put("fgsName", BasicData.businessFgsCodeNameMap.get(c.getFgsdm()+"_"+c.getGsdm()));
  1019 + m.put("fgsBm", c.getFgsdm());
  1020 + }
953 1021 m.put("xlBm", c.getXl());
954 1022 m.put("xlName", c.getXlName());
955 1023 m.put("jhzlc", c.getJhzlc());
... ... @@ -972,6 +1040,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
972 1040 m.put("ssgl_yw", c.getYwlc());
973 1041 m.put("ssgl_other", c.getQtlc());
974 1042 m.put("ljgl", c.getLjlc());
  1043 + m.put("ljks", c.getLjkslc());
975 1044 m.put("jhbc", c.getJhbcq());
976 1045 m.put("jhbc_m", c.getJhbcz());
977 1046 m.put("jhbc_a", c.getJhbcw());
... ... @@ -1003,7 +1072,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
1003 1072 //实时数据
1004 1073 List<Map<String, Object>> tjlist=new ArrayList<Map<String, Object>>();
1005 1074 if(!d4.equals("")){
1006   - tjlist= scheduleRealInfoService.statisticsDailyTjHb(gsdm, fgsdm, line, d3, d4, xlName, type);
  1075 + tjlist= scheduleRealInfoService.statisticsDailyTjHb(gsdm, fgsdm, line, d3, d4, xlName, type,nature);
1007 1076 }
1008 1077 List<Map<String, Object>> mapListHj = new ArrayList<Map<String, Object>>();
1009 1078 // List<String> lineList=new ArrayList<String>();
... ... @@ -1011,24 +1080,37 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
1011 1080 mapList.addAll(tjlist);
1012 1081 for (int i = 0; i < mapList.size(); i++) {
1013 1082 Map<String, Object> m =mapList.get(i);
1014   - if(kMap.get(m.get("xlBm").toString())==null){
1015   - kMap.put(m.get("xlBm").toString(), m.get("xlBm").toString());
1016   - }
  1083 +// if(line.equals("")){
  1084 + if(kMap.get(m.get("fgsBm")+"_"+m.get("xlBm").toString())==null){
  1085 + kMap.put(m.get("fgsBm")+"_"+m.get("xlBm").toString(), m.get("fgsBm")+"_"+m.get("xlBm").toString());
  1086 + }
  1087 +// }else{
  1088 +// if(kMap.get(m.get("xlBm").toString())==null){
  1089 +// kMap.put(m.get("xlBm").toString(), m.get("xlBm").toString());
  1090 +// }
  1091 +// }
  1092 +
1017 1093 }
1018 1094 for (Object xlbm : kMap.keySet()) {
1019 1095 Map<String, Object> hjMap = new HashMap<String, Object>();
1020 1096 for (int i = 0; i < mapList.size(); i++) {
1021 1097 Map<String, Object> lsMap=mapList.get(i);
1022   - if (lsMap.get("xlBm").toString().equals(xlbm)) {
  1098 + String xlbm_="";
  1099 +// if(line.equals("")){
  1100 + xlbm_=lsMap.get("fgsBm").toString()+"_"+lsMap.get("xlBm").toString();
  1101 +// }else{
  1102 +// xlbm_=lsMap.get("xlBm").toString();
  1103 +// }
  1104 + if (xlbm_.equals(xlbm)) {
1023 1105 if(hjMap.get("xlBm")==null){
1024 1106 hjMap.put("xlBm", lsMap.get("xlBm"));
1025 1107 hjMap.put("xlName", lsMap.get("xlName"));
  1108 + hjMap.put("fgsName", lsMap.get("fgsName"));
1026 1109 try {
1027 1110 if(lsMap.get("xlBm").toString().equals("hj")){
1028 1111 hjMap.put("xlNamePy", "zzzzz");
1029   -
1030 1112 }else{
1031   - hjMap.put("xlNamePy", PinyinHelper.convertToPinyinString(lsMap.get("xlName").toString(), "", PinyinFormat.WITHOUT_TONE));
  1113 + hjMap.put("xlNamePy", PinyinHelper.convertToPinyinString(lsMap.get("fgsBm").toString()+lsMap.get("xlName").toString(), "", PinyinFormat.WITHOUT_TONE));
1032 1114 }
1033 1115 } catch (PinyinException e) {
1034 1116 // TODO Auto-generated catch block
... ... @@ -1055,6 +1137,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
1055 1137 hjMap.put("ssgl_yw", Arith.add(lsMap.get("ssgl_yw"), hjMap.get("ssgl_yw")==null?"0":hjMap.get("ssgl_yw")));
1056 1138 hjMap.put("ssgl_other", Arith.add(lsMap.get("ssgl_other"), hjMap.get("ssgl_other")==null?"0":hjMap.get("ssgl_other")));
1057 1139 hjMap.put("ljgl", Arith.add(lsMap.get("ljgl"), hjMap.get("ljgl")==null?"0":hjMap.get("ljgl")));
  1140 + hjMap.put("ljks", Arith.add(lsMap.get("ljks"), hjMap.get("ljks")==null?"0":hjMap.get("ljks")));
1058 1141 hjMap.put("jhbc", Integer.parseInt(lsMap.get("jhbc").toString())+ Integer.parseInt(hjMap.get("jhbc")==null?"0":hjMap.get("jhbc").toString()));
1059 1142 hjMap.put("jhbc_m", Integer.parseInt(lsMap.get("jhbc_m").toString())+Integer.parseInt(hjMap.get("jhbc_m")==null?"0":hjMap.get("jhbc_m").toString()));
1060 1143 hjMap.put("jhbc_a", Integer.parseInt(lsMap.get("jhbc_a").toString())+ Integer.parseInt(hjMap.get("jhbc_a")==null?"0":hjMap.get("jhbc_a").toString()));
... ... @@ -1082,8 +1165,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
1082 1165 hjMap.put("djg_time",hjMap.get("djg_time"));
1083 1166 }
1084 1167 }
1085   -
1086   -
1087 1168 double jl = Arith.sub(Arith.add(hjMap.get("jhlc"), hjMap.get("ljgl")), hjMap.get("ssgl"));
1088 1169 if (jl == Double.parseDouble(hjMap.get("sjgl").toString())) {
1089 1170 hjMap.put("zt", 0);
... ... @@ -1097,7 +1178,15 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
1097 1178  
1098 1179 Collections.sort(mapListHj, new AccountXlbmByping());
1099 1180  
1100   -
  1181 + /*if(!line.equals("")){
  1182 + for (int i = 0; i < mapListHj.size(); i++) {
  1183 + if(mapListHj.get(i).get("xlBm").equals(line)){
  1184 + List<Line> l=lineRepository.findLineByCode(line);
  1185 + if(l.size()>0)
  1186 + mapListHj.get(i).put("fgsName", BasicData.businessFgsCodeNameMap.get(l.get(0).getBrancheCompany()+"_"+l.get(0).getCompany()));
  1187 + }
  1188 + }
  1189 + }*/
1101 1190 if (type != null && type.length() != 0 && type.equals("export")) {
1102 1191 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
1103 1192 sdfSimple = new SimpleDateFormat("yyyyMMdd");
... ... @@ -1115,7 +1204,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
1115 1204 }
1116 1205 listI.add(mapListHj.iterator());
1117 1206 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
1118   - ee.excelReplace(listI, new Object[]{m}, path + "mould/statisticsDaily_.xls",
  1207 + ee.excelReplace(listI, new Object[]{m}, path + "mould/statisticsDaily_2.xls",
1119 1208 path + "export/" + dateTime + "-" + xlName + "-统计日报.xls");
1120 1209 } catch (Exception e) {
1121 1210 // TODO: handle exception
... ... @@ -1148,6 +1237,10 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
1148 1237 s.setYwlc(Arith.add(s.getYwlc()!=null?s.getYwlc():0, s_.getYwlc()));
1149 1238 s.setQtlc(Arith.add(s.getQtlc()!=null?s.getQtlc():0, s_.getQtlc()));
1150 1239 s.setLjlc(Arith.add(s.getLjlc()!=null?s.getLjlc():0, s_.getLjlc()));
  1240 + if(s_.getLjkslc() == null){
  1241 + s_.setLjkslc(0d);
  1242 + }
  1243 + s.setLjkslc(Arith.add(s.getLjkslc()!=null?s.getLjkslc():0, s_.getLjkslc()));
1151 1244 s.setJhbcq(s.getJhbcq() + s_.getJhbcq());
1152 1245 s.setJhbcz(s.getJhbcz() + s_.getJhbcz());
1153 1246 s.setJhbcw(s.getJhbcw() + s_.getJhbcw());
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -28,7 +28,6 @@ import com.bsth.entity.mcy_forms.Operationservice;
28 28 import com.bsth.entity.mcy_forms.Shifday;
29 29 import com.bsth.entity.mcy_forms.Shiftuehiclemanth;
30 30 import com.bsth.entity.mcy_forms.Singledata;
31   -import com.bsth.entity.mcy_forms.Turnoutrate;
32 31 import com.bsth.entity.mcy_forms.Vehicleloading;
33 32 import com.bsth.entity.mcy_forms.Waybillday;
34 33 import com.bsth.entity.oil.Dlb;
... ... @@ -45,6 +44,7 @@ import com.bsth.entity.mcy_forms.Allline;
45 44 import com.bsth.entity.mcy_forms.Changetochange;
46 45 import com.bsth.entity.mcy_forms.Daily;
47 46 import com.bsth.entity.mcy_forms.Executionrate;
  47 +import com.bsth.service.LineService;
48 48 import com.bsth.service.forms.CommonService;
49 49 import com.bsth.service.forms.FormsService;
50 50 import com.bsth.service.realcontrol.ScheduleRealInfoService;
... ... @@ -61,6 +61,9 @@ public class FormsServiceImpl implements FormsService {
61 61 ScheduleRealInfoService scheduleRealInfoService;
62 62  
63 63 @Autowired
  64 + LineService lineService;
  65 +
  66 + @Autowired
64 67 CommonService commonService;
65 68  
66 69 @Autowired
... ... @@ -214,11 +217,11 @@ public class FormsServiceImpl implements FormsService {
214 217 sql+=" and l.line_code=" + map.get("line").toString();
215 218 }
216 219 sql+= " AND r.gs_bm is not null";
217   - if(map.get("gsdmLine").toString()!=""){
  220 + if(map.get("gsdmLine") != null && map.get("gsdmLine").toString()!=""){
218 221 sql+=" and r.gs_bm='"+map.get("gsdmLine").toString()+"' ";
219 222 }
220   - if(map.get("fgsdmLine").toString()!=""){
221   - sql+=" and r.fgs_bm='"+map.get("fgsdmLine").toString()+"'";
  223 + if(map.get("fgsdmLine") != null && map.get("fgsdmLine").toString()!=""){
  224 + sql+=" and r.fgs_bm='"+map.get("fgsdmLine").toString()+"' ";
222 225 }
223 226 sql += " GROUP BY s.station_name,l.name,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";
224 227 List<Linepasswengerflow> list = jdbcTemplate.query(sql, new RowMapper<Linepasswengerflow>() {
... ... @@ -244,10 +247,10 @@ public class FormsServiceImpl implements FormsService {
244 247 final String empnames=map.get("empnames").toString();
245 248 String gsdmManth="";
246 249 String fgsdmManth="";
247   - if(map.containsKey("gsdmManth")){
  250 + if(map.get("gsdmManth") != null){
248 251 gsdmManth=map.get("gsdmManth").toString();
249 252 }
250   - if(map.containsKey("fgsdmManth")){
  253 + if(map.get("fgsdmManth") != null){
251 254 fgsdmManth=map.get("fgsdmManth").toString();
252 255 }
253 256 String sql ="select ";
... ... @@ -410,10 +413,10 @@ public class FormsServiceImpl implements FormsService {
410 413 final String empnames=map.get("empnames").toString();
411 414 String gsdmManth="";
412 415 String fgsdmManth="";
413   - if(map.containsKey("gsdmManth")){
  416 + if(map.get("gsdmManth")!=null){
414 417 gsdmManth=map.get("gsdmManth").toString();
415 418 }
416   - if(map.containsKey("fgsdmManth")){
  419 + if(map.get("fgsdmManth")!=null){
417 420 fgsdmManth=map.get("fgsdmManth").toString();
418 421 }
419 422 String sql ="select ";
... ... @@ -766,6 +769,10 @@ public class FormsServiceImpl implements FormsService {
766 769  
767 770 rq = rq2 + "-" + rq3;
768 771  
  772 + String sfyy="";
  773 + if(map.get("sfyy")!=null){
  774 + sfyy=map.get("sfyy").toString();
  775 + }
769 776 String line="";
770 777 if(map.get("line")!=null){
771 778 line=map.get("line").toString().trim();
... ... @@ -784,21 +791,23 @@ public class FormsServiceImpl implements FormsService {
784 791  
785 792 if(!line.equals("")){
786 793 sql +=" and xl= '"+line+"'";
787   - }else{
788   - sql += " and gs= '"+gs+"' and fgs= '"+fgs+"'";
  794 + }
  795 + if(!gs.equals("")){
  796 + sql += " and gs= '"+gs+"'";
  797 + }
  798 + if(!fgs.equals("")){
  799 + sql += " and fgs= '"+fgs+"'";
789 800 }
790 801  
791 802 sql +=" order by rq";
792 803 List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() {
793   -
794   -
795 804 @Override
796 805 public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException {
797 806 Changetochange chan = new Changetochange();
798 807 chan.setRq(arg0.getString("rq"));
799 808 chan.setGs(BasicData.businessCodeNameMap.get(arg0.getString("gs")));
800 809 chan.setFgs(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs")+"_"+arg0.getString("gs")));
801   - chan.setXl(BasicData.lineCode2NameMap.get(arg0.getString("xl")));
  810 + chan.setXl(arg0.getString("xl"));
802 811 chan.setLp(arg0.getString("lp"));
803 812 chan.setFssj(arg0.getString("fssj"));
804 813 chan.setXgsj(arg0.getString("xgsj"));
... ... @@ -813,13 +822,42 @@ public class FormsServiceImpl implements FormsService {
813 822 return chan;
814 823 }
815 824 });
816   - return list;
  825 +
  826 + Map<String, Boolean> lineNature = lineService.lineNature();
  827 + List<Changetochange> resList = new ArrayList<Changetochange>();
  828 +
  829 + for(Changetochange c : list){
  830 + String xl = c.getXl();
  831 + if(sfyy.length() != 0){
  832 + if(sfyy.equals("0")){
  833 + resList.add(c);
  834 + } else if(sfyy.equals("1")){
  835 + if(lineNature.containsKey(xl) && lineNature.get(xl)){
  836 + resList.add(c);
  837 + }
  838 + } else {
  839 + if(lineNature.containsKey(xl) && !lineNature.get(xl)){
  840 + resList.add(c);
  841 + }
  842 + }
  843 + } else {
  844 + resList.add(c);
  845 + }
  846 +
  847 + c.setXl(BasicData.lineCode2NameMap.get(xl));
  848 + }
  849 +
  850 + return resList;
817 851 }
818 852  
819 853  
820 854 // 路单数据
821 855 @Override
822 856 public List<Singledata> singledatatj(Map<String, Object> map) {
  857 + String sfyy="";
  858 + if(map.get("sfyy")!=null){
  859 + sfyy=map.get("sfyy").toString();
  860 + }
823 861 String gsdm="";
824 862 if(map.get("gsdmSing")!=null){
825 863 gsdm=map.get("gsdmSing").toString();
... ... @@ -843,16 +881,20 @@ public class FormsServiceImpl implements FormsService {
843 881 List<Singledata> list_=new ArrayList<Singledata>();
844 882 if(tjtype.equals("jsy")){
845 883 //油统计
846   - String sql="select r.j_gh, r.xl_bm,r.cl_zbh,r.j_name"
  884 + String sql="select r.j_gh, r.xl_bm,r.cl_zbh,r.j_name,r.fgs_bm"
847 885 + " from bsth_c_s_sp_info_real r where "
848 886 + " r.schedule_date_str = '"+startDate+"'";
849   - if(xlbm.equals("")){
850   - sql +="and r.gs_bm='"+gsdm+"' "
851   - + " and r.fgs_bm='"+fgsdm+"'";
852   - }else{
  887 + if(xlbm.length() != 0){
853 888 sql += " and r.xl_bm = '"+xlbm+"'";
854 889 }
855   - sql += " group by r.j_gh,r.xl_bm,r.cl_zbh,r.j_name order by r.xl_bm,r.cl_zbh";
  890 + if(gsdm.length() != 0){
  891 + sql += " and r.gs_bm ='"+gsdm+"'";
  892 + }
  893 + if(fgsdm.length() != 0){
  894 + sql += " and r.fgs_bm ='"+fgsdm+"'";
  895 + }
  896 + sql += " group by r.j_gh,r.xl_bm,r.cl_zbh,r.j_name order by r.xl_bm,r.cl_zbh";
  897 +
856 898 list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
857 899 @Override
858 900 public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
... ... @@ -861,20 +903,30 @@ public class FormsServiceImpl implements FormsService {
861 903 sin.setJsy(arg0.getString("j_gh"));
862 904 sin.setjName(arg0.getString("j_name"));
863 905 sin.setClzbh(arg0.getString("cl_zbh"));
  906 + sin.setgS(arg0.getString("fgs_bm"));
864 907 return sin;
865 908 }
866 909 });
  910 +
  911 + Collections.sort(list,new SingledataByXlbm());
  912 +
867 913 String linesql="";
868 914 if(!xlbm.equals("")){
869 915 linesql +=" and xlbm ='"+xlbm+"' ";
870 916 }
871   - String nysql="SELECT id,xlbm,nbbm, jsy,jzl as jzl,yh as yh,sh as sh FROM bsth_c_ylb "
  917 + if(!gsdm.equals("")){
  918 + linesql +=" and ssgsdm ='"+gsdm+"' ";
  919 + }
  920 + if(!fgsdm.equals("")){
  921 + linesql +=" and fgsdm ='"+fgsdm+"' ";
  922 + }
  923 + String nysql="SELECT id,xlbm,nbbm,jsy,jzl as jzl,yh as yh,sh as sh,fgsdm FROM bsth_c_ylb"
872 924 + " WHERE rq = '"+startDate+"'"
873   - + " AND ssgsdm = '"+gsdm+"' AND fgsdm = '"+fgsdm+"'" +linesql
  925 + + linesql
874 926 + " union"
875   - + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh FROM bsth_c_dlb"
  927 + + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh,fgsdm FROM bsth_c_dlb"
876 928 + " WHERE rq = '"+startDate+"'"
877   - + " AND ssgsdm = '"+gsdm+"' AND fgsdm = '"+fgsdm+"'"+linesql;
  929 + + linesql;
878 930 List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() {
879 931 @Override
880 932 public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
... ... @@ -885,6 +937,7 @@ public class FormsServiceImpl implements FormsService {
885 937 sin.setJzl(arg0.getString("jzl"));
886 938 sin.setHyl(arg0.getString("yh"));
887 939 sin.setUnyyyl(arg0.getString("sh"));
  940 + sin.setgS(arg0.getString("fgsdm"));
888 941 return sin;
889 942 }
890 943 });
... ... @@ -913,7 +966,7 @@ public class FormsServiceImpl implements FormsService {
913 966 s.setClzbh(clzbh);
914 967 s.setSgh("");
915 968 s.setsName("");
916   - s.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  969 + s.setgS(BasicData.businessFgsCodeNameMap.get(sin_.getgS()+"_"+gsdm));
917 970 s.setxL(line);
918 971 s.setXlmc(BasicData.lineCode2NameMap.get(line));
919 972 s.setJzl(sin_.getJzl());
... ... @@ -983,27 +1036,29 @@ public class FormsServiceImpl implements FormsService {
983 1036 // sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
984 1037 sin.setSgh("");
985 1038 sin.setsName("");
986   - sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  1039 + sin.setgS(BasicData.businessFgsCodeNameMap.get(sin.getgS()+"_"+gsdm));
987 1040 list_.add(sin);
988 1041  
989 1042 }
990   - Collections.sort(list_,new SingledataByXlbm());
991 1043 }else{
992 1044 String sql="select r.s_gh,r.s_name, "
993 1045 + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm"
994 1046 + " from bsth_c_s_sp_info_real r where "
995 1047 + " r.schedule_date_str = '"+startDate+"'"
996 1048 + " and r.s_gh !='' and r.s_gh is not null ";
997   - if(xlbm.equals("")){
998   - sql +="and r.gs_bm='"+gsdm+"' "
999   - + " and r.fgs_bm='"+fgsdm+"'";
1000   - }else{
  1049 + if(!xlbm.equals("")){
1001 1050 sql += " and r.xl_bm = '"+xlbm+"'";
1002 1051 }
1003   - sql += " group by r.s_gh,r.s_name,"
  1052 + if(!gsdm.equals("")){
  1053 + sql += " and r.gs_bm = '"+gsdm+"'";
  1054 + }
  1055 + if(!fgsdm.equals("")){
  1056 + sql += " and r.fgs_bm = '"+fgsdm+"'";
  1057 + }
  1058 + sql += " group by r.s_gh,r.s_name,"
1004 1059 + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
1005 1060  
1006   - list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
  1061 + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
1007 1062 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
1008 1063 @Override
1009 1064 public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
... ... @@ -1013,10 +1068,13 @@ public class FormsServiceImpl implements FormsService {
1013 1068 sin.setClzbh(arg0.getString("cl_zbh"));
1014 1069 sin.setSgh(arg0.getString("s_gh"));
1015 1070 sin.setsName(arg0.getString("s_name"));
  1071 + sin.setgS(arg0.getString("fgs_bm"));
1016 1072 return sin;
1017 1073 }
1018 1074 });
1019 1075  
  1076 + Collections.sort(list,new SingledataByXlbm());
  1077 +
1020 1078 for (int i = 0; i < list.size(); i++) {
1021 1079 Singledata sin=list.get(i);
1022 1080 String jsy=sin.getSgh();
... ... @@ -1058,15 +1116,36 @@ public class FormsServiceImpl implements FormsService {
1058 1116 sin.setClzbh(clzbh);
1059 1117 sin.setJsy("");
1060 1118 sin.setjName("");
1061   - sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  1119 + sin.setgS(BasicData.businessFgsCodeNameMap.get(sin.getgS()+"_"+gsdm));
1062 1120 sin.setHyl("");
1063 1121 sin.setJzl("");
1064 1122 sin.setUnyyyl("");
1065 1123 list_.add(sin);
1066 1124 }
1067   - Collections.sort(list_,new SingledataByXlbm());
1068 1125 }
1069   - return list_;
  1126 +
  1127 + Map<String, Boolean> lineNature = lineService.lineNature();
  1128 + List<Singledata> resList = new ArrayList<Singledata>();
  1129 + for(Singledata s : list_){
  1130 + String xlBm = s.getxL();
  1131 + if(sfyy.length() != 0){
  1132 + if(sfyy.equals("0")){
  1133 + resList.add(s);
  1134 + } else if(sfyy.equals("1")){
  1135 + if(lineNature.containsKey(xlBm) && lineNature.get(xlBm)){
  1136 + resList.add(s);
  1137 + }
  1138 + } else {
  1139 + if(lineNature.containsKey(xlBm) && !lineNature.get(xlBm)){
  1140 + resList.add(s);
  1141 + }
  1142 + }
  1143 + } else {
  1144 + resList.add(s);
  1145 + }
  1146 + }
  1147 +
  1148 + return resList;
1070 1149 }
1071 1150  
1072 1151  
... ... @@ -1098,12 +1177,15 @@ public class FormsServiceImpl implements FormsService {
1098 1177 String sql="select r.j_gh, r.xl_bm,r.cl_zbh,r.j_name"
1099 1178 + " from bsth_c_s_sp_info_real r where "
1100 1179 + " r.schedule_date_str = '"+startDate+"'";
1101   - if(xlbm.equals("")){
1102   - sql +="and r.gs_bm='"+gsdm+"' "
1103   - + " and r.fgs_bm='"+fgsdm+"'";
1104   - }else{
  1180 + if(!xlbm.equals("")){
1105 1181 sql += " and r.xl_bm = '"+xlbm+"'";
1106 1182 }
  1183 + if(!gsdm.equals("")){
  1184 + sql += " and r.gs_bm='"+gsdm+"'";
  1185 + }
  1186 + if(!fgsdm.equals("")){
  1187 + sql += " and r.fgs_bm='"+fgsdm+"'";
  1188 + }
1107 1189 sql += " group by r.j_gh,r.xl_bm,r.cl_zbh,r.j_name order by r.xl_bm,r.cl_zbh";
1108 1190 list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
1109 1191 @Override
... ... @@ -1118,15 +1200,21 @@ public class FormsServiceImpl implements FormsService {
1118 1200 });
1119 1201 String linesql="";
1120 1202 if(!xlbm.equals("")){
1121   - linesql +=" and xlbm ='"+xlbm+"' ";
  1203 + linesql += " and xlbm ='"+xlbm+"' ";
1122 1204 }
  1205 + if(!gsdm.equals("")){
  1206 + linesql += " and ssgsdm ='"+gsdm+"'";
  1207 + }
  1208 + if(!fgsdm.equals("")){
  1209 + linesql += " and fgsdm ='"+fgsdm+"'";
  1210 + }
1123 1211 String nysql="SELECT id,xlbm,nbbm, jsy,jzl as jzl,yh as yh,sh as sh FROM bsth_c_ylb "
1124 1212 + " WHERE rq = '"+startDate+"'"
1125   - + " AND ssgsdm = '"+gsdm+"' AND fgsdm = '"+fgsdm+"'" +linesql
  1213 + + linesql
1126 1214 + " union"
1127 1215 + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh FROM bsth_c_dlb"
1128 1216 + " WHERE rq = '"+startDate+"'"
1129   - + " AND ssgsdm = '"+gsdm+"' AND fgsdm = '"+fgsdm+"'"+linesql;
  1217 + + linesql;
1130 1218 List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() {
1131 1219 @Override
1132 1220 public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
... ... @@ -1246,14 +1334,17 @@ public class FormsServiceImpl implements FormsService {
1246 1334 + " from bsth_c_s_sp_info_real r where "
1247 1335 + " r.schedule_date_str = '"+startDate+"'"
1248 1336 + " and r.s_gh !='' and r.s_gh is not null ";
1249   - if(xlbm.equals("")){
1250   - sql +="and r.gs_bm='"+gsdm+"' "
1251   - + " and r.fgs_bm='"+fgsdm+"'";
1252   - }else{
  1337 + if(!xlbm.equals("")){
1253 1338 sql += " and r.xl_bm = '"+xlbm+"'";
1254 1339 }
1255   - sql += " group by r.s_gh,r.s_name,"
1256   - + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
  1340 + if(!gsdm.equals("")){
  1341 + sql += " and r.gs_bm='"+gsdm+"'";
  1342 + }
  1343 + if(!fgsdm.equals("")){
  1344 + sql += " and r.fgs_bm='"+fgsdm+"'";
  1345 + }
  1346 + sql += " group by r.s_gh,r.s_name,"
  1347 + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
1257 1348  
1258 1349 list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
1259 1350 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
... ... @@ -1635,14 +1726,17 @@ public class FormsServiceImpl implements FormsService {
1635 1726 String sql="select r.s_gh,r.s_name, "
1636 1727 + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"
1637 1728 + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+startDate+"'";
1638   - if(xlbm.equals("")){
1639   - sql +="and r.gs_bm='"+gsdm+"' "
1640   - + " and r.fgs_bm='"+fgsdm+"'";
1641   - }else{
  1729 + if(!xlbm.equals("")){
1642 1730 sql += " and r.xl_bm = '"+xlbm+"'";
1643 1731 }
1644   - sql += " group by r.s_gh,r.s_name,"
1645   - + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
  1732 + if(!gsdm.equals("")){
  1733 + sql += " and r.gs_bm='"+gsdm+"'";
  1734 + }
  1735 + if(!fgsdm.equals("")){
  1736 + sql += " and r.fgs_bm='"+fgsdm+"'";
  1737 + }
  1738 + sql += " group by r.s_gh,r.s_name,"
  1739 + + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
1646 1740  
1647 1741 List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
1648 1742 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
... ... @@ -1929,14 +2023,17 @@ public class FormsServiceImpl implements FormsService {
1929 2023 + " from bsth_c_s_sp_info_real r where "
1930 2024 + " r.schedule_date_str = '"+startDate+"'"
1931 2025 + " and r.s_gh !='' and r.s_gh is not null ";
1932   - if(xlbm.equals("")){
1933   - sql +="and r.gs_bm='"+gsdm+"' "
1934   - + " and r.fgs_bm='"+fgsdm+"'";
1935   - }else{
  2026 + if(!xlbm.equals("")){
1936 2027 sql += " and r.xl_bm = '"+xlbm+"'";
1937 2028 }
1938   - sql += " group by r.s_gh,r.s_name,"
1939   - + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
  2029 + if(!gsdm.equals("")){
  2030 + sql += " and r.gs_bm='"+gsdm+"'";
  2031 + }
  2032 + if(!fgsdm.equals("")){
  2033 + sql += " and r.fgs_bm='"+fgsdm+"'";
  2034 + }
  2035 + sql += " group by r.s_gh,r.s_name,"
  2036 + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
1940 2037  
1941 2038 list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
1942 2039 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
... ... @@ -2205,13 +2302,16 @@ public class FormsServiceImpl implements FormsService {
2205 2302 + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm"
2206 2303 + " from bsth_c_s_sp_info_real r where "
2207 2304 + " r.schedule_date_str = '"+startDate+"'"
2208   - + " and r.s_gh !='' and r.s_gh is not null ";
2209   - if(xlbm.equals("")){
2210   - sql +="and r.gs_bm='"+gsdm+"' "
2211   - + " and r.fgs_bm='"+fgsdm+"'";
2212   - }else{
  2305 + + " and r.s_gh !='' and r.s_gh is not null ";
  2306 + if(!xlbm.equals("")){
2213 2307 sql += " and r.xl_bm = '"+xlbm+"'";
2214 2308 }
  2309 + if(!gsdm.equals("")){
  2310 + sql += " and r.gs_bm='"+gsdm+"'";
  2311 + }
  2312 + if(!fgsdm.equals("")){
  2313 + sql += " and r.fgs_bm='"+fgsdm+"'";
  2314 + }
2215 2315 sql += " group by r.s_gh,r.s_name,"
2216 2316 + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
2217 2317  
... ... @@ -2285,7 +2385,10 @@ public class FormsServiceImpl implements FormsService {
2285 2385 @Override
2286 2386 public List<Operationservice> operationservice(Map<String, Object> map) {
2287 2387  
2288   - String xlbm=map.get("line").toString().trim();
  2388 + String sfyy="";
  2389 + if(map.get("sfyy")!=null){
  2390 + sfyy=map.get("sfyy").toString();
  2391 + }
2289 2392 String gsdm="";
2290 2393 if(map.get("gsdmOperat")!=null){
2291 2394 gsdm=map.get("gsdmOperat").toString();
... ... @@ -2294,37 +2397,72 @@ public class FormsServiceImpl implements FormsService {
2294 2397 if(map.get("fgsdmOperat")!=null){
2295 2398 fgsdm=map.get("fgsdmOperat").toString();
2296 2399 }
2297   - startDate=map.get("startDate").toString();
2298   - endDate =map.get("endDate").toString();
2299   - String sql="select r.xl_bm"
  2400 + String xlbm=map.get("line").toString().trim();
  2401 + String startDate=map.get("startDate").toString();
  2402 + String endDate =map.get("endDate").toString();
  2403 +
  2404 + String sql="select r.xl_bm, r.gs_bm, r.fgs_bm"
2300 2405 + " from bsth_c_s_sp_info_real r where"
2301 2406 + " r.schedule_date_str BETWEEN '"+startDate+"' and '"+endDate+"'";
2302   - if(xlbm.equals("")){
2303   - sql +="and r.gs_bm='"+gsdm+"' "
2304   - + " and r.fgs_bm='"+fgsdm+"'";
2305   - }else{
  2407 + if(xlbm.length() != 0){
2306 2408 sql += " and r.xl_bm = '"+xlbm+"'";
2307 2409 }
2308   - sql += " group by r.xl_bm";
2309   -
  2410 + if(gsdm.length() != 0){
  2411 + sql += " and r.gs_bm='"+gsdm+"'";
  2412 + }
  2413 + if(fgsdm.length() != 0){
  2414 + sql += " and r.fgs_bm='"+fgsdm+"'";
  2415 + }
  2416 + sql += " group by r.gs_bm, r.fgs_bm, r.xl_bm " +
  2417 + "order by r.gs_bm, r.fgs_bm, r.xl_bm";
  2418 +
  2419 + System.out.println(sql);
2310 2420  
2311   - List<Operationservice> list= jdbcTemplate.query(sql, new RowMapper<Operationservice>() {
2312   - @Override
2313   - public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException {
2314   - Operationservice ve = new Operationservice();
2315   - ve.setXlBm(arg0.getString("xl_bm"));
2316   - return ve;
  2421 + List<Operationservice> query = jdbcTemplate.query(sql, new RowMapper<Operationservice>() {
  2422 + @Override
  2423 + public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException {
  2424 + Operationservice ve = new Operationservice();
  2425 + ve.setXlBm(arg0.getString("xl_bm"));
  2426 + ve.setGs(arg0.getString("gs_bm"));
  2427 + ve.setFgs(arg0.getString("fgs_bm"));
  2428 + return ve;
  2429 + }
  2430 + });
  2431 +
  2432 + List<Operationservice> list = new ArrayList<Operationservice>();
  2433 + Map<String, Boolean> lineNature = lineService.lineNature();
  2434 + for(Operationservice o : query){
  2435 + o.setFgs(BasicData.businessFgsCodeNameMap.get(o.getFgs()+"_"+o.getGs()));
  2436 +
  2437 + String xl = o.getXlBm();
  2438 + if(sfyy.length() != 0){
  2439 + if(sfyy.equals("0")){
  2440 + list.add(o);
  2441 + } else if(sfyy.equals("1")){
  2442 + if(lineNature.containsKey(xl) && lineNature.get(xl)){
  2443 + list.add(o);
  2444 + }
  2445 + } else {
  2446 + if(lineNature.containsKey(xl) && !lineNature.get(xl)){
  2447 + list.add(o);
  2448 + }
2317 2449 }
2318   - });
2319   -
2320   - String ylbSql=" select * from bsth_c_ylb where rq BETWEEN '"+startDate+"' and '"+endDate+"'";
2321   - if(xlbm.equals("")){
2322   - ylbSql +="and ssgsdm='"+gsdm+"' "
2323   - + " and fgsdm='"+fgsdm+"'";
2324   - }else{
  2450 + } else {
  2451 + list.add(o);
  2452 + }
  2453 + }
  2454 +
  2455 + String ylbSql=" select * from bsth_c_ylb where rq BETWEEN '"+startDate+"' and '"+endDate+"'";
  2456 + if(!xlbm.equals("")){
2325 2457 ylbSql += " and xlbm = '"+xlbm+"'";
2326 2458 }
2327   - List<Ylb> ylbList= jdbcTemplate.query(ylbSql, new RowMapper<Ylb>() {
  2459 + if(!gsdm.equals("")){
  2460 + ylbSql += " and ssgsdm='"+gsdm+"'";
  2461 + }
  2462 + if(!fgsdm.equals("")){
  2463 + ylbSql += " and fgsdm='"+fgsdm+"'";
  2464 + }
  2465 + List<Ylb> ylbList= jdbcTemplate.query(ylbSql, new RowMapper<Ylb>() {
2328 2466 @Override
2329 2467 public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException {
2330 2468 Ylb y = new Ylb();
... ... @@ -2333,16 +2471,19 @@ public class FormsServiceImpl implements FormsService {
2333 2471 y.setYh(arg0.getDouble("yh"));
2334 2472 return y;
2335 2473 }
2336   - });
  2474 + });
2337 2475  
2338   - String dlbSql=" select * from bsth_c_dlb where rq BETWEEN '"+startDate+"' and '"+endDate+"'";
2339   - if(xlbm.equals("")){
2340   - ylbSql +="and ssgsdm='"+gsdm+"' "
2341   - + " and fgsdm='"+fgsdm+"'";
2342   - }else{
  2476 + String dlbSql=" select * from bsth_c_dlb where rq BETWEEN '"+startDate+"' and '"+endDate+"'";
  2477 + if(!xlbm.equals("")){
2343 2478 ylbSql += " and xlbm = '"+xlbm+"'";
2344 2479 }
2345   - List<Dlb> dlbList= jdbcTemplate.query(dlbSql, new RowMapper<Dlb>() {
  2480 + if(!gsdm.equals("")){
  2481 + ylbSql += " and ssgsdm='"+gsdm+"'";
  2482 + }
  2483 + if(!fgsdm.equals("")){
  2484 + ylbSql += " and fgsdm='"+fgsdm+"'";
  2485 + }
  2486 + List<Dlb> dlbList= jdbcTemplate.query(dlbSql, new RowMapper<Dlb>() {
2346 2487 @Override
2347 2488 public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException {
2348 2489 Dlb d = new Dlb();
... ... @@ -2544,8 +2685,13 @@ public class FormsServiceImpl implements FormsService {
2544 2685 }
2545 2686 String rq2 = sdf1.format(d);
2546 2687 String rq3 = sdf1.format(d1);
2547   - String company = map.get("gsdmTurn").toString();
2548   - String subCompany = map.get("fgsdmTurn").toString();
  2688 + String company = "", subCompany = "";
  2689 + if(map.get("gsdmTurn") != null){
  2690 + company = map.get("gsdmTurn").toString();
  2691 + }
  2692 + if(map.get("fgsdmTurn") != null){
  2693 + subCompany = map.get("fgsdmTurn").toString();
  2694 + }
2549 2695 String line = map.get("line").toString();
2550 2696 String startDate = map.get("startDate").toString();
2551 2697 String endDate = map.get("endDate").toString();
... ... @@ -2559,12 +2705,17 @@ public class FormsServiceImpl implements FormsService {
2559 2705 List<Line> lineList = lineRepository.findLineBygsBm(company, subCompany, line.length()==0?"%"+line+"%":line);
2560 2706  
2561 2707 String sql = "select gs_name, fgs_name, cl_zbh, fcsj, bc_type, xl_bm, xl_name, schedule_date"
2562   - + " from bsth_c_s_sp_info where gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"' "
2563   - + "and schedule_date >= '"+startDate+"' "
2564   - + "and schedule_date <= '"+endDate+"' ";
  2708 + + " from bsth_c_s_sp_info where "
  2709 + + "schedule_date >= '"+startDate+"' and schedule_date <= '"+endDate+"' ";
2565 2710 if(line.trim().length() != 0){
2566 2711 sql += "and xl_bm = '"+line+"' ";
2567 2712 }
  2713 + if(company.trim().length() != 0){
  2714 + sql += "and gs_bm = '"+company+"' ";
  2715 + }
  2716 + if(subCompany.trim().length() != 0){
  2717 + sql += "and fgs_bm = '"+subCompany+"' ";
  2718 + }
2568 2719 List<SchedulePlanInfo> planList = jdbcTemplate.query(sql, new RowMapper<SchedulePlanInfo>() {
2569 2720  
2570 2721 @Override
... ... @@ -2711,18 +2862,34 @@ public class FormsServiceImpl implements FormsService {
2711 2862  
2712 2863 e.printStackTrace();
2713 2864 }
  2865 +
  2866 + String gsbm = "", fgsbm = "";
  2867 + if(map.get("gsdmEcecut")!=null){
  2868 + gsbm = map.get("gsdmEcecut").toString();
  2869 + }
  2870 + if(map.get("fgsdmEcecut")!=null){
  2871 + fgsbm = map.get("fgsdmEcecut").toString();
  2872 + }
  2873 +
2714 2874 String rq2 = sdf1.format(d);
2715 2875 String rq3 = sdf1.format(d1);
2716 2876  
2717 2877 rq = rq2 + "-" + rq3;
2718 2878  
  2879 + String where = "";
  2880 + if(gsbm.trim().length() != 0){
  2881 + where += " and gs_bm = '" + gsbm + "'";
  2882 + }
  2883 + if(fgsbm.trim().length() != 0){
  2884 + where += " and fgs_bm = '" + fgsbm + "'";
  2885 + }
  2886 +
2719 2887 String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.xl_name,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm,a.bc_type from "
2720 2888 + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl,bc_type"
2721 2889 + " from bsth_c_s_sp_info" + " where schedule_date >= '"
2722 2890 + map.get("startDate").toString() + "' and schedule_date <= '" + map.get("endDate").toString() + "' and xl_bm='"
2723 2891 + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out')"
2724   - + " and gs_bm='"+ map.get("gsdmEcecut").toString() + "'"
2725   - + " and fgs_bm='"+ map.get("fgsdmEcecut").toString() + "'"
  2892 + + where
2726 2893 // + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type "
2727 2894 + " ) a left JOIN ("
2728 2895 + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl "
... ... @@ -2899,14 +3066,17 @@ public class FormsServiceImpl implements FormsService {
2899 3066 + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"
2900 3067 + " from bsth_c_s_sp_info_real r where "
2901 3068 + "r.schedule_date_str = '"+map.get("date").toString()+"'";
2902   - if(xlbm.equals("")){
2903   - sql +="and r.gs_bm='"+gsbm+"' "
2904   - + " and r.fgs_bm='"+fgsbm+"'";
2905   - }else{
  3069 + if(!xlbm.equals("")){
2906 3070 sql += " and r.xl_bm = '"+xlbm+"'";
2907 3071 }
2908   - sql += " group by r.schedule_date_str,"
2909   - + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
  3072 + if(!gsbm.equals("")){
  3073 + sql += " and r.gs_bm='"+gsbm+"'";
  3074 + }
  3075 + if(!fgsbm.equals("")){
  3076 + sql += " and r.fgs_bm='"+fgsbm+"'";
  3077 + }
  3078 + sql += " group by r.schedule_date_str,"
  3079 + + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
2910 3080  
2911 3081 List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() {
2912 3082 @Override
... ... @@ -2972,10 +3142,10 @@ public class FormsServiceImpl implements FormsService {
2972 3142 }
2973 3143  
2974 3144 class SingledataByXlbm implements Comparator<Singledata>{
2975   - @Override
2976   - public int compare(Singledata o1, Singledata o2) {
2977   - // TODO Auto-generated method stub
2978   - return (o2.getxL()+o2.getClzbh()).compareTo((o1.getxL()+o1.getClzbh()));
2979   - }
  3145 + @Override
  3146 + public int compare(Singledata o1, Singledata o2) {
  3147 + // TODO Auto-generated method stub
  3148 + return (o1.getgS()+o1.getxL()+o1.getClzbh()).compareTo((o2.getgS()+o2.getxL()+o2.getClzbh()));
  3149 + }
2980 3150 }
2981 3151 }
... ...
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
... ... @@ -359,6 +359,10 @@ public class GpsServiceImpl implements GpsService {
359 359 return (byte)(((serviceState & 0x80000000) == 0x80000000) ? 1 : 0);
360 360 }
361 361  
  362 + public static void main(String[] args){
  363 + System.out.println(getGpsValid(-2147483648));
  364 + }
  365 +
362 366 public Map<String, ArrivalEntity> findArrivalByTs(Long st, Long et, List<DeviceChange> dcs) {
363 367 Map<String, ArrivalEntity> map = new HashMap<>();
364 368  
... ...
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
... ... @@ -44,6 +44,7 @@ import com.bsth.repository.oil.DlbRepository;
44 44 import com.bsth.repository.oil.YlbRepository;
45 45 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
46 46 import com.bsth.service.BusIntervalService;
  47 +import com.bsth.service.LineService;
47 48 import com.bsth.service.report.CulateMileageService;
48 49 import com.bsth.service.schedule.PeopleCarPlanService;
49 50 import com.bsth.service.sys.DutyEmployeeService;
... ... @@ -60,8 +61,11 @@ import com.google.gson.Gson;
60 61 public class BusIntervalServiceImpl implements BusIntervalService {
61 62  
62 63 @Autowired
63   - CulateMileageService culateService;
  64 + LineService lineService;
64 65  
  66 + @Autowired
  67 + CulateMileageService culateService;
  68 +
65 69 @Autowired
66 70 private PeopleCarPlanService peopleCarPlanService;
67 71  
... ... @@ -113,7 +117,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
113 117 }
114 118 }
115 119 if(company.length() != 0){
116   - sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  120 + sql += " and gs_bm = '"+company+"'";
  121 + }
  122 + if(subCompany.length() != 0){
  123 + sql += " and fgs_bm = '"+subCompany+"'";
117 124 }
118 125 if(normal){
119 126 sql += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'";
... ... @@ -147,6 +154,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
147 154 schedule.setAdjustExps(rs.getString("adjust_exps"));
148 155 schedule.setJhlcOrig(rs.getDouble("jhlc_orig"));
149 156 schedule.setRemarks(rs.getString("remarks"));
  157 + schedule.setFgsBm(rs.getString("fgs_bm"));
150 158 schedule.setGsName(rs.getString("gs_name"));
151 159 schedule.setFgsName(rs.getString("fgs_name"));
152 160 schedule.setDfAuto(rs.getBoolean("df_auto"));
... ... @@ -419,8 +427,11 @@ public class BusIntervalServiceImpl implements BusIntervalService {
419 427 List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
420 428 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
421 429  
422   - String company = map.get("company").toString();
423   - String subCompany = map.get("subCompany").toString();
  430 + String company = "", subCompany = "";
  431 + if(map.get("company")!=null)
  432 + company = map.get("company").toString();
  433 + if(map.get("subCompany")!=null)
  434 + subCompany = map.get("subCompany").toString();
424 435 String line = map.get("line").toString();
425 436 String startDate = map.get("startDate").toString();
426 437 String endDate = map.get("endDate").toString();
... ... @@ -429,6 +440,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
429 440 String times1 = map.get("times1").toString();
430 441 String times2 = map.get("times2").toString();
431 442 String type = map.get("type").toString();
  443 + String sfyy = map.get("sfyy").toString();
432 444 int sfqr = Integer.valueOf(map.get("sfqr").toString());
433 445  
434 446 if(startDate.length() == 0){
... ... @@ -467,6 +479,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
467 479 // int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]);
468 480 // int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]);
469 481  
  482 + Map<String, Boolean> lineNature = lineService.lineNature();
  483 +
470 484 for(ScheduleRealInfo schedule : list){
471 485 if(schedule.isCcService())
472 486 continue;
... ... @@ -479,7 +493,19 @@ public class BusIntervalServiceImpl implements BusIntervalService {
479 493 }
480 494 if(schedule.getXlName() == null || schedule.getXlName().trim().length() == 0)
481 495 continue;
482   - String key = schedule.getXlBm() + "/" + schedule.getXlName() + "/" + schedule.getQdzName();
  496 +
  497 + if(lineNature.containsKey(schedule.getXlBm()) && lineNature.get(schedule.getXlBm()) != null){
  498 + if(sfyy.equals("1") && !lineNature.get(schedule.getXlBm())){
  499 + continue;
  500 + } else if(sfyy.equals("2") && lineNature.get(schedule.getXlBm())){
  501 + continue;
  502 + }
  503 + } else if(sfyy.equals("2")){
  504 + continue;
  505 + }
  506 +
  507 + String key = schedule.getXlBm() + "/" + schedule.getXlName() + "/" + schedule.getQdzName()
  508 + + "/" + schedule.getFgsName() + "/" + schedule.getFgsBm();
483 509 if(!keyMap.containsKey(key))
484 510 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
485 511 keyMap.get(key).add(schedule);
... ... @@ -592,7 +618,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
592 618 tempMap.put("line", split[1]);
593 619 tempMap.put("qdz", split[2]);
594 620 tempMap.put("company", companyName);
595   - tempMap.put("subCompany", subCompanyName);
  621 + tempMap.put("subCompany", split[3]);
  622 + tempMap.put("fgsbm", split[4]);
596 623 long jhInterval = 0l;
597 624 long sjInterval = 0l;
598 625 for(Long i : fcsjs)
... ... @@ -622,7 +649,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
622 649 Map<Long, List<Map<String, Object>>> sortMap = new HashMap<Long, List<Map<String, Object>>>();
623 650 for(Map<String, Object> m : tempList){
624 651 String times = m.get("times").toString();
625   - Long sort = Long.valueOf(times.substring(0, 2));
  652 + Long sort = Long.valueOf(times.substring(0, 2)) * 1000l
  653 + + Long.valueOf(m.get("fgsbm").toString());
626 654 if(!sortMap.containsKey(sort)){
627 655 sortMap.put(sort, new ArrayList<Map<String, Object>>());
628 656 sortList.add(sort);
... ... @@ -649,7 +677,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
649 677 }else if(statu.equals("0")){
650 678 List<Long> longList = new ArrayList<Long>();
651 679 for(String key : keyList){
652   - long xlBm = Long.valueOf(key.split("/")[0]);
  680 + long xlBm = Long.valueOf(key.split("/")[4]) * 1000000l + Long.valueOf(key.split("/")[0]);
653 681 if(!longList.contains(xlBm))
654 682 longList.add(xlBm);
655 683 Collections.sort(longList);
... ... @@ -657,7 +685,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
657 685 for(long xlBm : longList){
658 686 for(String key : keyList){
659 687 String[] split = key.split("/");
660   - if((long)Long.valueOf(split[0]) == xlBm){
  688 + long kl = Long.valueOf(split[4]) * 1000000l + Long.valueOf(split[0]);
  689 + if(kl == xlBm){
661 690 Map<String, Object> tempMap = new HashMap<String, Object>();
662 691 List<Long> fcsjs = new ArrayList<Long>();
663 692 List<Long> fcsjAs = new ArrayList<Long>();
... ... @@ -683,7 +712,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
683 712 tempMap.put("line", split[1]);
684 713 tempMap.put("qdz", split[2]);
685 714 tempMap.put("company", companyName);
686   - tempMap.put("subCompany", subCompanyName);
  715 + tempMap.put("subCompany", split[3]);
  716 + tempMap.put("fgsbm", split[4]);
687 717 tempMap.put("jhInterval", fcsjs.size()>0?df.format((double)fcsj/fcsjs.size()):"/");
688 718 tempMap.put("sjInterval", fcsjAs.size()>0?df.format((double)fcsjA/fcsjAs.size()):"/");
689 719 tempMap.put("MaxInterval", fcsjAs.size()>0?fcsjAs.get(fcsjAs.size() - 1):"/");
... ... @@ -745,9 +775,13 @@ public class BusIntervalServiceImpl implements BusIntervalService {
745 775 Set<Long> tsSet = new HashSet<Long>();
746 776 Set<Long> ttSet = new HashSet<Long>();
747 777  
748   - String company = map.get("company").toString();
749   - String subCompany = map.get("subCompany").toString();
  778 + String company = "", subCompany = "";
  779 + if(map.get("company")!=null)
  780 + company = map.get("company").toString();
  781 + if(map.get("subCompany")!=null)
  782 + subCompany = map.get("subCompany").toString();
750 783 String lp = map.get("lp").toString();
  784 + String sfyy = map.get("sfyy").toString();
751 785 String line = map.get("line").toString();
752 786 String statu = map.get("statu").toString();
753 787 String startDate = map.get("startDate").toString();
... ... @@ -775,7 +809,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
775 809 where += " and lp_name = '"+lp+"'";
776 810 }
777 811 if(company.length() != 0){
778   - where += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  812 + where += " and gs_bm = '"+company+"'";
  813 + }
  814 + if(subCompany.length() != 0){
  815 + where += " and fgs_bm = '"+subCompany+"'";
779 816 }
780 817 if(sfqr == 1){
781 818 where += " and zdsj >= '"+times1+"' and fcsj <= '"+times2+"'";
... ... @@ -783,7 +820,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
783 820 // where += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'";
784 821 where += " and bc_type != 'ldks'";
785 822  
786   - String sql = "select id, schedule_date_str, real_exec_date, xl_name, lp_name, bcs, bcsj, jhlc, bc_type,"
  823 + String sql = "select id, schedule_date_str, real_exec_date, xl_name, lp_name, bcs, bcsj, jhlc, bc_type, xl_bm, fgs_bm,"
787 824 + " fcsj, fcsj_actual, zdsj, zdsj_actual, qdz_name, zdz_name, xl_dir, status, remarks, gs_name, fgs_name, sp_id"
788 825 + " ,cc_service from bsth_c_s_sp_info_real where schedule_date_str >= '"+startDate+"'"
789 826 + " and schedule_date_str <= '"+endDate+"'"+where+"";
... ... @@ -796,6 +833,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
796 833 schedule.setId(rs.getLong("id"));
797 834 schedule.setScheduleDateStr(rs.getString("schedule_date_str"));
798 835 schedule.setRealExecDate(rs.getString("real_exec_date"));
  836 + schedule.setXlBm(rs.getString("xl_bm"));
799 837 schedule.setXlName(rs.getString("xl_name"));
800 838 schedule.setLpName(rs.getString("lp_name"));
801 839 schedule.setBcs(rs.getInt("bcs"));
... ... @@ -813,6 +851,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
813 851 schedule.setRemarks(rs.getString("remarks"));
814 852 schedule.setGsName(rs.getString("gs_name"));
815 853 schedule.setFgsName(rs.getString("fgs_name"));
  854 + schedule.setFgsBm(rs.getString("fgs_bm"));
816 855 schedule.setSpId(rs.getLong("sp_id"));
817 856 schedule.setCcService(rs.getBoolean("cc_service"));
818 857  
... ... @@ -877,7 +916,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
877 916 sql += " and xl_bm = '"+line+"'";
878 917 }
879 918 if(company.length() != 0){
880   - sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  919 + sql += " and gs_bm = '"+company+"'";
  920 + }
  921 + if(subCompany.length() != 0){
  922 + sql += " and fgs_bm = '"+subCompany+"'";
881 923 }
882 924 temp1 = jdbcTemplate.query(sql,
883 925 new RowMapper<Map<String, String>>(){
... ... @@ -1002,13 +1044,26 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1002 1044 cMap.get(key).add(cTask);
1003 1045 }
1004 1046  
  1047 + Map<String, Boolean> lineNature = lineService.lineNature();
  1048 +
1005 1049 for(ScheduleRealInfo schedule : list){
1006 1050 if(schedule.getXlName()==null || schedule.getXlName().trim().length()==0
1007 1051 || schedule.isCcService())
1008 1052 continue;
  1053 + String xlBm = schedule.getXlBm();
  1054 + if(lineNature.containsKey(xlBm) && lineNature.get(xlBm) != null){
  1055 + if(sfyy.equals("1") && !lineNature.get(xlBm)){
  1056 + continue;
  1057 + } else if(sfyy.equals("2") && lineNature.get(xlBm)){
  1058 + continue;
  1059 + }
  1060 + } else if(sfyy.equals("2")){
  1061 + continue;
  1062 + }
  1063 + String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/"
  1064 + + schedule.getLpName() + "/" + schedule.getFgsName();
1009 1065 if(model.length() != 0){
1010 1066 if(ttSet.contains(schedule.getSpId())){
1011   - String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" + schedule.getLpName();
1012 1067 if(!keyMap.containsKey(key))
1013 1068 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
1014 1069 keyMap.get(key).add(schedule);
... ... @@ -1023,7 +1078,6 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1023 1078 // }
1024 1079 // }
1025 1080 }else{
1026   - String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" + schedule.getLpName();
1027 1081 if(!keyMap.containsKey(key))
1028 1082 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
1029 1083 keyMap.get(key).add(schedule);
... ... @@ -1081,9 +1135,6 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1081 1135 }else{
1082 1136 jhyysj += fcsj2 - fcsj1;
1083 1137 }
1084   - if(jhyysj < 0){
1085   - System.out.println(fcsj2 + " - " + fcsj1 + " = " + (fcsj2 - fcsj1));
1086   - }
1087 1138 jhyysj1 += fcsj2 - fcsj1;
1088 1139 }
1089 1140 if(i == 1 && schedule1.getBcType().toString().equals("normal")){
... ... @@ -1220,9 +1271,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1220 1271 sjlc += Double.valueOf(m.get("lc").toString());
1221 1272 }
1222 1273 }
1223   - tempMap.put("company", companyName);
1224   - tempMap.put("subCompany", subCompanyName);
1225 1274 String[] split = key.split("/");
  1275 + tempMap.put("company", companyName);
  1276 + tempMap.put("subCompany", split[3]);
1226 1277 tempMap.put("date", split[0]);
1227 1278 tempMap.put("line", split[1]);
1228 1279 tempMap.put("lp", split[2]);
... ... @@ -1272,7 +1323,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1272 1323 }
1273 1324 Map<String, List<Map<String, Object>>> keyMap2 = new HashMap<String, List<Map<String, Object>>>();
1274 1325 for(Map<String, Object> m : resList){
1275   - String key = m.get("line").toString() + "/" + m.get("lp").toString();
  1326 + String key = m.get("line").toString() + "/" + m.get("lp").toString()
  1327 + + "/" + m.get("subCompany").toString();
1276 1328 if(!keyMap2.containsKey(key))
1277 1329 keyMap2.put(key, new ArrayList<Map<String, Object>>());
1278 1330 keyMap2.get(key).add(m);
... ... @@ -1333,6 +1385,32 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1333 1385 return a.compareTo(b);
1334 1386 }
1335 1387 });
  1388 + Collections.sort(list3, new Comparator<String>() {
  1389 +
  1390 + public int compare(String o1, String o2) {
  1391 +
  1392 + Long a = 0l;
  1393 + Long b = 0l;
  1394 + String[] split1 = o1.split("/");
  1395 + String[] split2 = o2.split("/");
  1396 + char[] charArray1 = split1[2].toCharArray();
  1397 + char[] charArray2 = split2[2].toCharArray();
  1398 + for(int i = 0; i < charArray1.length; i++){
  1399 + long temp = 1l;
  1400 + for(int j = 0; j < i; j++)
  1401 + temp *= 10;
  1402 + a += (long)charArray1[charArray1.length - 1 - i] * temp;
  1403 + }
  1404 + for(int i = 0; i < charArray2.length; i++){
  1405 + long temp = 1l;
  1406 + for(int j = 0; j < i; j++)
  1407 + temp *= 10;
  1408 + b += (long)charArray2[charArray2.length - 1 - i] * temp;
  1409 + }
  1410 +
  1411 + return a.compareTo(b);
  1412 + }
  1413 + });
1336 1414 for(String key : list3){
1337 1415 Map<String, Object> tempMap = new HashMap<String, Object>();
1338 1416 BigDecimal jhyysj = new BigDecimal(0), jhyssj = new BigDecimal(0);
... ... @@ -1362,7 +1440,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1362 1440 tempMap.put("line", split[0]);
1363 1441 tempMap.put("lp", split[1]);
1364 1442 tempMap.put("company", companyName);
1365   - tempMap.put("subCompany", subCompanyName);
  1443 + tempMap.put("subCompany", split[2]);
1366 1444 tempMap.put("date", date);
1367 1445 list4.add(tempMap);
1368 1446 }
... ... @@ -1373,7 +1451,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1373 1451 List<Map<String, Object>> list5 = new ArrayList<Map<String, Object>>();
1374 1452 List<String> keyList = new ArrayList<String>();
1375 1453 for(Map<String, Object> m : list4){
1376   - String key = m.get("line").toString();
  1454 + String key = m.get("line").toString() + "/" + m.get("subCompany").toString();
1377 1455 if(!keyMap4.containsKey(key)){
1378 1456 keyList.add(key);
1379 1457 keyMap4.put(key, new ArrayList<Map<String, Object>>());
... ... @@ -1405,10 +1483,11 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1405 1483 tempMap.put("sjyssj", sjyssj.equals(0)?0:sjyssj.divide(size, 2, RoundingMode.HALF_UP));
1406 1484 tempMap.put("sjyycs", sjyycs.equals(0)?0:sjyycs.divide(size, 2, RoundingMode.HALF_UP));
1407 1485 tempMap.put("sjyscs", sjyscs.equals(0)?0:sjyscs.divide(size, 2, RoundingMode.HALF_UP));
1408   - tempMap.put("line", key);
  1486 + String[] split = key.split("/");
  1487 + tempMap.put("line", split[0]);
1409 1488 tempMap.put("lp", keyMap4.get(key).size());
1410 1489 tempMap.put("company", companyName);
1411   - tempMap.put("subCompany", subCompanyName);
  1490 + tempMap.put("subCompany", split[1]);
1412 1491 tempMap.put("date", date);
1413 1492 tempMap.put("work", keyMap4.get(key));
1414 1493 list5.add(tempMap);
... ... @@ -1491,8 +1570,13 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1491 1570 Map<String, List<Map<String, Object>>> keyMap0 = new HashMap<String, List<Map<String, Object>>>();
1492 1571 Map<String, List<Map<String, Object>>> keyMap1 = new HashMap<String, List<Map<String, Object>>>();
1493 1572  
1494   - String company = map.get("company").toString();
1495   - String subCompany = map.get("subCompany").toString();
  1573 + String sfqr = "", company = "", subCompany = "";
  1574 + if(map.get("sfqr")!=null)
  1575 + sfqr = map.get("sfqr").toString();
  1576 + if(map.get("company")!=null)
  1577 + company = map.get("company").toString();
  1578 + if(map.get("subCompany")!=null)
  1579 + subCompany = map.get("subCompany").toString();
1496 1580 String line = map.get("line").toString();
1497 1581 String startDate = map.get("startDate").toString();
1498 1582 String endDate = map.get("endDate").toString();
... ... @@ -1510,6 +1594,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1510 1594 if(times.length() == 0){
1511 1595 times = "05:00-23:00";
1512 1596 }
  1597 + if(sfqr.equals("0")){
  1598 + times = "";
  1599 + }
1513 1600  
1514 1601 list = getSchedule(company, subCompany, line, startDate, endDate, model, times, false);
1515 1602  
... ... @@ -1522,9 +1609,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1522 1609 date = startDate;
1523 1610 }
1524 1611  
1525   - String[] split = times.split("-");
1526   - int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]);
1527   - int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]);
  1612 +// String[] split = times.split("-");
  1613 +// int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]);
  1614 +// int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]);
1528 1615  
1529 1616 for(ScheduleRealInfo s : list){
1530 1617 if(s.isCcService()){
... ... @@ -1708,7 +1795,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1708 1795  
1709 1796 Map<String, Object> m = mapList.get(0);
1710 1797 tempMap.put("dates", date);
1711   - tempMap.put("times", times);
  1798 + tempMap.put("times", times.length()==0?"全日":times);
1712 1799 tempMap.put("line", m.get("line"));
1713 1800 tempMap.put("lp", m.get("lp"));
1714 1801 tempMap.put("station", m.get("station"));
... ... @@ -1730,10 +1817,14 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1730 1817 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
1731 1818 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
1732 1819 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
1733   -
1734   - String company = map.get("company").toString();
1735   - String subCompany = map.get("subCompany").toString();
  1820 +
  1821 + String company = "", subCompany = "";
  1822 + String sfyy = map.get("sfyy").toString();
1736 1823 String line = map.get("line").toString();
  1824 + if(map.get("company")!=null)
  1825 + company = map.get("company").toString();
  1826 + if(map.get("subCompany")!=null)
  1827 + subCompany = map.get("subCompany").toString();
1737 1828 String startDate = map.get("startDate").toString();
1738 1829 String endDate = map.get("endDate").toString();
1739 1830 String model = map.get("model").toString();
... ... @@ -1777,17 +1868,86 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1777 1868 int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]);
1778 1869 int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]);
1779 1870  
  1871 + Map<String, Boolean> lineNature = lineService.lineNature();
  1872 +
1780 1873 for(ScheduleRealInfo schedule : list){
1781 1874 Long fcsj = schedule.getFcsjT();
1782 1875 if(sfqr == 1 && !(endTime!=0?fcsj>=startTime&&fcsj<endTime:fcsj>=startTime)){
1783 1876 continue;
1784 1877 }
1785   - String key = schedule.getXlName();
  1878 +
  1879 + String xlBm = schedule.getXlBm();
  1880 + if(lineNature.containsKey(xlBm) && lineNature.get(xlBm) != null){
  1881 + if(sfyy.equals("1") && !lineNature.get(xlBm)){
  1882 + continue;
  1883 + } else if(sfyy.equals("2") && lineNature.get(xlBm)){
  1884 + continue;
  1885 + }
  1886 + } else if(sfyy.equals("2")){
  1887 + continue;
  1888 + }
  1889 +
  1890 + String key = schedule.getXlName() + "/" + schedule.getFgsName();
1786 1891 if(!keyMap.containsKey(key))
1787 1892 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
1788 1893 keyMap.get(key).add(schedule);
1789 1894 }
1790 1895  
  1896 + List<String> keyList = new ArrayList<String>();
  1897 + keyList.addAll(keyMap.keySet());
  1898 + Collections.sort(keyList, new Comparator<String>() {
  1899 +
  1900 + public int compare(String o1, String o2) {
  1901 +
  1902 + Long a = 0l;
  1903 + Long b = 0l;
  1904 + String[] split1 = o1.split("/");
  1905 + String[] split2 = o2.split("/");
  1906 + char[] charArray1 = split1[0].toCharArray();
  1907 + char[] charArray2 = split2[0].toCharArray();
  1908 + for(int i = 0; i < charArray1.length; i++){
  1909 + long temp = 1l;
  1910 + for(int j = 0; j < i; j++)
  1911 + temp *= 10;
  1912 + a += (long)charArray1[charArray1.length - 1 - i] * temp;
  1913 + }
  1914 + for(int i = 0; i < charArray2.length; i++){
  1915 + long temp = 1l;
  1916 + for(int j = 0; j < i; j++)
  1917 + temp *= 10;
  1918 + b += (long)charArray2[charArray2.length - 1 - i] * temp;
  1919 + }
  1920 +
  1921 + return a.compareTo(b);
  1922 + }
  1923 + });
  1924 + Collections.sort(keyList, new Comparator<String>() {
  1925 +
  1926 + public int compare(String o1, String o2) {
  1927 +
  1928 + Long a = 0l;
  1929 + Long b = 0l;
  1930 + String[] split1 = o1.split("/");
  1931 + String[] split2 = o2.split("/");
  1932 + char[] charArray1 = split1[1].toCharArray();
  1933 + char[] charArray2 = split2[1].toCharArray();
  1934 + for(int i = 0; i < charArray1.length; i++){
  1935 + long temp = 1l;
  1936 + for(int j = 0; j < i; j++)
  1937 + temp *= 10;
  1938 + a += (long)charArray1[charArray1.length - 1 - i] * temp;
  1939 + }
  1940 + for(int i = 0; i < charArray2.length; i++){
  1941 + long temp = 1l;
  1942 + for(int j = 0; j < i; j++)
  1943 + temp *= 10;
  1944 + b += (long)charArray2[charArray2.length - 1 - i] * temp;
  1945 + }
  1946 +
  1947 + return a.compareTo(b);
  1948 + }
  1949 + });
  1950 +
1791 1951 Map<String, Object> temp = new HashMap<String, Object>();
1792 1952 int jhbc_ = 0, sjbc_ = 0,
1793 1953 lzbc_ = 0, dmbc_ = 0,
... ... @@ -1801,7 +1961,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1801 1961 qclc_ = new BigDecimal("0"), kxlc_ = new BigDecimal("0"),
1802 1962 qhlc_ = new BigDecimal("0"), wylc_ = new BigDecimal("0"),
1803 1963 qtlc_ = new BigDecimal("0");
1804   - for(String key : keyMap.keySet()){
  1964 +// for(String key : keyMap.keySet()){
  1965 + for(String key : keyList){
1805 1966 Map<String, Object> tempMap = new HashMap<String, Object>();
1806 1967 int jhbc = 0, sjbc = 0,
1807 1968 lzbc = 0, dmbc = 0,
... ... @@ -1907,11 +2068,12 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1907 2068 if(jhlc.doubleValue() == 0d){
1908 2069 flag = false;
1909 2070 }
  2071 + String[] keys = key.split("/");
1910 2072 tempMap.put("date", Date);
1911 2073 tempMap.put("company", companyName);
1912   - tempMap.put("subCompany", subCompanyName);
  2074 + tempMap.put("subCompany", keys[1]);
1913 2075 tempMap.put("times", sfqr == 1 ? times : "全日");
1914   - tempMap.put("line", key);
  2076 + tempMap.put("line", keys[0]);
1915 2077 tempMap.put("jhbc", jhbc);
1916 2078 tempMap.put("sjbc", sjbc);
1917 2079 tempMap.put("bcbfb", df.format(jhbc>0?(double)sjbc/jhbc*100:0)+"%");
... ... @@ -2055,10 +2217,14 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2055 2217 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
2056 2218 Map<String, List<Map<String, Object>>> keyMap0 = new HashMap<String, List<Map<String, Object>>>();
2057 2219 Map<String, List<Map<String, Object>>> keyMap1 = new HashMap<String, List<Map<String, Object>>>();
2058   -
2059   - String company = map.get("company").toString();
2060   - String subCompany = map.get("subCompany").toString();
  2220 +
  2221 + String company = "", subCompany = "";
  2222 + String sfyy = map.get("sfyy").toString();
2061 2223 String line = map.get("line").toString();
  2224 + if(map.get("company")!=null)
  2225 + company = map.get("company").toString();
  2226 + if(map.get("subCompany")!=null)
  2227 + subCompany = map.get("subCompany").toString();
2062 2228 String startDate = map.get("startDate").toString();
2063 2229 String endDate = map.get("endDate").toString();
2064 2230 String times = map.get("times").toString();
... ... @@ -2091,7 +2257,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2091 2257 }
2092 2258 }
2093 2259 if(company.length() != 0){
2094   - sql += " and (gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"')";
  2260 + sql += " and gs_bm = '"+company+"'";
  2261 + }
  2262 + if(subCompany.length() != 0){
  2263 + sql += " and fgs_bm = '"+subCompany+"'";
2095 2264 }
2096 2265 sql += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'";
2097 2266  
... ... @@ -2152,10 +2321,23 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2152 2321 date = startDate;
2153 2322 else
2154 2323 date = startDate + "--" + endDate;
  2324 +
  2325 + Map<String, Boolean> lineNature = lineService.lineNature();
2155 2326  
2156 2327 for(ScheduleRealInfo schedule : list){
2157 2328 if(schedule.getXlName() == null || schedule.getXlName().trim().length() == 0)
2158 2329 continue;
  2330 + String xlBm = schedule.getXlBm();
  2331 + if(lineNature.containsKey(xlBm) && lineNature.get(xlBm) != null){
  2332 + if(sfyy.equals("1") && !lineNature.get(xlBm)){
  2333 + continue;
  2334 + } else if(sfyy.equals("2") && lineNature.get(xlBm)){
  2335 + continue;
  2336 + }
  2337 + } else if(sfyy.equals("2")){
  2338 + continue;
  2339 + }
  2340 +
2159 2341 String key = schedule.getGsName() + "/" + schedule.getFgsName() + "/" + schedule.getXlBm();
2160 2342 if(!keyMap.containsKey(key))
2161 2343 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
... ... @@ -2339,13 +2521,14 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2339 2521 // tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%");
2340 2522 resList.add(tempMap);
2341 2523 }
  2524 +
2342 2525 //计算掉线调整
2343 2526 String sqldot = "select * from "
2344   - + "logger_sch_modify where gsbm =? and fgsbm=? and rq BETWEEN ? and ? order by line_code,sch_id";
2345   -
2346   - ;
  2527 + + "logger_sch_modify where gsbm = ? and fgsbm like ? and rq BETWEEN ? and ? order by line_code,sch_id";
  2528 +
  2529 +
2347 2530 List<SchEditInfoDto> listDot = jdbcTemplate.query(sqldot,
2348   - new BeanPropertyRowMapper(SchEditInfoDto.class),company,subCompany,map.get("startDate").toString(),map.get("endDate").toString());
  2531 + new BeanPropertyRowMapper(SchEditInfoDto.class),company,"%"+subCompany+"%",map.get("startDate").toString(),map.get("endDate").toString());
2349 2532 int dxtzz=0;
2350 2533 Map<String, Object> mapSchId=new HashMap<String,Object>();
2351 2534 for (int i = 0; i < resList.size(); i++) {
... ... @@ -2860,21 +3043,28 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2860 3043 String startDate = map.get("startDate").toString().trim();
2861 3044 String endDate = map.get("endDate").toString().trim();
2862 3045 String line = map.get("line").toString().trim();
2863   - String company = map.get("gs").toString().trim();
2864   - String subCompany = map.get("fgs").toString().trim();
  3046 + String company = "", subCompany = "";
  3047 + if(map.get("gs")!=null)
  3048 + company = map.get("gs").toString().trim();
  3049 + if(map.get("fgs")!=null)
  3050 + subCompany = map.get("fgs").toString().trim();
  3051 + String sfyy = "";
  3052 + if(map.get("sfyy")!=null)
  3053 + sfyy = map.get("sfyy").toString().trim();
2865 3054  
2866 3055 String sql = "select id, cl_zbh, fcsj, fcsj_actual, j_gh, j_name, lp_name, qdz_name, " +
2867   - "schedule_date_str, xl_name, zdsj, zdsj_actual, fgs_name, gs_name, xl_dir, xl_bm " +
  3056 + "schedule_date_str, xl_name, zdsj, zdsj_actual, fgs_bm, fgs_name, gs_name, xl_dir, xl_bm " +
2868 3057 "from bsth_c_s_sp_info_real " +
2869 3058 "where schedule_date_str >= '"+startDate+"' and schedule_date_str <= '"+endDate+"' " +
2870 3059 "and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and cc_service = 0";
2871 3060  
2872 3061 if(company.length() != 0)
2873   - sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  3062 + sql += " and gs_bm = '"+company+"'";
  3063 + if(subCompany.length() != 0)
  3064 + sql += " and fgs_bm = '"+subCompany+"'";
2874 3065 if(line.length() != 0)
2875 3066 sql += " and xl_bm = '"+line+"'";
2876 3067  
2877   - System.out.println(sql);
2878 3068 List<ScheduleRealInfo> list = jdbcTemplate.query(sql,
2879 3069 new RowMapper<ScheduleRealInfo>(){
2880 3070 @Override
... ... @@ -2893,6 +3083,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2893 3083 schedule.setQdzName(rs.getString("qdz_name"));
2894 3084 schedule.setGsName(rs.getString("gs_name"));
2895 3085 schedule.setFgsName(rs.getString("fgs_name"));
  3086 + schedule.setFgsBm(rs.getString("fgs_bm"));
2896 3087 schedule.setClZbh(rs.getString("cl_zbh"));
2897 3088 schedule.setjGh(rs.getString("j_gh"));
2898 3089 schedule.setjName(rs.getString("j_name"));
... ... @@ -2903,8 +3094,21 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2903 3094 Map<String, Map<String, List<ScheduleRealInfo>>> sches = new HashMap<String, Map<String, List<ScheduleRealInfo>>>();
2904 3095 Map<String, List<List<Map<String, Object>>>> keyMap = new HashMap<String, List<List<Map<String, Object>>>>();
2905 3096  
  3097 + Map<String, Boolean> lineNature = lineService.lineNature();
  3098 +
2906 3099 for(ScheduleRealInfo s : list){
2907   - String xl = s.getXlName();
  3100 + String xlBm = s.getXlBm();
  3101 + if(lineNature.containsKey(xlBm) && lineNature.get(xlBm) != null){
  3102 + if(sfyy.equals("1") && !lineNature.get(xlBm)){
  3103 + continue;
  3104 + } else if(sfyy.equals("2") && lineNature.get(xlBm)){
  3105 + continue;
  3106 + }
  3107 + } else if(sfyy.equals("2")){
  3108 + continue;
  3109 + }
  3110 +
  3111 + String xl = s.getXlName() + "/" + s.getFgsName();
2908 3112 String dateStr = s.getScheduleDateStr();
2909 3113 if(!sches.containsKey(xl)){
2910 3114 sches.put(xl, new HashMap<String, List<ScheduleRealInfo>>());
... ... @@ -2956,6 +3160,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2956 3160 Map<String, Object> temp = new HashMap<String, Object>();
2957 3161 temp.put("gs", s.getGsName());
2958 3162 temp.put("fgs", s.getFgsName());
  3163 + temp.put("fgsBm", s.getFgsBm());
2959 3164 temp.put("date", date);
2960 3165 temp.put("xlbm", s.getXlBm());
2961 3166 temp.put("line", s.getXlName());
... ... @@ -3020,6 +3225,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
3020 3225 }
3021 3226 tempMap.put("gs", list1.get(0).get(0).get("gs"));
3022 3227 tempMap.put("fgs", list1.get(0).get(0).get("fgs"));
  3228 + tempMap.put("fgsBm", list1.get(0).get(0).get("fgsBm"));
3023 3229 tempMap.put("line", list1.get(0).get(0).get("line"));
3024 3230 tempMap.put("date", list1.get(0).get(0).get("date"));
3025 3231 tempMap.put("xlbm", list1.get(0).get(0).get("xlbm"));
... ... @@ -3077,6 +3283,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
3077 3283 }
3078 3284 tempMap.put("gs", list2.get(0).get("gs"));
3079 3285 tempMap.put("fgs", list2.get(0).get("fgs"));
  3286 + tempMap.put("fgsBm", list2.get(0).get("fgsBm"));
3080 3287 tempMap.put("line", list2.get(0).get("line"));
3081 3288 tempMap.put("date", list2.get(0).get("date"));
3082 3289 tempMap.put("xl_date", list2.get(0).get("date") + "_" + list2.get(0).get("xlbm") + "_" + list2.get(0).get("line"));
... ...
src/main/java/com/bsth/service/impl/LineServiceImpl.java
... ... @@ -6,10 +6,14 @@ import com.bsth.repository.LineRepository;
6 6 import com.bsth.service.LineService;
7 7 import org.springframework.beans.factory.annotation.Autowired;
8 8 import org.springframework.jdbc.core.JdbcTemplate;
  9 +import org.springframework.jdbc.core.RowMapper;
9 10 import org.springframework.stereotype.Service;
10 11 import org.springframework.transaction.annotation.Transactional;
11 12  
  13 +import java.sql.ResultSet;
  14 +import java.sql.SQLException;
12 15 import java.util.HashMap;
  16 +import java.util.List;
13 17 import java.util.Map;
14 18  
15 19 /**
... ... @@ -117,4 +121,34 @@ public class LineServiceImpl extends BaseServiceImpl&lt;Line, Integer&gt; implements L
117 121 }
118 122 return map;
119 123 }
  124 +
  125 + /*获取线路性质*/
  126 + @Override
  127 + public Map<String, Boolean> lineNature() {
  128 + // TODO Auto-generated method stub
  129 +// List<Line> lineList=repository.findLineBygsBm(gsBm, fgsBm, line);
  130 + String sql="select * from bsth_c_line ";
  131 + List<Line> lineList=jdbcTemplate.query(sql,
  132 + new RowMapper<Line>(){
  133 + @Override
  134 + public Line mapRow(ResultSet rs, int rowNum) throws SQLException {
  135 + Line l=new Line();
  136 + l.setLineCode(rs.getString("line_code"));
  137 + l.setNature(rs.getString("nature"));
  138 + return l;
  139 + }
  140 + });
  141 + Map<String, Boolean> map=new HashMap<String,Boolean>();
  142 + for (int i = 0; i < lineList.size(); i++) {
  143 + Line t=lineList.get(i);
  144 + String nature=t.getNature()==null?"":t.getNature();
  145 + if(nature.equals("yxl")||nature.equals("cgxl")||nature.equals("gjxl")
  146 + ||nature.equals("csbs")||nature.equals("cctxl")){
  147 + map.put(t.getLineCode(), true);
  148 + }else{
  149 + map.put(t.getLineCode(), false);
  150 + }
  151 + }
  152 + return map;
  153 + }
120 154 }
... ...
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
... ... @@ -77,6 +77,10 @@ public class TrafficManageServiceImpl implements TrafficManageService{
77 77 @Autowired
78 78 private StationRouteRepository stationRouteRepository;
79 79  
  80 + // 历史站点路由repository
  81 + @Autowired
  82 + private LsStationRouteRepository lsStationRouteRepository;
  83 +
80 84 @Autowired
81 85 private SectionRepository sectionRepository;
82 86  
... ... @@ -532,7 +536,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
532 536 //发送邮件
533 537 EmailBean mail = new EmailBean();
534 538 mail.setSubject(InetAddress.getLocalHost().getHostAddress()+":路单日志数据"+date);
535   - mail.setContent(logSuccess+"<br/>成功数:"+countSuccess+"<br/>" +logFailure+"<br/>失败数:"+countFailure);
  539 + mail.setContent("成功数:"+countSuccess+"<br/>失败数:"+countFailure+"<br/>" +logSuccess + "<br/>"+logFailure);
536 540 sendEmailController.sendMail(emailSendToAddress, mail);
537 541 logger.info("setLD-sendMail:邮件发送成功!");
538 542 }catch (Exception e){
... ... @@ -944,6 +948,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
944 948 String result = "failure";
945 949 StringBuffer sBuffer = new StringBuffer();
946 950 DecimalFormat df = new DecimalFormat("######0.000");
  951 + Map<String,String> lsStationCode2NameMap;
  952 + Map<String, Integer> lsStationName2YgcNumber;
947 953 try {
948 954 String[] idArray = ids.split(",");
949 955 StringBuffer sBufferA ,sBufferB ,sBufferC ;
... ... @@ -960,10 +966,17 @@ public class TrafficManageServiceImpl implements TrafficManageService{
960 966 HashMap<String,String> paramMap;
961 967 HashMap<String,String> otherMap = new HashMap<>();
962 968 for (int i = 0; i < idArray.length; i++) {
963   - ttInfo = ttInfoRepository.findOne(Long.valueOf(idArray[i]));
  969 + long ttinfoId = Long.valueOf(idArray[i]);
  970 + ttInfo = ttInfoRepository.findOne(ttinfoId);
964 971 if(ttInfo == null)
965 972 continue;
966 973 ttinfoList.add(ttInfo); // 保存时刻表
  974 + // 得到时刻表版本号
  975 + int lineVersion = ttInfo.getLineVersion();
  976 + // 查询历史站点路由
  977 + lsStationCode2NameMap = getLsStationCode(ttInfo.getXl().getLineCode(),lineVersion);
  978 + // 查询历史站点路由
  979 + lsStationName2YgcNumber = getLsStationRoute(ttInfo.getXl().getLineCode(),lineVersion);
967 980 zlc = 0.0f;
968 981 yylc = 0.0f;
969 982 // 获得时刻表
... ... @@ -992,7 +1005,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
992 1005 ttInfoDetail = ttInfoDetailIterator.next();
993 1006 bcType = ttInfoDetail.getBcType();
994 1007 sxx = ttInfoDetail.getXlDir();
995   - // 进出场班次
  1008 + // 进出场班次的里程,加入总里程
996 1009 if(bcType.equals("in") || bcType.equals("out")){
997 1010 // 进出班次的计划里程,算空驶里程
998 1011 emptyLc = ttInfoDetail.getJhlc();
... ... @@ -1000,6 +1013,10 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1000 1013 zlc += emptyLc;
1001 1014 continue;
1002 1015 }
  1016 + // 不是正常班次,不传到运管处
  1017 + if(!bcType.equals("normal")){
  1018 + continue;
  1019 + }
1003 1020 // 如果发车时间格式错误,忽略此条
1004 1021 if(changeTimeFormat(ttInfoDetail) == null){
1005 1022 continue;
... ... @@ -1007,19 +1024,19 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1007 1024 sBufferC.append("<BC>");
1008 1025 sBufferC.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>");
1009 1026 sBufferC.append("<SXX>").append(sxx).append("</SXX>");
1010   - sBufferC.append("<FCZDMC>").append(BasicData.stationCode2NameMap.get(ttInfoDetail.getXl().getLineCode()+"_"+ttInfoDetail.getXlDir()
  1027 + sBufferC.append("<FCZDMC>").append(lsStationCode2NameMap.get(ttInfoDetail.getXl().getLineCode()+"_"+ttInfoDetail.getXlDir()
1011 1028 +"_"+ttInfoDetail.getQdzCode())).append("</FCZDMC>");
1012 1029 // 起点站的参数
1013 1030 otherMap.put("stationMark","B");
1014 1031 paramMap = packageYgcStationNumParam(ttInfoDetail,otherMap);
1015   - sBufferC.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,null)).append("</ZDXH>");
  1032 + sBufferC.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,lsStationName2YgcNumber)).append("</ZDXH>");
1016 1033 sBufferC.append("<JHFCSJ>").append(changeTimeFormat(ttInfoDetail)).append("</JHFCSJ>");
1017   - sBufferC.append("<DDZDMC>").append(BasicData.stationCode2NameMap.get(ttInfoDetail.getXl().getLineCode()+"_"+ttInfoDetail.getXlDir()
  1034 + sBufferC.append("<DDZDMC>").append(lsStationCode2NameMap.get(ttInfoDetail.getXl().getLineCode()+"_"+ttInfoDetail.getXlDir()
1018 1035 +"_"+ttInfoDetail.getZdzCode())).append("</DDZDMC>");
1019 1036 // 起点站的参数
1020 1037 otherMap.put("stationMark","E");
1021 1038 paramMap = packageYgcStationNumParam(ttInfoDetail,otherMap);
1022   - sBufferC.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,null)).append("</DDXH>");
  1039 + sBufferC.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,lsStationName2YgcNumber)).append("</DDXH>");
1023 1040 sBufferC.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>");
1024 1041 sBufferC.append("</BC>");
1025 1042 // 0:上行;1:下行
... ... @@ -1520,4 +1537,51 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1520 1537 map.put("stationMark",stationMark); // 站点类型
1521 1538 return map;
1522 1539 }
  1540 +
  1541 + /**
  1542 + * 取得历史站点编码和站点名称的对应关系
  1543 + * @return
  1544 + */
  1545 + private Map<String, String> getLsStationCode(String lineCode,int lineVersion){
  1546 + Map<String,Object> map = new HashMap<>();
  1547 + map.put("lineCode_eq", lineCode);
  1548 + map.put("versions_eq",lineVersion);
  1549 + LsStationRoute lsroute;
  1550 + Iterator<LsStationRoute> iterator = lsStationRouteRepository.findAll(new CustomerSpecs<LsStationRoute>(map)).iterator();
  1551 + Map<String, String> stationCode2Name = new HashMap<>();
  1552 + while (iterator.hasNext()) {
  1553 + lsroute = iterator.next();
  1554 + stationCode2Name.put(lsroute.getLineCode() + "_" + lsroute.getDirections() + "_" + lsroute.getStationCode(), lsroute.getStationName());
  1555 + }
  1556 + return stationCode2Name;
  1557 + }
  1558 +
  1559 + private Map<String, Integer> getLsStationRoute(String xlbm,int lineVersion){
  1560 + Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>();
  1561 + /**
  1562 + * 加载运管处的站点及序号
  1563 + * 上行从1开始,下行顺序续编
  1564 + */
  1565 + List<Map<String, String>> ygcLines = lsStationRouteRepository.findLineWithLineCode4Ygc(xlbm,lineVersion);
  1566 + if(ygcLines != null && ygcLines.size() > 0){
  1567 + int size = ygcLines.size();
  1568 + Map<String, String> tempMap ;
  1569 + int num = 1;
  1570 + String key;
  1571 + String lineCode = "";
  1572 + for (int i = 0; i < size; i ++){
  1573 + tempMap = ygcLines.get(i);
  1574 + if(lineCode.equals("")){
  1575 + lineCode = tempMap.get("lineCode");
  1576 + }else if(!lineCode.equals(tempMap.get("lineCode"))){
  1577 + num = 1;
  1578 + lineCode = tempMap.get("lineCode");
  1579 + }
  1580 + key = tempMap.get("lineCode") + "_"+String.valueOf(tempMap.get("directions"))
  1581 + + "_"+tempMap.get("stationCode")+ "_"+tempMap.get("stationMark");
  1582 + tempStationName2YgcNumber.put(key,num++);
  1583 + }
  1584 + }
  1585 + return tempStationName2YgcNumber;
  1586 + }
1523 1587 }
... ...
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
... ... @@ -117,10 +117,10 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
117 117  
118 118 List<Map<String,Object>> statisticsDaily(String line, String date, String xlName, String type);
119 119  
120   - List<Map<String,Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2, String xlName, String type);
  120 + List<Map<String,Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2, String xlName, String type,String nature);
121 121  
122 122 //用于实时数据与统计数据合并查询
123   - List<Map<String,Object>> statisticsDailyTjHb(String gsdm,String fgsdm,String line, String date,String date2, String xlName, String type);
  123 + List<Map<String,Object>> statisticsDailyTjHb(String gsdm,String fgsdm,String line, String date,String date2, String xlName, String type,String nature);
124 124  
125 125 //List<Object> scheduleDaily(String line,String date);
126 126  
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -53,6 +53,7 @@ import com.bsth.repository.schedule.CarConfigInfoRepository;
53 53 import com.bsth.repository.schedule.EmployeeConfigInfoRepository;
54 54 import com.bsth.repository.schedule.GuideboardInfoRepository;
55 55 import com.bsth.security.util.SecurityUtils;
  56 +import com.bsth.service.LineService;
56 57 import com.bsth.service.SectionRouteService;
57 58 import com.bsth.service.directive.DirectiveService;
58 59 import com.bsth.service.impl.BaseServiceImpl;
... ... @@ -114,7 +115,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
114 115  
115 116 @Autowired
116 117 LineRepository lineRepository;
117   -
  118 + @Autowired
  119 + LineService lineService;
118 120 @Autowired
119 121 GuideboardInfoRepository guideboardInfoRepository;
120 122  
... ... @@ -2232,6 +2234,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2232 2234 }
2233 2235 try {
2234 2236 String dateTime = sdfSimple.format(sdfMonth.parse(date));
  2237 + if(!endDate.equals(date)){
  2238 + dateTime += "-" + sdfSimple.format(sdfMonth.parse(endDate));
  2239 + }
2235 2240 String lineName = BasicData.lineCode2NameMap.get(line);
2236 2241 listI.add(tempList.iterator());
2237 2242 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
... ... @@ -2666,10 +2671,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2666 2671 }
2667 2672 Map<String, Object> map = new HashMap<String, Object>();
2668 2673 if (list.size() > 0) {
  2674 + map.put("fgsBm", list.get(0).getFgsBm());
2669 2675 map.put("xlBm", list.get(0).getXlBm());
2670 2676 map.put("xlName", list.get(0).getXlName());
  2677 + map.put("fgsName", list.get(0).getFgsName());
2671 2678 try {
2672   - map.put("xlNamePy", PinyinHelper.convertToPinyinString(list.get(0).getXlName(), "", PinyinFormat.WITHOUT_TONE));
  2679 + map.put("xlNamePy", PinyinHelper.convertToPinyinString(list.get(0).getFgsBm()+list.get(0).getXlName(), "", PinyinFormat.WITHOUT_TONE));
2673 2680 } catch (PinyinException e) {
2674 2681 // TODO Auto-generated catch block
2675 2682 e.printStackTrace();
... ... @@ -2679,7 +2686,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2679 2686 map.put("jhlc", jhyygl);
2680 2687 map.put("jcclc", jhjcclc);
2681 2688 map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
2682   -
  2689 + double ljks=culateService.culateLjksgl(lists);
  2690 + map.put("ljks", ljks);
2683 2691 double ljgl = culateService.culateLjgl(lists);
2684 2692 double sjyygl = culateService.culateSjgl(lists);
2685 2693 double zyygl = Arith.add(sjyygl, ljgl);
... ... @@ -2744,18 +2752,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2744 2752  
2745 2753 @Override
2746 2754 public List<Map<String, Object>> statisticsDailyTj(String gsdm, String fgsdm, String line, String date, String date2,
2747   - String xlName, String type) {
2748   - List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  2755 + String xlName, String type,String nature) {
  2756 + List<ScheduleRealInfo> listAll = new ArrayList<ScheduleRealInfo>();
2749 2757 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
2750 2758 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
2751 2759 line = line.trim();
2752 2760 if (line.equals("")) {
2753 2761 //查询所有线路
2754   - list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date, date2, gsdm, fgsdm);
  2762 + listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date, date2, gsdm, fgsdm);
2755 2763 } else {
2756 2764 //查询单条线路
2757   - list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date, date2);
2758   - }
  2765 + listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date, date2);
  2766 + }
  2767 + Map<String, Boolean> lineMap=lineService.lineNature();
  2768 + List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>();
  2769 + for (int i = 0; i < listAll.size(); i++) {
  2770 + ScheduleRealInfo s=listAll.get(i);
  2771 + if (nature.equals("0")) {
  2772 + list.add(s);
  2773 + }else if(nature.equals("1")){
  2774 + if(lineMap.get(s.getXlBm())){
  2775 + list.add(s);
  2776 + }
  2777 + }else{
  2778 + if(!lineMap.get(s.getXlBm())){
  2779 + list.add(s);
  2780 + }
  2781 + }
  2782 + }
2759 2783 for (int i = 0; i < list.size(); i++) {
2760 2784 ScheduleRealInfo s = list.get(i);
2761 2785 Set<ChildTaskPlan> cts = s.getcTasks();
... ... @@ -2770,7 +2794,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2770 2794 List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
2771 2795 for (int i = 0; i < list.size(); i++) {
2772 2796 if (i < list.size() - 1) {
2773   - if (list.get(i + 1).getXlBm().equals(list.get(i).getXlBm())) {
  2797 + if ((list.get(i+1).getFgsBm()+list.get(i + 1).getXlBm()).equals(list.get(i).getFgsBm()+list.get(i).getXlBm())) {
2774 2798 lists.add(list.get(i));
2775 2799 } else {
2776 2800 lists.add(list.get(i));
... ... @@ -2779,7 +2803,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2779 2803 lists = new ArrayList<ScheduleRealInfo>();
2780 2804 }
2781 2805 } else {
2782   - if (list.get(i).getXlBm().equals(list.get(i - 1).getXlBm())) {
  2806 + if ((list.get(i).getFgsBm()+list.get(i).getXlBm()).equals(list.get(i - 1).getFgsBm()+list.get(i - 1).getXlBm())) {
2783 2807 lists.add(list.get(i));
2784 2808 Map<String, Object> map = staticTj(lists);
2785 2809 lMap.add(map);
... ... @@ -2791,10 +2815,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2791 2815 }
2792 2816 }
2793 2817 }
2794   -
  2818 + /*if(!line.equals("")){
  2819 + List<Line> l=lineRepository.findLineByCode(line);
  2820 + if(l.size()>0)
  2821 + lMap.get(0).put("fgsName", BasicData.businessFgsCodeNameMap.get(l.get(0).getBrancheCompany()+"_"+l.get(0).getCompany()));
  2822 + }*/
2795 2823 Collections.sort(lMap, new AccountXlbm());
2796 2824 Map<String, Object> map = new HashMap<String, Object>();
2797 2825 map.put("xlName", "合计");
  2826 + map.put("fgsName", "");
2798 2827 double jhyygl = culateService.culateJhgl(list);//计划营运公里
2799 2828 double jhjcclc = culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
2800 2829 map.put("jhlc", jhyygl);
... ... @@ -2804,7 +2833,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2804 2833 double ljgl = culateService.culateLjgl(list_s);
2805 2834 double sjyygl = culateService.culateSjgl(list_s);
2806 2835 double zyygl = Arith.add(sjyygl, ljgl);
2807   -
  2836 + double ljks=culateService.culateLjksgl(list_s);
  2837 + map.put("ljks", ljks);
2808 2838 double sjjccgl = culateService.culateJccgl(list_s);
2809 2839 double sjksgl = culateService.culateKsgl(list_s);
2810 2840 double zksgl = Arith.add(sjjccgl, sjksgl);
... ... @@ -2902,7 +2932,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2902 2932 }
2903 2933 listI.add(lMap.iterator());
2904 2934 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
2905   - ee.excelReplace(listI, new Object[]{m}, path + "mould/statisticsDaily_.xls",
  2935 + ee.excelReplace(listI, new Object[]{m}, path + "mould/statisticsDaily_2.xls",
2906 2936 path + "export/" + dateTime + "-" + xlName + "-统计日报.xls");
2907 2937 } catch (Exception e) {
2908 2938 // TODO: handle exception
... ... @@ -2916,18 +2946,35 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2916 2946  
2917 2947 @Override
2918 2948 public List<Map<String, Object>> statisticsDailyTjHb(String gsdm, String fgsdm, String line, String date, String date2,
2919   - String xlName, String type) {
2920   - List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  2949 + String xlName, String type,String nature) {
  2950 + List<ScheduleRealInfo> listAll = new ArrayList<ScheduleRealInfo>();
2921 2951 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
2922 2952 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
2923 2953 line = line.trim();
2924 2954 if (line.equals("")) {
2925 2955 //查询所有线路
2926   - list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date, date2, gsdm, fgsdm);
  2956 + listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date, date2, gsdm, fgsdm);
2927 2957 } else {
2928 2958 //查询单条线路
2929   - list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date, date2);
2930   - }
  2959 + listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date, date2);
  2960 + }
  2961 +
  2962 + Map<String, Boolean> lineMap=lineService.lineNature();
  2963 + List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>();
  2964 + for (int i = 0; i < listAll.size(); i++) {
  2965 + ScheduleRealInfo s=listAll.get(i);
  2966 + if (nature.equals("0")) {
  2967 + list.add(s);
  2968 + }else if(nature.equals("1")){
  2969 + if(lineMap.get(s.getXlBm())){
  2970 + list.add(s);
  2971 + }
  2972 + }else{
  2973 + if(!lineMap.get(s.getXlBm())){
  2974 + list.add(s);
  2975 + }
  2976 + }
  2977 + }
2931 2978 for (int i = 0; i < list.size(); i++) {
2932 2979 ScheduleRealInfo s = list.get(i);
2933 2980 Set<ChildTaskPlan> cts = s.getcTasks();
... ... @@ -2942,7 +2989,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2942 2989 List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
2943 2990 for (int i = 0; i < list.size(); i++) {
2944 2991 if (i < list.size() - 1) {
2945   - if (list.get(i + 1).getXlBm().equals(list.get(i).getXlBm())) {
  2992 + if ((list.get(i + 1).getFgsBm()+list.get(i + 1).getXlBm()).equals(list.get(i).getFgsBm()+list.get(i).getXlBm())) {
2946 2993 lists.add(list.get(i));
2947 2994 } else {
2948 2995 lists.add(list.get(i));
... ... @@ -2951,7 +2998,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2951 2998 lists = new ArrayList<ScheduleRealInfo>();
2952 2999 }
2953 3000 } else {
2954   - if (list.get(i).getXlBm().equals(list.get(i - 1).getXlBm())) {
  3001 + if ((list.get(i).getFgsBm()+list.get(i).getXlBm()).equals(list.get(i - 1).getFgsBm()+list.get(i - 1).getXlBm())) {
2955 3002 lists.add(list.get(i));
2956 3003 Map<String, Object> map = staticTj(lists);
2957 3004 lMap.add(map);
... ... @@ -2968,6 +3015,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2968 3015 Map<String, Object> map = new HashMap<String, Object>();
2969 3016 map.put("xlBm", "hj");
2970 3017 map.put("xlName", "合计");
  3018 + map.put("fgsBm", "");
  3019 + map.put("fgsName", "");
  3020 + map.put("gsBm", "");
2971 3021 double jhyygl = culateService.culateJhgl(list);//计划营运公里
2972 3022 double jhjcclc = culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
2973 3023 map.put("jhlc", jhyygl);
... ... @@ -2977,7 +3027,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2977 3027 double ljgl = culateService.culateLjgl(list_s);
2978 3028 double sjyygl = culateService.culateSjgl(list_s);
2979 3029 double zyygl = Arith.add(sjyygl, ljgl);
2980   -
  3030 + double ljks=culateService.culateLjksgl(list_s);
  3031 + map.put("ljks", ljks);
2981 3032 double sjjccgl = culateService.culateJccgl(list_s);
2982 3033 double sjksgl = culateService.culateKsgl(list_s);
2983 3034 double zksgl = Arith.add(sjjccgl, sjksgl);
... ...
src/main/java/com/bsth/service/report/CalcSheetService.java 0 → 100644
  1 +package com.bsth.service.report;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import com.bsth.entity.sheet.CalcSheet;
  7 +import com.bsth.entity.sheet.Sheet;
  8 +import com.bsth.service.BaseService;
  9 +
  10 +public interface CalcSheetService extends BaseService<CalcSheet, Integer>{
  11 + public List<CalcSheet> countListCalcSheet(Map<String, Object> map);
  12 + public List<CalcSheet> calcListSheet(Map<String, Object> map);
  13 + public List<Sheet> calcSheet(Map<String, Object> map);
  14 + public List<Map<String, Object>> calcTurnoutrate(Map<String, Object> map);
  15 +}
... ...
src/main/java/com/bsth/service/report/CulateMileageService.java
... ... @@ -4,6 +4,7 @@ import java.util.List;
4 4 import java.util.Map;
5 5  
6 6 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  7 +import com.google.common.util.concurrent.AbstractScheduledService.Scheduler;
7 8  
8 9 public interface CulateMileageService {
9 10  
... ... @@ -12,6 +13,7 @@ public interface CulateMileageService {
12 13 int culateLbbc(List<ScheduleRealInfo> lists);
13 14  
14 15 List<Map<String,Object>> jobLjqk(List<ScheduleRealInfo> lists);
  16 + double culateLjksgl(List<ScheduleRealInfo> lists);
15 17 double culateLjgl(List<ScheduleRealInfo> lists);
16 18 double culateLjgl_(List<ScheduleRealInfo> lists,String item);
17 19 double culateLjgl_spy(List<ScheduleRealInfo> lists);
... ... @@ -43,7 +45,7 @@ public interface CulateMileageService {
43 45  
44 46 int culateDtfzbc(List<ScheduleRealInfo> lists,String type,String status,String item);
45 47  
46   -
  48 +
47 49 //以下计算方法供新报表使用
48 50 Map<String, Double> culateSjlcMap(List<ScheduleRealInfo> lists);//计划内营运and计划外营运
49 51  
... ...
src/main/java/com/bsth/service/report/impl/CalcSheetServiceImpl.java 0 → 100644
  1 +package com.bsth.service.report.impl;
  2 +
  3 +
  4 +import java.lang.reflect.InvocationTargetException;
  5 +import java.sql.ResultSet;
  6 +import java.sql.SQLException;
  7 +import java.text.DecimalFormat;
  8 +import java.text.ParseException;
  9 +import java.text.SimpleDateFormat;
  10 +import java.util.ArrayList;
  11 +import java.util.Calendar;
  12 +import java.util.Collections;
  13 +import java.util.Comparator;
  14 +import java.util.Date;
  15 +import java.util.GregorianCalendar;
  16 +import java.util.HashMap;
  17 +import java.util.Iterator;
  18 +import java.util.List;
  19 +import java.util.Map;
  20 +
  21 +import org.apache.commons.lang3.StringUtils;
  22 +import org.springframework.beans.factory.annotation.Autowired;
  23 +import org.springframework.jdbc.core.JdbcTemplate;
  24 +import org.springframework.jdbc.core.RowMapper;
  25 +import org.springframework.stereotype.Service;
  26 +
  27 +import com.bsth.data.BasicData;
  28 +import com.bsth.entity.Line;
  29 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  30 +import com.bsth.entity.sheet.CalcSheet;
  31 +import com.bsth.entity.sheet.Sheet;
  32 +import com.bsth.repository.LineRepository;
  33 +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  34 +import com.bsth.service.LineService;
  35 +import com.bsth.service.impl.BaseServiceImpl;
  36 +import com.bsth.service.report.CalcSheetService;
  37 +import com.bsth.util.ComparableReal;
  38 +import com.bsth.util.ReportRelatedUtils;
  39 +import com.bsth.util.ReportUtils;
  40 +
  41 +
  42 +@Service
  43 +public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> implements CalcSheetService {
  44 + @Autowired
  45 + JdbcTemplate jdbcTemplate;
  46 + @Autowired
  47 + ScheduleRealInfoRepository scheduleRealInfoRepository;
  48 + @Autowired
  49 + LineRepository lineRepository;
  50 + @Autowired
  51 + LineService lineService;
  52 + @Override
  53 + public List<CalcSheet> countListCalcSheet(Map<String, Object> map) {
  54 + // TODO Auto-generated method stub
  55 + final DecimalFormat df = new DecimalFormat("0.00");
  56 + String line="";
  57 + if(map.get("line")!=null){
  58 + line =map.get("line").toString().trim();
  59 + }
  60 + String gs="";
  61 + if(map.get("gs")!=null){
  62 + gs=map.get("gs").toString().trim();
  63 + }
  64 + String fgs="";
  65 + if(map.get("fgs")!=null){
  66 + fgs=map.get("fgs").toString().trim();
  67 + }
  68 + String nature="0";
  69 + if(map.get("nature")!=null){
  70 + nature=map.get("nature").toString();
  71 + }
  72 + Map<String, Boolean> lineMap=lineService.lineNature();
  73 +
  74 + String date=map.get("date").toString();
  75 + String endDate=map.get("endDate").toString();
  76 + String sql="select gsdm,fgsdm,xl,xl_name,max(id) as id,sum(jhszfcs) as jhszfcs ,"
  77 + + " sum(sjszfczds) as sjszfczds,sum(sjszddzds) as sjszddzds"
  78 + + " from bsth_c_calc_sheet where date >= '"+date+"' and date <= '"+endDate+"'";
  79 + if(line.trim().equals("")){
  80 + sql +=" and gsdm = '"+gs+"' and fgsdm like '%"+fgs+"%'";
  81 + }else{
  82 + sql +=" and xl ='"+line+"'";
  83 + }
  84 + sql +=" group by gsdm,fgsdm,xl,xl_name";
  85 + List<CalcSheet> lists=jdbcTemplate.query(sql,
  86 + new RowMapper<CalcSheet>(){
  87 + @Override
  88 + public CalcSheet mapRow(ResultSet rs, int rowNum) throws SQLException {
  89 + CalcSheet s=new CalcSheet();
  90 + s.setGsdm(rs.getString("gsdm"));
  91 + s.setFgsdm(rs.getString("fgsdm"));
  92 + s.setXl(rs.getString("xl"));
  93 + s.setXlName(rs.getString("xl_name"));
  94 + s.setId(rs.getInt("id"));
  95 + s.setJhszfcs(rs.getString("jhszfcs"));
  96 + s.setSjszfczds(rs.getString("sjszfczds"));
  97 + s.setSjszddzds(rs.getString("sjszddzds"));
  98 + int jhfc=Integer.parseInt(rs.getString("jhszfcs"));
  99 + int zdfc=Integer.parseInt(rs.getString("sjszfczds"));
  100 + int zddd=Integer.parseInt(rs.getString("sjszddzds"));
  101 + if(jhfc>0){
  102 + double zdl=(zdfc*1.0)/(jhfc*1.0)*100;
  103 + s.setSzfczdl(df.format(zdl)+"%");
  104 + zdl=(zddd*1.0)/(jhfc*1.0)*100;
  105 + s.setSzddzdl(df.format(zdl)+"%");
  106 + }else{
  107 + s.setSzfczdl("0.0%");
  108 + s.setSzddzdl("0.0%");
  109 + }
  110 + return s;
  111 + }
  112 + });
  113 + List<CalcSheet> list=new ArrayList<CalcSheet>();
  114 + for (int i = 0; i < lists.size(); i++) {
  115 + if (nature.equals("0")) {
  116 + list.add(lists.get(i));
  117 + }else if(nature.equals("1")){
  118 + if(lineMap.get(lists.get(i).getXl())){
  119 + list.add(lists.get(i));
  120 + }
  121 + }else{
  122 + if(!lineMap.get(lists.get(i).getXl())){
  123 + list.add(lists.get(i));
  124 + }
  125 + }
  126 + }
  127 + if(map.get("type").equals("export")){
  128 + String lineName="";
  129 + if(!line.equals("")){
  130 + lineName=list.get(0).getXlName();
  131 + }else if(!fgs.equals("")){
  132 + lineName=list.get(0).getFgsname();
  133 + }else{
  134 + lineName=list.get(0).getGsname();
  135 + }
  136 + List<Map<String, Object>> listmap=new ArrayList<Map<String, Object>>();
  137 + for (int i = 0; i < list.size(); i++) {
  138 + CalcSheet c=list.get(i);
  139 + Map<String, Object> m=new HashMap<String,Object>();
  140 + m.put("gs", c.getGsname());
  141 + m.put("fgs", c.getFgsname());
  142 + m.put("line", c.getXlName());
  143 + m.put("bcs", c.getJhszfcs());
  144 + m.put("zdbcs", c.getSjszfczds());
  145 + m.put("zdlv", c.getSzfczdl());
  146 + m.put("ddzdbcs", c.getSjszddzds());
  147 + m.put("ddzdlv", c.getSzddzdl());
  148 + listmap.add(m);
  149 + }
  150 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  151 + Map<String, Object> m = new HashMap<String, Object>();
  152 + m.put("date", date);
  153 + m.put("endDate", endDate);
  154 + ReportUtils ee = new ReportUtils();
  155 + try {
  156 + String dateTime = "";
  157 + if(date.equals(endDate)){
  158 + dateTime = date.replaceAll("-", "");
  159 + } else {
  160 + dateTime = date.replaceAll("-", "")+"-"+
  161 + endDate.replaceAll("-", "");
  162 + }
  163 + listI.add(listmap.iterator());
  164 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  165 + ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "calcSheetList.xls",
  166 + path + "export/"+dateTime+"-"+lineName+"-发车到站准点率.xls");
  167 + } catch (Exception e) {
  168 + // TODO: handle exception
  169 + e.printStackTrace();
  170 + }
  171 + }
  172 + return list;
  173 + }
  174 + @Override
  175 + public List<CalcSheet> calcListSheet(Map<String, Object> map) {
  176 + // TODO Auto-generated method stub
  177 + String line=map.get("line").toString();
  178 + String date=map.get("date").toString();
  179 + String endDate=map.get("endDate").toString();
  180 + String sql="select * from bsth_c_calc_sheet where date >= '"+date+"' and "
  181 + + " date <= '"+endDate+"' and xl = '"+line+"' order by date";
  182 + List<CalcSheet> list=jdbcTemplate.query(sql,
  183 + new RowMapper<CalcSheet>(){
  184 + @Override
  185 + public CalcSheet mapRow(ResultSet rs, int rowNum) throws SQLException {
  186 + CalcSheet s=new CalcSheet();
  187 + s.setGsdm(rs.getString("gsdm"));
  188 + s.setFgsdm(rs.getString("fgsdm"));
  189 + s.setXl(rs.getString("xl"));
  190 + s.setXlName(rs.getString("xl_name"));
  191 + s.setId(rs.getInt("id"));
  192 + s.setDate(rs.getString("date"));
  193 + s.setJhszfcs(rs.getString("jhszfcs"));
  194 + s.setSjszfczds(rs.getString("sjszfczds"));
  195 + s.setSzfczdl(rs.getString("szfczdl"));
  196 + s.setSjszddzds(rs.getString("sjszddzds"));
  197 + s.setSzddzdl(rs.getString("szddzdl"));
  198 + return s;
  199 + }
  200 + });
  201 + if(map.get("type").equals("export")){
  202 + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
  203 + for (int i = 0; i < list.size(); i++) {
  204 + Map<String, Object> m = new HashMap<String, Object>();
  205 + CalcSheet c = list.get(i);
  206 + m.put("gs", c.getGsname());
  207 + m.put("fgs", c.getFgsname());
  208 + m.put("date", c.getDate());
  209 + m.put("line", c.getXlName());
  210 + m.put("bcs", c.getJhszfcs());
  211 + m.put("zdbcs", c.getSjszfczds());
  212 + m.put("zdlv", c.getSzfczdl()+"%");
  213 + m.put("ddzdbcs", c.getSjszddzds());
  214 + m.put("ddzdlv", c.getSzddzdl()+"%");
  215 + tempList.add(m);
  216 + }
  217 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  218 + Map<String, Object> m = new HashMap<String, Object>();
  219 + m.put("date", date);
  220 + m.put("endDate", endDate);
  221 + ReportUtils ee = new ReportUtils();
  222 + try {
  223 + listI.add(tempList.iterator());
  224 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  225 + ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "calcSheetList1.xls",
  226 + path + "export/发车到站准点率"+date.replaceAll("-", "")+"-"+endDate.replaceAll("-", "")+".xls");
  227 + } catch (Exception e) {
  228 + // TODO: handle exception
  229 + e.printStackTrace();
  230 + }
  231 + }
  232 + return list;
  233 + }
  234 + @Override
  235 + public List<Sheet> calcSheet(Map<String, Object> map) {
  236 + // TODO Auto-generated method stub
  237 + System.out.println();
  238 + String line=map.get("line").toString();
  239 + String date=map.get("date").toString();
  240 + String dir =map.get("dir").toString();
  241 + List<ScheduleRealInfo> list=scheduleRealInfoRepository.scheduleDaily(line, date);
  242 + Line l =lineRepository.findByLineCode(line);
  243 + List<Sheet> listSheet=new ArrayList<Sheet>();
  244 + if(list.size()>0){
  245 + if(dir.equals("1")){
  246 + listSheet=calcSheetFcZdl(list, list.get(0).getXlBm(),l.getStartStationName(),l.getEndStationName());
  247 + }else{
  248 + listSheet=calcSheetDdZdl(list, list.get(0).getXlBm(),l.getStartStationName(),l.getEndStationName());
  249 + }
  250 + if(map.get("type").equals("export")){
  251 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  252 + Map<String, Object> m = new HashMap<String, Object>();
  253 + ReportUtils ee = new ReportUtils();
  254 + try {
  255 + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
  256 + for(int i = 0; i < listSheet.size(); i++){
  257 + Map<String, Object> temp = new HashMap<String, Object>();
  258 + Sheet s = listSheet.get(i);
  259 + temp.put("id", i+1);
  260 + temp.put("date", s.getDate());
  261 + temp.put("line", s.getLine());
  262 + temp.put("zdname", s.getZdname());
  263 + temp.put("jhsj", s.getJhsj());
  264 + temp.put("sjsj", s.getSjsj());
  265 + temp.put("sfzd", s.getSfzd());
  266 + tempList.add(temp);
  267 + }
  268 + listI.add(tempList.iterator());
  269 + m.put("date", date);
  270 + String fileName="";
  271 + if(dir.equals("1")){
  272 + fileName="发车准点率"+date;
  273 + }else{
  274 + fileName="到站准点率"+date;
  275 + }
  276 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  277 + ee.excelReplace(listI, new Object[]{m}, path + "mould/sheetList2.xls",
  278 + path + "export/"+fileName+".xls");
  279 + } catch (Exception e) {
  280 + // TODO: handle exception
  281 + e.printStackTrace();
  282 + }
  283 +
  284 + }
  285 + }
  286 + return listSheet;
  287 + }
  288 +
  289 + private List<Sheet> calcSheetFcZdl(List<ScheduleRealInfo> lists,String line,String qdz,String zdz) {
  290 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  291 + SimpleDateFormat sdf_ = new SimpleDateFormat("yyyy-MM-dd");
  292 + DecimalFormat df = new DecimalFormat("0.00");
  293 + List<Sheet> listSheet=new ArrayList<Sheet>();
  294 + List<ScheduleRealInfo> listjh0 = new ArrayList<ScheduleRealInfo>();
  295 + List<ScheduleRealInfo> listjh1 = new ArrayList<ScheduleRealInfo>();
  296 + List<ScheduleRealInfo> listsj0 = new ArrayList<ScheduleRealInfo>();
  297 + List<ScheduleRealInfo> listsj1 = new ArrayList<ScheduleRealInfo>();
  298 + long minFcsj = minFcsj(line);
  299 + for (int j = 0; j < lists.size(); j++) {
  300 + ScheduleRealInfo s = lists.get(j);
  301 + boolean fage=true;
  302 + if(s.getBcType().equals("region")){
  303 + if(s.getXlDir().equals("0")){
  304 + if(!s.getQdzName().equals(qdz))
  305 + fage=false;
  306 + }else{
  307 + if(!s.getQdzName().equals(zdz))
  308 + fage=false;
  309 + }
  310 + }
  311 + if (!isInOut(s) && fage) {
  312 + String[] fcsj = s.getFcsj().split(":");
  313 + Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
  314 + Long fcsjT = 0L;
  315 + if (fcsjL < minFcsj) {
  316 + Calendar calendar = new GregorianCalendar();
  317 + calendar.setTime(s.getScheduleDate());
  318 + calendar.add(calendar.DATE, 1);
  319 + Date date = calendar.getTime();
  320 + try {
  321 + fcsjT = sdf.parse(sdf_.format(date) + " " + s.getFcsj()).getTime();
  322 + } catch (ParseException e) {
  323 + // TODO Auto-generated catch block
  324 + e.printStackTrace();
  325 + }
  326 + } else {
  327 + try {
  328 + fcsjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
  329 + } catch (ParseException e) {
  330 + // TODO Auto-generated catch block
  331 + e.printStackTrace();
  332 + }
  333 + }
  334 + Long fcsjAcual = 0L;
  335 + if (StringUtils.isEmpty(s.getFcsjActual())) {
  336 + s.setFcsjActualTime(0L);
  337 + s.setFcsjT(fcsjT);
  338 + } else {
  339 + try {
  340 + fcsjAcual = sdf.parse(s.getRealExecDate() + " " + s.getFcsjActual()).getTime();
  341 + s.setFcsjActualTime(fcsjAcual);
  342 + s.setFcsjT(fcsjT);
  343 + } catch (ParseException e) {
  344 + // TODO Auto-generated catch block
  345 + e.printStackTrace();
  346 + }
  347 + }
  348 + if (s.isSflj()) {
  349 + if (s.getXlDir().equals("0")) {
  350 + listsj0.add(s);
  351 + } else {
  352 + listsj1.add(s);
  353 + }
  354 + } else {
  355 + if (s.getXlDir().equals("0")) {
  356 + listsj0.add(s);
  357 + listjh0.add(s);
  358 + } else {
  359 + listsj1.add(s);
  360 + listjh1.add(s);
  361 + }
  362 + }
  363 + }
  364 + }
  365 + Collections.sort(listjh0, new ComparableReal());
  366 + Collections.sort(listjh1, new ComparableReal());
  367 + Collections.sort(listsj0, new ComparableAcual());
  368 + Collections.sort(listsj1, new ComparableAcual());
  369 + Map<String, Object> mjh = new HashMap<String, Object>();
  370 + Map<String, Object> msj = new HashMap<String, Object>();
  371 + Sheet sheet;
  372 + //获取上行所有准点班次
  373 + for (int k = 0; k < listjh0.size(); k++) {
  374 + ScheduleRealInfo sJh = listjh0.get(k);
  375 + for (int j = 0; j < listsj0.size(); j++) {
  376 + ScheduleRealInfo sSj = listsj0.get(j);
  377 + long sjc = sSj.getFcsjActualTime() - sJh.getFcsjT();
  378 + if (sjc >= -1 * 60 * 1000 && sjc <= 3 * 60 * 1000) {
  379 + if (mjh.get(String.valueOf(sJh.getId())) == null && msj.get(String.valueOf(sSj.getId())) == null) {
  380 + sheet = new Sheet();
  381 + sheet.setDate(sJh.getScheduleDateStr());
  382 + sheet.setRealDate(sSj.getRealExecDate());
  383 + sheet.setLine(sJh.getXlName());
  384 + sheet.setZdname(sJh.getQdzName());
  385 + sheet.setJhsj(sJh.getFcsj());
  386 + sheet.setSjsj(sSj.getFcsjActual());
  387 + sheet.setSfzd("准点");
  388 + sheet.setXlDir("0");
  389 + listSheet.add(sheet);
  390 + mjh.put(String.valueOf(sJh.getId()), sJh.getId());
  391 + msj.put(String.valueOf(sSj.getId()), sSj.getId());
  392 + }
  393 + }
  394 + }
  395 + }
  396 + // 获取上行所有不准点班次
  397 +
  398 + for (int k = 0; k < listjh0.size(); k++) {
  399 + ScheduleRealInfo sJh = listjh0.get(k);
  400 + for (int j = 0; j < listsj0.size(); j++) {
  401 + ScheduleRealInfo sSj = listsj0.get(j);
  402 + if (mjh.get(String.valueOf(sJh.getId())) == null&&msj.get(String.valueOf(sSj.getId())) == null) {
  403 + sheet = new Sheet();
  404 + sheet.setDate(sJh.getScheduleDateStr());
  405 + sheet.setRealDate(sSj.getRealExecDate());
  406 + sheet.setLine(sJh.getXlName());
  407 + sheet.setZdname(sJh.getQdzName());
  408 + sheet.setJhsj(sJh.getFcsj());
  409 + sheet.setSjsj(sSj.getFcsjActual()==null?"烂班":sSj.getFcsjActual());
  410 + sheet.setSfzd("不准点");
  411 + sheet.setXlDir("0");
  412 + listSheet.add(sheet);
  413 + mjh.put(String.valueOf(sJh.getId()), sJh.getId());
  414 + msj.put(String.valueOf(sSj.getId()), sSj.getId());
  415 + }
  416 +
  417 + }
  418 + }
  419 + // 获取下行所有准点班次
  420 + for (int k = 0; k < listjh1.size(); k++) {
  421 + ScheduleRealInfo sJh = listjh1.get(k);
  422 + for (int j = 0; j < listsj1.size(); j++) {
  423 + ScheduleRealInfo sSj = listsj1.get(j);
  424 + long sjc = sSj.getFcsjActualTime() - sJh.getFcsjT();
  425 + if (sjc >= -1 * 60 * 1000 && sjc <= 3 * 60 * 1000) {
  426 + if (mjh.get(String.valueOf(sJh.getId())) == null && msj.get(String.valueOf(sSj.getId())) == null) {
  427 + sheet = new Sheet();
  428 + sheet.setDate(sJh.getScheduleDateStr());
  429 + sheet.setRealDate(sSj.getRealExecDate());
  430 + sheet.setLine(sJh.getXlName());
  431 + sheet.setZdname(sJh.getQdzName());
  432 + sheet.setJhsj(sJh.getFcsj());
  433 + sheet.setSjsj(sSj.getFcsjActual());
  434 + sheet.setSfzd("准点");
  435 + sheet.setXlDir("1");
  436 + listSheet.add(sheet);
  437 + mjh.put(String.valueOf(sJh.getId()), sJh.getId());
  438 + msj.put(String.valueOf(sSj.getId()), sSj.getId());
  439 + }
  440 + }
  441 + }
  442 + }
  443 +
  444 + // 获取下行所有不准点班次
  445 +
  446 + for (int k = 0; k < listjh1.size(); k++) {
  447 + ScheduleRealInfo sJh = listjh1.get(k);
  448 + for (int j = 0; j < listsj1.size(); j++) {
  449 + ScheduleRealInfo sSj = listsj1.get(j);
  450 + if (mjh.get(String.valueOf(sJh.getId())) == null&&msj.get(String.valueOf(sSj.getId())) == null) {
  451 + sheet = new Sheet();
  452 + sheet.setDate(sJh.getScheduleDateStr());
  453 + sheet.setRealDate(sSj.getRealExecDate());
  454 + sheet.setLine(sJh.getXlName());
  455 + sheet.setZdname(sJh.getQdzName());
  456 + sheet.setJhsj(sJh.getFcsj());
  457 + sheet.setSjsj(sSj.getFcsjActual()==null?"烂班":sSj.getFcsjActual());
  458 + sheet.setSfzd("不准点");
  459 + sheet.setXlDir("1");
  460 + listSheet.add(sheet);
  461 + mjh.put(String.valueOf(sJh.getId()), sJh.getId());
  462 + msj.put(String.valueOf(sSj.getId()), sSj.getId());
  463 + }
  464 +
  465 + }
  466 + }
  467 +
  468 + Collections.sort(listSheet, new ComparableSheet());
  469 + return listSheet;
  470 + }
  471 +
  472 +
  473 + private List<Sheet> calcSheetDdZdl(List<ScheduleRealInfo> lists,String line,String qdz,String zdz) {
  474 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  475 + SimpleDateFormat sdf_ = new SimpleDateFormat("yyyy-MM-dd");
  476 + DecimalFormat df = new DecimalFormat("0.00");
  477 + List<Sheet> listSheet=new ArrayList<Sheet>();
  478 + List<ScheduleRealInfo> listjh0 = new ArrayList<ScheduleRealInfo>();
  479 + List<ScheduleRealInfo> listjh1 = new ArrayList<ScheduleRealInfo>();
  480 + List<ScheduleRealInfo> listsj0 = new ArrayList<ScheduleRealInfo>();
  481 + List<ScheduleRealInfo> listsj1 = new ArrayList<ScheduleRealInfo>();
  482 + long minFcsj = minFcsj(line);
  483 + for (int j = 0; j < lists.size(); j++) {
  484 + ScheduleRealInfo s = lists.get(j);
  485 + boolean fage=true;
  486 + if(s.getBcType().equals("region")){
  487 + if(s.getXlDir().equals("0")){
  488 + if(!s.getQdzName().equals(qdz))
  489 + fage=false;
  490 + }else{
  491 + if(!s.getQdzName().equals(zdz))
  492 + fage=false;
  493 + }
  494 + }
  495 + if (!isInOut(s) && fage) {
  496 + String[] fcsj = s.getFcsj().split(":");
  497 + Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
  498 + Long fcsjT = 0L;
  499 + if (fcsjL < minFcsj) {
  500 + Calendar calendar = new GregorianCalendar();
  501 + calendar.setTime(s.getScheduleDate());
  502 + calendar.add(calendar.DATE, 1);
  503 + Date date = calendar.getTime();
  504 + try {
  505 + fcsjT = sdf.parse(sdf_.format(date) + " " + s.getFcsj()).getTime();
  506 + } catch (ParseException e) {
  507 + // TODO Auto-generated catch block
  508 + e.printStackTrace();
  509 + }
  510 + } else {
  511 + try {
  512 + fcsjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
  513 + } catch (ParseException e) {
  514 + // TODO Auto-generated catch block
  515 + e.printStackTrace();
  516 + }
  517 + }
  518 + //计划达到时间
  519 + Long ddsjT=0L;
  520 + try {
  521 + ddsjT = sdf.parse(s.getRealExecDate()+" "+s.getZdsj()).getTime();
  522 + } catch (ParseException e1) {
  523 + // TODO Auto-generated catch block
  524 + e1.printStackTrace();
  525 + }
  526 +
  527 + Long fcsjAcual = 0L;
  528 + if (StringUtils.isEmpty(s.getFcsjActual())) {
  529 + s.setFcsjActualTime(0L);
  530 + s.setFcsjT(fcsjT);
  531 + } else {
  532 + try {
  533 + fcsjAcual = sdf.parse(s.getRealExecDate() + " " + s.getFcsjActual()).getTime();
  534 + s.setFcsjActualTime(fcsjAcual);
  535 + s.setFcsjT(fcsjT);
  536 + } catch (ParseException e) {
  537 + // TODO Auto-generated catch block
  538 + e.printStackTrace();
  539 + }
  540 + }
  541 + if(fcsjT.longValue()>ddsjT.longValue()){
  542 + ddsjT=ddsjT+24*60*60*1000;
  543 + }
  544 + s.setZdsjT(ddsjT);
  545 + if(StringUtils.isEmpty(s.getZdsjActual())){
  546 + s.setZdsjActualTime(0L);
  547 + }else{
  548 + try {
  549 + Long ddsjActualT = sdf.parse(s.getRealExecDate()+" "+s.getZdsjActual()).getTime();
  550 + if(Math.abs(ddsjActualT-ddsjT)/60000>1000){
  551 + if(ddsjActualT.longValue()>ddsjT.longValue()){
  552 + ddsjActualT=ddsjActualT-24*60*60*1000;
  553 + }else{
  554 + ddsjActualT=ddsjActualT+24*60*60*1000;
  555 + }
  556 + }
  557 + s.setZdsjActualTime(ddsjActualT);
  558 + } catch (ParseException e) {
  559 + // TODO Auto-generated catch block
  560 + e.printStackTrace();
  561 + }
  562 + }
  563 + if (s.isSflj()) {
  564 + if (s.getXlDir().equals("0")) {
  565 + listsj0.add(s);
  566 + } else {
  567 + listsj1.add(s);
  568 + }
  569 + } else {
  570 + if (s.getXlDir().equals("0")) {
  571 + listsj0.add(s);
  572 + listjh0.add(s);
  573 + } else {
  574 + listsj1.add(s);
  575 + listjh1.add(s);
  576 + }
  577 + }
  578 + }
  579 + }
  580 + Collections.sort(listjh0, new ComparableJhZd());
  581 + Collections.sort(listjh1, new ComparableJhZd());
  582 + Collections.sort(listsj0, new ComparableZdAcual());
  583 + Collections.sort(listsj1, new ComparableZdAcual());
  584 + Map<String, Object> mjh = new HashMap<String, Object>();
  585 + Map<String, Object> msj = new HashMap<String, Object>();
  586 + Sheet sheet;
  587 + //获取上行所有准点班次
  588 + for (int k = 0; k < listjh0.size(); k++) {
  589 + ScheduleRealInfo sJh = listjh0.get(k);
  590 + for (int j = 0; j < listsj0.size(); j++) {
  591 + ScheduleRealInfo sSj = listsj0.get(j);
  592 + long sjc = sSj.getZdsjActualTime() - sJh.getZdsjT();
  593 + if (sjc >= -1 * 60 * 1000 && sjc <= 3 * 60 * 1000) {
  594 + if (mjh.get(String.valueOf(sJh.getId())) == null && msj.get(String.valueOf(sSj.getId())) == null) {
  595 + sheet = new Sheet();
  596 + sheet.setDate(sJh.getScheduleDateStr());
  597 + try {
  598 + long abs=Math.abs(sdf.parse(sJh.getRealExecDate()+" "+sJh.getFcsj()).getTime()-
  599 + sdf.parse(sJh.getRealExecDate()+" "+sJh.getZdsj()).getTime())/60000;
  600 + if(abs>1000){
  601 + Calendar calendar = new GregorianCalendar();
  602 + calendar.setTime(sdf_.parse(sJh.getRealExecDate()));
  603 + calendar.add(calendar.DATE, 1);
  604 + Date date = calendar.getTime();
  605 + sheet.setRealDate(sdf_.format(date));
  606 + }else{
  607 + sheet.setRealDate(sJh.getRealExecDate());
  608 + }
  609 + } catch (ParseException e) {
  610 + // TODO Auto-generated catch block
  611 + e.printStackTrace();
  612 + }
  613 + sheet.setLine(sJh.getXlName());
  614 + sheet.setZdname(sJh.getQdzName());
  615 + sheet.setJhsj(sJh.getZdsj());
  616 + sheet.setSjsj(sSj.getZdsjActual());
  617 + sheet.setSfzd("准点");
  618 + sheet.setXlDir("0");
  619 + listSheet.add(sheet);
  620 + mjh.put(String.valueOf(sJh.getId()), sJh.getId());
  621 + msj.put(String.valueOf(sSj.getId()), sSj.getId());
  622 + }
  623 + }
  624 + }
  625 + }
  626 + // 获取上行所有不准点班次
  627 + for (int k = 0; k < listjh0.size(); k++) {
  628 + ScheduleRealInfo sJh = listjh0.get(k);
  629 + for (int j = 0; j < listsj0.size(); j++) {
  630 + ScheduleRealInfo sSj = listsj0.get(j);
  631 + if (mjh.get(String.valueOf(sJh.getId())) == null&&msj.get(String.valueOf(sSj.getId())) == null) {
  632 + sheet = new Sheet();
  633 + sheet.setDate(sJh.getScheduleDateStr());
  634 + try {
  635 + long abs=Math.abs(sdf.parse(sJh.getRealExecDate()+" "+sJh.getFcsj()).getTime()-
  636 + sdf.parse(sJh.getRealExecDate()+" "+sJh.getZdsj()).getTime())/60000;
  637 + if(abs>1000){
  638 + Calendar calendar = new GregorianCalendar();
  639 + calendar.setTime(sdf_.parse(sJh.getRealExecDate()));
  640 + calendar.add(calendar.DATE, 1);
  641 + Date date = calendar.getTime();
  642 + sheet.setRealDate(sdf_.format(date));
  643 + }else{
  644 + sheet.setRealDate(sJh.getRealExecDate());
  645 + }
  646 + } catch (ParseException e) {
  647 + // TODO Auto-generated catch block
  648 + e.printStackTrace();
  649 + }
  650 + sheet.setLine(sJh.getXlName());
  651 + sheet.setZdname(sJh.getQdzName());
  652 + sheet.setJhsj(sJh.getZdsj());
  653 + sheet.setSjsj(sSj.getZdsjActual()==null?"烂班":sSj.getZdsjActual());
  654 + sheet.setSfzd("不准点");
  655 + sheet.setXlDir("0");
  656 + listSheet.add(sheet);
  657 + mjh.put(String.valueOf(sJh.getId()), sJh.getId());
  658 + msj.put(String.valueOf(sSj.getId()), sSj.getId());
  659 + }
  660 +
  661 + }
  662 + }
  663 + // 获取下行所有准点班次
  664 + for (int k = 0; k < listjh1.size(); k++) {
  665 + ScheduleRealInfo sJh = listjh1.get(k);
  666 + for (int j = 0; j < listsj1.size(); j++) {
  667 + ScheduleRealInfo sSj = listsj1.get(j);
  668 + long sjc = sSj.getZdsjActualTime() - sJh.getZdsjT();
  669 + if (sjc >= -1 * 60 * 1000 && sjc <= 3 * 60 * 1000) {
  670 + if (mjh.get(String.valueOf(sJh.getId())) == null && msj.get(String.valueOf(sSj.getId())) == null) {
  671 + sheet = new Sheet();
  672 + sheet.setDate(sJh.getScheduleDateStr());
  673 + try {
  674 + long abs=Math.abs(sdf.parse(sJh.getRealExecDate()+" "+sJh.getFcsj()).getTime()-
  675 + sdf.parse(sJh.getRealExecDate()+" "+sJh.getZdsj()).getTime())/60000;
  676 + if(abs>1000){
  677 + Calendar calendar = new GregorianCalendar();
  678 + calendar.setTime(sdf_.parse(sJh.getRealExecDate()));
  679 + calendar.add(calendar.DATE, 1);
  680 + Date date = calendar.getTime();
  681 + sheet.setRealDate(sdf_.format(date));
  682 + }else{
  683 + sheet.setRealDate(sJh.getRealExecDate());
  684 + }
  685 + } catch (ParseException e) {
  686 + // TODO Auto-generated catch block
  687 + e.printStackTrace();
  688 + }
  689 +
  690 + sheet.setLine(sJh.getXlName());
  691 + sheet.setZdname(sJh.getQdzName());
  692 + sheet.setJhsj(sJh.getZdsj());
  693 + sheet.setSjsj(sSj.getZdsjActual());
  694 + sheet.setSfzd("准点");
  695 + sheet.setXlDir("1");
  696 + listSheet.add(sheet);
  697 + mjh.put(String.valueOf(sJh.getId()), sJh.getId());
  698 + msj.put(String.valueOf(sSj.getId()), sSj.getId());
  699 + }
  700 + }
  701 + }
  702 + }
  703 +
  704 + // 获取下行所有不准点班次
  705 + for (int k = 0; k < listjh1.size(); k++) {
  706 + ScheduleRealInfo sJh = listjh1.get(k);
  707 + for (int j = 0; j < listsj1.size(); j++) {
  708 + ScheduleRealInfo sSj = listsj1.get(j);
  709 + if (mjh.get(String.valueOf(sJh.getId())) == null&&msj.get(String.valueOf(sSj.getId())) == null) {
  710 + sheet = new Sheet();
  711 + sheet.setDate(sJh.getScheduleDateStr());
  712 + try {
  713 + long abs=Math.abs(sdf.parse(sJh.getRealExecDate()+" "+sJh.getFcsj()).getTime()-
  714 + sdf.parse(sJh.getRealExecDate()+" "+sJh.getZdsj()).getTime())/60000;
  715 + if(abs>1000){
  716 + Calendar calendar = new GregorianCalendar();
  717 + calendar.setTime(sdf_.parse(sJh.getRealExecDate()));
  718 + calendar.add(calendar.DATE, 1);
  719 + Date date = calendar.getTime();
  720 + sheet.setRealDate(sdf_.format(date));
  721 + }else{
  722 + sheet.setRealDate(sJh.getRealExecDate());
  723 + }
  724 + } catch (ParseException e) {
  725 + // TODO Auto-generated catch block
  726 + e.printStackTrace();
  727 + }
  728 + sheet.setLine(sJh.getXlName());
  729 + sheet.setZdname(sJh.getQdzName());
  730 + sheet.setJhsj(sJh.getZdsj());
  731 + sheet.setSjsj(sSj.getZdsjActual()==null?"烂班":sSj.getZdsjActual());
  732 + sheet.setSfzd("不准点");
  733 + sheet.setXlDir("1");
  734 + listSheet.add(sheet);
  735 + mjh.put(String.valueOf(sJh.getId()), sJh.getId());
  736 + msj.put(String.valueOf(sSj.getId()), sSj.getId());
  737 + }
  738 +
  739 + }
  740 + }
  741 +
  742 + Collections.sort(listSheet, new ComparableSheet());
  743 + return listSheet;
  744 + }
  745 + private Long minFcsj(String line){
  746 + String minfcsj="02:00";
  747 + List<Line> lineList=lineRepository.findLineByCode(line);
  748 + if(lineList.size()>0){
  749 + String sqlMinYysj="select start_opt from bsth_c_line_config where "
  750 + + " id = ("
  751 + + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
  752 + + ")";
  753 + minfcsj= jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  754 + }
  755 + String[] minSjs = minfcsj.split(":");
  756 + //车辆最早发车时间 用了过滤超第二天0点的数据
  757 + Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
  758 + return minSj;
  759 + }
  760 +
  761 + private static boolean isInOut(ScheduleRealInfo s){
  762 + boolean fage=false;
  763 + if(s.getBcType().equals("in")){
  764 + fage=true;
  765 + }
  766 + if(s.getBcType().equals("out")){
  767 + fage=true;
  768 + }
  769 + if(s.getBcType().equals("ldks")){
  770 + fage=true;
  771 + }
  772 + if(s.isCcService()){
  773 + fage=true;
  774 + }
  775 + return fage;
  776 + }
  777 + @Override
  778 + public List<Map<String, Object>> calcTurnoutrate(Map<String, Object> map) {
  779 + final DecimalFormat df = new DecimalFormat("0.00");
  780 + String line="";
  781 + if(map.get("line")!=null){
  782 + line =map.get("line").toString().trim();
  783 + }
  784 + String gs="";
  785 + if(map.get("gsdmTurn")!=null){
  786 + gs=map.get("gsdmTurn").toString().trim();
  787 + }
  788 + String fgs="";
  789 + if(map.get("fgsdmTurn")!=null){
  790 + fgs=map.get("fgsdmTurn").toString().trim();
  791 + }
  792 + String nature="0";
  793 + if(map.get("nature")!=null){
  794 + nature=map.get("nature").toString();
  795 + }
  796 + Map<String, Boolean> lineMap=lineService.lineNature();
  797 +
  798 + String startDate=map.get("startDate").toString();
  799 + String endDate=map.get("endDate").toString();
  800 + String date=startDate+"-"+endDate;
  801 + if(startDate.equals(endDate)){
  802 + date=startDate;
  803 + }else{
  804 + date=startDate+"-"+endDate;
  805 + }
  806 + String type=map.get("type").toString();
  807 + final String dates=date;
  808 + String sql_="";
  809 + if(line.equals("")){
  810 + sql_= " and gsdm ='"+gs+"' and fgsdm like '%"+fgs+"%'";
  811 + }else{
  812 + sql_=" and xl='"+line+"'";
  813 + }
  814 + String sql="select t.*,y.warrant_car as qzpcs from ("
  815 + + " select gsdm,fgsdm,xl,xl_name,sum(jhcc) as jhcc,sum(sjcc) as sjcc,"
  816 + + " sum(sjcczgf) as sjcczgf,sum(jhbcs) as jhbcs,sum(sjbcs) as sjbcs "
  817 + + " from bsth_c_calc_sheet where date >='"+startDate+"' and date <='"+endDate+"'"
  818 + + sql_
  819 + + " group by gsdm,fgsdm,xl,xl_name ) "
  820 + + " t LEFT JOIN bsth_c_line y "
  821 + + " on t.xl=y.line_code order by fgsdm,xl_name";
  822 + List<Map<String, Object>> lists=jdbcTemplate.query(sql,
  823 + new RowMapper<Map<String, Object>>(){
  824 + @Override
  825 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  826 + Map<String, Object> s=new HashMap<String,Object>();
  827 + s.put("rq",dates);
  828 + s.put("gsdm", rs.getString("gsdm"));
  829 + s.put("fgsdm", rs.getString("fgsdm"));
  830 + s.put("gsName", BasicData.businessCodeNameMap.get(rs.getString("gsdm")));
  831 + s.put("fgsName", BasicData.businessFgsCodeNameMap.get(rs.getString("fgsdm")+"_"+rs.getString("gsdm")));
  832 + s.put("xl", rs.getString("xl"));
  833 + s.put("xlName", rs.getString("xl_name"));
  834 + s.put("jhcc", rs.getInt("jhcc"));
  835 + s.put("sjcc", rs.getInt("sjcc"));
  836 + s.put("qzpcs",rs.getInt("qzpcs"));
  837 + s.put("sjcczgf", rs.getInt("sjcczgf"));
  838 + if(rs.getInt("jhcc")>0){
  839 + s.put("ccl",df.format((float)rs.getInt("sjcc")/rs.getInt("jhcc")*100)+"%");
  840 + s.put("cclzgf", df.format((float)rs.getInt("sjcczgf")/rs.getInt("jhcc")*100)+"%");
  841 + }else{
  842 + s.put("ccl", "0.00%");
  843 + s.put("cclzgf","0.00%");
  844 + }
  845 + s.put("jhbc", rs.getInt("jhbcs"));
  846 + s.put("sjbc", rs.getInt("sjbcs"));
  847 + if(rs.getInt("jhbcs")>0){
  848 + s.put("zxl", df.format((float)rs.getInt("sjbcs")/rs.getInt("jhbcs")*100)+"%");
  849 + }else{
  850 + s.put("zxl", "0.00%");
  851 + }
  852 + s.put("sm", "");
  853 + return s;
  854 + }
  855 + });
  856 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  857 +
  858 + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
  859 + int jhcc = 0, sjcc = 0,sjcczgf=0;;
  860 + int jhbc = 0, sjbc = 0;
  861 + int qz = 0;
  862 + int count=0;
  863 + Map<String, String> xlMap=new HashMap<String,String>();
  864 + for(Map<String, Object> m : lists){
  865 + if(nature.equals("0")){
  866 + list.add(m);
  867 + jhcc += Integer.valueOf(m.get("jhcc").toString());
  868 + sjcc += Integer.valueOf(m.get("sjcc").toString());
  869 + jhbc += Integer.valueOf(m.get("jhbc").toString());
  870 + sjbc += Integer.valueOf(m.get("sjbc").toString());
  871 + sjcczgf +=Integer.valueOf(m.get("sjcczgf").toString());
  872 + qz += Integer.valueOf(m.get("qzpcs").toString());
  873 + if(xlMap.get(m.get("xl").toString())==null){
  874 + count++;
  875 + xlMap.put(m.get("xl").toString(), m.get("xl").toString());
  876 + }
  877 + }else if(nature.equals("1")){
  878 + if(lineMap.get(m.get("xl").toString())){
  879 + list.add(m);
  880 + jhcc += Integer.valueOf(m.get("jhcc").toString());
  881 + sjcc += Integer.valueOf(m.get("sjcc").toString());
  882 + jhbc += Integer.valueOf(m.get("jhbc").toString());
  883 + sjbc += Integer.valueOf(m.get("sjbc").toString());
  884 + sjcczgf +=Integer.valueOf(m.get("sjcczgf").toString());
  885 + qz += Integer.valueOf(m.get("qzpcs").toString());
  886 + if(xlMap.get(m.get("xl").toString())==null){
  887 + count++;
  888 + xlMap.put(m.get("xl").toString(), m.get("xl").toString());
  889 + }
  890 + }
  891 + }else{
  892 + if(!lineMap.get(m.get("xl").toString())){
  893 + list.add(m);
  894 + jhcc += Integer.valueOf(m.get("jhcc").toString());
  895 + sjcc += Integer.valueOf(m.get("sjcc").toString());
  896 + jhbc += Integer.valueOf(m.get("jhbc").toString());
  897 + sjbc += Integer.valueOf(m.get("sjbc").toString());
  898 + sjcczgf +=Integer.valueOf(m.get("sjcczgf").toString());
  899 + qz += Integer.valueOf(m.get("qzpcs").toString());
  900 + if(xlMap.get(m.get("xl").toString())==null){
  901 + count++;
  902 + xlMap.put(m.get("xl").toString(), m.get("xl").toString());
  903 + }
  904 + }
  905 + }
  906 +
  907 + }
  908 +
  909 + Map<String, Object> tempMap=new HashMap<String,Object>();
  910 + tempMap.put("rq", "分类汇总");
  911 + tempMap.put("line_", "共" + list.size() + "条线路");
  912 + tempMap.put("xlName", "共" +count + "条线路");
  913 + tempMap.put("jhcc", jhcc);
  914 + tempMap.put("sjcc", sjcc);
  915 + tempMap.put("sjcczgf", sjcczgf);
  916 + tempMap.put("jhbc", jhbc);
  917 + tempMap.put("sjbc", sjbc);
  918 + tempMap.put("qzpcs", qz);
  919 + tempMap.put("sm", "");
  920 + if(jhcc != 0 && sjcc != 0){
  921 + tempMap.put("ccl", df.format(((float)sjcc / jhcc)*100)+"%");
  922 + tempMap.put("cclzgf", df.format(((float)sjcczgf / jhcc)*100)+"%");
  923 + }else{
  924 + tempMap.put("ccl", "0.00%");
  925 + tempMap.put("cclzgf", "0.00%");
  926 + }
  927 + if(jhbc != 0 && sjbc != 0){
  928 + tempMap.put("zxl", df.format(((float)sjbc / jhbc)*100)+"%");
  929 + }else{
  930 + tempMap.put("zxl", "0.00%");
  931 + }
  932 + if (type.equals("export")) {
  933 + String lineName=map.get("lineName").toString();
  934 + ReportUtils ee = new ReportUtils();
  935 + listI.add(list.iterator());
  936 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  937 + ee.excelReplace(listI, new Object[] { tempMap }, path + "mould/calcTurnoutrate.xls", path + "export/"
  938 + + dates + "-" + lineName + "-营运线路出车率统计表.xls");
  939 + }
  940 + list.add(tempMap);
  941 + return list;
  942 + }
  943 +}
  944 +
  945 +class ComparableSheet implements Comparator<Sheet>{
  946 + @Override
  947 + public int compare(Sheet o1, Sheet o2) {
  948 + // TODO Auto-generated method stub
  949 + return (o1.getXlDir()+o1.getRealDate()+o1.getJhsj()).compareTo((o2.getXlDir()+o2.getRealDate()+o2.getJhsj()));
  950 + }
  951 +}
  952 +
  953 +class ComparableZdAcual implements Comparator<ScheduleRealInfo>{
  954 + @Override
  955 + public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
  956 + // TODO Auto-generated method stub
  957 + return o1.getZdsjActualTime().compareTo(o2.getZdsjActualTime());
  958 + }
  959 +}
  960 +
  961 +class ComparableJhZd implements Comparator<ScheduleRealInfo>{
  962 + @Override
  963 + public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
  964 + // TODO Auto-generated method stub
  965 + return o1.getZdsjT().compareTo(o2.getZdsjT());
  966 + }
  967 +}
... ...
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
... ... @@ -1084,14 +1084,21 @@ public class CulateMileageServiceImpl implements CulateMileageService{
1084 1084 while (it.hasNext()) {
1085 1085 ChildTaskPlan childTaskPlan = it.next();
1086 1086 if(!childTaskPlan.isDestroy()){
1087   - if(childTaskPlan.getMileageType().equals("service")){
1088   - ljyy =Arith.add(ljyy,childTaskPlan.getMileage());
1089   - }
1090   - if(childTaskPlan.getMileageType().equals("empty")){
1091   - if(childTaskPlan.getType2().equals("2")||childTaskPlan.getType2().equals("3")){
1092   - ljjcc =Arith.add(ljjcc, childTaskPlan.getMileage());
1093   - }
1094   - }
  1087 + if(childTaskPlan.getCcId()==null){
  1088 + if(childTaskPlan.getMileageType().equals("service")){
  1089 + ljyy =Arith.add(ljyy,childTaskPlan.getMileage());
  1090 + }
  1091 + if(childTaskPlan.getMileageType().equals("empty")){
  1092 + if(childTaskPlan.getType2().equals("2")||childTaskPlan.getType2().equals("3")){
  1093 + ljjcc =Arith.add(ljjcc, childTaskPlan.getMileage());
  1094 + }
  1095 + }
  1096 + if(childTaskPlan.getMileageType().equals("empty")){
  1097 + if(childTaskPlan.getType2().equals("1")){
  1098 + ljkfks =Arith.add(ljkfks, childTaskPlan.getMileage());
  1099 + }
  1100 + }
  1101 + }
1095 1102 }
1096 1103 }
1097 1104 }
... ... @@ -1211,7 +1218,8 @@ public class CulateMileageServiceImpl implements CulateMileageService{
1211 1218 // }else{
1212 1219 if(childTaskPlan.getType2().equals("2")||childTaskPlan.getType2().equals("3")){
1213 1220 if (!childTaskPlan.isDestroy()) {
1214   - if(childTaskPlan.getReason().equals(item)){
  1221 + String reason=childTaskPlan.getReason()==null?"":childTaskPlan.getReason();
  1222 + if(reason.equals(item)){
1215 1223 zrwjcclc=Arith.add(zrwjcclc,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage());
1216 1224 }
1217 1225 }
... ... @@ -1607,5 +1615,55 @@ public class CulateMileageServiceImpl implements CulateMileageService{
1607 1615 }
1608 1616 return ljgl;
1609 1617 }
  1618 +
  1619 + @Override
  1620 + public double culateLjksgl(List<ScheduleRealInfo> lists) {
  1621 + double ljks=0.0;
  1622 + for (int i = 0; i < lists.size(); i++) {
  1623 + ScheduleRealInfo t=lists.get(i);
  1624 + if(t.isSflj()){
  1625 + if(isInOut(t)){
  1626 + Set<ChildTaskPlan> childTaskPlans = t.getcTasks();
  1627 + if(childTaskPlans.isEmpty()){
  1628 + if(!t.isDestroy()){
  1629 + ljks =Arith.add(ljks, t.getJhlc());
  1630 + }
  1631 +
  1632 + }
  1633 + }else{
  1634 + Set<ChildTaskPlan> childTaskPlans = t.getcTasks();
  1635 + if(!childTaskPlans.isEmpty()){
  1636 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  1637 + while (it.hasNext()) {
  1638 + ChildTaskPlan childTaskPlan = it.next();
  1639 + if(!childTaskPlan.isDestroy()){
  1640 + if(childTaskPlan.getMileageType().equals("empty") && childTaskPlan.getCcId()==null){
  1641 + ljks =Arith.add(ljks, childTaskPlan.getMileage());
  1642 + }
  1643 + }
  1644 + }
  1645 + }
  1646 + }
  1647 + }else{
  1648 + Set<ChildTaskPlan> childTaskPlans = t.getcTasks();
  1649 + if(!childTaskPlans.isEmpty()){
  1650 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  1651 + while (it.hasNext()) {
  1652 + ChildTaskPlan childTaskPlan = it.next();
  1653 + if(childTaskPlan.getCcId()==null){
  1654 + if("empty".equals(childTaskPlan.getMileageType())&&"临加".equals(childTaskPlan.getType1())){
  1655 + if (!childTaskPlan.isDestroy()) {
  1656 + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1657 + ljks=Arith.add(ljks,jhgl);
  1658 + }
  1659 + }
  1660 + }
  1661 + }
  1662 + }
  1663 +
  1664 + }
  1665 + }
  1666 + return ljks;
  1667 + }
1610 1668  
1611 1669 }
... ...
src/main/java/com/bsth/service/schedule/EmployeeConfigInfoService.java
... ... @@ -7,8 +7,14 @@ import com.bsth.service.schedule.exception.ScheduleException;
7 7 * Created by xu on 16/5/10.
8 8 */
9 9 public interface EmployeeConfigInfoService extends BService<EmployeeConfigInfo, Long> {
  10 + // 验证驾驶员配置是否重复配置
10 11 void validate_jsy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException;
  12 + // 验证售票员配置是否重复配置
11 13 void validate_spy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException;
  14 + // 验证驾驶员是否配置在指定线路
  15 + void validate_jsy_config(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException;
  16 + // 验证售票员是否配置在指定线路
  17 + void validate_spy_config(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException;
12 18 void toggleCancel(Long id) throws ScheduleException;
13 19 Long getMaxDbbm(Integer xlId);
14 20 }
... ...
src/main/java/com/bsth/service/schedule/impl/CarDeviceServiceImpl.java
... ... @@ -47,6 +47,7 @@ public class CarDeviceServiceImpl extends BServiceImpl&lt;CarDevice, Long&gt; implemen
47 47 }
48 48 param.put("xl_eq", carDevice.getXl());
49 49 param.put("cl_eq", carDevice.getCl());
  50 + param.put("isCancel_eq", false); // 未标记作废删除的
50 51 param.put("qyrq_ge", carDevice.getQyrq());
51 52 if (!CollectionUtils.isEmpty(list(param))) {
52 53 throw new ScheduleException("启用日期必须比历史的启用日期大");
... ...
src/main/java/com/bsth/service/schedule/impl/EmployeeConfigInfoServiceImpl.java
... ... @@ -100,6 +100,18 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl&lt;EmployeeConfigIn
100 100  
101 101 @Transactional
102 102 @Override
  103 + public void validate_jsy_config(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException {
  104 + Map<String, Object> param = new HashMap<>();
  105 + param.put("xl.id_eq", employeeConfigInfo.getXl().getId());
  106 + param.put("jsy.id_eq", employeeConfigInfo.getJsy().getId());
  107 + List<EmployeeConfigInfo> employeeConfigInfos = list(param);
  108 + if (CollectionUtils.isEmpty(employeeConfigInfos)) {
  109 + throw new ScheduleException("驾驶员没有配置在当前线路中,不属于当前线路!");
  110 + }
  111 + }
  112 +
  113 + @Transactional
  114 + @Override
103 115 public void validate_spy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException {
104 116 // 售票员不能重复配置
105 117 Map<String, Object> param = new HashMap<>();
... ... @@ -127,6 +139,18 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl&lt;EmployeeConfigIn
127 139  
128 140 @Transactional
129 141 @Override
  142 + public void validate_spy_config(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException {
  143 + Map<String, Object> param = new HashMap<>();
  144 + param.put("xl.id_eq", employeeConfigInfo.getXl().getId());
  145 + param.put("spy.id_eq", employeeConfigInfo.getSpy().getId());
  146 + List<EmployeeConfigInfo> employeeConfigInfos = list(param);
  147 + if (CollectionUtils.isEmpty(employeeConfigInfos)) {
  148 + throw new ScheduleException("售票员没有配置在当前线路中,不属于当前线路!");
  149 + }
  150 + }
  151 +
  152 + @Transactional
  153 + @Override
130 154 public void delete(Long aLong) throws ScheduleException {
131 155 toggleCancel(aLong);
132 156 }
... ...
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
... ... @@ -26,6 +26,7 @@ import com.bsth.data.BasicData;
26 26 import com.bsth.entity.realcontrol.ScheduleRealInfo;
27 27 import com.bsth.entity.schedule.SchedulePlanInfo;
28 28 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  29 +import com.bsth.service.LineService;
29 30 import com.bsth.service.schedule.PeopleCarPlanService;
30 31 import com.bsth.util.ReportUtils;
31 32  
... ... @@ -36,6 +37,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
36 37 private ScheduleRealInfoRepository scheduleRealInfoRepository;
37 38  
38 39 @Autowired
  40 + private LineService lineService;
  41 +
  42 + @Autowired
39 43 private JdbcTemplate jdbcTemplate;
40 44  
41 45 public List<ScheduleRealInfo> getSchedule(String company, String subCompany, String line, String date){
... ... @@ -47,7 +51,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
47 51 if(line.length() != 0)
48 52 sql += " and xl_bm = '"+line+"'";
49 53 if(company.length() != 0)
50   - sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  54 + sql += " and gs_bm = '"+company+"'";
  55 + if(subCompany.length() != 0)
  56 + sql += " and fgs_bm = '"+subCompany+"'";
  57 +
  58 + sql += " order by gs_bm, fgs_bm, xl_bm";
51 59  
52 60 list = jdbcTemplate.query(sql,
53 61 new RowMapper<ScheduleRealInfo>(){
... ... @@ -56,6 +64,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
56 64 ScheduleRealInfo schedule = new ScheduleRealInfo();
57 65 schedule.setScheduleDateStr(rs.getString("schedule_date_str"));
58 66 schedule.setRealExecDate(rs.getString("real_exec_date"));
  67 + schedule.setXlBm(rs.getString("xl_bm"));
59 68 schedule.setXlName(rs.getString("xl_name"));
60 69 schedule.setLpName(rs.getString("lp_name"));
61 70 schedule.setBcType(rs.getString("bc_type"));
... ... @@ -170,15 +179,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
170 179 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
171 180 List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
172 181  
173   - String company = "";
174   - String subCompany ="";
175   - if(map.get("company")!=null){
176   - company = map.get("company").toString();
177   - }
178   -
179   - if(map.get("subCompany")!=null){
  182 + String company = "", subCompany ="";
  183 + if(map.get("company")!=null)
  184 + company = map.get("company").toString();
  185 + if(map.get("subCompany")!=null)
180 186 subCompany = map.get("subCompany").toString();
181   - }
182 187 String line = map.get("line").toString();
183 188 String date = map.get("date").toString();
184 189 String type = map.get("type").toString();
... ... @@ -193,9 +198,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
193 198 if(line.length() != 0){
194 199 sql += " and xl_bm = '"+line+"'";
195 200 }
196   - if(company.length() != 0){
197   - sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
198   - }
  201 + if(company.length() != 0)
  202 + sql += " and gs_bm = '"+company+"'";
  203 + if(subCompany.length() != 0)
  204 + sql += " and fgs_bm = '"+subCompany+"'";
199 205  
200 206 list = jdbcTemplate.query(sql,
201 207 new RowMapper<SchedulePlanInfo>(){
... ... @@ -322,8 +328,13 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
322 328 Set<String> lineSet = getNotOperation();
323 329 DecimalFormat df = new DecimalFormat("###0.##");
324 330  
325   - String company = map.get("company").toString();
326   - String subCompany = map.get("subCompany").toString();
  331 + String sfyy = "", company = "", subCompany = "";
  332 + if(map.get("sfyy")!=null)
  333 + sfyy = map.get("sfyy").toString();
  334 + if(map.get("company")!=null)
  335 + company = map.get("company").toString();
  336 + if(map.get("subCompany")!=null)
  337 + subCompany = map.get("subCompany").toString();
327 338 String line = map.get("line").toString();
328 339 String date = map.get("date").toString();
329 340 String type = map.get("type").toString();
... ... @@ -332,9 +343,27 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
332 343 date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
333 344 }
334 345  
335   - List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date);
  346 + List<ScheduleRealInfo> schedules = this.getSchedule(company, subCompany, line, date);
  347 + Map<String, Boolean> lineNature = lineService.lineNature();
336 348  
  349 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
337 350 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
  351 +
  352 + //是否营运
  353 + for(ScheduleRealInfo schedule : schedules){
  354 + String xlbm = schedule.getXlBm();
  355 + if(sfyy.length() == 0 || sfyy.equals("0")){
  356 + list.add(schedule);
  357 + } else if(sfyy.equals("1")){
  358 + if(lineNature.containsKey(xlbm) && lineNature.get(xlbm)){
  359 + list.add(schedule);
  360 + }
  361 + } else {
  362 + if(lineNature.containsKey(xlbm) && !lineNature.get(xlbm)){
  363 + list.add(schedule);
  364 + }
  365 + }
  366 + }
338 367 for(ScheduleRealInfo schedule : list){
339 368 String key = schedule.getXlName();
340 369 if(key == null || key.trim().equals("") || lineSet.contains(key))
... ... @@ -573,16 +602,19 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
573 602 }
574 603 try {
575 604  
576   - String sql = "select schedule_date_str,xl_name,bc_type,gs_name,fgs_name,bcs,fcno,"
577   - +"fcsj,fcsj_actual,zdsj,zdsj_actual,bcsj,qdz_name,sp_id,cc_service"
  605 + String sql = "select schedule_date_str,xl_name,bc_type,gs_name,fgs_name,fgs_bm,bcs,"
  606 + +"fcno,fcsj,fcsj_actual,zdsj,zdsj_actual,bcsj,qdz_name,sp_id,cc_service"
578 607 +" from bsth_c_s_sp_info_real where schedule_date_str >= '"+startDate
579 608 +"' and schedule_date_str <= '"+endDate+"'";
580 609 if(line.length() != 0){
581 610 sql += " and xl_bm = '"+line+"'";
582 611 }
583   -// if(company.length() != 0){
584   - sql += " and gs_bm like '%"+company+"%' and fgs_bm like '%"+subCompany+"%'";
585   -// }
  612 + if(company.length() != 0){
  613 + sql += " and gs_bm = '"+company+"'";
  614 + }
  615 + if(subCompany.length() != 0){
  616 + sql += " and fgs_bm = '"+subCompany+"'";
  617 + }
586 618 sql += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'";
587 619 if(Integer.valueOf(bcType) == 1){
588 620 sql += " and bc_type != 'region'";
... ... @@ -599,6 +631,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
599 631 schedule.setBcType(rs.getString("bc_type"));
600 632 schedule.setGsName(rs.getString("gs_name"));
601 633 schedule.setFgsName(rs.getString("fgs_name"));
  634 + schedule.setFgsBm(rs.getString("fgs_bm"));
602 635 schedule.setBcs(rs.getInt("bcs"));
603 636 schedule.setFcno(rs.getInt("fcno"));
604 637 schedule.setFcsj(rs.getString("fcsj"));
... ... @@ -676,22 +709,23 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
676 709 if(schedule.isCcService()){
677 710 continue;
678 711 }
  712 +
  713 + String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj()+"/"+schedule.getFgsBm();
679 714 if(model.length() != 0){
680 715 if(ttSet.contains(schedule.getSpId())){
681   - String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj();
682 716 if(!keyMap.containsKey(key))
683 717 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
684 718 keyMap.get(key).add(schedule);
685 719 }
686 720 } else {
687   - String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj();
688   - if(!keyMap.containsKey(key))
  721 + if(!keyMap.containsKey(key)){
689 722 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
  723 + }
690 724 keyMap.get(key).add(schedule);
691 725 }
692 726 }
693   - String companyName = "", subCompanyName = "";
694 727 for(String key : keyMap.keySet()){
  728 + String companyName = "", subCompanyName = "";
695 729 Map<String, Object> tempMap = new HashMap<String, Object>();
696 730 List<Integer> fcsj = new ArrayList<Integer>();
697 731 List<Integer> yssj = new ArrayList<Integer>();
... ... @@ -777,7 +811,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
777 811 Map<String, List<Map<String, Object>>> listMap = new HashMap<String, List<Map<String, Object>>>();
778 812 Map<String, List<Map<String, Object>>> listMap2 = new HashMap<String, List<Map<String, Object>>>();
779 813 for(Map<String, Object> m : tempList){
780   - String key = m.get("line").toString() + m.get("qdz");
  814 + String key = m.get("line").toString() + m.get("qdz") + m.get("subCompany");
781 815 if(!listMap.containsKey(key))
782 816 listMap.put(key, new ArrayList<Map<String, Object>>());
783 817 listMap.get(key).add(m);
... ... @@ -889,9 +923,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
889 923 if(nbbm.length() != 0){
890 924 sql += " and cl_zbh like '%"+nbbm+"%'";
891 925 }
892   -// if(company.length() != 0){
893   - sql += " and gs_bm like '%"+company+"%' and fgs_bm like '%"+subCompany+"%'";
894   -// }
  926 + if(company.length() != 0){
  927 + sql += " and gs_bm like '"+company+"'";
  928 + }
  929 + if(subCompany.length() != 0){
  930 + sql += " and fgs_bm like '"+subCompany+"'";
  931 + }
895 932 sql += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'";
896 933 if(bcType.trim().equals("1")){
897 934 sql += " and bc_type != 'region'";
... ... @@ -1209,10 +1246,13 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1209 1246 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
1210 1247 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
1211 1248  
1212   - Set<String> lineSet = getNotOperation();
1213   -
1214   - String company = map.get("company").toString();
1215   - String subCompany = map.get("subCompany").toString();
  1249 + String sfyy = "", company = "", subCompany = "";
  1250 + if(map.get("sfyy")!=null)
  1251 + sfyy = map.get("sfyy").toString();
  1252 + if(map.get("company")!=null)
  1253 + company = map.get("company").toString();
  1254 + if(map.get("subCompany")!=null)
  1255 + subCompany = map.get("subCompany").toString();
1216 1256 String line = map.get("line").toString();
1217 1257 String date = map.get("date").toString();
1218 1258 String type = map.get("type").toString();
... ... @@ -1222,13 +1262,15 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1222 1262  
1223 1263 try {
1224 1264 String sql = "select a.schedule_date_str, a.real_exec_date, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, a.gs_name, a.fgs_name,"
1225   - + " a.cc_service, b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b on a.xl_bm = b.line"
  1265 + + " a.xl_bm, a.fgs_bm, a.cc_service, b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b on a.xl_bm = b.line"
1226 1266 + " where schedule_date_str = '"+date+"'"
1227 1267 + " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'";
1228 1268 if(line.trim().length() != 0)
1229 1269 sql += " and xl_bm = '"+line+"'";
1230   - else if(company.length() != 0)
1231   - sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  1270 + if(company.length() != 0)
  1271 + sql += " and gs_bm = '"+company+"'";
  1272 + if(subCompany.length() != 0)
  1273 + sql += " and fgs_bm = '"+subCompany+"'";
1232 1274  
1233 1275 list = jdbcTemplate.query(sql,
1234 1276 new RowMapper<ScheduleRealInfo>(){
... ... @@ -1238,6 +1280,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1238 1280 schedule.setScheduleDateStr(rs.getString("schedule_date_str"));
1239 1281 schedule.setRealExecDate(rs.getString("real_exec_date"));
1240 1282 schedule.setXlName(rs.getString("xl_name"));
  1283 + schedule.setXlBm(rs.getString("xl_Bm"));
1241 1284 schedule.setFcsj(rs.getString("fcsj"));
1242 1285 schedule.setFcsjActual(rs.getString("fcsj_actual"));
1243 1286 schedule.setZdsj(rs.getString("zdsj"));
... ... @@ -1248,6 +1291,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1248 1291 schedule.setStatus(rs.getInt("status"));
1249 1292 schedule.setGsName(rs.getString("gs_name"));
1250 1293 schedule.setFgsName(rs.getString("fgs_name"));
  1294 + schedule.setFgsBm(rs.getString("fgs_bm"));
1251 1295 schedule.setCcService(rs.getBoolean("cc_service"));
1252 1296  
1253 1297 int startOpt = 0;
... ... @@ -1287,26 +1331,54 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1287 1331 }
1288 1332  
1289 1333 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
1290   - String companyName = "", subCompanyName = "";
  1334 + Map<String, Boolean> lineNature = lineService.lineNature();
1291 1335  
1292 1336 for(ScheduleRealInfo s : list){
1293   - if(lineSet.contains(s.getXlName()) || s.isCcService()){
  1337 + if(s.isCcService()){
1294 1338 continue;
1295 1339 }
1296   - String xlName = s.getXlName();
1297   - if(!keyMap.containsKey(xlName))
1298   - keyMap.put(xlName, new ArrayList<ScheduleRealInfo>());
1299   - keyMap.get(xlName).add(s);
1300   - if(companyName.length()==0&&s.getGsName()!=null&&s.getGsName().trim().length()!=0)
1301   - companyName = s.getGsName();
1302   - if(subCompanyName.length()==0&&s.getFgsName()!=null&&s.getFgsName().trim().length()!=0)
1303   - subCompanyName = s.getFgsName();
  1340 +
  1341 + String xlbm = s.getXlBm();
  1342 + boolean flag = false;
  1343 + if(sfyy.length() == 0 || sfyy.equals("0")){
  1344 + flag = true;
  1345 + } else if(sfyy.equals("1")){
  1346 + if(lineNature.containsKey(xlbm) && lineNature.get(xlbm)){
  1347 + flag = true;
  1348 + }
  1349 + } else {
  1350 + if(lineNature.containsKey(xlbm) && !lineNature.get(xlbm)){
  1351 + flag = true;
  1352 + }
  1353 + }
  1354 + if(!flag){
  1355 + continue;
  1356 + }
  1357 +
  1358 + String key = s.getXlName() + "/" + s.getXlBm() + "/" + s.getFgsBm();
  1359 + if(!keyMap.containsKey(key)){
  1360 + keyMap.put(key, new ArrayList<ScheduleRealInfo>());
  1361 + }
  1362 + keyMap.get(key).add(s);
1304 1363 }
1305 1364  
1306   - for(String xlName : keyMap.keySet()){
  1365 + //给key排序
  1366 + List<Long> longList = new ArrayList<Long>();
  1367 + Map<Long, String> longMap = new HashMap<Long, String>();
  1368 + for(String key : keyMap.keySet()){
  1369 + String[] keys = key.split("/");
  1370 + Long l = Long.valueOf(keys[2]) * 10000000000l + Long.valueOf(keys[1]);
  1371 + longMap.put(l, key);
  1372 + longList.add(l);
  1373 + }
  1374 + Collections.sort(longList);
  1375 +
  1376 + for(Long l : longList){
  1377 + String key = longMap.get(l);
1307 1378 Map<String, Object> tempMap = new HashMap<String, Object>();
  1379 + String[] keys = key.split("/");
1308 1380 tempMap.put("date", date.substring(5));
1309   - tempMap.put("line", xlName);
  1381 + tempMap.put("line", keys[0]);
1310 1382 List<Long> up1 = new ArrayList<Long>();
1311 1383 List<Long> up2 = new ArrayList<Long>();
1312 1384 List<Long> dn1 = new ArrayList<Long>();
... ... @@ -1315,7 +1387,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1315 1387 Map<Long, ScheduleRealInfo> up2Map = new HashMap<Long, ScheduleRealInfo>();
1316 1388 Map<Long, ScheduleRealInfo> dn1Map = new HashMap<Long, ScheduleRealInfo>();
1317 1389 Map<Long, ScheduleRealInfo> dn2Map = new HashMap<Long, ScheduleRealInfo>();
1318   - for(ScheduleRealInfo s : keyMap.get(xlName)){
  1390 + String companyName = "", subCompanyName = "";
  1391 + for(ScheduleRealInfo s : keyMap.get(key)){
  1392 + if(companyName.length()==0&&s.getGsName()!=null&&s.getGsName().trim().length()!=0)
  1393 + companyName = s.getGsName();
  1394 + if(subCompanyName.length()==0&&s.getFgsName()!=null&&s.getFgsName().trim().length()!=0)
  1395 + subCompanyName = s.getFgsName();
1319 1396 if(s.getXlDir().equals("0")){
1320 1397 up1.add(s.getFcsjT());
1321 1398 up1Map.put(s.getFcsjT(), s);
... ... @@ -1389,7 +1466,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1389 1466 tempMap.put("company", companyName);
1390 1467 tempMap.put("subCompany", subCompanyName);
1391 1468 tempMap.put("date", date);
1392   - tempMap.put("line", xlName);
  1469 + tempMap.put("line", keys[0]);
1393 1470 resList.add(tempMap);
1394 1471 }
1395 1472  
... ... @@ -1425,10 +1502,13 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1425 1502 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
1426 1503 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
1427 1504  
1428   - Set<String> lineSet = getNotOperation();
1429   -
1430   - String company = map.get("company").toString();
1431   - String subCompany = map.get("subCompany").toString();
  1505 + String sfyy = "", company = "", subCompany = "";
  1506 + if(map.get("sfyy")!=null)
  1507 + sfyy = map.get("sfyy").toString();
  1508 + if(map.get("company")!=null)
  1509 + company = map.get("company").toString();
  1510 + if(map.get("subCompany")!=null)
  1511 + subCompany = map.get("subCompany").toString();
1432 1512 String line = map.get("line").toString();
1433 1513 // String date = map.get("date").toString();
1434 1514 String startDate = map.get("startDate").toString();
... ... @@ -1453,13 +1533,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1453 1533  
1454 1534 try {
1455 1535 String sql = "select a.schedule_date_str, a.real_exec_date, a.xl_bm, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, a.gs_name, a.fgs_name,"
1456   - + " a.cc_service, a.remarks, a.adjust_exps, b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b on a.xl_bm = b.line"
  1536 + + " a.fgs_bm, a.cc_service, a.remarks, a.adjust_exps, b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b "
  1537 + + " on a.xl_bm = b.line"
1457 1538 + " where schedule_date_str >= '"+startDate+"' and schedule_date_str <= '"+endDate+"'"
1458 1539 + " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'";
1459 1540 if(line.length() != 0)
1460 1541 sql += " and xl_bm = '"+line+"'";
1461 1542 if(company.length() != 0)
1462   - sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  1543 + sql += " and gs_bm = '"+company+"'";
  1544 + if(subCompany.length() != 0)
  1545 + sql += " and fgs_bm = '"+subCompany+"'";
1463 1546  
1464 1547 list = jdbcTemplate.query(sql,
1465 1548 new RowMapper<ScheduleRealInfo>(){
... ... @@ -1480,6 +1563,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1480 1563 schedule.setStatus(rs.getInt("status"));
1481 1564 schedule.setGsName(rs.getString("gs_name"));
1482 1565 schedule.setFgsName(rs.getString("fgs_name"));
  1566 + schedule.setFgsBm(rs.getString("fgs_bm"));
1483 1567 schedule.setCcService(rs.getBoolean("cc_service"));
1484 1568 schedule.setRemarks(rs.getString("remarks")!=null?rs.getString("remarks"):"");
1485 1569 schedule.setAdjustExps(rs.getString("adjust_exps")!=null?rs.getString("adjust_exps"):"");
... ... @@ -1520,36 +1604,67 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1520 1604 e.printStackTrace();
1521 1605 }
1522 1606  
  1607 + Map<String, Boolean> lineNature = lineService.lineNature();
1523 1608 Map<String, Map<String, List<ScheduleRealInfo>>> keyMap = new HashMap<String, Map<String,List<ScheduleRealInfo>>>();
1524 1609 Map<String, String> xlMap = new HashMap<String, String>();
1525   - String companyName = "", subCompanyName = "";
1526 1610  
1527 1611 for(ScheduleRealInfo s : list){
1528   - if(lineSet.contains(s.getXlName()) || s.isCcService()){
  1612 + if(s.isCcService()){
1529 1613 continue;
1530 1614 }
1531   - String xlName = s.getXlName();
  1615 +
  1616 + boolean flag = false;
  1617 + String xlbm = s.getXlBm();
  1618 + if(sfyy.length() == 0 || sfyy.equals("0")){
  1619 + flag = true;
  1620 + } else if(sfyy.equals("1")){
  1621 + if(lineNature.containsKey(xlbm) && lineNature.get(xlbm)){
  1622 + flag = true;
  1623 + }
  1624 + } else {
  1625 + if(lineNature.containsKey(xlbm) && !lineNature.get(xlbm)){
  1626 + flag = true;
  1627 + }
  1628 + }
  1629 + if(!flag){
  1630 + continue;
  1631 + }
  1632 +
  1633 + String key = s.getXlName() + "/" + s.getXlBm() + "/" + s.getFgsBm();
1532 1634 String date = s.getScheduleDateStr();
1533   - if(!keyMap.containsKey(xlName))
1534   - keyMap.put(xlName, new HashMap<String, List<ScheduleRealInfo>>());
1535   - if(!keyMap.get(xlName).containsKey(date))
1536   - keyMap.get(xlName).put(date, new ArrayList<ScheduleRealInfo>());
1537   - keyMap.get(xlName).get(date).add(s);
1538   - if(companyName.length()==0&&s.getGsName()!=null&&s.getGsName().trim().length()!=0)
1539   - companyName = s.getGsName();
1540   - if(subCompanyName.length()==0&&s.getFgsName()!=null&&s.getFgsName().trim().length()!=0)
1541   - subCompanyName = s.getFgsName();
1542   - xlMap.put(xlName, s.getXlBm());
  1635 + if(!keyMap.containsKey(key)){
  1636 + keyMap.put(key, new HashMap<String, List<ScheduleRealInfo>>());
  1637 + }
  1638 + if(!keyMap.get(key).containsKey(date)){
  1639 + keyMap.get(key).put(date, new ArrayList<ScheduleRealInfo>());
  1640 + }
  1641 + keyMap.get(key).get(date).add(s);
  1642 +
  1643 + xlMap.put(key, s.getXlBm());
1543 1644 }
1544 1645  
  1646 + //给key排序
  1647 + List<Long> longList = new ArrayList<Long>();
  1648 + Map<Long, String> longMap = new HashMap<Long, String>();
  1649 + for(String key : keyMap.keySet()){
  1650 + String[] keys = key.split("/");
  1651 + Long l = Long.valueOf(keys[2]) * 10000000000l + Long.valueOf(keys[1]);
  1652 + longMap.put(l, key);
  1653 + longList.add(l);
  1654 + }
  1655 + Collections.sort(longList);
  1656 +
  1657 +
1545 1658 List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
1546   - for(String xlName : keyMap.keySet()){
  1659 + for(Long tempLong : longList){
  1660 + String key = longMap.get(tempLong);
  1661 + String companyName = "", subCompanyName = "";
1547 1662 List<Map<String, Object>> tempList = new ArrayList<Map<String,Object>>();
1548 1663 Map<String, Object> tempMap = new HashMap<String, Object>();
1549 1664 Map<Long, String> dateMap = new HashMap<Long, String>();
1550 1665 List<Long> Longs = new ArrayList<Long>();
1551 1666 int jhbc = 0, sjbc = 0;
1552   - for(String date : keyMap.get(xlName).keySet()){
  1667 + for(String date : keyMap.get(key).keySet()){
1553 1668 String[] split = date.split("-");
1554 1669 long l = Long.valueOf(split[0])*10000 + Long.valueOf(split[1])*100 + Long.valueOf(split[2]);
1555 1670 dateMap.put(l, date);
... ... @@ -1559,10 +1674,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1559 1674 for(long l : Longs){
1560 1675 String date = dateMap.get(l);
1561 1676 Map<String, Object> temp = new HashMap<String, Object>();
  1677 + String[] keys = key.split("/");
1562 1678 temp.put("date", date.substring(5));
1563 1679 temp.put("dates", date);
1564   - temp.put("line", xlName);
1565   - temp.put("xlbm", xlMap.get(xlName));
  1680 + temp.put("line", keys[0]);
  1681 + temp.put("xlbm", xlMap.get(key));
1566 1682 List<Long> up1 = new ArrayList<Long>();
1567 1683 List<Long> up2 = new ArrayList<Long>();
1568 1684 List<Long> dn1 = new ArrayList<Long>();
... ... @@ -1571,7 +1687,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1571 1687 Map<Long, ScheduleRealInfo> up2Map = new HashMap<Long, ScheduleRealInfo>();
1572 1688 Map<Long, ScheduleRealInfo> dn1Map = new HashMap<Long, ScheduleRealInfo>();
1573 1689 Map<Long, ScheduleRealInfo> dn2Map = new HashMap<Long, ScheduleRealInfo>();
1574   - for(ScheduleRealInfo s : keyMap.get(xlName).get(date)){
  1690 + for(ScheduleRealInfo s : keyMap.get(key).get(date)){
  1691 + if(companyName.length()==0&&s.getGsName()!=null&&s.getGsName().trim().length()!=0)
  1692 + companyName = s.getGsName();
  1693 + if(subCompanyName.length()==0&&s.getFgsName()!=null&&s.getFgsName().trim().length()!=0)
  1694 + subCompanyName = s.getFgsName();
  1695 +
1575 1696 if(s.getXlDir().equals("0")){
1576 1697 up1.add(s.getFcsjT());
1577 1698 up1Map.put(s.getFcsjT(), s);
... ... @@ -1612,7 +1733,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1612 1733 Map<String, Object> m = new HashMap<String, Object>();
1613 1734 m.put("date", date.substring(5));
1614 1735 m.put("dates", date);
1615   - m.put("line", xlName);
  1736 + m.put("line", keys[0]);
  1737 + m.put("company", companyName);
  1738 + m.put("subCompany", subCompanyName);
1616 1739 m.put("firstOrLast", "上行首发");
1617 1740 m.put("qdz", s1.getQdzName());
1618 1741 m.put("jhfc", s1.getFcsj());
... ... @@ -1629,7 +1752,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1629 1752 Map<String, Object> m = new HashMap<String, Object>();
1630 1753 m.put("date", date.substring(5));
1631 1754 m.put("dates", date);
1632   - m.put("line", xlName);
  1755 + m.put("line", keys[0]);
  1756 + m.put("company", companyName);
  1757 + m.put("subCompany", subCompanyName);
1633 1758 m.put("firstOrLast", "上行末发");
1634 1759 m.put("qdz", s3.getQdzName());
1635 1760 m.put("jhfc", s3.getFcsj());
... ... @@ -1674,7 +1799,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1674 1799 Map<String, Object> m = new HashMap<String, Object>();
1675 1800 m.put("date", date.substring(5));
1676 1801 m.put("dates", date);
1677   - m.put("line", xlName);
  1802 + m.put("line", keys[0]);
  1803 + m.put("company", companyName);
  1804 + m.put("subCompany", subCompanyName);
1678 1805 m.put("firstOrLast", "下行首发");
1679 1806 m.put("qdz", s1.getQdzName());
1680 1807 m.put("jhfc", s1.getFcsj());
... ... @@ -1692,7 +1819,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1692 1819 Map<String, Object> m = new HashMap<String, Object>();
1693 1820 m.put("date", date.substring(5));
1694 1821 m.put("dates", date);
1695   - m.put("line", xlName);
  1822 + m.put("line", keys[0]);
  1823 + m.put("company", companyName);
  1824 + m.put("subCompany", subCompanyName);
1696 1825 m.put("firstOrLast", "下行末发");
1697 1826 m.put("qdz", s3.getQdzName());
1698 1827 m.put("jhfc", s3.getFcsj());
... ... @@ -1718,11 +1847,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1718 1847 continue;
1719 1848 tempList.add(temp);
1720 1849 }
  1850 + String[] keys = key.split("/");
1721 1851 tempMap.put("map", tempList);
1722 1852 tempMap.put("company", companyName);
1723 1853 tempMap.put("subCompany", subCompanyName);
1724   - tempMap.put("xlbm", xlMap.get(xlName));
1725   - tempMap.put("line", xlName);
  1854 + tempMap.put("xlbm", xlMap.get(key));
  1855 + tempMap.put("line", keys[0]);
1726 1856 tempMap.put("date", dates);
1727 1857 tempMap.put("jhbc", jhbc);
1728 1858 tempMap.put("sjbc", sjbc);
... ... @@ -1744,8 +1874,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1744 1874 tempMap.put("zdl", (jhbc<1?"0":nf.format((float) sjbc / jhbc * 100)) + "%");
1745 1875 for(Map<String, Object> m : mapList){
1746 1876 m.put("no", ++i);
1747   - m.put("company", companyName);
1748   - m.put("subCompany", subCompanyName);
  1877 +// m.put("company", companyName);
  1878 +// m.put("subCompany", subCompanyName);
1749 1879 }
1750 1880 tempMap.put("map", mapList);
1751 1881 if(!type.equals("export"))
... ... @@ -1844,7 +1974,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1844 1974 sql += " and cl_zbh = '"+code+"'";
1845 1975 }
1846 1976 if(company.length() != 0){
1847   - sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  1977 + sql += " and gs_bm = '"+company+"'";
  1978 + }
  1979 + if(subCompany.length() != 0){
  1980 + sql += " and fgs_bm = '"+subCompany+"'";
1848 1981 }
1849 1982 sql += " union " +
1850 1983 "select r.id, r.schedule_date_str, r.xl_name, r.cl_zbh, r.j_gh, r.j_name, r.fcsj, d.timestamp, d.reply46, d.reply47, d.reply46time, d.reply47time, r.gs_name, r.fgs_name " +
... ... @@ -1856,7 +1989,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1856 1989 sql += " and cl_zbh = '"+code+"'";
1857 1990 }
1858 1991 if(company.length() != 0){
1859   - sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  1992 + sql += " and gs_bm = '"+company+"'";
  1993 + }
  1994 + if(subCompany.length() != 0){
  1995 + sql += " and fgs_bm = '"+subCompany+"'";
1860 1996 }
1861 1997 sql += " order by xl_name, fcsj";
1862 1998  
... ... @@ -1998,11 +2134,17 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1998 2134 return resList;
1999 2135 }
2000 2136 */
  2137 +
2001 2138 @Override
2002 2139 public List<Map<String, Object>> commandState(Map<String, Object> map) {
2003 2140 // TODO Auto-generated method stub
2004   - String company = map.get("company").toString();
2005   - String subCompany = map.get("subCompany").toString();
  2141 + String sfyy = "", company = "", subCompany = "";
  2142 + if(map.get("sfyy")!=null)
  2143 + sfyy=map.get("sfyy").toString();
  2144 + if(map.get("company")!=null)
  2145 + company=map.get("company").toString();
  2146 + if(map.get("subCompany")!=null)
  2147 + subCompany=map.get("subCompany").toString();
2006 2148 String line = map.get("line").toString().trim();
2007 2149 String date = map.get("date").toString();
2008 2150 // String code = map.get("code").toString();
... ... @@ -2010,18 +2152,22 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2010 2152  
2011 2153 String sql_="select * from bsth_c_s_sp_info_real "
2012 2154 + " WHERE schedule_date_str = '"+date+"' ";
2013   - if(line.equals("")){
2014   - sql_ += "and gs_bm='"+company+"'and fgs_bm='"+subCompany+"'";
2015   - }else{
  2155 + if(!line.equals("")){
2016 2156 sql_ += " and xl_bm = '"+line+"'";
2017 2157 }
  2158 + if(company.length() != 0){
  2159 + sql_ += " and gs_bm='"+company+"'";
  2160 + }
  2161 + if(subCompany.length() != 0){
  2162 + sql_ += " and fgs_bm='"+subCompany+"'";
  2163 + }
2018 2164  
2019 2165  
2020 2166 String sql="SELECT r.id,r.schedule_date_str,r.xl_name,r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.fcsj,"
2021 2167 + " r.gs_name,r.fgs_name,CONCAT(r.xl_bm,'_',r.id) as line_sch FROM ("+sql_+") AS r"
2022   - + " order by r.xl_name,r.id ";
  2168 + + " order by r.gs_bm,r.fgs_bm,r.xl_bm,r.id ";
2023 2169  
2024   - List<Map<String, Object>> list = jdbcTemplate.query(sql,
  2170 + List<Map<String, Object>> tempList = jdbcTemplate.query(sql,
2025 2171 new RowMapper<Map<String, Object>>(){
2026 2172 @Override
2027 2173 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
... ... @@ -2050,6 +2196,23 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2050 2196 e.printStackTrace();
2051 2197 }
2052 2198  
  2199 + Map<String, Boolean> lineNature = lineService.lineNature();
  2200 + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
  2201 + for(Map<String, Object> m : tempList){
  2202 + String xlbm = m.get("xlbm").toString();
  2203 + if(sfyy.length() == 0 || sfyy.equals("0")){
  2204 + list.add(m);
  2205 + } else if(sfyy.equals("1")){
  2206 + if(lineNature.containsKey(xlbm) && lineNature.get(xlbm)){
  2207 + list.add(m);
  2208 + }
  2209 + } else {
  2210 + if(lineNature.containsKey(xlbm) && !lineNature.get(xlbm)){
  2211 + list.add(m);
  2212 + }
  2213 + }
  2214 + }
  2215 +
2053 2216 long min = 0, max = 0;
2054 2217 for(Map<String, Object> m : list){
2055 2218 long l = Long.valueOf(m.get("id").toString());
... ... @@ -2411,7 +2574,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2411 2574 String jgh = map.get("jgh").toString();
2412 2575 // String code = map.get("code").toString();
2413 2576 String type = "";
2414   - if(map.containsKey("type"))
  2577 + if(map.get("type")!=null)
2415 2578 type = map.get("type").toString().trim();
2416 2579  
2417 2580 String sql_="select * from bsth_c_s_sp_info_real "
... ... @@ -2420,7 +2583,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2420 2583 if(!line.equals("")){
2421 2584 sql_ +=" and xl_bm = '"+line+"'";
2422 2585 }
2423   -
  2586 +
2424 2587  
2425 2588 String sql="SELECT r.id,r.schedule_date_str,r.fcsj,r.xl_name,r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,"
2426 2589 + " r.fcsj,d. TIMESTAMP,d.reply46,d.reply47,d.reply46time,d.reply47time,"
... ...
src/main/java/com/bsth/service/schedule/plan/DroolsSchedulePlan.java
... ... @@ -475,6 +475,9 @@ public class DroolsSchedulePlan {
475 475 * @param schedulePlan
476 476 */
477 477 public void validPlanResult(PlanResult planResult) {
  478 + // 1-0、获取路牌信息
  479 + LpInfoResults_output lpInfoResults_output = (LpInfoResults_output) this.ttInfoOutput(this.mainLine)[1];
  480 +
478 481 // 1-1、构造drools规则输入数据,输出数据
479 482 ValidateParam validateParam = new ValidateParam(
480 483 new DateTime(this.from), new DateTime(this.to));
... ... @@ -494,6 +497,9 @@ public class DroolsSchedulePlan {
494 497 for (SchedulePlanInfo schedulePlanInfo: planResult.getSchedulePlanInfos()) {
495 498 session.insert(schedulePlanInfo);
496 499 }
  500 + for (LpInfoResult_output lpInfoResult_output: lpInfoResults_output.getLpInfoResult_outputs()) {
  501 + session.insert(lpInfoResult_output);
  502 + }
497 503  
498 504 // 执行rule
499 505 session.fireAllRules();
... ...
src/main/java/com/bsth/service/schedule/rules/ttinfo/LpInfoResult_output.java
... ... @@ -10,6 +10,8 @@ public class LpInfoResult_output {
10 10 private DateTime dateTime;
11 11 /** 路牌Id */
12 12 private String lpId;
  13 + /** 路牌名字 */
  14 + private String lpName;
13 15 /** 线路Id */
14 16 private String xlId;
15 17 /** 时刻表Id */
... ... @@ -56,4 +58,12 @@ public class LpInfoResult_output {
56 58 public void setTtInfoName(String ttInfoName) {
57 59 this.ttInfoName = ttInfoName;
58 60 }
  61 +
  62 + public String getLpName() {
  63 + return lpName;
  64 + }
  65 +
  66 + public void setLpName(String lpName) {
  67 + this.lpName = lpName;
  68 + }
59 69 }
... ...
src/main/java/com/bsth/service/schedule/rules/ttinfo/LpInfoResultsFunction.java
... ... @@ -64,6 +64,7 @@ public class LpInfoResultsFunction implements AccumulateFunction {
64 64 if (lpInfoResultsData.lpInfoResult_outputMap.get(ttInfoDetail.getLp().getId()) == null) {
65 65 LpInfoResult_output lpInfoResult_output = new LpInfoResult_output();
66 66 lpInfoResult_output.setLpId(String.valueOf(ttInfoDetail.getLp().getId()));
  67 + lpInfoResult_output.setLpName(ttInfoDetail.getLp().getLpName());
67 68 lpInfoResult_output.setXlId(String.valueOf(ttInfoDetail.getXl().getId()));
68 69 lpInfoResult_output.setTtInfoId(String.valueOf(ttInfoDetail.getTtinfo().getId()));
69 70 lpInfoResult_output.setTtInfoName(ttInfoDetail.getTtinfo().getName());
... ...
src/main/java/com/bsth/service/schedule/rules/validate/ValidWantLpFunction.java 0 → 100644
  1 +package com.bsth.service.schedule.rules.validate;
  2 +
  3 +import com.bsth.entity.schedule.SchedulePlanInfo;
  4 +import com.bsth.service.schedule.rules.ttinfo.LpInfoResult_output;
  5 +import org.kie.api.runtime.rule.AccumulateFunction;
  6 +
  7 +import java.io.*;
  8 +import java.text.SimpleDateFormat;
  9 +import java.util.*;
  10 +
  11 +/**
  12 + * 计算缺少路牌错误。
  13 + * 同一天,如果有时刻表路牌没有执行到,统计。
  14 + * 注意:使用这个函数时,要一天计算一次,多天计算无意义。
  15 + */
  16 +public class ValidWantLpFunction implements AccumulateFunction {
  17 + @Override
  18 + public void writeExternal(ObjectOutput out) throws IOException {
  19 + }
  20 +
  21 + @Override
  22 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  23 +
  24 + }
  25 +
  26 + protected static class WantLpInfo implements Externalizable {
  27 + /** 错误描述 */
  28 + public List<ValidateResults_output.ValidInfo> validInfoList = new ArrayList<>();
  29 + /** 每天的路牌班次数量 */
  30 + public Map<String, Integer> lpBcCount = new HashMap<>();
  31 + /** 每天的路牌名字对应 */
  32 + public Map<String, String> lpNamesMap = new HashMap<>();
  33 + /** 排班日期 */
  34 + public Date scheduleDate;
  35 +
  36 + public WantLpInfo() {
  37 +
  38 + }
  39 +
  40 + @Override
  41 + public void writeExternal(ObjectOutput out) throws IOException {
  42 + out.writeObject(validInfoList);
  43 + }
  44 +
  45 + @Override
  46 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  47 + validInfoList = (List<ValidateResults_output.ValidInfo>) in.readObject();
  48 + }
  49 + }
  50 +
  51 + @Override
  52 + public Serializable createContext() {
  53 + return new WantLpInfo();
  54 + }
  55 +
  56 + @Override
  57 + public void init(Serializable serializable) throws Exception {
  58 + // TODO:
  59 +// System.out.println("init");
  60 + }
  61 +
  62 + @Override
  63 + public void accumulate(Serializable context, Object o) {
  64 + WantLpInfo wantLpInfo = (WantLpInfo) context;
  65 + ValidateResource validateResource = (ValidateResource) o;
  66 +
  67 + SchedulePlanInfo spi = validateResource.getSpi();
  68 + List<LpInfoResult_output> lpiList = validateResource.getLpiList();
  69 +
  70 + // 获取当天所有路牌信息,每个验证对象都带当天所有路牌信息,只需判定一次
  71 + if (wantLpInfo.lpNamesMap.isEmpty()) {
  72 + for (LpInfoResult_output lpInfoResult_output: lpiList) {
  73 + wantLpInfo.lpNamesMap.put(lpInfoResult_output.getLpId(), lpInfoResult_output.getLpName());
  74 + wantLpInfo.lpBcCount.put(lpInfoResult_output.getLpId(), 0);
  75 + }
  76 + }
  77 + if (wantLpInfo.scheduleDate == null) {
  78 + wantLpInfo.scheduleDate = spi.getScheduleDate();
  79 + }
  80 +
  81 + // 累计记录每个排班班次出现次数
  82 + String lpId_spi = spi.getLp().toString();
  83 + wantLpInfo.lpBcCount.put(lpId_spi, wantLpInfo.lpBcCount.get(lpId_spi) + 1);
  84 +
  85 + }
  86 +
  87 + @Override
  88 + public boolean supportsReverse() {
  89 + return true;
  90 + }
  91 +
  92 + @Override
  93 + public void reverse(Serializable context, Object o) throws Exception {
  94 + WantLpInfo wantLpInfo = (WantLpInfo) context;
  95 +
  96 + // 清空数据,下一天继续迭代
  97 + wantLpInfo.lpBcCount.clear();
  98 + wantLpInfo.lpNamesMap.clear();
  99 + wantLpInfo.scheduleDate = null;
  100 + wantLpInfo.validInfoList.clear();
  101 +
  102 +// System.out.println("reverse");
  103 +
  104 + }
  105 +
  106 + @Override
  107 + public Class<?> getResultType() {
  108 + return List.class;
  109 + }
  110 +
  111 + @Override
  112 + public Object getResult(Serializable context) throws Exception {
  113 + WantLpInfo wantLpInfo = (WantLpInfo) context;
  114 +
  115 + SimpleDateFormat sf = new SimpleDateFormat("yyyy年MM月dd日");
  116 + String infoFormat = "日期(%s),路牌(%s),没有排班班次";
  117 +
  118 + for (String lpId : wantLpInfo.lpBcCount.keySet()) {
  119 + if (wantLpInfo.lpBcCount.get(lpId) == 0) {
  120 + // 排班没有班次
  121 + ValidateResults_output.ValidInfo validInfo = new ValidateResults_output.ValidInfo();
  122 + validInfo.setSd(wantLpInfo.scheduleDate);
  123 + validInfo.setDesc(String.format(
  124 + infoFormat,
  125 + sf.format(wantLpInfo.scheduleDate),
  126 + wantLpInfo.lpNamesMap.get(lpId))
  127 + );
  128 + wantLpInfo.validInfoList.add(validInfo);
  129 + }
  130 + }
  131 +
  132 + System.out.println("ValidWantLpFunction==>" + wantLpInfo.lpBcCount);
  133 +
  134 + return wantLpInfo.validInfoList;
  135 + }
  136 +
  137 +}
  138 +
  139 +
  140 +
  141 +
  142 +
  143 +
  144 +
  145 +
... ...
src/main/java/com/bsth/service/schedule/rules/validate/ValidateResource.java 0 → 100644
  1 +package com.bsth.service.schedule.rules.validate;
  2 +
  3 +import com.bsth.entity.schedule.SchedulePlanInfo;
  4 +import com.bsth.service.schedule.rules.ttinfo.LpInfoResult_output;
  5 +
  6 +import java.util.Date;
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * 验证操作dsl类。
  11 + */
  12 +public class ValidateResource {
  13 + /** 具体日期 */
  14 + private Date sd;
  15 + /** 当天排班计划 */
  16 + private SchedulePlanInfo spi;
  17 + /** 当天所有路牌信息 */
  18 + private List<LpInfoResult_output> lpiList;
  19 +
  20 + public Date getSd() {
  21 + return sd;
  22 + }
  23 +
  24 + public void setSd(Date sd) {
  25 + this.sd = sd;
  26 + }
  27 +
  28 + public SchedulePlanInfo getSpi() {
  29 + return spi;
  30 + }
  31 +
  32 + public void setSpi(SchedulePlanInfo spi) {
  33 + this.spi = spi;
  34 + }
  35 +
  36 + public List<LpInfoResult_output> getLpiList() {
  37 + return lpiList;
  38 + }
  39 +
  40 + public void setLpiList(List<LpInfoResult_output> lpiList) {
  41 + this.lpiList = lpiList;
  42 + }
  43 +}
... ...
src/main/java/com/bsth/service/sys/RoleService.java
... ... @@ -8,6 +8,6 @@ import com.bsth.service.BaseService;
8 8 public interface RoleService extends BaseService<Role, Integer>{
9 9  
10 10 Map<String, Object> settRoleModules(Integer roleId, String mIds);
11   -
  11 +
12 12 Map<String, Object> roleInfo(Integer id);
13 13 }
... ...
src/main/java/com/bsth/service/sys/impl/RoleServiceImpl.java
... ... @@ -33,7 +33,7 @@ public class RoleServiceImpl extends BaseServiceImpl&lt;Role, Integer&gt; implements
33 33  
34 34 @Autowired
35 35 ModuleRepository moduleRepository;
36   -
  36 +
37 37 SimpleDateFormat sdfMinute = new SimpleDateFormat("yyyy-MM-dd HH:mm");
38 38  
39 39 @Override
... ...
src/main/resources/rules/functions.drl
... ... @@ -8,3 +8,4 @@ import accumulate com.bsth.service.schedule.rules.ttinfo.LpInfoResultsFunction l
8 8 import accumulate com.bsth.service.schedule.rules.ttinfo.MinRuleQyrqFunction minruleqyrq;
9 9 import accumulate com.bsth.service.schedule.rules.validate.ValidRepeatBcFunction vrb;
10 10 import accumulate com.bsth.service.schedule.rules.validate.ValidWholeRerunBcFunction vwrb;
  11 +import accumulate com.bsth.service.schedule.rules.validate.ValidWantLpFunction vwlp;
... ...
src/main/resources/rules/validplan.drl
... ... @@ -2,6 +2,7 @@ package com.bsth.service.schedule.rules.validate;
2 2  
3 3 import com.bsth.entity.schedule.SchedulePlanInfo;
4 4 import com.bsth.service.schedule.rules.ttinfo.LpInfoResult_output;
  5 +import com.bsth.service.schedule.rules.validate.ValidateResource;
5 6  
6 7 import org.joda.time.*;
7 8 import java.util.*;
... ... @@ -14,7 +15,22 @@ global Logger log;
14 15 // 输出
15 16 global ValidateResults_output validResult;
16 17  
17   -//------------------------- 第一阶段、构造循环体 ----------------------------//
  18 +//------------------------- 第一阶段、构造验证源 ----------------------------//
  19 +rule "Calcu_validate_resource"
  20 + salience 2000
  21 + when
  22 + $spi: SchedulePlanInfo($sd: scheduleDate)
  23 + $lpiList: ArrayList() from collect (LpInfoResult_output(dateTime.getMillis() == $sd.getTime()))
  24 + then
  25 + ValidateResource resource = new ValidateResource();
  26 + resource.setSd($sd);
  27 + resource.setSpi($spi);
  28 + resource.setLpiList($lpiList);
  29 +
  30 + insert(resource);
  31 +end
  32 +
  33 +//------------------------- 第二阶段、构造循环体 ----------------------------//
18 34  
19 35 declare Loop_param
20 36 start_date: DateTime // 开始日期(这个要不停的更新迭代)
... ... @@ -39,23 +55,27 @@ rule &quot;Calcu_Loop_param&quot;
39 55 insert(p);
40 56 end
41 57  
42   -//------------------------- 第阶段、验证计算 ----------------------------//
  58 +//------------------------- 第阶段、验证计算 ----------------------------//
43 59  
44 60  
45   -rule "Valid_repeat_bc" // 验证是否存在重复班次
  61 +rule "Valid_repeat_bc" // 验证是否存在重复班次,未套跑班次,未执行路牌
46 62 salience 600
47 63 when
48 64 $lp: Loop_param($sd: start_date, $ed: end_date)
49 65 eval($sd.isBefore($ed) || $sd.isEqual($ed))
50   - $spiList: ArrayList() from collect (SchedulePlanInfo(scheduleDate.getTime() == $sd.getMillis()))
51   - $infos: ArrayList() from accumulate ($spi: SchedulePlanInfo() from $spiList, vrb($spi))
52   - $infos2: ArrayList() from accumulate ($spi: SchedulePlanInfo() from $spiList, vwrb($spi))
  66 + $vrList: ArrayList() from collect (ValidateResource(sd.getTime() == $sd.getMillis()))
  67 + $infos: ArrayList() from accumulate ($vr: ValidateResource() from $vrList, vrb($vr.getSpi()))
  68 + $infos2: ArrayList() from accumulate ($vr: ValidateResource() from $vrList, vwrb($vr.getSpi()))
  69 + $infos3: ArrayList() from accumulate ($vr: ValidateResource() from $vrList, vwlp($vr))
53 70 then
54 71 // TODO:
55 72 // log.info("日期={},班次重复错误数={}", $sd, $infos.size());
56 73  
  74 +// log.info("班次数={}", $vrList.size());
  75 +
57 76 validResult.getInfos().addAll($infos);
58 77 validResult.getInfos().addAll($infos2);
  78 + validResult.getInfos().addAll($infos3);
59 79  
60 80 // 迭代
61 81 $lp.setStart_date($sd.plusDays(1));
... ...
src/main/resources/static/index.html
... ... @@ -630,8 +630,7 @@
630 630 <script
631 631 src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"
632 632 data-exclude=1></script>
633   -<!-- echarts -->
634   -<script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script>
  633 +
635 634 <script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script>
636 635  
637 636 </body>
... ...
src/main/resources/static/pages/base/stationroute/list.html
... ... @@ -255,7 +255,6 @@
255 255 </div>
256 256 </div>
257 257 </div>
258   -<script src="/assets/js/baidu/bd_GeoUtils_min.js" ></script>
259 258 <!-- 线路类 -->
260 259 <script src="/pages/base/stationroute/js/line.js"></script>
261 260 <!-- 新增站点对象类 -->
... ...
src/main/resources/static/pages/base/timesmodel/js/v2/AdjustTripStrategy.js
1   -//------------------ 策略模块(以下) -----------------//
2   -
3   -var AdjustTripS1 = (function() {
4   -
5   - function _f1(aBc, schedule, paramObj, fre) {
6   - if (fre > 0) {
7   - aBc.sort(function (o1, o2) {
8   - if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
9   - return -1;
10   - } else {
11   - return 1;
12   - }
13   - });
14   -
15   - var i;
16   - var j;
17   -
18   - var iBcCountOfGroup = 3; // 3个班次取一次计算
19   - var aBcOfGroup; // 3个班次列表
20   - var aBcIntervalOfGroup; // 班次间隔列表,如:3个班次,2个间隔
21   - var oBcFcTime; // 班次发车时间
22   -
23   - for (i = 0; i <= aBc.length - iBcCountOfGroup; i++) {
24   - aBcOfGroup = [];
25   - aBcIntervalOfGroup = [];
26   - for (j = i; j < i + iBcCountOfGroup; j++) {
27   - aBcOfGroup.push(aBc[j]);
28   - }
29   -
30   - for (j = 0; j < aBcOfGroup.length; j++) {
31   - if (j < aBcOfGroup.length - 1) {
32   - aBcIntervalOfGroup.push(aBcOfGroup[j + 1].getFcTimeObj().diff(
33   - aBcOfGroup[j].getFcTimeObj(), "m"));
34   - }
35   - }
36   -
37   - // 判定规则
38   - oBcFcTime = aBcOfGroup[1].getFcTimeObj();
39   -
40   - // 第一个班次发车时间不动,根据间隔,调整中间一个班次
41   - // 如果3个班次2个间隔时间差1分钟,不调整
42   - // 如果第一个间隔大,调整第二个班次往前1分钟
43   - // 如果第二个间隔大,调整第二个班次往后1分钟
44   -
45   - if (paramObj.isTroughBc(oBcFcTime) &&
46   - aBcIntervalOfGroup[0] > paramObj.getTroughMaxFcjx()) {
47   -
48   - // aBcOfGroup[1].addMinuteToFcsj(-1);
49   -
50   - // 判定是否能调整发车时间
51   - // if (aBcOfGroup[1].getGroup().getLp().isModifyBcFcsj(aBcOfGroup[1], -1, _paramObj)) {
52   - aBcOfGroup[1]._$_fcsjObj.add(-1, "m");
53   - aBcOfGroup[1].setArrTimeObj(paramObj.addMinute(
54   - aBcOfGroup[1].getFcTimeObj(),
55   - paramObj.calcuTravelTime(
56   - aBcOfGroup[1].getFcTimeObj(),
57   - aBcOfGroup[1].isUp())
58   - ));
59   -
60   - // }
61   - }
62   -
63   - //else if (_paramObj.isMPeakBc(oBcFcTime) &&
64   - // aBcIntervalOfGroup[0] < _paramObj.getMPeakMinFcjx()) {
65   - // aBcOfGroup[1].addMinuteToFcsj(1);
66   - //} else if (_paramObj.isMPeakBc(oBcFcTime) &&
67   - // aBcIntervalOfGroup[0] > _paramObj.getMPeakMaxFcjx()) {
68   - // aBcOfGroup[1].addMinuteToFcsj(-1);
69   - //} else if (_paramObj.isEPeakBc(oBcFcTime) &&
70   - // aBcIntervalOfGroup[0] < _paramObj.getEPeakMinFcjx()) {
71   - // aBcOfGroup[1].addMinuteToFcsj(1);
72   - //} else if (_paramObj.isEPeakBc(oBcFcTime) &&
73   - // aBcIntervalOfGroup[0] > _paramObj.getEPeakMaxFcjx()) {
74   - // aBcOfGroup[1].addMinuteToFcsj(-1);
75   - //}
76   -
77   -
78   - else {
79   - if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
80   - //continue;
81   - } else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
82   -
83   -
84   - // 判定是否能调整发车时间
85   - // if (aBcOfGroup[1].getGroup().getLp().isModifyBcFcsj(aBcOfGroup[1], -1, _paramObj)) {
86   - aBcOfGroup[1]._$_fcsjObj.add(-1, "m");
87   - aBcOfGroup[1].setArrTimeObj(paramObj.addMinute(
88   - aBcOfGroup[1].getFcTimeObj(),
89   - paramObj.calcuTravelTime(
90   - aBcOfGroup[1].getFcTimeObj(),
91   - aBcOfGroup[1].isUp())
92   - ));
93   - // }
94   -
95   - // aBcOfGroup[1].addMinuteToFcsj(-1);
96   - } else {
97   - // aBcOfGroup[1].addMinuteToFcsj(1);
98   -
99   - // 判定是否能调整发车时间
100   - // if (aBcOfGroup[1].getGroup().getLp().isModifyBcFcsj(aBcOfGroup[1], 1, _paramObj)) {
101   - aBcOfGroup[1]._$_fcsjObj.add(1, "m");
102   - aBcOfGroup[1].setArrTimeObj(paramObj.addMinute(
103   - aBcOfGroup[1].getFcTimeObj(),
104   - paramObj.calcuTravelTime(
105   - aBcOfGroup[1].getFcTimeObj(),
106   - aBcOfGroup[1].isUp())
107   - ));
108   - // }
109   - }
110   - }
111   -
112   - //if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
113   - // //continue;
114   - //} else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
115   - // aBcOfGroup[1].addMinuteToFcsj(-1);
116   - //} else {
117   - // aBcOfGroup[1].addMinuteToFcsj(1);
118   - //}
119   -
120   -
121   - }
122   -
123   - _f1(aBc, schedule, paramObj, fre - 1);
124   -
125   - }
126   - }
127   -
128   -
129   - function f1(aUpBc, aDownBc, schedule, paramObj) {
130   - // TODO:9、调整纵向班次间隔
131   - _f1(aUpBc, schedule, paramObj, 5);
132   - _f1(aDownBc, schedule, paramObj, 5);
133   -
134   - schedule.fnAdjustLpBcInterval(1);
135   -
136   - _f1(aUpBc, schedule, paramObj, 5);
137   - _f1(aDownBc, schedule, paramObj, 5);
138   - }
139   -
140   - return f1;
141   -}());
142   -
143   -//------------------ 策略模块(以上) -----------------//
144   -
145   -
146   -
147   -
148   -
149   -// 调整班次策略类
150   -var AdjustTripStrategy = (function() {
151   -
152   - /**
153   - * 内部策略配置封装类。
154   - * @constructor
155   - */
156   - function InternalStrategy() {
157   - // 策略函数对应,每个函数都由一个标识符号对应,类似配置函数
158   - this._oSTRATIGIS = {
159   - "ADJUST_TRIP": AdjustTripS1
160   - };
161   - }
162   -
163   - /**
164   - * 返回策略函数
165   - * @param str 标识
166   - * @returns {function}
167   - */
168   - InternalStrategy.prototype.sFn = function(str) {
169   - if (!this._oSTRATIGIS[str]) {
170   - throw "指定标识" + str + "策略函数不存在!";
171   - }
172   - return this._oSTRATIGIS[str];
173   - };
174   - /**
175   - * 替换策略配置
176   - * @param str 策略函数标识
177   - * @param fn 策略函数
178   - */
179   - InternalStrategy.prototype.sConfig = function(str, fn) {
180   - this._oSTRATIGIS[str] = fn;
181   - };
182   -
183   - return new InternalStrategy();
  1 +//------------------ 策略模块(以下) -----------------//
  2 +
  3 +var AdjustTripS1 = (function() {
  4 +
  5 + function _f1(aBc, schedule, paramObj, fre) {
  6 + if (fre > 0) {
  7 + aBc.sort(function (o1, o2) {
  8 + if (o1.getFcTimeObj().isBefore(o2.getFcTimeObj())) {
  9 + return -1;
  10 + } else {
  11 + return 1;
  12 + }
  13 + });
  14 +
  15 + var i;
  16 + var j;
  17 +
  18 + var iBcCountOfGroup = 3; // 3个班次取一次计算
  19 + var aBcOfGroup; // 3个班次列表
  20 + var aBcIntervalOfGroup; // 班次间隔列表,如:3个班次,2个间隔
  21 + var oBcFcTime; // 班次发车时间
  22 +
  23 + for (i = 0; i <= aBc.length - iBcCountOfGroup; i++) {
  24 + aBcOfGroup = [];
  25 + aBcIntervalOfGroup = [];
  26 + for (j = i; j < i + iBcCountOfGroup; j++) {
  27 + aBcOfGroup.push(aBc[j]);
  28 + }
  29 +
  30 + for (j = 0; j < aBcOfGroup.length; j++) {
  31 + if (j < aBcOfGroup.length - 1) {
  32 + aBcIntervalOfGroup.push(aBcOfGroup[j + 1].getFcTimeObj().diff(
  33 + aBcOfGroup[j].getFcTimeObj(), "m"));
  34 + }
  35 + }
  36 +
  37 + // 判定规则
  38 + oBcFcTime = aBcOfGroup[1].getFcTimeObj();
  39 +
  40 + // 第一个班次发车时间不动,根据间隔,调整中间一个班次
  41 + // 如果3个班次2个间隔时间差1分钟,不调整
  42 + // 如果第一个间隔大,调整第二个班次往前1分钟
  43 + // 如果第二个间隔大,调整第二个班次往后1分钟
  44 +
  45 + if (paramObj.isTroughBc(oBcFcTime) &&
  46 + aBcIntervalOfGroup[0] > paramObj.getTroughMaxFcjx()) {
  47 +
  48 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  49 +
  50 + // 判定是否能调整发车时间
  51 + // if (aBcOfGroup[1].getGroup().getLp().isModifyBcFcsj(aBcOfGroup[1], -1, _paramObj)) {
  52 + aBcOfGroup[1]._$_fcsjObj.add(-1, "m");
  53 + aBcOfGroup[1].setArrTimeObj(paramObj.addMinute(
  54 + aBcOfGroup[1].getFcTimeObj(),
  55 + paramObj.calcuTravelTime(
  56 + aBcOfGroup[1].getFcTimeObj(),
  57 + aBcOfGroup[1].isUp())
  58 + ));
  59 +
  60 + // }
  61 + }
  62 +
  63 + //else if (_paramObj.isMPeakBc(oBcFcTime) &&
  64 + // aBcIntervalOfGroup[0] < _paramObj.getMPeakMinFcjx()) {
  65 + // aBcOfGroup[1].addMinuteToFcsj(1);
  66 + //} else if (_paramObj.isMPeakBc(oBcFcTime) &&
  67 + // aBcIntervalOfGroup[0] > _paramObj.getMPeakMaxFcjx()) {
  68 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  69 + //} else if (_paramObj.isEPeakBc(oBcFcTime) &&
  70 + // aBcIntervalOfGroup[0] < _paramObj.getEPeakMinFcjx()) {
  71 + // aBcOfGroup[1].addMinuteToFcsj(1);
  72 + //} else if (_paramObj.isEPeakBc(oBcFcTime) &&
  73 + // aBcIntervalOfGroup[0] > _paramObj.getEPeakMaxFcjx()) {
  74 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  75 + //}
  76 +
  77 +
  78 + else {
  79 + if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
  80 + //continue;
  81 + } else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
  82 +
  83 +
  84 + // 判定是否能调整发车时间
  85 + // if (aBcOfGroup[1].getGroup().getLp().isModifyBcFcsj(aBcOfGroup[1], -1, _paramObj)) {
  86 + aBcOfGroup[1]._$_fcsjObj.add(-1, "m");
  87 + aBcOfGroup[1].setArrTimeObj(paramObj.addMinute(
  88 + aBcOfGroup[1].getFcTimeObj(),
  89 + paramObj.calcuTravelTime(
  90 + aBcOfGroup[1].getFcTimeObj(),
  91 + aBcOfGroup[1].isUp())
  92 + ));
  93 + // }
  94 +
  95 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  96 + } else {
  97 + // aBcOfGroup[1].addMinuteToFcsj(1);
  98 +
  99 + // 判定是否能调整发车时间
  100 + // if (aBcOfGroup[1].getGroup().getLp().isModifyBcFcsj(aBcOfGroup[1], 1, _paramObj)) {
  101 + aBcOfGroup[1]._$_fcsjObj.add(1, "m");
  102 + aBcOfGroup[1].setArrTimeObj(paramObj.addMinute(
  103 + aBcOfGroup[1].getFcTimeObj(),
  104 + paramObj.calcuTravelTime(
  105 + aBcOfGroup[1].getFcTimeObj(),
  106 + aBcOfGroup[1].isUp())
  107 + ));
  108 + // }
  109 + }
  110 + }
  111 +
  112 + //if (Math.abs(aBcIntervalOfGroup[0] - aBcIntervalOfGroup[1]) <= 1) {
  113 + // //continue;
  114 + //} else if (aBcIntervalOfGroup[0] > aBcIntervalOfGroup[1]) {
  115 + // aBcOfGroup[1].addMinuteToFcsj(-1);
  116 + //} else {
  117 + // aBcOfGroup[1].addMinuteToFcsj(1);
  118 + //}
  119 +
  120 +
  121 + }
  122 +
  123 + _f1(aBc, schedule, paramObj, fre - 1);
  124 +
  125 + }
  126 + }
  127 +
  128 +
  129 + function f1(aUpBc, aDownBc, schedule, paramObj) {
  130 + // TODO:9、调整纵向班次间隔
  131 + _f1(aUpBc, schedule, paramObj, 5);
  132 + _f1(aDownBc, schedule, paramObj, 5);
  133 +
  134 + schedule.fnAdjustLpBcInterval(1);
  135 +
  136 + _f1(aUpBc, schedule, paramObj, 5);
  137 + _f1(aDownBc, schedule, paramObj, 5);
  138 + }
  139 +
  140 + return f1;
  141 +}());
  142 +
  143 +//------------------ 策略模块(以上) -----------------//
  144 +
  145 +
  146 +
  147 +
  148 +
  149 +// 调整班次策略类
  150 +var AdjustTripStrategy = (function() {
  151 +
  152 + /**
  153 + * 内部策略配置封装类。
  154 + * @constructor
  155 + */
  156 + function InternalStrategy() {
  157 + // 策略函数对应,每个函数都由一个标识符号对应,类似配置函数
  158 + this._oSTRATIGIS = {
  159 + "ADJUST_TRIP": AdjustTripS1
  160 + };
  161 + }
  162 +
  163 + /**
  164 + * 返回策略函数
  165 + * @param str 标识
  166 + * @returns {function}
  167 + */
  168 + InternalStrategy.prototype.sFn = function(str) {
  169 + if (!this._oSTRATIGIS[str]) {
  170 + throw "指定标识" + str + "策略函数不存在!";
  171 + }
  172 + return this._oSTRATIGIS[str];
  173 + };
  174 + /**
  175 + * 替换策略配置
  176 + * @param str 策略函数标识
  177 + * @param fn 策略函数
  178 + */
  179 + InternalStrategy.prototype.sConfig = function(str, fn) {
  180 + this._oSTRATIGIS[str] = fn;
  181 + };
  182 +
  183 + return new InternalStrategy();
184 184 }());
185 185 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/mould/calcSheetList.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/calcSheetList1.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/calcTurnoutrate.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/operationservice.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/statisticsDaily_2.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/busInterval.html
... ... @@ -49,7 +49,15 @@
49 49 </select>
50 50 </div>
51 51 <div style="margin-top: 10px"></div>
52   - <div style="display: inline-block;margin-left: 5px;">
  52 + <div style="display: inline-block; margin-left: 5px">
  53 + <span class="item-label" style="width: 80px;">是否营运: </span>
  54 + <select class="form-control" name="sfyy" id="sfyy" style="width: 140px;">
  55 + <option value="0">全部线路</option>
  56 + <option value="1" selected="selected">营运线路</option>
  57 + <option value="2">非营运线路</option>
  58 + </select>
  59 + </div>
  60 + <div style="display: inline-block;margin-left: 10px;">
53 61 <span class="item-label" style="width: 80px;">开始时间: </span>
54 62 <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
55 63 </div>
... ... @@ -81,7 +89,7 @@
81 89 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
82 90 <table class="table table-bordered table-hover table-checkable" id="forms">
83 91 <thead>
84   -
  92 +
85 93 </thead>
86 94 <tbody>
87 95  
... ... @@ -164,7 +172,7 @@
164 172 $("#company").on("change",updateCompany);
165 173 function updateCompany(){
166 174 var company = $('#company').val();
167   - var options = '';
  175 + var options = '<option value="">全部分公司</option>';
168 176 for(var i = 0; i < obj.length; i++){
169 177 if(obj[i].companyCode == company){
170 178 var children = obj[i].children;
... ... @@ -214,14 +222,16 @@
214 222 var temp = tempData[$("#line").val()].split(":");
215 223 $("#company").val(temp[0]);
216 224 updateCompany();
217   - $("#subCompany").val(temp[1]);
  225 +// $("#subCompany").val(temp[1]);
  226 + $("#subCompany").val("");
218 227 $("#company").attr("disabled", true);
219   - $("#subCompany").attr("disabled", true);
  228 +// $("#subCompany").attr("disabled", true);
220 229 }
221 230 });
222 231  
223 232 $("#query").on("click",jsDoQuery);
224   -
  233 +
  234 + var sfyy = 1;
225 235 var sfqr = 0;
226 236 var statu = 0;
227 237 var line = $("#line").val();
... ... @@ -244,6 +254,7 @@
244 254 return;
245 255 }
246 256 var params = {};
  257 + sfyy = $("#sfyy").val();
247 258 line = $("#line").val();
248 259 startDate = $("#startDate").val();
249 260 endDate = $("#endDate").val();
... ... @@ -255,6 +266,7 @@
255 266 lineName = $('#line option:selected').text();
256 267 if(lineName == "全部线路")
257 268 lineName = $('#subCompany option:selected').text();
  269 + params['sfyy'] = sfyy;
258 270 params['line'] = line;
259 271 params['sfqr'] = sfqr;
260 272 params['statu'] = statu;
... ... @@ -293,6 +305,7 @@
293 305 return;
294 306 }
295 307 var params = {};
  308 + params['sfyy'] = sfyy;
296 309 params['line'] = line;
297 310 params['sfqr'] = sfqr;
298 311 params['statu'] = statu;
... ...
src/main/resources/static/pages/forms/statement/commandState.html
... ... @@ -27,29 +27,36 @@
27 27 <div class="portlet light porttlet-fit bordered">
28 28 <div class="portlet-title">
29 29 <form id="history" class="form-inline" action="">
30   - <div style="display: inline-block; margin-left: 15px;" id="company1">
  30 + <div style="display: inline-block; margin-left: 33px;" id="company1">
31 31 <span class="item-label" style="width: 80px;">公司: </span>
32   - <select class="form-control" name="company" id="company" style="width: 180px;"></select>
  32 + <select class="form-control" name="company" id="company" style="width: 150px;"></select>
33 33 </div>
34   - <div style="display: inline-block; margin-left: 22px;" id="subCompany1">
  34 + <div style="display: inline-block; margin-left: 6px;" id="subCompany1">
35 35 <span class="item-label" style="width: 80px;">分公司: </span>
36   - <select class="form-control" name="subCompany" id="subCompany" style="width: 180px;"></select>
  36 + <select class="form-control" name="subCompany" id="subCompany" style="width: 150px;"></select>
37 37 </div>
38   - <div style="margin-top: 10px" ></div>
39 38 <div style="display: inline-block; margin-left: 15px;">
40 39 <span class="item-label" style="width: 80px;">线路: </span>
41   - <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  40 + <select class="form-control" name="line" id="line" style="width: 160px;"></select>
  41 + </div>
  42 + <div style="margin-top: 10px" ></div>
  43 + <div style="display: inline-block; margin-left: 5px">
  44 + <span class="item-label" style="width: 80px;">是否营运: </span>
  45 + <select class="form-control" name="sfyy" id="sfyy" style="width: 150px;">
  46 + <option value="0">全部线路</option>
  47 + <option value="1" selected="selected">营运线路</option>
  48 + <option value="2">非营运线路</option>
  49 + </select>
42 50 </div>
43   -
44   - <div style="display: inline-block;margin-left: 36px;">
  51 + <div style="display: inline-block;margin-left: 20px;">
45 52 <span class="item-label" style="width: 80px;">时间: </span>
46   - <input class="form-control" type="text" id="date" style="width: 180px;"/>
  53 + <input class="form-control" type="text" id="date" style="width: 150px;"/>
47 54 </div>
48 55 <div style="display:none;margin-left: 8px">
49 56 <span class="item-label" style="width: 140px;">内部编码: </span>
50   - <select class="form-control" name="code" id="code" style="width: 180px;"></select>
  57 + <select class="form-control" name="code" id="code" style="width: 150px;"></select>
51 58 </div>
52   - <div class="form-group" style="margin-left: 9px">
  59 + <div class="form-group" style="margin-left: 15px">
53 60 <input class="btn btn-default" type="button" id="query" value="筛选"/>
54 61 <input class="btn btn-default" type="button" id="export" value="导出"/>
55 62 </div>
... ... @@ -169,7 +176,7 @@
169 176 $("#company").on("change",updateCompany);
170 177 function updateCompany(){
171 178 var company = $('#company').val();
172   - var options = '';
  179 + var options = '<option value="">全部分公司</option>';
173 180 for(var i = 0; i < obj.length; i++){
174 181 if(obj[i].companyCode == company){
175 182 var children = obj[i].children;
... ... @@ -212,9 +219,10 @@
212 219 var temp = tempData[$("#line").val()].split(":");
213 220 $("#company").val(temp[0]);
214 221 updateCompany();
215   - $("#subCompany").val(temp[1]);
  222 +// $("#subCompany").val(temp[1]);
  223 + $("#subCompany").val("");
216 224 $("#company").attr("disabled", true);
217   - $("#subCompany").attr("disabled", true);
  225 +// $("#subCompany").attr("disabled", true);
218 226 }
219 227 });
220 228  
... ... @@ -260,7 +268,8 @@
260 268  
261 269  
262 270 $("#query").on("click",jsDoQuery);
263   -
  271 +
  272 + var sfyy = 1;
264 273 var line = "";
265 274 var date = $("#date").val();
266 275 var code = $("#code").val();
... ... @@ -277,6 +286,7 @@
277 286 line = $("#line").val();
278 287 if(line == " ")
279 288 line = "";
  289 + sfyy = $("#sfyy").val();
280 290 date = $("#date").val();
281 291 code = $("#code").val();
282 292 company = $("#company").val();
... ... @@ -284,6 +294,7 @@
284 294 lineName = $('#line option:selected').text();
285 295 if(lineName == "全部线路")
286 296 lineName = $('#subCompany option:selected').text();
  297 + params['sfyy'] = sfyy;
287 298 params['line'] = line;
288 299 params['date'] = date;
289 300 params['code'] = code;
... ... @@ -318,7 +329,7 @@
318 329 $("#works_hidden").removeClass("hidden");
319 330 var i = layer.load(2);
320 331 $get('/pcpc/commandByLineList',params,function(result){
321   - var commandByLine = template('list_workList',{list:result});
  332 + var commandByLine = template('list_commandState_1',{list:result});
322 333 $('#works tbody').html(commandByLine);
323 334 layer.close(i);
324 335  
... ... @@ -354,6 +365,7 @@
354 365  
355 366 $("#export").on("click",function(){
356 367 var params = {};
  368 + params['sfyy'] = sfyy;
357 369 params['line'] = line;
358 370 params['date'] = date;
359 371 params['type'] = "export";
... ... @@ -410,7 +422,7 @@
410 422 {{/if}}
411 423 </script>
412 424  
413   -<script type="text/html" id="list_workList">
  425 +<script type="text/html" id="list_commandState_1">
414 426 {{each list as obj i}}
415 427 <tr>
416 428 <td>{{obj.company}}</td>
... ...
src/main/resources/static/pages/forms/statement/correctStatis.html
... ... @@ -35,16 +35,24 @@
35 35 <span class="item-label" style="width: 80px;">分公司: </span>
36 36 <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select>
37 37 </div>
38   - <div style="display: inline-block; margin-left: 25px;">
  38 + <div style="display: inline-block; margin-left: 20px;">
39 39 <span class="item-label" style="width: 80px;">选择线路: </span>
40 40 <select class="form-control" name="line" id="line" style="width: 150px;"></select>
41 41 </div>
42 42 <div style="margin-top: 10px"></div>
43   - <div style="display: inline-block;margin-left: 5px;">
  43 + <div style="display: inline-block; margin-left: 5px">
  44 + <span class="item-label" style="width: 80px;">是否营运: </span>
  45 + <select class="form-control" name="sfyy" id="sfyy" style="width: 140px;">
  46 + <option value="0">全部线路</option>
  47 + <option value="1" selected="selected">营运线路</option>
  48 + <option value="2">非营运线路</option>
  49 + </select>
  50 + </div>
  51 + <div style="display: inline-block;margin-left: 10px;">
44 52 <span class="item-label" style="width: 80px;">开始时间: </span>
45 53 <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
46 54 </div>
47   - <div style="display: inline-block;margin-left: 10px;">
  55 + <div style="display: inline-block;margin-left: 20px;">
48 56 <span class="item-label" style="width: 80px;">结束时间: </span>
49 57 <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
50 58 </div>
... ... @@ -62,7 +70,7 @@
62 70 <span class="item-label" style="width: 80px;"> - </span>
63 71 <input class="form-control" type="text" id="times2" style="width: 60px;"/>
64 72 </div>
65   - <div class="form-group">
  73 + <div class="form-group" style="margin-left: 5px;">
66 74 <input class="btn btn-default" type="button" id="query" value="筛选"/>
67 75 <!-- <input class="btn btn-default" type="button" id="export" value="导出"/> -->
68 76 </div>
... ... @@ -112,14 +120,6 @@
112 120 if (!$('body').hasClass('page-sidebar-closed'))
113 121 $('.menu-toggler.sidebar-toggler').click();
114 122  
115   - $("#startDate").datetimepicker({
116   - format : 'YYYY-MM-DD',
117   - locale : 'zh-cn'
118   - });
119   - $("#endDate").datetimepicker({
120   - format : 'YYYY-MM-DD',
121   - locale : 'zh-cn'
122   - });
123 123 $("#times1").datetimepicker({
124 124 format : 'HH:mm',
125 125 locale : 'zh-cn'
... ... @@ -130,6 +130,7 @@
130 130 });
131 131  
132 132 var d = new Date();
  133 +// d.setTime(d.getTime() - 1*1000*60*60*24); //当前日期减一天
133 134 var year = d.getFullYear();
134 135 var month = d.getMonth() + 1;
135 136 var day = d.getDate();
... ... @@ -137,8 +138,19 @@
137 138 month = "0" + month;
138 139 if(day < 10)
139 140 day = "0" + day;
140   - $("#startDate").val(year + "-" + month + "-" + day);
141   - $("#endDate").val(year + "-" + month + "-" + day);
  141 + var dateTime = year + "-" + month + "-" + day;
  142 + $("#startDate").datetimepicker({
  143 + format : 'YYYY-MM-DD',
  144 + locale : 'zh-cn',
  145 +// maxDate : dateTime //设置最大日期
  146 + });
  147 + $("#endDate").datetimepicker({
  148 + format : 'YYYY-MM-DD',
  149 + locale : 'zh-cn',
  150 +// maxDate : dateTime //设置最大日期
  151 + });
  152 + $("#startDate").val(dateTime);
  153 + $("#endDate").val(dateTime);
142 154  
143 155 $("#times1").val("05:00");
144 156 $("#times2").val("23:00");
... ... @@ -174,7 +186,7 @@
174 186 $("#company").on("change",updateCompany);
175 187 function updateCompany(){
176 188 var company = $('#company').val();
177   - var options = '';
  189 + var options = '<option value="">全部分公司</option>';
178 190 for(var i = 0; i < obj.length; i++){
179 191 if(obj[i].companyCode == company){
180 192 var children = obj[i].children;
... ... @@ -217,16 +229,18 @@
217 229 var temp = tempData[$("#line").val()].split(":");
218 230 $("#company").val(temp[0]);
219 231 updateCompany();
220   - $("#subCompany").val(temp[1]);
  232 +// $("#subCompany").val(temp[1]);
  233 + $("#subCompany").val("");
221 234 $("#company").attr("disabled", true);
222   - $("#subCompany").attr("disabled", true);
  235 +// $("#subCompany").attr("disabled", true);
223 236 }
224 237 });
225 238  
226 239  
227 240 $("#query").on("click",jsDoQuery);
228   -
  241 +
229 242 var sfqr = 0;
  243 + var sfyy = 1;
230 244 var company = $("#company").val();
231 245 var subCompany = $("#subCompany").val();
232 246 var lines;
... ... @@ -245,6 +259,7 @@
245 259 }
246 260 var params = {};
247 261 // line = $("#line").val();
  262 + sfyy = $("#sfyy").val();
248 263 startDate = $("#startDate").val();
249 264 endDate = $("#endDate").val();
250 265 times = $("#times1").val() + "-" + $("#times2").val();
... ... @@ -252,6 +267,7 @@
252 267 subCompany = $("#subCompany").val();
253 268 params['sfqr'] = sfqr;
254 269 params['line'] = line;
  270 + params['sfyy'] = sfyy;
255 271 params['startDate'] = startDate;
256 272 params['endDate'] = endDate;
257 273 params['times'] = times;
... ... @@ -259,9 +275,12 @@
259 275 params['subCompany'] = subCompany;
260 276 params['type'] = "query";
261 277 // $(".hidden").removeClass("hidden");
  278 + var i = layer.load(2);
262 279 $get('/busInterval/correctStatis', params, function(result){
263 280 // 把数据填充到模版中
264   - var tbodyHtml = template('list_company',{list:result});;
  281 + var tbodyHtml = template('list_company',{list:result});
  282 + layer.close(i);
  283 +
265 284 /* if(result.length != 0){
266 285 tbodyHtml = template('list_company',{list:result[0].workList[0].workList, type:3});
267 286 }else{
... ... @@ -276,7 +295,7 @@
276 295 $("#lines").html("");
277 296  
278 297 // company = result;
279   - lines = result[0].workList[0].workList;
  298 +// lines = result[0].workList[0].workList;
280 299 });
281 300 }
282 301  
... ... @@ -329,7 +348,7 @@
329 348 });
330 349 $.each(lines, function(i, g){
331 350 if(g.company == params[1] && g.subCompany == params[2] && g.line == params[3]){
332   - var tbodyHtml = template('list_workList',{list:g.workList});
  351 + var tbodyHtml = template('list_company_1',{list:g.workList});
333 352 $("#lines").html(tbodyHtml);
334 353 }
335 354 });
... ... @@ -432,7 +451,7 @@
432 451 {{/if}}
433 452 </tbody>
434 453 </script>
435   -<script type="text/html" id="list_workList">
  454 +<script type="text/html" id="list_company_1">
436 455 <thead>
437 456 <tr>
438 457 <th colspan="9">修正报表</th>
... ...
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
... ... @@ -28,23 +28,32 @@
28 28 <div class="portlet light porttlet-fit bordered">
29 29 <div class="portlet-title">
30 30 <form id="history" class="form-inline" action="">
31   - <div style="display: inline-block;margin-left: 10px;" id="company1">
  31 + <div style="display: inline-block;margin-left: 33px;" id="company1">
32 32 <span class="item-label" style="width: 80px;">公司: </span>
33   - <select class="form-control" name="company" id="company" style="width: 160px;"></select>
  33 + <select class="form-control" name="company" id="company" style="width: 150px;"></select>
34 34 </div>
35 35 <div style="display: inline-block;margin-left: 10px;" id="subCompany1">
36 36 <span class="item-label" style="width: 80px;">分公司: </span>
37   - <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
  37 + <select class="form-control" name="subCompany" id="subCompany" style="width: 150px;"></select>
38 38 </div>
39 39 <div style="display: inline-block;margin-left: 10px;">
40 40 <span class="item-label" style="width: 80px;">线路: </span>
41 41 <select class="form-control" name="line" id="line" style="width: 160px;"></select>
42 42 </div>
43   - <div style="display: inline-block;margin-left: 10px;">
  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: 150px;">
  47 + <option value="0">全部线路</option>
  48 + <option value="1" selected="selected">营运线路</option>
  49 + <option value="2">非营运线路</option>
  50 + </select>
  51 + </div>
  52 + <div style="display: inline-block;margin-left: 24px;">
44 53 <span class="item-label" style="width: 80px;">时间: </span>
45   - <input class="form-control" type="text" id="date" style="width: 160px;"/>
  54 + <input class="form-control" type="text" id="date" style="width: 150px;"/>
46 55 </div>
47   - <div class="form-group">
  56 + <div class="form-group" style="margin-left: 10px;">
48 57 <input class="btn btn-default" type="button" id="query" value="筛选"/>
49 58 <input class="btn btn-default" type="button" id="export" value="导出"/>
50 59 </div>
... ... @@ -147,7 +156,7 @@
147 156 $("#company").on("change",updateCompany);
148 157 function updateCompany(){
149 158 var company = $('#company').val();
150   - var options = '';
  159 + var options = '<option value="">全部分公司</option>';
151 160 for(var i = 0; i < obj.length; i++){
152 161 if(obj[i].companyCode == company){
153 162 var children = obj[i].children;
... ... @@ -217,18 +226,20 @@
217 226 var temp = tempData[$("#line").val()].split(":");
218 227 $("#company").val(temp[0]);
219 228 updateCompany();
220   - $("#subCompany").val(temp[1]);
  229 +// $("#subCompany").val(temp[1]);
  230 + $("#subCompany").val("");
221 231 $("#company").attr("disabled", true);
222   - $("#subCompany").attr("disabled", true);
  232 +// $("#subCompany").attr("disabled", true);
223 233 }
224 234 });
225 235  
226 236 $("#query").on("click",jsDoQuery);
227 237  
228   - var company = $("#company").val();
229   - var subCompany = $("#subCompany").val();
  238 + var sfyy = $("#sfyy").val();
230 239 var line = $("#line").val();
231 240 var date = $("#date").val();
  241 + var company = $("#company").val();
  242 + var subCompany = $("#subCompany").val();
232 243 var lineName = $('#line option:selected').text();
233 244 function jsDoQuery(pagination){
234 245 if($("#date").val() == null || $("#date").val().trim().length == 0){
... ... @@ -236,20 +247,22 @@
236 247 return;
237 248 }
238 249 var params = {};
239   - company = $("#company").val();
240   - subCompany = $("#subCompany").val();
  250 + sfyy = $("#sfyy").val();
241 251 line = $("#line").val();
242 252 date = $("#date").val();
  253 + company = $("#company").val();
  254 + subCompany = $("#subCompany").val();
243 255 lineName = $('#line option:selected').text();
244 256 if(lineName == "全部线路")
245 257 lineName = $('#subCompany option:selected').text();
246 258 if(line == " ")
247 259 line = "";
248   - params['company'] = company;
249   - params['subCompany'] = subCompany;
  260 + params['sfyy'] = sfyy;
250 261 params['line'] = line;
251 262 params['date'] = date;
252 263 params['type'] = "query";
  264 + params['company'] = company;
  265 + params['subCompany'] = subCompany;
253 266 $(".hidden").removeClass("hidden");
254 267 var i = layer.load(2);
255 268 $get('/pcpc/firstAndLastBus', params, function(result){
... ... @@ -272,11 +285,12 @@
272 285 return;
273 286 }
274 287 var params = {};
275   - params['company'] = company;
276   - params['subCompany'] = subCompany;
  288 + params['sfyy'] = sfyy;
277 289 params['line'] = line;
278 290 params['date'] = date;
279 291 params['type'] = "export";
  292 + params['company'] = company;
  293 + params['subCompany'] = subCompany;
280 294 params['lineName'] = lineName;
281 295 var i = layer.load(2);
282 296 $get('/pcpc/firstAndLastBus', params, function(result){
... ...
src/main/resources/static/pages/forms/statement/firstAndLastBus_delay.html
... ... @@ -32,24 +32,32 @@
32 32 <span class="item-label" style="width: 80px;">公司: </span>
33 33 <select class="form-control" name="company" id="company" style="width: 160px;"></select>
34 34 </div>
35   - <div style="display: inline-block;margin-left: 24px;" id="subCompany1">
  35 + <div style="display: inline-block;margin-left: 19px;" id="subCompany1">
36 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 37 <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
38 38 </div>
39   - <div style="display: inline-block;margin-left: 10px;">
  39 + <div style="display: inline-block;margin-left: 33px;">
40 40 <span class="item-label" style="width: 80px;">线路: </span>
41 41 <select class="form-control" name="line" id="line" style="width: 160px;"></select>
42 42 </div>
43 43 <div style="margin-top: 10px"></div>
44   - <div style="display: inline-block;margin-left: 0px;">
  44 + <div style="display: inline-block; margin-left: 0px">
  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">全部线路</option>
  48 + <option value="1" selected="selected">营运线路</option>
  49 + <option value="2">非营运线路</option>
  50 + </select>
  51 + </div>
  52 + <div style="display: inline-block;margin-left: 5px;">
45 53 <span class="item-label" style="width: 80px;">开始时间: </span>
46 54 <input class="form-control" type="text" id="startDate" style="width: 160px;"/>
47 55 </div>
48   - <div style="display: inline-block;margin-left: 10px;">
  56 + <div style="display: inline-block;margin-left: 5px;">
49 57 <span class="item-label" style="width: 80px;">结束时间: </span>
50 58 <input class="form-control" type="text" id="endDate" style="width: 160px;"/>
51 59 </div>
52   - <div class="form-group" style="margin-left: 10px;">
  60 + <div class="form-group" style="margin-left: 5px;">
53 61 <input class="btn btn-default" type="button" id="query" value="筛选"/>
54 62 <input class="btn btn-default" type="button" id="export" value="导出"/>
55 63 </div>
... ... @@ -135,7 +143,7 @@
135 143 $("#company").on("change",updateCompany);
136 144 function updateCompany(){
137 145 var company = $('#company').val();
138   - var options = '';
  146 + var options = '<option value="">全部分公司</option>';
139 147 for(var i = 0; i < obj.length; i++){
140 148 if(obj[i].companyCode == company){
141 149 var children = obj[i].children;
... ... @@ -186,9 +194,10 @@
186 194  
187 195 $("#query").on("click",jsDoQuery);
188 196  
  197 + var sfyy = 1;
  198 + var line = $("#line").val();
189 199 var company = $("#company").val();
190 200 var subCompany = $("#subCompany").val();
191   - var line = $("#line").val();
192 201 var startDate = $("#startDate").val();
193 202 var endDate = $("#endDate").val();
194 203 var lineName = $('#line option:selected').text();
... ... @@ -203,9 +212,10 @@
203 212 }
204 213 var i = layer.load(2);
205 214 var params = {};
  215 + sfyy = $("#sfyy").val();
  216 + line = $("#line").val();
206 217 company = $("#company").val();
207 218 subCompany = $("#subCompany").val();
208   - line = $("#line").val();
209 219 startDate = $("#startDate").val();
210 220 endDate = $("#endDate").val();
211 221 lineName = $('#line option:selected').text();
... ... @@ -213,9 +223,10 @@
213 223 lineName = $('#subCompany option:selected').text();
214 224 if(line == " ")
215 225 line = "";
  226 + params['sfyy'] = sfyy;
  227 + params['line'] = line;
216 228 params['company'] = company;
217 229 params['subCompany'] = subCompany;
218   - params['line'] = line;
219 230 params['startDate'] = startDate;
220 231 params['endDate'] = endDate;
221 232 params['type'] = "query";
... ... @@ -253,9 +264,10 @@
253 264 endDate = $("#endDate").val();
254 265 if(line == " ")
255 266 line = "";
  267 + params['sfyy'] = sfyy;
  268 + params['line'] = line;
256 269 params['company'] = company;
257 270 params['subCompany'] = subCompany;
258   - params['line'] = line;
259 271 params['startDate'] = startDate;
260 272 params['endDate'] = endDate;
261 273 params['type'] = "delay_export";
... ...
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html
... ... @@ -28,24 +28,32 @@
28 28 <div class="portlet light porttlet-fit bordered">
29 29 <div class="portlet-title">
30 30 <form id="history" class="form-inline" action="">
31   - <div style="display: inline-block;margin-left: 28px;" id="company1">
  31 + <div style="display: inline-block;margin-left: 33px;" id="company1">
32 32 <span class="item-label" style="width: 80px;">公司: </span>
33 33 <select class="form-control" name="company" id="company" style="width: 160px;"></select>
34 34 </div>
35   - <div style="display: inline-block;margin-left: 24px;" id="subCompany1">
  35 + <div style="display: inline-block;margin-left: 19px;" id="subCompany1">
36 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 37 <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
38 38 </div>
39   - <div style="display: inline-block;margin-left: 10px;">
  39 + <div style="display: inline-block;margin-left: 33px;">
40 40 <span class="item-label" style="width: 80px;">线路: </span>
41 41 <select class="form-control" name="line" id="line" style="width: 160px;"></select>
42 42 </div>
43 43 <div style="margin-top: 10px"></div>
44   - <div style="display: inline-block;margin-left: 0px;">
  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">全部线路</option>
  48 + <option value="1" selected="selected">营运线路</option>
  49 + <option value="2">非营运线路</option>
  50 + </select>
  51 + </div>
  52 + <div style="display: inline-block;margin-left: 5px;">
45 53 <span class="item-label" style="width: 80px;">开始时间: </span>
46 54 <input class="form-control" type="text" id="startDate" style="width: 160px;"/>
47 55 </div>
48   - <div style="display: inline-block;margin-left: 10px;">
  56 + <div style="display: inline-block;margin-left: 5px;">
49 57 <span class="item-label" style="width: 80px;">结束时间: </span>
50 58 <input class="form-control" type="text" id="endDate" style="width: 160px;"/>
51 59 </div>
... ... @@ -189,7 +197,7 @@
189 197 $("#company").on("change",updateCompany);
190 198 function updateCompany(){
191 199 var company = $('#company').val();
192   - var options = '';
  200 + var options = '<option value="">全部分公司</option>';
193 201 for(var i = 0; i < obj.length; i++){
194 202 if(obj[i].companyCode == company){
195 203 var children = obj[i].children;
... ... @@ -232,9 +240,10 @@
232 240 var temp = tempData[$("#line").val()].split(":");
233 241 $("#company").val(temp[0]);
234 242 updateCompany();
235   - $("#subCompany").val(temp[1]);
  243 +// $("#subCompany").val(temp[1]);
  244 + $("#subCompany").val("");
236 245 $("#company").attr("disabled", true);
237   - $("#subCompany").attr("disabled", true);
  246 +// $("#subCompany").attr("disabled", true);
238 247 }
239 248 });
240 249  
... ... @@ -276,9 +285,10 @@
276 285  
277 286 $("#query").on("click",jsDoQuery);
278 287  
  288 + var sfyy = 1;
  289 + var line = $("#line").val();
279 290 var company = $("#company").val();
280 291 var subCompany = $("#subCompany").val();
281   - var line = $("#line").val();
282 292 var startDate = $("#startDate").val();
283 293 var endDate = $("#endDate").val();
284 294 var lineName = $('#line option:selected').text();
... ... @@ -292,9 +302,10 @@
292 302 return;
293 303 }
294 304 var params = {};
  305 + sfyy = $("#sfyy").val();
  306 + line = $("#line").val();
295 307 company = $("#company").val();
296 308 subCompany = $("#subCompany").val();
297   - line = $("#line").val();
298 309 startDate = $("#startDate").val();
299 310 endDate = $("#endDate").val();
300 311 lineName = $('#line option:selected').text();
... ... @@ -302,9 +313,10 @@
302 313 lineName = $('#subCompany option:selected').text();
303 314 if(line == " ")
304 315 line = "";
  316 + params['sfyy'] = sfyy;
  317 + params['line'] = line;
305 318 params['company'] = company;
306 319 params['subCompany'] = subCompany;
307   - params['line'] = line;
308 320 params['startDate'] = startDate;
309 321 params['endDate'] = endDate;
310 322 params['type'] = "query";
... ... @@ -332,9 +344,10 @@
332 344  
333 345 $("#export").on("click",function(){
334 346 var params = {};
  347 + params['sfyy'] = sfyy;
  348 + params['line'] = line;
335 349 params['company'] = company;
336 350 params['subCompany'] = subCompany;
337   - params['line'] = line;
338 351 params['startDate'] = startDate;
339 352 params['endDate'] = endDate;
340 353 params['type'] = "export";
... ... @@ -357,9 +370,10 @@
357 370 $("#exportMap").on("click",function(){
358 371 var i = layer.load(2);
359 372 var params = {};
  373 + params['sfyy'] = sfyy;
  374 + params['line'] = tempLine;
360 375 params['company'] = company;
361 376 params['subCompany'] = subCompany;
362   - params['line'] = tempLine;
363 377 params['startDate'] = startDate;
364 378 params['endDate'] = endDate;
365 379 params['type'] = "exportMap";
... ... @@ -381,9 +395,10 @@
381 395 $("#exportSumMap").on("click",function(){
382 396 var i = layer.load(2);
383 397 var params = {};
  398 + params['sfyy'] = sfyy;
  399 + params['line'] = line;
384 400 params['company'] = company;
385 401 params['subCompany'] = subCompany;
386   - params['line'] = line;
387 402 params['startDate'] = startDate;
388 403 params['endDate'] = endDate;
389 404 params['type'] = "delay_export";
... ...
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
... ... @@ -53,7 +53,7 @@
53 53 <span class="item-label" style="width: 80px;">分公司: </span>
54 54 <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select>
55 55 </div>
56   - <div style="display: inline-block; margin-left: 25px;">
  56 + <div style="display: inline-block; margin-left: 10px;">
57 57 <span class="item-label" style="width: 80px;">选择线路: </span>
58 58 <select class="form-control" name="line" id="line" style="width: 150px;"></select>
59 59 </div>
... ... @@ -64,7 +64,15 @@
64 64 </select>
65 65 </div>
66 66 <div style="margin-top: 10px"></div>
67   - <div style="display: inline-block;margin-left: 5px;">
  67 + <div style="display: inline-block; margin-left: 5px">
  68 + <span class="item-label" style="width: 80px;">是否营运: </span>
  69 + <select class="form-control" name="sfyy" id="sfyy" style="width: 140px;">
  70 + <option value="0">全部线路</option>
  71 + <option value="1" selected="selected">营运线路</option>
  72 + <option value="2">非营运线路</option>
  73 + </select>
  74 + </div>
  75 + <div style="display: inline-block;margin-left: 10px;">
68 76 <span class="item-label" style="width: 80px;">开始时间: </span>
69 77 <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
70 78 </div>
... ... @@ -227,7 +235,7 @@
227 235 $("#company").on("change",updateCompany);
228 236 function updateCompany(){
229 237 var company = $('#company').val();
230   - var options = '';
  238 + var options = '<option value="">全部分公司</option>';
231 239 for(var i = 0; i < obj.length; i++){
232 240 if(obj[i].companyCode == company){
233 241 var children = obj[i].children;
... ... @@ -270,9 +278,10 @@
270 278 var temp = tempData[$("#line").val()].split(":");
271 279 $("#company").val(temp[0]);
272 280 updateCompany();
273   - $("#subCompany").val(temp[1]);
  281 +// $("#subCompany").val(temp[1]);
  282 + $("#subCompany").val("");
274 283 $("#company").attr("disabled", true);
275   - $("#subCompany").attr("disabled", true);
  284 +// $("#subCompany").attr("disabled", true);
276 285 }
277 286 });
278 287  
... ... @@ -305,6 +314,7 @@
305 314 $("#query").on("click",jsDoQuery);
306 315  
307 316 var sfqr = 0;
  317 + var sfyy = 1;
308 318 var line = $("#line").val();
309 319 var startDate = $("#startDate").val();
310 320 var endDate = $("#endDate").val();
... ... @@ -327,6 +337,7 @@
327 337 if(line == " ")
328 338 line = "";
329 339 // line = $("#line").val();
  340 + sfyy = $("#sfyy").val();
330 341 startDate = $("#startDate").val();
331 342 endDate = $("#endDate").val();
332 343 model = $("#model").val();
... ... @@ -335,6 +346,7 @@
335 346 subCompany = $("#subCompany").val();
336 347 params['sfqr'] = sfqr;
337 348 params['line'] = line;
  349 + params['sfyy'] = sfyy;
338 350 params['startDate'] = startDate;
339 351 params['endDate'] = endDate;
340 352 params['model'] = model;
... ... @@ -385,6 +397,7 @@
385 397 var params = {};
386 398 params['sfqr'] = sfqr;
387 399 params['line'] = line;
  400 + params['sfyy'] = sfyy;
388 401 params['startDate'] = startDate;
389 402 params['endDate'] = endDate;
390 403 params['model'] = model;
... ...
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
... ... @@ -33,15 +33,15 @@
33 33 <div class="portlet light porttlet-fit bordered">
34 34 <div class="portlet-title">
35 35 <form id="history" class="form-inline" action="">
36   - <div style="display: inline-block; margin-left: 33px;" id="company1">
  36 + <div style="display: inline-block; margin-left: 28px;" id="company1">
37 37 <span class="item-label" style="width: 80px;">公司: </span>
38 38 <select class="form-control" name="company" id="company" style="width: 140px;"></select>
39 39 </div>
40   - <div style="display: inline-block; margin-left: 24px;" id="subCompany1">
  40 + <div style="display: inline-block; margin-left: 19px;" id="subCompany1">
41 41 <span class="item-label" style="width: 80px;">分公司: </span>
42 42 <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select>
43 43 </div>
44   - <div style="display: inline-block; margin-left: 24px;">
  44 + <div style="display: inline-block; margin-left: 15px;">
45 45 <span class="item-label" style="width: 80px;">线路: </span>
46 46 <select class="form-control" name="line" id="line" style="width: 140px;"></select>
47 47 </div>
... ... @@ -58,16 +58,22 @@
58 58 </select>
59 59 </div>
60 60 <div style="margin-top: 10px"></div>
61   - <div style="display: inline-block;margin-left: 5px;">
  61 + <div style="display: inline-block;margin-left: 0px;">
62 62 <span class="item-label" style="width: 80px;">开始时间: </span>
63 63 <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
64 64 </div>
65   - <div style="display: inline-block;margin-left: 10px;">
  65 + <div style="display: inline-block;margin-left: 5px;">
66 66 <span class="item-label" style="width: 80px;">结束时间: </span>
67 67 <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
68 68 </div>
  69 + <div style="display: inline-block; margin-left: 10px;">
  70 + <select class="form-control" name="sfqr" id="sfqr" style="width: 75px;">
  71 + <option value="0">全日</option>
  72 + <option value="1">时段</option>
  73 + </select>
  74 + </div>
69 75 <div style="display: inline-block;margin-left: 10px;">
70   - <span class="item-label" style="width: 80px;">时间段: </span>
  76 +<!-- <span class="item-label" style="width: 80px;">时间段: </span> -->
71 77 <input class="form-control" type="text" id="times1" style="width: 60px;"/>
72 78 </div>
73 79 <div style="display: inline-block;">
... ... @@ -164,7 +170,7 @@
164 170  
165 171 <script>
166 172 $(function(){
167   - var list;
  173 + var workLists;
168 174  
169 175 // 关闭左侧栏
170 176 if (!$('body').hasClass('page-sidebar-closed'))
... ... @@ -205,6 +211,8 @@
205 211  
206 212 $("#times1").val("05:00");
207 213 $("#times2").val("23:00");
  214 + $("#times1").attr("disabled", true);
  215 + $("#times2").attr("disabled", true);
208 216  
209 217 var fage=false;
210 218 var xlList;
... ... @@ -291,14 +299,27 @@
291 299 updateCompany();
292 300 $("#subCompany").val(temp[1]);
293 301 $("#company").attr("disabled", true);
294   - $("#subCompany").attr("disabled", true);
  302 +// $("#subCompany").attr("disabled", true);
  303 + }
  304 + });
  305 +
  306 + $("#sfqr").on("change", function(){
  307 + if($("#sfqr").val() == 0){
  308 + $("#times1").attr("disabled", true);
  309 + $("#times2").attr("disabled", true);
  310 + sfqr = 0;
  311 + }else{
  312 + $("#times1").attr("disabled", false);
  313 + $("#times2").attr("disabled", false);
  314 + sfqr = 1;
295 315 }
296 316 });
297 317  
298 318 $("#query").on("click", function (){
299 319 jsDoQuery();
300 320 });
301   -
  321 +
  322 + var sfqr = 0;
302 323 var line = $("#line").val();
303 324 var startDate = $("#startDate").val();
304 325 var endDate = $("#endDate").val();
... ... @@ -312,7 +333,7 @@
312 333 layer.msg("请选择日期");
313 334 return;
314 335 }
315   - if($("#times1").val().trim().length == 0 || $("#times2").val().trim().length == 0){
  336 + if(sfqr == 1 && $("#times1").val().trim().length == 0 || $("#times2").val().trim().length == 0){
316 337 layer.msg("请选择时间");
317 338 return;
318 339 }
... ... @@ -326,6 +347,7 @@
326 347 company = $("#company").val();
327 348 subCompany = $("#subCompany").val();
328 349 params['line'] = line;
  350 + params['sfqr'] = sfqr;
329 351 params['startDate'] = startDate;
330 352 params['endDate'] = endDate;
331 353 params['model'] = model;
... ... @@ -337,7 +359,6 @@
337 359 var i = layer.load(2);
338 360 $("#forms .hidden").removeClass("hidden");
339 361 $get('/busInterval/lineTimeAnaliy', params, function(result){
340   - console.log(result);
341 362 // 把数据填充到模版中
342 363 var tbodyHtml = template('list_lineTimeAnaly',{list:result});
343 364 layer.close(i);
... ... @@ -346,13 +367,13 @@
346 367 $('#forms tbody').html(tbodyHtml);
347 368 $("#works_hidden").addClass("hidden");
348 369 $("#printArea").addClass("hidden");
349   - list = result;
  370 + workLists = result;
350 371 });
351 372  
352 373 }
353 374  
354 375 $("#forms tbody").on("click","tr",function(){
355   - if($(this).children().size() < 2){
  376 + if(!$(this).children() || $(this).children().size() < 2){
356 377 return;
357 378 }
358 379 var params = {};
... ... @@ -361,9 +382,9 @@
361 382 params[index] = $(this).text();
362 383 }
363 384 });
364   - $.each(list, function(i, g){
  385 + $.each(workLists, function(i, g){
365 386 if(g.line == params[2] && g.lp == params[3] &&g.station == params[4]){
366   - var tbodyHtml = template('list_workList',{list:g});
  387 + var tbodyHtml = template('list_lineTimeAnaly_1',{list:g});
367 388 $('#works tbody').html(tbodyHtml);
368 389 $("#works_hidden").removeClass("hidden");
369 390 $("#works .hidden").removeClass("hidden");
... ... @@ -491,7 +512,7 @@
491 512 </tr>
492 513 {{/if}}
493 514 </script>
494   -<script type="text/html" id="list_workList">
  515 +<script type="text/html" id="list_lineTimeAnaly_1">
495 516 {{each list.workList as obj i}}
496 517 <tr>
497 518 <td>{{obj.date}}</td>
... ...
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
... ... @@ -28,38 +28,38 @@
28 28 <div class="portlet light porttlet-fit bordered">
29 29 <div class="portlet-title">
30 30 <form id="history" class="form-inline" action="">
31   - <div style="display: inline-block;margin-left: 38px;" id="company1">
  31 + <div style="display: inline-block;margin-left: 33px;" id="company1">
32 32 <span class="item-label" style="width: 80px;">公司: </span>
33   - <select class="form-control" name="company" id="company" style="width: 160px;"></select>
  33 + <select class="form-control" name="company" id="company" style="width: 150px;"></select>
34 34 </div>
35 35 <div style="display: inline-block;margin-left: 24px;" id="subCompany1">
36 36 <span class="item-label" style="width: 80px;">分公司: </span>
37   - <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
  37 + <select class="form-control" name="subCompany" id="subCompany" style="width: 150px;"></select>
38 38 </div>
39 39 <div style="display: inline-block;margin-left: 38px;">
40 40 <span class="item-label" style="width: 80px;">线路: </span>
41   - <select class="form-control" name="line" id="line" style="width: 160px;"></select>
  41 + <select class="form-control" name="line" id="line" style="width: 150px;"></select>
42 42 </div>
43 43 <div style="display: inline-block;margin-left: 10px;">
44 44 <span class="item-label" style="width: 80px;">班次类型: </span>
45   - <select class="form-control" name="line" id="bcType" style="width: 160px;">
  45 + <select class="form-control" name="line" id="bcType" style="width: 150px;">
46 46 <option value="0">全部班次</option>
47 47 <option value="1">全程</option>
48 48 <option value="2">区间</option>
49 49 </select>
50 50 </div>
51 51 <div style="margin-top: 10px"></div>
52   - <div style="display: inline-block;margin-left: 10px;">
  52 + <div style="display: inline-block;margin-left: 5px;">
53 53 <span class="item-label" style="width: 80px;">开始时间: </span>
54   - <input class="form-control" type="text" id="startDate" style="width: 160px;"/>
  54 + <input class="form-control" type="text" id="startDate" style="width: 150px;"/>
55 55 </div>
56 56 <div style="display: inline-block;margin-left: 10px;">
57 57 <span class="item-label" style="width: 80px;">结束时间: </span>
58   - <input class="form-control" type="text" id="endDate" style="width: 160px;"/>
  58 + <input class="form-control" type="text" id="endDate" style="width: 150px;"/>
59 59 </div>
60 60 <div style="display: inline-block;margin-left: 10px;">
61 61 <span class="item-label" style="width: 80px;">模板类型: </span>
62   - <select class="form-control" name="model" id="model" style="width: 160px;">
  62 + <select class="form-control" name="model" id="model" style="width: 150px;">
63 63 <option value="">请选择...</option>
64 64 </select>
65 65 </div>
... ... @@ -162,6 +162,7 @@
162 162 function updateCompany(){
163 163 var company = $('#company').val();
164 164 var options = '';
  165 +// var options = '<option value="">全部分公司</option>';
165 166 for(var i = 0; i < obj.length; i++){
166 167 if(obj[i].companyCode == company){
167 168 var children = obj[i].children;
... ... @@ -208,11 +209,11 @@
208 209 updateCompany();
209 210 $("#subCompany").val(temp[1]);
210 211 $("#company").attr("disabled", true);
211   - $("#subCompany").attr("disabled", true);
  212 +// $("#subCompany").attr("disabled", true);
212 213 }
213 214 });
214 215  
215   -
  216 +
216 217 $("#query").on("click", function(){
217 218 page = 0;
218 219 jsDoQuery(true);
... ...
src/main/resources/static/pages/forms/statement/statisticsDaily.html
... ... @@ -37,7 +37,7 @@
37 37 <!-- <div> -->
38 38 <div class="portlet-title">
39 39 <form class="form-inline" action="">
40   - <div style="display: inline-block; " id="gsdmDiv">
  40 + <div style="display: inline-block;margin-left: 29px; " id="gsdmDiv">
41 41 <span class="item-label" style="width: 80px;">公司: </span>
42 42 <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
43 43 </div>
... ... @@ -45,11 +45,21 @@
45 45 <span class="item-label" style="width: 80px;">分公司: </span>
46 46 <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
47 47 </div>
48   - <div style="margin-top: 2px"></div>
49   - <div style="display: inline-block;">
  48 + <div style="display: inline-block;margin-left: 42px;">
50 49 <span class="item-label" style="width: 80px;">线路: </span>
51 50 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
52 51 </div>
  52 + <div style="margin-top: 3px"></div>
  53 + <div style="display: inline-block;">
  54 + <span class="item-label" style="width: 80px;">线路性质: </span>
  55 + <select
  56 + class="form-control" name="nature" id="nature"
  57 + style="width: 180px;">
  58 + <option value="0">全部线路</option>
  59 + <option value="1" selected="selected">营运线路</option>
  60 + <option value="2">非营运线路</option>
  61 + </select>
  62 + </div>
53 63 <div style="display: inline-block;margin-left: 15px;">
54 64 <span class="item-label" style="width: 80px;">开始时间: </span>
55 65 <input class="form-control" type="text" id="date" style="width: 180px;"/>
... ... @@ -70,11 +80,12 @@
70 80 <table class="table table-bordered table-hover table-checkable" id="forms">
71 81 <thead>
72 82 <tr>
73   - <th colspan="44"><label id="tjrq"></label> 线路统计日报</th>
  83 + <th colspan="45"><label id="tjrq"></label> 线路统计日报</th>
74 84 </tr>
75 85 <tr>
  86 + <td rowspan="3"><span >分公司</span></td>
76 87 <td rowspan="3"><span >路线名</span></td>
77   - <td colspan="20">全日营运里程(公里)(注:实际营运里程、实际空驶里程、实际总里程均已包含临加里程)</td>
  88 + <td colspan="21">全日营运里程(公里)(注:实际营运里程、实际空驶里程、实际总里程均已包含临加里程)</td>
78 89 <td colspan="15">全日营运班次</td>
79 90 <td colspan="9">大间隔情况</td>
80 91 </tr>
... ... @@ -89,7 +100,7 @@
89 100 <td rowspan="2"><span>少驶公里</span></td>
90 101 <td rowspan="2"><span>少驶班次</span></td>
91 102 <td colspan="11">少驶原因(公里)</td>
92   - <td rowspan="2"><span >临加公里</span></td>
  103 + <td colspan="2">临加公里</td>
93 104 <td colspan="3">计划班次</td>
94 105 <td colspan="3">实际班次</td>
95 106 <td colspan="3">临加班次</td>
... ... @@ -97,7 +108,7 @@
97 108 <td colspan="3">调头班次</td>
98 109 <td colspan="3">发生次数</td>
99 110 <td rowspan="2">最大间隔时间(分)</td>
100   - <td rowspan="2">原因</td>
  111 + <td rowspan="2">原因</td>
101 112 </tr>
102 113 <tr>
103 114 <td><span >路阻</span></td>
... ... @@ -111,6 +122,8 @@
111 122 <td><span>气候</span></td>
112 123 <td><span>援外</span></td>
113 124 <td><span>其他</span></td>
  125 + <td><span>营运</span></td>
  126 + <td><span>空驶</span></td>
114 127 <td><span>全日</span></td>
115 128 <td><span>早高峰</span></td>
116 129 <td><span>晚高峰</span></td>
... ... @@ -138,8 +151,6 @@
138 151 </div>
139 152 </div>
140 153 </div>
141   - </div>
142   -</div>
143 154  
144 155 <script>
145 156 $(function(){
... ... @@ -173,7 +184,7 @@
173 184 });
174 185  
175 186  
176   - var fage=false;
  187 + var fage=true;
177 188 var obj = [];
178 189 var xlList;
179 190 $.get('/report/lineList',function(result){
... ... @@ -189,8 +200,10 @@
189 200 $("#gsdmDiv").css('display','none');
190 201 }else if(obj.length ==1){
191 202 $("#gsdmDiv").css('display','none');
192   - if(obj[0].children.length == 1 || obj[0].children.length ==0)
  203 + if(obj[0].children.length == 1 || obj[0].children.length ==0){
  204 + fage=false;
193 205 $('#fgsdmDiv').css('display','none');
  206 + }
194 207 }
195 208 $('#gsdm').html(options);
196 209 updateCompany();
... ... @@ -200,6 +213,9 @@
200 213 function updateCompany(){
201 214 var company = $('#gsdm').val();
202 215 var options = '';
  216 + if(fage){
  217 + options = '<option value="">请选择</option>';
  218 + }
203 219 for(var i = 0; i < obj.length; i++){
204 220 if(obj[i].companyCode == company){
205 221 var children = obj[i].children;
... ... @@ -243,6 +259,7 @@
243 259 var temp = tempData[$("#line").val()].split(":");
244 260 $("#gsdm").val(temp[0]);
245 261 updateCompany();
  262 + $("#nature").val(0);
246 263 $("#fgsdm").val(temp[1]);
247 264 $("#gsdm").attr("disabled", true);
248 265 $("#fgsdm").attr("disabled", true);
... ... @@ -256,6 +273,7 @@
256 273 var date2 ="";
257 274 var gsdm="";
258 275 var fgsdm="";
  276 + var nature="";
259 277 $("#query").on("click",function(){
260 278 if($("#date").val() == null || $("#date").val().trim().length == 0){
261 279 layer.msg("请选择时间范围!");
... ... @@ -271,9 +289,12 @@
271 289 date2 =$("#date2").val();
272 290 gsdm =$("#gsdm").val();
273 291 fgsdm=$("#fgsdm").val();
  292 + nature=$("#nature").val();
274 293 xlName = $("#select2-line-container").html();
275 294 if(xlName == "全部线路")
276 295 xlName = $('#fgsdm option:selected').text();
  296 + if(xlName == "请选择")
  297 + xlName = $('#gsdm option:selected').text();
277 298 if(line=="请选择"){
278 299 line="";
279 300 }
... ... @@ -292,6 +313,7 @@
292 313 params['date'] = date;
293 314 params['date2'] = date2;
294 315 params['xlName'] = xlName;
  316 + params['nature'] = nature;
295 317 params['type'] = "query";
296 318 var i = layer.load(2);
297 319 $get('/realSchedule/statisticsDailyTj',params,function(result){
... ... @@ -318,6 +340,7 @@
318 340 params['date'] = date;
319 341 params['date2'] = date2;
320 342 params['xlName'] = xlName;
  343 + params['nature'] = nature;
321 344 params['type'] = "export";
322 345 var i = layer.load(2);
323 346 $get('/realSchedule/statisticsDailyTj',params,function(result){
... ... @@ -339,6 +362,7 @@
339 362 <script type="text/html" id="statisticsDaily">
340 363 {{each list as obj i}}
341 364 <tr {{if obj.zt==1}}style='color: red'{{/if}}>
  365 + <td>{{obj.fgsName}}</td>
342 366 <td>{{obj.xlName}}</td>
343 367 <td>{{obj.jhzlc}}</td>
344 368 <td>{{obj.jhlc}}</td>
... ... @@ -360,6 +384,7 @@
360 384 <td>{{obj.ssgl_yw}}</td>
361 385 <td>{{obj.ssgl_other}}</td>
362 386 <td>{{obj.ljgl}}</td>
  387 + <td>{{obj.ljks}}</td>
363 388 <td>{{obj.jhbc}}</td>
364 389 <td>{{obj.jhbc_m}}</td>
365 390 <td>{{obj.jhbc_a}}</td>
... ...
src/main/resources/static/pages/forms/statement/statisticsDailyCalc.html
... ... @@ -28,7 +28,7 @@
28 28  
29 29 <div class="page-head">
30 30 <div class="page-title">
31   - <h1>统计日报</h1>
  31 + <h1>缁熻鏃ユ姤</h1>
32 32 </div>
33 33 </div>
34 34  
... ... @@ -38,97 +38,97 @@
38 38 <div class="portlet-title">
39 39 <form class="form-inline" action="">
40 40 <div style="display: inline-block; " id="gsdmDiv">
41   - <span class="item-label" style="width: 80px;">公司: </span>
  41 + <span class="item-label" style="width: 80px;">鍏徃: </span>
42 42 <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
43 43 </div>
44 44 <div style="display: inline-block; margin-left: 29px;" id="fgsdmDiv">
45   - <span class="item-label" style="width: 80px;">分公司: </span>
  45 + <span class="item-label" style="width: 80px;">鍒嗗叕鍙�: </span>
46 46 <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
47 47 </div>
48 48 <div style="margin-top: 2px"></div>
49 49 <div style="display: inline-block;">
50   - <span class="item-label" style="width: 80px;">线路: </span>
  50 + <span class="item-label" style="width: 80px;">绾胯矾: </span>
51 51 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
52 52 </div>
53 53 <div style="display: inline-block;margin-left: 15px;">
54   - <span class="item-label" style="width: 80px;">开始时间: </span>
  54 + <span class="item-label" style="width: 80px;">寮�濮嬫椂闂�: </span>
55 55 <input class="form-control" type="text" id="date" style="width: 180px;"/>
56 56 </div>
57 57 <div style="display: inline-block;margin-left: 15px;">
58   - <span class="item-label" style="width: 80px;">结束时间: </span>
  58 + <span class="item-label" style="width: 80px;">缁撴潫鏃堕棿: </span>
59 59 <input class="form-control" type="text" id="date2" style="width: 180px;"/>
60 60 </div>
61 61 <div class="form-group">
62   - <input class="btn btn-default" type="button" id="query" value="查询"/>
63   - <input class="btn btn-default" type="button" id="export" value="导出"/>
  62 + <input class="btn btn-default" type="button" id="query" value="鏌ヨ"/>
  63 + <input class="btn btn-default" type="button" id="export" value="瀵煎嚭"/>
64 64 </div>
65 65 </form>
66 66 </div>
67 67 <div class="portlet-body" id="tjrbBody" style="overflow:auto;height: calc(100% - 80px)">
68 68 <div class="table-container" style="margin-top: 10px;min-width: 906px">
69   - <label>早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
  69 + <label>鏃╅珮宄�:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;鏅氶珮宄�:16:01~18:00</label>
70 70 <table class="table table-bordered table-hover table-checkable" id="forms">
71 71 <thead>
72 72 <tr>
73   - <th colspan="44"><label id="tjrq"></label> 线路统计日报</th>
  73 + <th colspan="44"><label id="tjrq"></label> 绾胯矾缁熻鏃ユ姤</th>
74 74 </tr>
75 75 <tr>
76   - <td rowspan="3"><span >路线名</span></td>
77   - <td colspan="20">全日营运里程(公里)</td>
78   - <td colspan="15">全日营运班次</td>
79   - <td colspan="9">大间隔情况</td>
  76 + <td rowspan="3"><span >璺嚎鍚�</span></td>
  77 + <td colspan="20">鍏ㄦ棩钀ヨ繍閲岀▼锛堝叕閲岋級</td>
  78 + <td colspan="15">鍏ㄦ棩钀ヨ繍鐝</td>
  79 + <td colspan="9">澶ч棿闅旀儏鍐�</td>
80 80 </tr>
81 81 <tr>
82   - <td rowspan="2"><label>计划总</label>
83   - <label>公里&nbsp;&nbsp;&nbsp;</label></td>
84   - <td rowspan="2"><label>计划营</label><label>运公里</label></td>
85   - <td rowspan="2"><label>计划空</label><label>驶公里</label></td>
86   - <td rowspan="2"><label>实际</label><label>总公里</label></td>
87   - <td rowspan="2"><label>实际营</label><label>运公里</label></td>
88   - <td rowspan="2"><label>实际空</label><label>驶公里</label></td>
89   - <td rowspan="2"><span>少驶公里</span></td>
90   - <td rowspan="2"><span>少驶班次</span></td>
91   - <td colspan="11">少驶原因(公里)</td>
92   - <td rowspan="2"><span >临加公里</span></td>
93   - <td colspan="3">计划班次</td>
94   - <td colspan="3">实际班次</td>
95   - <td colspan="3">临加班次</td>
96   - <td colspan="3">放站班次</td>
97   - <td colspan="3">调头班次</td>
98   - <td colspan="3">发生次数</td>
99   - <td rowspan="2">最大间隔时间(分)</td>
100   - <td rowspan="2">原因</td>
  82 + <td rowspan="2"><label>璁″垝鎬�</label>
  83 + <label>鍏噷&nbsp;&nbsp;&nbsp;</label></td>
  84 + <td rowspan="2"><label>璁″垝钀�</label><label>杩愬叕閲�</label></td>
  85 + <td rowspan="2"><label>璁″垝绌�</label><label>椹跺叕閲�</label></td>
  86 + <td rowspan="2"><label>瀹為檯</label><label>鎬诲叕閲�</label></td>
  87 + <td rowspan="2"><label>瀹為檯钀�</label><label>杩愬叕閲�</label></td>
  88 + <td rowspan="2"><label>瀹為檯绌�</label><label>椹跺叕閲�</label></td>
  89 + <td rowspan="2"><span>灏戦┒鍏噷</span></td>
  90 + <td rowspan="2"><span>灏戦┒鐝</span></td>
  91 + <td colspan="11">灏戦┒鍘熷洜锛堝叕閲岋級</td>
  92 + <td rowspan="2"><span >涓村姞鍏噷</span></td>
  93 + <td colspan="3">璁″垝鐝</td>
  94 + <td colspan="3">瀹為檯鐝</td>
  95 + <td colspan="3">涓村姞鐝</td>
  96 + <td colspan="3">鏀剧珯鐝</td>
  97 + <td colspan="3">璋冨ご鐝</td>
  98 + <td colspan="3">鍙戠敓娆℃暟</td>
  99 + <td rowspan="2">鏈�澶ч棿闅旀椂闂达紙鍒嗭級</td>
  100 + <td rowspan="2">鍘熷洜</td>
101 101 </tr>
102 102 <tr>
103   - <td><span >路阻</span></td>
104   - <td><span>吊慢</span></td>
105   - <td><span >故障</span></td>
106   - <td><span >纠纷</span></td>
107   - <td><span >肇事</span></td>
108   - <td><span>缺人</span></td>
109   - <td><span>缺车</span></td>
110   - <td><span >客稀</span></td>
111   - <td><span>气候</span></td>
112   - <td><span>援外</span></td>
113   - <td><span>其他</span></td>
114   - <td><span>全日</span></td>
115   - <td><span>早高峰</span></td>
116   - <td><span>晚高峰</span></td>
117   - <td><span>全日</span></td>
118   - <td><span>早高峰</span></td>
119   - <td><span>晚高峰</span></td>
120   - <td><span>全日</span></td>
121   - <td><span>早高峰</span></td>
122   - <td><span>晚高峰</span></td>
123   - <td><span>全日</span></td>
124   - <td><span>早高峰</span></td>
125   - <td><span>晚高峰</span></td>
126   - <td><span>全日</span></td>
127   - <td><span>早高峰</span></td>
128   - <td><span>晚高峰</span></td>
129   - <td><span>全日</span></td>
130   - <td><span>早高峰</span></td>
131   - <td><span>晚高峰</span></td>
  103 + <td><span >璺樆</span></td>
  104 + <td><span>鍚婃參</span></td>
  105 + <td><span >鏁呴殰</span></td>
  106 + <td><span >绾犵悍</span></td>
  107 + <td><span >鑲囦簨</span></td>
  108 + <td><span>缂轰汉</span></td>
  109 + <td><span>缂鸿溅</span></td>
  110 + <td><span >瀹㈢█</span></td>
  111 + <td><span>姘斿��</span></td>
  112 + <td><span>鎻村</span></td>
  113 + <td><span>鍏朵粬</span></td>
  114 + <td><span>鍏ㄦ棩</span></td>
  115 + <td><span>鏃╅珮宄�</span></td>
  116 + <td><span>鏅氶珮宄�</span></td>
  117 + <td><span>鍏ㄦ棩</span></td>
  118 + <td><span>鏃╅珮宄�</span></td>
  119 + <td><span>鏅氶珮宄�</span></td>
  120 + <td><span>鍏ㄦ棩</span></td>
  121 + <td><span>鏃╅珮宄�</span></td>
  122 + <td><span>鏅氶珮宄�</span></td>
  123 + <td><span>鍏ㄦ棩</span></td>
  124 + <td><span>鏃╅珮宄�</span></td>
  125 + <td><span>鏅氶珮宄�</span></td>
  126 + <td><span>鍏ㄦ棩</span></td>
  127 + <td><span>鏃╅珮宄�</span></td>
  128 + <td><span>鏅氶珮宄�</span></td>
  129 + <td><span>鍏ㄦ棩</span></td>
  130 + <td><span>鏃╅珮宄�</span></td>
  131 + <td><span>鏅氶珮宄�</span></td>
132 132 </tr>
133 133 </thead>
134 134 <tbody class="statisticsDailyCalc">
... ... @@ -145,7 +145,7 @@
145 145 $(function(){
146 146 $('#export').attr('disabled', "true");
147 147  
148   - // 关闭左侧栏
  148 + // 鍏抽棴宸︿晶鏍�
149 149 if (!$('body').hasClass('page-sidebar-closed'))
150 150 $('.menu-toggler.sidebar-toggler').click();
151 151  
... ... @@ -215,7 +215,7 @@
215 215 var tempData = {};
216 216 $.get('/report/lineList',function(xlList){
217 217 var data = [];
218   - data.push({id: " ", text: "全部线路"});
  218 + data.push({id: " ", text: "鍏ㄩ儴绾胯矾"});
219 219 $.get('/user/companyData', function(result){
220 220 for(var i = 0; i < result.length; i++){
221 221 var companyCode = result[i].companyCode;
... ... @@ -258,11 +258,11 @@
258 258 var fgsdm="";
259 259 $("#query").on("click",function(){
260 260 if($("#date").val() == null || $("#date").val().trim().length == 0){
261   - layer.msg("请选择时间范围!");
  261 + layer.msg("璇烽�夋嫨鏃堕棿鑼冨洿锛�");
262 262 return;
263 263 }
264 264 if($("#date2").val() == null || $("#date2").val().trim().length == 0){
265   - layer.msg("请选择时间范围!");
  265 + layer.msg("璇烽�夋嫨鏃堕棿鑼冨洿锛�");
266 266 return;
267 267 }
268 268 // $("#tjrbBody").height($(window).height()-100);
... ... @@ -272,15 +272,15 @@
272 272 gsdm =$("#gsdm").val();
273 273 fgsdm=$("#fgsdm").val();
274 274 xlName = $("#select2-line-container").html();
275   - if(xlName == "全部线路")
  275 + if(xlName == "鍏ㄩ儴绾胯矾")
276 276 xlName = $('#fgsdm option:selected').text();
277   - if(line=="请选择"){
  277 + if(line=="璇烽�夋嫨"){
278 278 line="";
279 279 }
280 280 if(date==null || date =="" ||date2==null || date2 ==""){
281   - layer.msg('请选择时间段.');
  281 + layer.msg('璇烽�夋嫨鏃堕棿娈�.');
282 282 }else{
283   - $("#tjrq").html(date+""+date2);
  283 + $("#tjrq").html(date+"鑷�"+date2);
284 284 var params = {};
285 285 params['gsdm'] = gsdm;
286 286 params['fgsdm'] =fgsdm ;
... ... @@ -292,9 +292,9 @@
292 292 var i = layer.load(2);
293 293 // $get('/realSchedule/statisticsDailyTj',params,function(result){
294 294 $get('/calcWaybill/statisticsDailyTj',params,function(result){
295   - // 把数据填充到模版中
  295 + // 鎶婃暟鎹~鍏呭埌妯$増涓�
296 296 var tbodyHtml = template('statisticsDailyCalc',{list:result});
297   - // 把渲染好的模版html文本追加到表格中
  297 + // 鎶婃覆鏌撳ソ鐨勬ā鐗坔tml鏂囨湰杩藉姞鍒拌〃鏍间腑
298 298 $('#forms .statisticsDailyCalc').html(tbodyHtml);
299 299 layer.close(i);
300 300  
... ... @@ -327,7 +327,7 @@
327 327 +"-"+moment(date2).format("YYYYMMDD");
328 328 }
329 329 window.open("/downloadFile/download?fileName="
330   - +dateTime+"-"+xlName+"-统计日报");
  330 + +dateTime+"-"+xlName+"-缁熻鏃ユ姤");
331 331 layer.close(i);
332 332 });
333 333 });
... ... @@ -382,7 +382,7 @@
382 382 {{/each}}
383 383 {{if list.length == 0}}
384 384 <tr>
385   - <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td>
  385 + <td colspan="44"><h6 class="muted">娌℃湁鎵惧埌鐩稿叧鏁版嵁</h6></td>
386 386 </tr>
387 387 {{/if}}
388 388 </script>
389 389 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/statisticsDailyCalc2.html
... ... @@ -37,7 +37,7 @@
37 37 <!-- <div> -->
38 38 <div class="portlet-title">
39 39 <form class="form-inline" action="">
40   - <div style="display: inline-block; " id="gsdmDiv">
  40 + <div style="display: inline-block;margin-left: 29px; " id="gsdmDiv">
41 41 <span class="item-label" style="width: 80px;">公司: </span>
42 42 <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
43 43 </div>
... ... @@ -45,11 +45,21 @@
45 45 <span class="item-label" style="width: 80px;">分公司: </span>
46 46 <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
47 47 </div>
48   - <div style="margin-top: 2px"></div>
49   - <div style="display: inline-block;">
  48 + <div style="display: inline-block;margin-left: 42px;">
50 49 <span class="item-label" style="width: 80px;">线路: </span>
51 50 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
52 51 </div>
  52 + <div style="margin-top: 3px"></div>
  53 + <div style="display: inline-block;">
  54 + <span class="item-label" style="width: 80px;">线路性质: </span>
  55 + <select
  56 + class="form-control" name="nature" id="nature"
  57 + style="width: 180px;">
  58 + <option value="0">全部线路</option>
  59 + <option value="1" selected="selected">营运线路</option>
  60 + <option value="2">非营运线路</option>
  61 + </select>
  62 + </div>
53 63 <div style="display: inline-block;margin-left: 15px;">
54 64 <span class="item-label" style="width: 80px;">开始时间: </span>
55 65 <input class="form-control" type="text" id="date" style="width: 180px;"/>
... ... @@ -70,11 +80,12 @@
70 80 <table class="table table-bordered table-hover table-checkable" id="forms">
71 81 <thead>
72 82 <tr>
73   - <th colspan="44"><label id="tjrq"></label> 线路统计日报</th>
  83 + <th colspan="45"><label id="tjrq"></label> 线路统计日报</th>
74 84 </tr>
75 85 <tr>
  86 + <td rowspan="3"><span >分公司</span></td>
76 87 <td rowspan="3"><span >路线名</span></td>
77   - <td colspan="20">全日营运里程(公里)(注:实际营运里程、实际空驶里程、实际总里程均已包含临加里程)</td>
  88 + <td colspan="21">全日营运里程(公里)(注:实际营运里程、实际空驶里程、实际总里程均已包含临加里程)</td>
78 89 <td colspan="15">全日营运班次</td>
79 90 <td colspan="9">大间隔情况</td>
80 91 </tr>
... ... @@ -89,7 +100,7 @@
89 100 <td rowspan="2"><span>少驶公里</span></td>
90 101 <td rowspan="2"><span>少驶班次</span></td>
91 102 <td colspan="11">少驶原因(公里)</td>
92   - <td rowspan="2"><span >临加公里</span></td>
  103 + <td colspan="2">临加公里</td>
93 104 <td colspan="3">计划班次</td>
94 105 <td colspan="3">实际班次</td>
95 106 <td colspan="3">临加班次</td>
... ... @@ -111,6 +122,8 @@
111 122 <td><span>气候</span></td>
112 123 <td><span>援外</span></td>
113 124 <td><span>其他</span></td>
  125 + <td><span>营运</span></td>
  126 + <td><span>空驶</span></td>
114 127 <td><span>全日</span></td>
115 128 <td><span>早高峰</span></td>
116 129 <td><span>晚高峰</span></td>
... ... @@ -138,8 +151,6 @@
138 151 </div>
139 152 </div>
140 153 </div>
141   - </div>
142   -</div>
143 154  
144 155 <script>
145 156 $(function(){
... ... @@ -173,7 +184,7 @@
173 184 $("#date2").val(dateTime);
174 185  
175 186  
176   - var fage=false;
  187 + var fage=true;
177 188 var obj = [];
178 189 var xlList;
179 190 $.get('/report/lineList',function(result){
... ... @@ -189,8 +200,10 @@
189 200 $("#gsdmDiv").css('display','none');
190 201 }else if(obj.length ==1){
191 202 $("#gsdmDiv").css('display','none');
192   - if(obj[0].children.length == 1 || obj[0].children.length ==0)
  203 + if(obj[0].children.length == 1 || obj[0].children.length ==0){
  204 + fage=false;
193 205 $('#fgsdmDiv').css('display','none');
  206 + }
194 207 }
195 208 $('#gsdm').html(options);
196 209 updateCompany();
... ... @@ -200,6 +213,9 @@
200 213 function updateCompany(){
201 214 var company = $('#gsdm').val();
202 215 var options = '';
  216 + if(fage){
  217 + options = '<option value="">请选择</option>';
  218 + }
203 219 for(var i = 0; i < obj.length; i++){
204 220 if(obj[i].companyCode == company){
205 221 var children = obj[i].children;
... ... @@ -256,6 +272,7 @@
256 272 var date2 ="";
257 273 var gsdm="";
258 274 var fgsdm="";
  275 + var nature="";
259 276 $("#query").on("click",function(){
260 277 if($("#date").val() == null || $("#date").val().trim().length == 0){
261 278 layer.msg("请选择时间范围!");
... ... @@ -271,9 +288,12 @@
271 288 date2 =$("#date2").val();
272 289 gsdm =$("#gsdm").val();
273 290 fgsdm=$("#fgsdm").val();
  291 + nature=$("#nature").val();
274 292 xlName = $("#select2-line-container").html();
275 293 if(xlName == "全部线路")
276 294 xlName = $('#fgsdm option:selected').text();
  295 + if(xlName =='请选择')
  296 + xlName = $('#gsdm option:selected').text();
277 297 if(line=="请选择"){
278 298 line="";
279 299 }
... ... @@ -289,6 +309,7 @@
289 309 params['date2'] = date2;
290 310 params['xlName'] = xlName;
291 311 params['type'] = "query";
  312 + params['nature']=nature;
292 313 var i = layer.load(2);
293 314 // $get('/realSchedule/statisticsDailyTj',params,function(result){
294 315 $get('/calcWaybill/calcStatisticsDaily2',params,function(result){
... ... @@ -315,7 +336,8 @@
315 336 params['date'] = date;
316 337 params['date2'] = date2;
317 338 params['xlName'] = xlName;
318   - params['type'] = "export";
  339 + params['type'] = "export";
  340 + params['nature']=nature;
319 341 var i = layer.load(2);
320 342 // $get('/realSchedule/statisticsDailyTj',params,function(result){
321 343 $get('/calcWaybill/calcStatisticsDaily2',params,function(result){
... ... @@ -337,6 +359,7 @@
337 359 <script type="text/html" id="statisticsDailyCalc2">
338 360 {{each list as obj i}}
339 361 <tr {{if obj.zt==1}}style='color: red'{{/if}}>
  362 + <td>{{obj.fgsName}}</td>
340 363 <td>{{obj.xlName}}</td>
341 364 <td>{{obj.jhzlc}}</td>
342 365 <td>{{obj.jhlc}}</td>
... ... @@ -358,6 +381,7 @@
358 381 <td>{{obj.ssgl_yw}}</td>
359 382 <td>{{obj.ssgl_other}}</td>
360 383 <td>{{obj.ljgl}}</td>
  384 + <td>{{obj.ljks}}</td>
361 385 <td>{{obj.jhbc}}</td>
362 386 <td>{{obj.jhbc_m}}</td>
363 387 <td>{{obj.jhbc_a}}</td>
... ...
src/main/resources/static/pages/forms/statement/timeAndSpeed.html
... ... @@ -55,8 +55,20 @@
55 55 <option value="">请选择...</option>
56 56 </select>
57 57 </div>
  58 + <div style="display: inline-block; margin-left: 10px" id="lp1">
  59 + <span class="item-label" style="width: 80px;">路牌: </span>
  60 + <select class="form-control" name="lp" id="lp" style="width: 140px;"></select>
  61 + </div>
58 62 <div style="margin-top: 10px"></div>
59   - <div style="display: inline-block; margin-left: 5px;">
  63 + <div style="display: inline-block; margin-left: 5px">
  64 + <span class="item-label" style="width: 80px;">是否营运: </span>
  65 + <select class="form-control" name="sfyy" id="sfyy" style="width: 140px;">
  66 + <option value="0">全部线路</option>
  67 + <option value="1" selected="selected">营运线路</option>
  68 + <option value="2">非营运线路</option>
  69 + </select>
  70 + </div>
  71 + <div style="display: inline-block; margin-left: 10px;">
60 72 <span class="item-label" style="width: 80px;">开始时间: </span>
61 73 <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
62 74 </div>
... ... @@ -78,10 +90,6 @@
78 90 <span class="item-label" style="width: 80px;"> - </span>
79 91 <input class="form-control" type="text" id="times2" style="width: 60px;"/>
80 92 </div>
81   - <div style="display: inline-block; margin-left: 10px" id="lp1">
82   - <span class="item-label" style="width: 80px;">路牌: </span>
83   - <select class="form-control" name="lp" id="lp" style="width: 140px;"></select>
84   - </div>
85 93 <div class="form-group" style="margin-left: 14px">
86 94 <input class="btn btn-default" type="button" id="query" value="筛选"/>
87 95 <input class="btn btn-default" type="button" id="export" value="导出"/>
... ... @@ -186,7 +194,7 @@
186 194 $("#company").on("change",updateCompany);
187 195 function updateCompany(){
188 196 var company = $('#company').val();
189   - var options = '';
  197 + var options = '<option value="">全部分公司</option>';
190 198 for(var i = 0; i < obj.length; i++){
191 199 if(obj[i].companyCode == company){
192 200 var children = obj[i].children;
... ... @@ -196,7 +204,7 @@
196 204 }
197 205 }
198 206 $('#subCompany').html(options);
199   - }
  207 + }
200 208  
201 209 var tempData = {};
202 210 $.get('/report/lineList',function(xlList){
... ... @@ -235,9 +243,10 @@
235 243 var temp = tempData[$("#line").val()].split(":");
236 244 $("#company").val(temp[0]);
237 245 updateCompany();
238   - $("#subCompany").val(temp[1]);
  246 +// $("#subCompany").val(temp[1]);
  247 + $("#subCompany").val("");
239 248 $("#company").attr("disabled", true);
240   - $("#subCompany").attr("disabled", true);
  249 +// $("#subCompany").attr("disabled", true);
241 250 }
242 251 });
243 252  
... ... @@ -246,6 +255,7 @@
246 255 });
247 256  
248 257 var list = [];
  258 + var sfyy = 1;
249 259 var sfqr = 0;
250 260 var statu = 0;
251 261 var line = $("#line").val();
... ... @@ -269,6 +279,7 @@
269 279 return;
270 280 }
271 281 var params = {};
  282 + sfyy = $("#sfyy").val();
272 283 line = $("#line").val();
273 284 startDate = $("#startDate").val();
274 285 endDate = $("#endDate").val();
... ... @@ -282,6 +293,7 @@
282 293 if(lineName == "全部线路")
283 294 lineName = $('#subCompany option:selected').text();
284 295 params['lp'] = lp;
  296 + params['sfyy'] = sfyy;
285 297 params['line'] = line;
286 298 params['sfqr'] = sfqr;
287 299 params['statu'] = statu;
... ... @@ -314,7 +326,7 @@
314 326 var key = $(this).parent().prev().html();
315 327 $.each(list.dataList, function(i, g){
316 328 if(g.line == key){
317   - var tbodyHtml = template('list_workList',{list:g});
  329 + var tbodyHtml = template('list_timeAndSpeed_1',{list:g});
318 330 $("#works_hidden").removeClass("hidden");
319 331 $("#date0").html(g.date);
320 332 $("#line0").html(g.line);
... ... @@ -344,6 +356,7 @@
344 356 }
345 357 var params = {};
346 358 params['lp'] = lp;
  359 + params['sfyy'] = sfyy;
347 360 params['line'] = line;
348 361 params['sfqr'] = sfqr;
349 362 params['statu'] = statu;
... ... @@ -585,7 +598,7 @@
585 598 {{/if}}
586 599 </tbody>
587 600 </script>
588   -<script type="text/html" id="list_workList">
  601 +<script type="text/html" id="list_timeAndSpeed_1">
589 602 <thead>
590 603 <tr>
591 604 <th width='80px'>日期</th>
... ...
src/main/resources/static/pages/forms/statement/workDaily.html
... ... @@ -28,11 +28,11 @@
28 28 <div class="portlet light porttlet-fit bordered">
29 29 <div class="portlet-title">
30 30 <form id="history" class="form-inline" action="">
31   - <div style="display: inline-block; margin-left: 10px;" id="company1">
  31 + <div style="display: inline-block; margin-left: 33px;" id="company1">
32 32 <span class="item-label" style="width: 80px;">公司: </span>
33 33 <select class="form-control" name="company" id="company" style="width: 160px;"></select>
34 34 </div>
35   - <div style="display: inline-block; margin-left: 10px;" id="subCompany1">
  35 + <div style="display: inline-block; margin-left: 5px;" id="subCompany1">
36 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 37 <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
38 38 </div>
... ... @@ -40,11 +40,20 @@
40 40 <span class="item-label" style="width: 80px;">线路: </span>
41 41 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
42 42 </div>
43   - <div style="display: inline-block;margin-left: 10px;">
  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">全部线路</option>
  48 + <option value="1" selected="selected">营运线路</option>
  49 + <option value="2">非营运线路</option>
  50 + </select>
  51 + </div>
  52 + <div style="display: inline-block;margin-left: 19px;">
44 53 <span class="item-label" style="width: 80px;">时间: </span>
45   - <input class="form-control" type="text" id="date" style="width: 180px;"/>
  54 + <input class="form-control" type="text" id="date" style="width: 160px;"/>
46 55 </div>
47   - <div class="form-group">
  56 + <div class="form-group" style="margin-left: 10px;">
48 57 <input class="btn btn-default" type="button" id="query" value="筛选"/>
49 58 <input class="btn btn-default" type="button" id="export" value="导出"/>
50 59 </div>
... ... @@ -185,7 +194,7 @@
185 194 updateCompany();
186 195 $("#subCompany").val(temp[1]);
187 196 $("#company").attr("disabled", true);
188   - $("#subCompany").attr("disabled", true);
  197 +// $("#subCompany").attr("disabled", true);
189 198 }
190 199 });
191 200  
... ... @@ -194,6 +203,7 @@
194 203  
195 204 $("#query").on("click",jsDoQuery);
196 205  
  206 + var sfyy = $("#sfyy").val();
197 207 var line = $("#line").val();
198 208 var date = $("#date").val();
199 209 var company = $("#company").val();
... ... @@ -205,6 +215,7 @@
205 215 return;
206 216 }
207 217 var params = {};
  218 + sfyy = $("#sfyy").val();
208 219 line = $("#line").val();
209 220 date = $("#date").val();
210 221 company = $("#company").val();
... ... @@ -214,6 +225,7 @@
214 225 lineName = $('#subCompany option:selected').text();
215 226 if(line == " ")
216 227 line = "";
  228 + params['sfyy'] = sfyy;
217 229 params['line'] = line;
218 230 params['date'] = date;
219 231 params['type'] = "query";
... ... @@ -237,6 +249,7 @@
237 249  
238 250 $("#export").on("click",function(){
239 251 var params = {};
  252 + params['sfyy'] = sfyy;
240 253 params['line'] = line;
241 254 params['date'] = date;
242 255 params['type'] = "export";
... ...
src/main/resources/static/pages/mforms/changetochanges/changetochange.html
... ... @@ -49,23 +49,31 @@
49 49 class="form-control" name="company" id="gsdmChange"
50 50 style="width: 140px;"></select>
51 51 </div>
52   - <div style="display: inline-block; margin-left: 24px;"
  52 + <div style="display: inline-block; margin-left: 19px;"
53 53 id="fgsdmDiv_change">
54 54 <span class="item-label" style="width: 80px;">分公司: </span> <select
55 55 class="form-control" name="subCompany" id="fgsdmChange"
56 56 style="width: 140px;"></select>
57 57 </div>
58   - <div style="display: inline-block; margin-left: 10px;">
  58 + <div style="display: inline-block; margin-left: 33px;">
59 59 <span class="item-label" style="width: 80px;">线路: </span> <select
60 60 class="form-control" name="line" id="line" style="width: 180px;"></select>
61 61 </div>
62 62 <div style="margin-top: 10px"></div>
  63 + <div style="display: inline-block; margin-left: 5px">
  64 + <span class="item-label" style="width: 80px;">是否营运: </span>
  65 + <select class="form-control" name="sfyy" id="sfyy" style="width: 140px;">
  66 + <option value="0">全部线路</option>
  67 + <option value="1" selected="selected">营运线路</option>
  68 + <option value="2">非营运线路</option>
  69 + </select>
  70 + </div>
63 71 <div style="display: inline-block; margin-left: 5px;">
64 72 <span class="item-label" style="width: 80px;">开始时间: </span> <input
65 73 class="form-control" type="text" id="startDate"
66 74 style="width: 140px;" />
67 75 </div>
68   - <div style="display: inline-block; margin-left: 10px;">
  76 + <div style="display: inline-block; margin-left: 5px;">
69 77 <span class="item-label" style="width: 80px;">结束时间: </span> <input
70 78 class="form-control" type="text" id="endDate"
71 79 style="width: 140px;" />
... ... @@ -182,7 +190,7 @@
182 190 $("#gsdmChange").on("change",updateCompany);
183 191 function updateCompany(){
184 192 var company = $('#gsdmChange').val();
185   - var options = '';
  193 + var options = '<option value="">全部分公司</option>';
186 194 for(var i = 0; i < obj.length; i++){
187 195 if(obj[i].companyCode == company){
188 196 var children = obj[i].children;
... ... @@ -194,7 +202,7 @@
194 202 $('#fgsdmChange').html(options);
195 203 }
196 204  
197   -
  205 +
198 206 var tempData = {};
199 207 $.get('/report/lineList',function(xlList){
200 208 var data = [];
... ... @@ -226,18 +234,21 @@
226 234 var temp = tempData[$("#line").val()].split(":");
227 235 $("#gsdmChange").val(temp[0]);
228 236 updateCompany();
229   - $("#fgsdmChange").val(temp[1]);
  237 +// $("#fgsdmChange").val(temp[1]);
  238 + $("#fgsdmChange").val("");
230 239 $("#gsdmChange").attr("disabled", true);
231   - $("#fgsdmChange").attr("disabled", true);
  240 +// $("#fgsdmChange").attr("disabled", true);
232 241 }
233 242 });
234 243  
235 244 var line;
236 245 var startDate;
237 246 var endDate;
  247 + var sfyy = 0;
238 248 $("#query").on(
239 249 "click",
240 250 function() {
  251 + sfyy = $("#sfyy").val();
241 252 line = $("#line").val();
242 253 sel = $("#sel").val();
243 254 var startDate1 = $("#startDate").val();
... ... @@ -249,6 +260,7 @@
249 260 $get('/mcy_forms/changetochange', {
250 261 sel : sel,
251 262 line : line,
  263 + sfyy : sfyy,
252 264 startDate : $("#startDate").val(),
253 265 endDate : $("#endDate").val(),
254 266 gsdm:gsdmChange,
... ... @@ -272,13 +284,14 @@
272 284 $("#export").on(
273 285 "click",
274 286 function() {
  287 + sfyy = $("#sfyy").val();
275 288 line = $("#line").val();
276 289 var sel = $("#sel").val();
277   - var startDate = $("#startDate").val();
278   - var endDate = $("#endDate").val();
279   - var lpName = $("#lpName").val();
280   - var gsdmChange= $("#gsdmChange").val();
281   - var fgsdmChange= $("#fgsdmChange").val();
  290 + var startDate = $("#startDate").val();
  291 + var endDate = $("#endDate").val();
  292 + var lpName = $("#lpName").val();
  293 + var gsdmChange= $("#gsdmChange").val();
  294 + var fgsdmChange= $("#fgsdmChange").val();
282 295 var lineName = $('#line option:selected').text();
283 296 if(lineName == "全部线路")
284 297 lineName = $('#fgsdmChange option:selected').text();
... ... @@ -286,6 +299,7 @@
286 299 $post('/mcy_export/changetochangeExport', {
287 300 sel:sel,
288 301 line:line,
  302 + sfyy:sfyy,
289 303 gsdm:gsdmChange,
290 304 fgsdm:fgsdmChange,
291 305 startDate : startDate,
... ...
src/main/resources/static/pages/mforms/operationservices/operationservice.html
... ... @@ -34,31 +34,39 @@
34 34 id="gsdmDiv_operat">
35 35 <span class="item-label" style="width: 80px;">公司: </span> <select
36 36 class="form-control" name="company" id="gsdmOperat"
37   - style="width: 140px;"></select>
  37 + style="width: 150px;"></select>
38 38 </div>
39   - <div style="display: inline-block; margin-left: 25px;"
  39 + <div style="display: inline-block; margin-left: 19px;"
40 40 id="fgsdmDiv_operat">
41 41 <span class="item-label" style="width: 80px;">分公司: </span> <select
42 42 class="form-control" name="subCompany" id="fgsdmOperat"
43   - style="width: 140px;"></select>
  43 + style="width: 150px;"></select>
44 44 </div>
45   - <div style="margin-top: 2px"></div>
46 45 <div style="display: inline-block;margin-left: 33px;">
47 46 <span class="item-label" style="width: 80px;">线路: </span> <select
48   - class="form-control" name="line" id="line" style="width: 140px;"></select>
  47 + class="form-control" name="line" id="line" style="width: 150px;"></select>
49 48 </div>
50   - <div style="display: inline-block; margin-left: 11px;">
  49 + <div style="margin-top: 10px"></div>
  50 + <div style="display: inline-block; margin-left: 5px">
  51 + <span class="item-label" style="width: 80px;">是否营运: </span>
  52 + <select class="form-control" name="sfyy" id="sfyy" style="width: 150px;">
  53 + <option value="0">全部线路</option>
  54 + <option value="1" selected="selected">营运线路</option>
  55 + <option value="2">非营运线路</option>
  56 + </select>
  57 + </div>
  58 + <div style="display: inline-block; margin-left: 5px;">
51 59 <span class="item-label" style="width: 80px;">开始时间: </span> <input
52 60 class="form-control" type="text" id="startDate"
53   - style="width: 140px;" />
  61 + style="width: 150px;" />
54 62 </div>
55   - <div style="display: inline-block; margin-left: 15px;">
  63 + <div style="display: inline-block; margin-left: 5px;">
56 64 <span class="item-label" style="width: 80px;">结束时间: </span> <input
57 65 class="form-control" type="text" id="endDate"
58   - style="width: 140px;" />
  66 + style="width: 150px;" />
59 67 </div>
60   - <div style="display: inline-block; margin-left: 15px">
61   - <span class="item-label" style="width: 150px;">统计: </span>
  68 + <div style="display: inline-block; margin-left: 10px">
  69 + <span class="item-label" style="width: 150px;">统计: </span>
62 70 </div>
63 71 <div class="form-group">
64 72 <input class="btn btn-default" type="button" id="query" value="筛选" />
... ... @@ -75,6 +83,7 @@
75 83 <thead>
76 84 <tr>
77 85 <th>序号</th>
  86 + <th>公司</th>
78 87 <th>线路名称</th>
79 88 <th>加注量</th>
80 89 <th>消耗量</th>
... ... @@ -143,7 +152,7 @@
143 152 $("#gsdmOperat").on("change",updateCompany);
144 153 function updateCompany(){
145 154 var company = $('#gsdmOperat').val();
146   - var options = '';
  155 + var options = '<option value="">全部分公司</option>';
147 156 for(var i = 0; i < obj.length; i++){
148 157 if(obj[i].companyCode == company){
149 158 var children = obj[i].children;
... ... @@ -186,9 +195,10 @@
186 195 var temp = tempData[$("#line").val()].split(":");
187 196 $("#gsdmOperat").val(temp[0]);
188 197 updateCompany();
189   - $("#fgsdmOperat").val(temp[1]);
  198 +// $("#fgsdmOperat").val(temp[1]);
  199 + $("#fgsdmOperat").val("");
190 200 $("#gsdmOperat").attr("disabled", true);
191   - $("#fgsdmOperat").attr("disabled", true);
  201 +// $("#fgsdmOperat").attr("disabled", true);
192 202 }
193 203 });
194 204  
... ... @@ -196,6 +206,7 @@
196 206 $("#query").on(
197 207 "click",
198 208 function() {
  209 + var sfyy = $("#sfyy").val();
199 210 var line = $("#line").val();
200 211 var startDate = $("#startDate").val();
201 212 var endDate = $("#endDate").val();
... ... @@ -204,9 +215,10 @@
204 215 var fgsdmOperat = $("#fgsdmOperat").val();
205 216 var i = layer.load(2);
206 217 $get("/mcy_forms/operationservice", {
  218 + sfyy : sfyy,
  219 + line : line,
207 220 gsdmOperat : gsdmOperat,
208 221 fgsdmOperat : fgsdmOperat,
209   - line : line,
210 222 startDate : startDate,
211 223 endDate : endDate,
212 224 lpName : lpName,
... ... @@ -236,6 +248,7 @@
236 248 });
237 249 });
238 250 $("#export").on("click",function(){
  251 + sfyy = $("#sfyy").val();
239 252 line = $("#line").val();
240 253 startDate=$("#startDate").val();
241 254 endDate=$("#endDate").val();
... ... @@ -245,7 +258,7 @@
245 258 if(lineName == "全部线路")
246 259 lineName = $('#fgsdmOperat option:selected').text();
247 260 var i = layer.load(2);
248   - $get('/mcy_export/operationserviceExport',{gsdmOperat:gsdmOperat,fgsdmOperat:fgsdmOperat,line:line,startDate:startDate,endDate:endDate,type:'export',lineName:lineName},function(result){
  261 + $get('/mcy_export/operationserviceExport',{sfyy:sfyy,line:line,gsdmOperat:gsdmOperat,fgsdmOperat:fgsdmOperat,startDate:startDate,endDate:endDate,type:'export',lineName:lineName},function(result){
249 262 var dateTime = "";
250 263 if(startDate == endDate){
251 264 dateTime = moment(startDate).format("YYYYMMDD");
... ... @@ -266,6 +279,7 @@
266 279 {{each list as obj i}}
267 280 <tr>
268 281 <td>{{i+1}}</td>
  282 + <td>{{obj.fgs}}</td>
269 283 <td>{{obj.xlName}}</td>
270 284 <td>{{obj.jzl}}</td>
271 285 <td>{{obj.xhl}}</td>
... ... @@ -276,7 +290,7 @@
276 290 {{/each}}
277 291 {{if list.length == 0}}
278 292 <tr>
279   - <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  293 + <td colspan="8"><h6 class="muted">没有找到相关数据</h6></td>
280 294 </tr>
281 295 {{/if}}
282 296 </script>
... ...
src/main/resources/static/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html
... ... @@ -188,7 +188,7 @@
188 188 updateCompany();
189 189 $("#fgsdmManth").val(temp[1]);
190 190 $("#gsdmManth").attr("disabled", true);
191   - $("#fgsdmManth").attr("disabled", true);
  191 +// $("#fgsdmManth").attr("disabled", true);
192 192 }
193 193 });
194 194  
... ...
src/main/resources/static/pages/mforms/singledatas/singledata.html
... ... @@ -32,21 +32,30 @@
32 32 <span class="item-label" style="width: 80px;">公司: </span>
33 33 <select class="form-control" name="company" id="gsdmSing" style="width: 140px;"></select>
34 34 </div>
35   - <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_sing">
  35 + <div style="display: inline-block; margin-left: 10px;" id="fgsdmDiv_sing">
36 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 37 <select class="form-control" name="subCompany" id="fgsdmSing" style="width: 140px;"></select>
38 38 </div>
39   - <div style="display: inline-block;">
40   - <span class="item-label" style="width: 80px;">&nbsp;线路: </span>
  39 + <div style="display: inline-block; margin-left: 15px;">
  40 + <span class="item-label" style="width: 80px;">线路: </span>
41 41 <select class="form-control" name="line" id="line" style="width: 140px;"></select>
42 42 </div>
43   - <div style="display: inline-block;margin-left: 15px;">
  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: 140px;">
  47 + <option value="0">全部线路</option>
  48 + <option value="1" selected="selected">营运线路</option>
  49 + <option value="2">非营运线路</option>
  50 + </select>
  51 + </div>
  52 + <div style="display: inline-block;margin-left: 24px;">
44 53 <span class="item-label" style="width: 140px;">时间: </span>
45 54 <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
46 55 </div>
47 56  
48 57 <div style="display: inline-block;margin-left: 15px">
49   - <span class="item-label" style="width: 150px;">统计 </span>
  58 + <span class="item-label" style="width: 150px;">统计: </span>
50 59 <select class="form-control" name="tjtype" id="tjtype" style="width: 140px;">
51 60 <option value="jsy">驾驶员</option>
52 61 <option value="spy">售票员</option>
... ... @@ -129,7 +138,7 @@
129 138 $("#gsdmSing").on("change",updateCompany);
130 139 function updateCompany(){
131 140 var company = $('#gsdmSing').val();
132   - var options = '';
  141 + var options = '<option value="">全部分公司</option>';
133 142 for(var i = 0; i < obj.length; i++){
134 143 if(obj[i].companyCode == company){
135 144 var children = obj[i].children;
... ... @@ -172,9 +181,10 @@
172 181 var temp = tempData[$("#line").val()].split(":");
173 182 $("#gsdmSing").val(temp[0]);
174 183 updateCompany();
175   - $("#fgsdmSing").val(temp[1]);
  184 +// $("#fgsdmSing").val(temp[1]);
  185 + $("#fgsdmSing").val("");
176 186 $("#gsdmSing").attr("disabled", true);
177   - $("#fgsdmSing").attr("disabled", true);
  187 +// $("#fgsdmSing").attr("disabled", true);
178 188 }
179 189 });
180 190  
... ... @@ -184,6 +194,7 @@
184 194 layer.msg("请选择时间!");
185 195 return;
186 196 }
  197 + var sfyy = $("#sfyy").val();
187 198 var line = $("#line").val();
188 199 var startDate = $("#startDate").val();
189 200 var lpName = $("#lpName").val();
... ... @@ -193,7 +204,7 @@
193 204 var params = {};
194 205 var i = layer.load(2);
195 206 // if(tjtype=='jsy'){
196   - $get("/mcy_forms/singledatatj",{ gsdmSing:gsdmSing,fgsdmSing:fgsdmSing, line:line,startDate:startDate,lpName:lpName,tjtype:tjtype},function(result){
  207 + $get("/mcy_forms/singledatatj",{sfyy:sfyy,gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,lpName:lpName,tjtype:tjtype},function(result){
197 208 layer.close(i);
198 209 var singledata = template('singledata',{list:result});
199 210 // 把渲染好的模版html文本追加到表格中
... ... @@ -219,6 +230,7 @@
219 230 });
220 231  
221 232 $("#export").on("click",function(){
  233 + var sfyy = $("#sfyy").val();
222 234 var line = $("#line").val();
223 235 var startDate = $("#startDate").val();
224 236 var endDate = $("#endDate").val();
... ... @@ -231,7 +243,7 @@
231 243 lineName = $('#fgsdmSing option:selected').text();
232 244 var i = layer.load(2);
233 245 // if(tjtype=='jsy'){
234   - $get('/mcy_export/singledataExportTj',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,type:'export',lineName:lineName},function(result){
  246 + $get('/mcy_export/singledataExportTj',{sfyy:sfyy,gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,type:'export',lineName:lineName},function(result){
235 247 window.open("/downloadFile/download?fileName="
236 248 +moment(startDate).format("YYYYMMDD")
237 249 +"-"+lineName+"-路单数据");
... ...
src/main/resources/static/pages/mforms/turnoutrates/calcTurnoutrate.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 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px;
  14 + text-align: center;}
  15 +
  16 + .table > tbody + tbody {
  17 + border-top: 1px solid; }
  18 + .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{ text-align: center; }
  19 +.table-checkable tr > th:first-child, .table-checkable tr > td:first-child {
  20 + text-align: center;
  21 + max-width: initial;
  22 + min-width: 40px;
  23 + padding-left: 0;
  24 + padding-right: 0;
  25 +}
  26 +
  27 +</style>
  28 +
  29 +<div class="page-head">
  30 + <div class="page-title">
  31 + <h1>营运线路出车率统计表</h1>
  32 + </div>
  33 +</div>
  34 +
  35 +<div class="row">
  36 + <div class="col-md-12">
  37 + <div class="portlet light porttlet-fit bordered">
  38 + <div class="portlet-title">
  39 + <form class="form-inline" action="" method="post">
  40 + <div style="display: inline-block; margin-left: 20px;" id="gsdmDiv_turn">
  41 + <span class="item-label" style="width: 80px;margin-left: 11px;">公司: </span>
  42 + <select class="form-control" name="company" id="gsdmTurn" style="width: 140px;"></select>
  43 + </div>
  44 + <div style="display: inline-block; margin-left: 20px;" id="fgsdmDiv_turn">
  45 + <span class="item-label" style="width: 80px;margin-left: 5px;">分公司: </span>
  46 + <select class="form-control" name="subCompany" id="fgsdmTurn" style="width: 140px;"></select>
  47 + </div>
  48 + <div style="display: inline-block; margin-left: 33px;">
  49 + <span class="item-label" style="width: 80px;margin-left: 11px;">线路: </span>
  50 + <select class="form-control" name="line" id="line" style="width: 140px;"></select>
  51 + </div>
  52 + <div style="margin-top: 10px"></div>
  53 + <div style="display: inline-block;">
  54 + <span class="item-label" style="width: 80px;">线路性质: </span> <select
  55 + class="form-control" name="nature" id="nature"
  56 + style="width: 140px;">
  57 + <option value="0">全部线路</option>
  58 + <option value="1" selected="selected">营运线路</option>
  59 + <option value="2">非营运线路</option>
  60 + </select>
  61 + </div>
  62 + <div style="display: inline-block;margin-left: 15px;">
  63 + <span class="item-label" style="width: 80px;">开始时间: </span>
  64 + <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
  65 + </div>
  66 + <div style="display: inline-block;margin-left: 15px;">
  67 + <span class="item-label" style="width: 80px;">结束时间: </span>
  68 + <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
  69 + </div>
  70 + <div class="form-group">
  71 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  72 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  73 + </div>
  74 + </form>
  75 + </div>
  76 + <div class="portlet-body">
  77 + <div class="table-container" style="margin-top: 20px;overflow:auto;min-width: 1000px">
  78 + <table class="table table-bordered table-hover table-checkable" id="forms1">
  79 + <thead>
  80 + <tr>
  81 + <th colspan="15">营运线路出车率统计表</th>
  82 + </tr>
  83 + <tr>
  84 + <td rowspan="3" style=" padding-top: 20px;">日期</td>
  85 + <td rowspan="3" style=" padding-top: 20px;">公司</td>
  86 + <td rowspan="3" style=" padding-top: 20px;">直属公司</td>
  87 + <td rowspan="3" style=" padding-top: 20px;">线路条数</td>
  88 + <td colspan="4">出车数</td>
  89 + <td colspan="2">出车率</td>
  90 + <td colspan="2" >班次数</td>
  91 + <td rowspan="3" style=" padding-top: 20px;">班次执行率</td>
  92 + <td rowspan="3" style=" padding-top: 20px;">说明</td>
  93 + </tr>
  94 + <tr>
  95 + <td rowspan="2">权证</td>
  96 + <td rowspan="2">计划</td>
  97 + <td colspan="2">实际</td>
  98 + <td rowspan="2">全日</td>
  99 + <td rowspan="2">早高峰</td>
  100 + <td rowspan="2">计划</td>
  101 + <td rowspan="2">实际</td>
  102 + </tr>
  103 + <tr>
  104 + <td>全日</td>
  105 + <td>早高峰</td>
  106 + </tr>
  107 + </thead>
  108 + <tbody id="tbody">
  109 +
  110 + </tbody>
  111 + </table>
  112 + </div>
  113 + </div>
  114 + </div>
  115 + </div>
  116 +</div>
  117 +
  118 +<script>
  119 + $(function(){
  120 + // 关闭左侧栏
  121 + if (!$('body').hasClass('page-sidebar-closed'))
  122 + $('.menu-toggler.sidebar-toggler').click();
  123 +
  124 +
  125 + var d = new Date();
  126 + d.setTime(d.getTime() - 1*1000*60*60*24);
  127 + var year = d.getFullYear();
  128 + var month = d.getMonth() + 1;
  129 + var day = d.getDate();
  130 + if(month < 10)
  131 + month = "0" + month;
  132 + if(day < 10)
  133 + day = "0" + day;
  134 + var dateTime = year + "-" + month + "-" + day;
  135 + $("#startDate,#endDate").datetimepicker({
  136 + format : 'YYYY-MM-DD',
  137 + locale : 'zh-cn',
  138 + maxDate : dateTime
  139 + });
  140 + $("#startDate").val(dateTime);
  141 + $("#endDate").val(dateTime);
  142 +
  143 + var fage=true;
  144 + var xlList;
  145 + var obj = [];
  146 +
  147 + $.get('/report/lineList',function(result){
  148 + xlList=result;
  149 + $.get('/user/companyData', function(result){
  150 + obj = result;
  151 + var options = '';
  152 + for(var i = 0; i < obj.length; i++){
  153 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  154 + }
  155 +
  156 + if(obj.length ==0){
  157 + $("#gsdmDiv_turn").css('display','none');
  158 + }else if(obj.length ==1){
  159 + $("#gsdmDiv_turn").css('display','none');
  160 + if(obj[0].children.length == 1 || obj[0].children.length ==0){
  161 + fage=false;
  162 + $('#fgsdmDiv_turn').css('display','none');
  163 +
  164 + }
  165 + }
  166 + $('#gsdmTurn').html(options);
  167 + updateCompany();
  168 + });
  169 + })
  170 + $("#gsdmTurn").on("change",updateCompany);
  171 + function updateCompany(){
  172 + var company = $('#gsdmTurn').val();
  173 + var options = '';
  174 + if(fage){
  175 + options = '<option value="">请选择</option>';
  176 + }
  177 + for(var i = 0; i < obj.length; i++){
  178 + if(obj[i].companyCode == company){
  179 + var children = obj[i].children;
  180 + for(var j = 0; j < children.length; j++){
  181 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  182 + }
  183 + }
  184 + }
  185 + $('#fgsdmTurn').html(options);
  186 + }
  187 +
  188 + var tempData = {};
  189 + $.get('/report/lineList',function(xlList){
  190 + var data = [];
  191 + data.push({id: " ", text: "全部线路"});
  192 + $.get('/user/companyData', function(result){
  193 + for(var i = 0; i < result.length; i++){
  194 + var companyCode = result[i].companyCode;
  195 + var children = result[i].children;
  196 + for(var j = 0; j < children.length; j++){
  197 + var code = children[j].code;
  198 + for(var k=0;k < xlList.length;k++ ){
  199 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  200 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  201 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  202 + }
  203 + }
  204 + }
  205 + }
  206 + initPinYinSelect2('#line',data,'');
  207 +
  208 + });
  209 + });
  210 +
  211 + $("#line").on("change", function(){
  212 + if($("#line").val() == " "){
  213 + $("#gsdmTurn").attr("disabled", false);
  214 + $("#fgsdmTurn").attr("disabled", false);
  215 + } else {
  216 + var temp = tempData[$("#line").val()].split(":");
  217 + $("#gsdmTurn").val(temp[0]);
  218 + updateCompany();
  219 + $("#fgsdmTurn").val(temp[1]);
  220 + $("#gsdmTurn").attr("disabled", true);
  221 + $("#fgsdmTurn").attr("disabled", true);
  222 + }
  223 + });
  224 +
  225 + var line;
  226 + var startDate;
  227 + var endDate;
  228 + var gsdmTurn;
  229 + var fgsdmTurn;
  230 + var nature;
  231 + $("#query").on("click",function(){
  232 +
  233 + line = $("#line").val();
  234 + startDate=$("#startDate").val();
  235 + endDate=$("#endDate").val();
  236 + gsdmTurn=$("#gsdmTurn").val();
  237 + fgsdmTurn=$("#fgsdmTurn").val();
  238 + nature=$("#nature").val();
  239 + if(startDate!=''&&endDate!=''){
  240 + var i = layer.load(2);
  241 + $get('/calcSheet/calcTurnoutrate',
  242 + { gsdmTurn:gsdmTurn,fgsdmTurn:fgsdmTurn, line:line,startDate:startDate,endDate:endDate,nature:nature,type:'query'},function(result){
  243 +// var result=[];
  244 + // 把数据填充到模版中
  245 + var tbodyHtml = template('calcTurnoutrate',{list:result});
  246 + // 把渲染好的模版html文本追加到表格中
  247 + $('#tbody').html(tbodyHtml);
  248 + layer.close(i);
  249 + line = $("#line").val();
  250 + startDate = $("#startDate").val();
  251 + endDate = $("#endDate").val();
  252 + $("#sDate").text(startDate);
  253 + $("#eDate").text(endDate);
  254 + var temp = {};
  255 + var today_account = 0;
  256 +
  257 + temp["line"] = $("#line").text();
  258 + $.each(result, function(i, obj) {
  259 + if(moment(obj.schedule_date_str).format("YYYY-MM-DD") == moment(obj.startDate).format("YYYY-MM-DD")){
  260 + today_account++;
  261 + }
  262 + obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss");
  263 + });
  264 +
  265 + });
  266 +
  267 + }else{
  268 + layer.msg("请选择时间范围!");
  269 + }
  270 + });
  271 +
  272 + $("#export").on("click",function(){
  273 + line = $("#line").val();
  274 + startDate=$("#startDate").val();
  275 + endDate=$("#endDate").val();
  276 + gsdmTurn=$("#gsdmTurn").val();
  277 + fgsdmTurn=$("#fgsdmTurn").val();
  278 + nature=$("#nature").val();
  279 + var lineName = $('#line option:selected').text();
  280 + if(lineName == "全部线路")
  281 + lineName = $('#fgsdmTurn option:selected').text();
  282 + if(lineName =="请选择")
  283 + lineName = $('#gsdmTurn option:selected').text();
  284 + var i = layer.load(2);
  285 + $get('/calcSheet/calcTurnoutrate',{gsdmTurn:gsdmTurn,fgsdmTurn:fgsdmTurn,line:line,startDate:startDate,endDate:endDate,nature:nature,type:'export',lineName:lineName},function(result){
  286 + var dateTime = "";
  287 + if(startDate == endDate){
  288 + dateTime = startDate;
  289 + } else {
  290 + dateTime = startDate+"-"+endDate;
  291 + }
  292 + window.open("/downloadFile/download?fileName="
  293 + +dateTime+"-"+lineName+"-营运线路出车率统计表");
  294 + layer.close(i);
  295 + });
  296 + });
  297 + });
  298 +</script>
  299 +<script type="text/html" id="calcTurnoutrate">
  300 + {{each list as obj i}}
  301 + <tr>
  302 + {{if obj.rq == '分类汇总'}}
  303 + <td colspan='3'>{{obj.rq}}</td>
  304 + {{/if}}
  305 + {{if obj.rq != '分类汇总'}}
  306 + <td>{{obj.rq}}</td>
  307 + <td>{{obj.gsName}}</td>
  308 + <td>{{obj.fgsName}}</td>
  309 + {{/if}}
  310 + <td>{{obj.xlName}}</td>
  311 + <td>{{obj.qzpcs}}</td>
  312 + <td>{{obj.jhcc}}</td>
  313 + <td>{{obj.sjcc}}</td>
  314 + <td>{{obj.sjcczgf}}</td>
  315 + <td>{{obj.ccl}}</td>
  316 + <td>{{obj.cclzgf}}</td>
  317 + <td>{{obj.jhbc}}</td>
  318 + <td>{{obj.sjbc}}</td>
  319 + <td>{{obj.zxl}}</td>
  320 + <td>{{obj.sm}}</td>
  321 + </tr>
  322 + {{/each}}
  323 + {{if list.length == 0}}
  324 + <tr>
  325 + <td colspan="12"><h6 class="muted">没有找到相关数据</h6></td>
  326 + </tr>
  327 + {{/if}}
  328 +</script>
... ...
src/main/resources/static/pages/permission/resource/add.html
1 1 <div class="page-head">
2   - <div class="page-title">
3   - <h1>添加资源</h1>
4   - </div>
  2 + <div class="page-title">
  3 + <h1>添加资源</h1>
  4 + </div>
5 5 </div>
6 6  
7 7 <ul class="page-breadcrumb breadcrumb">
8   - <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
9   - <li><span class="active">权限管理</span> <i class="fa fa-circle"></i></li>
10   - <li><a href="list.html" data-pjax>资源管理</a> <i class="fa fa-circle"></i></li>
11   - <li><span class="active">添加资源</span></li>
  8 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">权限管理</span> <i class="fa fa-circle"></i></li>
  10 + <li><a href="list.html" data-pjax>资源管理</a> <i class="fa fa-circle"></i></li>
  11 + <li><span class="active">添加资源</span></li>
12 12 </ul>
13 13  
14 14 <div class="portlet light bordered">
15   - <div class="portlet-title">
16   - <div class="caption">
17   - <i class="icon-equalizer font-red-sunglo"></i> <span
18   - class="caption-subject font-red-sunglo bold uppercase">表单</span>
19   - </div>
20   - </div>
21   - <div class="portlet-body form">
22   - <form action="/resource" class="form-horizontal" id="resource_add_form" >
23   - <div class="alert alert-danger display-hide">
24   - <button class="close" data-close="alert"></button>
25   - 您的输入有误,请检查下面的输入项
26   - </div>
27   - <div class="form-body">
28   - <div class="form-group">
29   - <label class="col-md-3 control-label">所属模块</label>
30   - <div class="col-md-4">
31   - <div class="input-group">
32   - <select class="form-control" name="module.id" id="moduleSelect">
33   - </select>
34   - </div>
35   - </div>
36   - </div>
37   - <div class="form-group">
38   - <label class="col-md-3 control-label">资源名称</label>
39   - <div class="col-md-4">
40   - <input type="text" class="form-control" name="name">
41   - </div>
42   - </div>
43   - <div class="form-group">
44   - <label class="col-md-3 control-label">映射地址</label>
45   - <div class="col-md-4">
46   - <input type="text" class="form-control" name="url">
47   - <span class="help-block"> 例(新增资源):/resource/add</span>
48   - </div>
49   - </div>
50   - <div class="form-group">
51   - <label class="col-md-3 control-label">请求方式</label>
52   - <div class="col-md-4">
53   - <div class="input-group">
54   - <select class="form-control" name="method" style="width: 160px;">
55   - <option value="get">get</option>
56   - <option value="post">post</option>
57   - <option value="delete">delete</option>
58   - </select>
59   - </div>
60   - </div>
61   - </div>
62   - <div class="form-group">
63   - <label class="col-md-3 control-label">是否启用</label>
64   - <div class="col-md-4">
65   - <div class="input-group">
66   - <select class="form-control" name="enable" style="width: 160px;">
67   - <option value="1">可用</option>
68   - <option value="0">禁用</option>
69   - </select>
70   - </div>
71   - </div>
72   - </div>
73   - <div class="form-group">
74   - <label class="col-md-3 control-label">备注/描述</label>
75   - <div class="col-md-4">
76   - <textarea class="form-control" rows="3" name="descriptions"></textarea>
77   - </div>
78   - </div>
79   - </div>
80   - <div class="form-actions">
81   - <div class="row">
82   - <div class="col-md-offset-3 col-md-4">
83   - <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button>
84   - <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a>
85   - </div>
86   - </div>
87   - </div>
88   - </form>
89   - <!-- END FORM-->
90   - </div>
  15 + <div class="portlet-title">
  16 + <div class="caption">
  17 + <i class="icon-equalizer font-red-sunglo"></i> <span
  18 + class="caption-subject font-red-sunglo bold uppercase">表单</span>
  19 + </div>
  20 + </div>
  21 + <div class="portlet-body form">
  22 + <form action="/resource" class="form-horizontal" id="resource_add_form">
  23 + <div class="alert alert-danger display-hide">
  24 + <button class="close" data-close="alert"></button>
  25 + 您的输入有误,请检查下面的输入项
  26 + </div>
  27 + <div class="form-body">
  28 + <div class="form-group">
  29 + <label class="col-md-3 control-label">所属模块</label>
  30 + <div class="col-md-4">
  31 + <div class="input-group">
  32 + <select class="form-control" name="module.id" id="moduleSelect">
  33 + </select>
  34 + </div>
  35 + </div>
  36 + </div>
  37 + <div class="form-group">
  38 + <label class="col-md-3 control-label">资源名称</label>
  39 + <div class="col-md-4">
  40 + <input type="text" class="form-control" name="name">
  41 + </div>
  42 + </div>
  43 + <div class="form-group">
  44 + <label class="col-md-3 control-label">映射地址</label>
  45 + <div class="col-md-4">
  46 + <input type="text" class="form-control" name="url">
  47 + <span class="help-block"> 例(新增资源):/resource/add</span>
  48 + </div>
  49 + </div>
  50 + <div class="form-group">
  51 + <label class="col-md-3 control-label">请求方式</label>
  52 + <div class="col-md-4">
  53 + <div class="input-group">
  54 + <select class="form-control" name="method" style="width: 160px;">
  55 + <option value="get">get</option>
  56 + <option value="post">post</option>
  57 + <option value="delete">delete</option>
  58 + </select>
  59 + </div>
  60 + </div>
  61 + </div>
  62 + <div class="form-group">
  63 + <label class="col-md-3 control-label">是否启用</label>
  64 + <div class="col-md-4">
  65 + <div class="input-group">
  66 + <select class="form-control" name="enable" style="width: 160px;">
  67 + <option value="1">可用</option>
  68 + <option value="0">禁用</option>
  69 + </select>
  70 + </div>
  71 + </div>
  72 + </div>
  73 + <div class="form-group">
  74 + <label class="col-md-3 control-label">备注/描述</label>
  75 + <div class="col-md-4">
  76 + <textarea class="form-control" rows="3" name="descriptions"></textarea>
  77 + </div>
  78 + </div>
  79 + </div>
  80 + <div class="form-actions">
  81 + <div class="row">
  82 + <div class="col-md-offset-3 col-md-4">
  83 + <button type="submit" class="btn green"><i class="fa fa-check"></i> 提交</button>
  84 + <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i>
  85 + 取消</a>
  86 + </div>
  87 + </div>
  88 + </div>
  89 + </form>
  90 + <!-- END FORM-->
  91 + </div>
91 92 </div>
92 93 <script>
93   -$(function(){
94   -
95   - var form = $('#resource_add_form');
96   - var error = $('.alert-danger', form);
97   -
98   - //form validate
99   - form.validate({
100   - errorElement : 'span',
101   - errorClass : 'help-block help-block-error',
102   - focusInvalid : false,
103   - rules : {
104   - 'name' : {
105   - required : true
106   - },
107   - 'url' : {
108   - required : true
109   - },
110   - 'module.id': {
111   - required : true
112   - }
113   - },
114   - invalidHandler : function(event, validator) {
115   - error.show();
116   - App.scrollTo(error, -200);
117   - },
118   -
119   - highlight : function(element) {
120   - $(element).closest('.form-group').addClass('has-error');
121   - },
122   -
123   - unhighlight : function(element) {
124   - $(element).closest('.form-group').removeClass('has-error');
125   - },
126   -
127   - success : function(label) {
128   - label.closest('.form-group').removeClass('has-error');
129   - },
130   -
131   - submitHandler : function(f) {
132   - var params = form.serializeJSON();
133   - error.hide();
134   - console.log(params);
135   -
136   - $post('/resource', params, function(res){
137   - layer.msg('添加资源成功.');
138   - });
139   - }
140   - });
141   -
142   - //模块下拉框
143   - getModuleTreeData(function(treeData){
144   - var options = '<option value="">请选择...</option>';
145   -
146   - $.each(treeData, function(i, g){
147   - var dArray = g.children;
148   - for(var i = 0,d; d = dArray[i++];){
149   - options += '<optgroup label="'+d.name+'">';
150   - if(!d.children)
151   - continue;
152   -
153   - $.each(d.children, function(i, m){
154   - options += '<option value="'+m.id+'">'+m.name+'</option>'
155   - });
156   - options += '</optgroup>';
157   - }
158   - });
159   -
160   - console.log(options);
161   -
162   - $('#moduleSelect').html(options).select2();
163   - });
164   -
165   - function getModuleTreeData(cb){
166   - var treeData = [];
167   - $get('/module/all',null, function(arr){
168   - treeData = createTreeData(arr);
169   - cb && cb(treeData)
170   - });
171   - }
172   -
173   - /**
174   - * 将模块List 转换为树结构
175   - * @param arr
176   - * @returns {Array}
177   - */
178   - function createTreeData(arr){
179   - var treeData = [];
180   - var len = arr.length;
181   - for(var i = 0; i < len; i ++){
182   - var pId = arr[i].pId;
183   - arr[i].text = arr[i].name;
184   - if(!pId){
185   - treeData.push(arr[i]);
186   - }
187   -
188   - for(var j = 0; j < len; j ++){
189   - if(pId == arr[j].id){
190   - if(!arr[j].children)
191   - arr[j].children = [];
192   - arr[j].children.push(arr[i]);
193   - break;
194   - }
195   - }
196   - }
197   - return treeData;
198   - }
199   -
200   -});
  94 + $(function () {
  95 +
  96 + var form = $('#resource_add_form');
  97 + var error = $('.alert-danger', form);
  98 +
  99 + //form validate
  100 + form.validate({
  101 + errorElement: 'span',
  102 + errorClass: 'help-block help-block-error',
  103 + focusInvalid: false,
  104 + rules: {
  105 + 'name': {
  106 + required: true
  107 + },
  108 + 'url': {
  109 + required: true
  110 + },
  111 + 'module.id': {
  112 + required: true
  113 + }
  114 + },
  115 + invalidHandler: function (event, validator) {
  116 + error.show();
  117 + App.scrollTo(error, -200);
  118 + },
  119 +
  120 + highlight: function (element) {
  121 + $(element).closest('.form-group').addClass('has-error');
  122 + },
  123 +
  124 + unhighlight: function (element) {
  125 + $(element).closest('.form-group').removeClass('has-error');
  126 + },
  127 +
  128 + success: function (label) {
  129 + label.closest('.form-group').removeClass('has-error');
  130 + },
  131 +
  132 + submitHandler: function (f) {
  133 + var params = form.serializeJSON();
  134 + error.hide();
  135 + console.log(params);
  136 +
  137 + $post('/resource', params, function (res) {
  138 + layer.msg('添加资源成功.');
  139 + });
  140 + }
  141 + });
  142 +
  143 + //模块下拉框
  144 + getModuleTreeData(function (treeData) {
  145 + var options = '<option value="">请选择...</option>';
  146 +
  147 + $.each(treeData, function (i, g) {
  148 + var dArray = g.children;
  149 + if (!dArray)
  150 + return true;
  151 + for (var i = 0, d; d = dArray[i++];) {
  152 + options += '<optgroup label="' + d.name + '">';
  153 + if (!d.children)
  154 + continue;
  155 +
  156 + $.each(d.children, function (i, m) {
  157 + options += '<option value="' + m.id + '">' + m.name + '</option>'
  158 + });
  159 + options += '</optgroup>';
  160 + }
  161 + });
  162 +
  163 + console.log(options);
  164 +
  165 + $('#moduleSelect').html(options).select2();
  166 + });
  167 +
  168 + function getModuleTreeData(cb) {
  169 + var treeData = [];
  170 + $get('/module/all', null, function (arr) {
  171 + treeData = createTreeData(arr);
  172 + cb && cb(treeData)
  173 + });
  174 + }
  175 +
  176 + /**
  177 + * 将模块List 转换为树结构
  178 + * @param arr
  179 + * @returns {Array}
  180 + */
  181 + function createTreeData(arr) {
  182 + var treeData = [];
  183 + var len = arr.length;
  184 + for (var i = 0; i < len; i++) {
  185 + var pId = arr[i].pId;
  186 + arr[i].text = arr[i].name;
  187 + if (!pId) {
  188 + treeData.push(arr[i]);
  189 + }
  190 +
  191 + for (var j = 0; j < len; j++) {
  192 + if (pId == arr[j].id) {
  193 + if (!arr[j].children)
  194 + arr[j].children = [];
  195 + arr[j].children.push(arr[i]);
  196 + break;
  197 + }
  198 + }
  199 + }
  200 + return treeData;
  201 + }
  202 +
  203 + });
201 204 </script>
202 205 \ No newline at end of file
... ...
src/main/resources/static/pages/permission/resource/list.html
... ... @@ -165,12 +165,12 @@ $(function(){
165 165 var options = '<option value="">请选择...</option>';
166 166 $.each(treeData, function(i, g){
167 167 var dArray = g.children;
168   -
  168 +
169 169 for(var i = 0,d; d = dArray[i++];){
170 170 options += '<optgroup label="'+d.name+'">';
171 171 if(!d.children)
172 172 continue;
173   -
  173 +
174 174 $.each(d.children, function(i, m){
175 175 options += '<option value="'+m.id+'">'+m.name+'</option>'
176 176 });
... ...
src/main/resources/static/pages/punctual/list.html
... ... @@ -67,7 +67,8 @@
67 67 var date = id.split("_")[0];
68 68 var endDate = date;
69 69 var line = id.split("_")[1];
70   - var fgs=$('#fgsdm').val();
  70 + var fgs = id.split("_")[3];
  71 +// var fgs=$('#fgsdm').val();
71 72 var gs=$('#gsdm').val();
72 73 $get('/busInterval/onTime',{line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs,flag:2},function(result){
73 74 var onTime_2 = template('onTime_2',{list:result});
... ... @@ -78,7 +79,8 @@
78 79 var date = no.split("_")[0];
79 80 var endDate = date;
80 81 var line = no.split("_")[1];
81   - var fgs=$('#fgsdm').val();
  82 + var fgs = no.split("_")[3];
  83 +// var fgs=$('#fgsdm').val();
82 84 var gs=$('#gsdm').val();
83 85 $get('/busInterval/onTime',{line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs,flag:2,type:"export",lineName:no.split("_")[2]},function(result){
84 86 window.open("/downloadFile/download?fileName="
... ...
src/main/resources/static/pages/punctual/onTime.html
... ... @@ -27,27 +27,34 @@
27 27 <div class="portlet light porttlet-fit bordered">
28 28 <div class="portlet-title">
29 29 <form class="form-inline" action="">
30   - <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv">
31   - <span class="item-label" style="width: 80px;">公司: </span>
32   - <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
33   - </div>
34   - <div style="display: inline-block; margin-left: 38px;" id="fgsdmDiv">
35   - <span class="item-label" style="width: 80px;">分公司: </span>
36   - <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
37   - </div>
38   - <div style="margin-top: 10px">
39   - </div>
40   - <div style="display: inline-block;margin-left: 33px;">
  30 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv">
  31 + <span class="item-label" style="width: 80px;">公司: </span>
  32 + <select class="form-control" name="company" id="gsdm" style="width: 150px;"></select>
  33 + </div>
  34 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv">
  35 + <span class="item-label" style="width: 80px;">分公司: </span>
  36 + <select class="form-control" name="subCompany" id="fgsdm" style="width: 150px;"></select>
  37 + </div>
  38 + <div style="display: inline-block;margin-left: 38px;">
41 39 <span class="item-label" style="width: 80px;">线路: </span>
42   - <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  40 + <select class="form-control" name="line" id="line" style="width: 150px;"></select>
43 41 </div>
  42 + <div style="margin-top: 10px"/>
  43 + <div style="display: inline-block; margin-left: 5px">
  44 + <span class="item-label" style="width: 80px;">是否营运: </span>
  45 + <select class="form-control" name="sfyy" id="sfyy" style="width: 150px;">
  46 + <option value="0">全部线路</option>
  47 + <option value="1" selected="selected">营运线路</option>
  48 + <option value="2">非营运线路</option>
  49 + </select>
  50 + </div>
44 51 <div style="display: inline-block;">
45   - <span class="item-label" style="width: 80px;margin-left: 24px;">开始时间: </span>
46   - <input class="form-control" type="text" id="date" style="width: 180px;"/>
  52 + <span class="item-label" style="width: 80px;margin-left: 10px;">开始时间: </span>
  53 + <input class="form-control" type="text" id="date" style="width: 150px;"/>
47 54 </div>
48 55 <div style="display: inline-block;">
49   - <span class="item-label" style="width: 80px;margin-left: 24px;">结束时间: </span>
50   - <input class="form-control" type="text" id="endDate" style="width: 180px;"/>
  56 + <span class="item-label" style="width: 80px;margin-left: 10px;">结束时间: </span>
  57 + <input class="form-control" type="text" id="endDate" style="width: 150px;"/>
51 58 </div>
52 59  
53 60 <div class="form-group">
... ... @@ -204,7 +211,7 @@
204 211 $("#gsdm").on("change",updateCompany);
205 212 function updateCompany(){
206 213 var company = $('#gsdm').val();
207   - var options = '';
  214 + var options = '<option value="">全部分公司</option>';
208 215 for(var i = 0; i < obj.length; i++){
209 216 if(obj[i].companyCode == company){
210 217 var children = obj[i].children;
... ... @@ -248,15 +255,17 @@
248 255 var temp = tempData[$("#line").val()].split(":");
249 256 $("#gsdm").val(temp[0]);
250 257 updateCompany();
251   - $("#fgsdm").val(temp[1]);
  258 +// $("#fgsdm").val(temp[1]);
  259 + $("#fgsdm").val("");
252 260 $("#gsdm").attr("disabled", true);
253   - $("#fgsdm").attr("disabled", true);
  261 +// $("#fgsdm").attr("disabled", true);
254 262 }
255 263 });
256 264  
257   -
  265 +
258 266 //查询
259 267 $("#query").on('click',function(){
  268 + var sfyy = $("#sfyy").val();
260 269 var line = $("#line").val();
261 270 var date = $("#date").val();
262 271 var endDate = $("#endDate").val();
... ... @@ -266,7 +275,7 @@
266 275 if(lineName == "全部线路")
267 276 lineName = $('#subCompany option:selected').text();
268 277 var i = layer.load(2);
269   - $get('/busInterval/onTime',{line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs},function(result){
  278 + $get('/busInterval/onTime',{sfyy:sfyy,line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs},function(result){
270 279 var onTime = template('onTime',{list:result});
271 280 $('#forms tbody').html(onTime);
272 281 $('#forms_h tbody').html(template('onTime_h',{list:result}));
... ... @@ -281,6 +290,7 @@
281 290 });
282 291 });
283 292  
  293 + var fgs1;
284 294 var line1;
285 295 var lineName1;
286 296 function showSheetList(){
... ... @@ -288,7 +298,9 @@
288 298 lineName1 = $(this).parent().parent().children()[2].innerHTML;
289 299 var date = $("#date").val();
290 300 var endDate = $("#endDate").val();
291   - var fgs=$('#fgsdm').val();
  301 +// var fgs=$('#fgsdm').val();
  302 + var fgs=$(this).data('fgs');
  303 + fgs1 = fgs;
292 304 var gs=$('#gsdm').val();
293 305 var i = layer.load(2);
294 306 $get('/busInterval/onTime',{line:line1,startDate:date,endDate:endDate,gs:gs,fgs:fgs,flag:1},function(result){
... ... @@ -304,12 +316,12 @@
304 316 });
305 317 }
306 318 function openSheetList(){
307   - var id = $(this).data('id');
  319 + var id = $(this).data('id') + "_" + $(this).data('fgs');
308 320 var date = id.split("_")[0];
309 321 var endDate = date;
310 322 var line = id.split("_")[1];
311   - var fgs=$('#fgsdm').val();
312   - var gs=$('#gsdm').val();
  323 +// var fgs=$('#fgsdm').val();
  324 +// var gs=$('#gsdm').val();
313 325 $.get('/pages/punctual/list.html', function (content) {
314 326 layer.open({
315 327 type: 1,
... ... @@ -326,6 +338,7 @@
326 338 });
327 339 }
328 340 $("#export").on("click",function(){
  341 + var sfyy = $("#sfyy").val();
329 342 var line = $("#line").val();
330 343 var date = $("#date").val();
331 344 var endDate = $("#endDate").val();
... ... @@ -335,7 +348,7 @@
335 348 if(lineName == "全部线路")
336 349 lineName = $('#fgsdm option:selected').text();
337 350 var i = layer.load(2);
338   - $get('/busInterval/onTime',{line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs,type:"export",lineName:lineName},function(result){
  351 + $get('/busInterval/onTime',{sfyy:sfyy,line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs,type:"export",lineName:lineName},function(result){
339 352 var dateTime = "";
340 353 if(date == endDate){
341 354 dateTime = moment(date).format("YYYYMMDD");
... ... @@ -352,7 +365,8 @@
352 365 $("#export_1").on("click",function(){
353 366 var date = $("#date").val();
354 367 var endDate = $("#endDate").val();
355   - var fgs=$('#fgsdm').val();
  368 +// var fgs=$('#fgsdm').val();
  369 + var fgs = fgs1;
356 370 var gs=$('#gsdm').val();
357 371 var i = layer.load(2);
358 372 $get('/busInterval/onTime',{line:line1,startDate:date,endDate:endDate,gs:gs,fgs:fgs,flag:1,type:"export",lineName:lineName1},function(result){
... ... @@ -384,7 +398,7 @@
384 398 <td>{{obj.zdzdl}}</td>
385 399 <td>
386 400 <button type="button" class="btn btn-sm blue btn-onTime"
387   - data-id="{{obj.xlbm}}">查看</button>
  401 + data-id="{{obj.xlbm}}" data-fgs="{{obj.fgsBm}}">查看</button>
388 402 </td>
389 403 </tr>
390 404 {{/each}}
... ... @@ -429,7 +443,7 @@
429 443 <td>{{obj.zdzdl}}</td>
430 444 <td>
431 445 <button type="button" class="btn btn-sm blue btn-onTime_1"
432   - data-id="{{obj.xl_date}}">详细</button>
  446 + data-id="{{obj.xl_date}}" data-fgs="{{obj.fgsBm}}">详细</button>
433 447 </td>
434 448 </tr>
435 449 {{/each}}
... ...
src/main/resources/static/pages/report/inoutstation/inoutstation.html
... ... @@ -25,25 +25,9 @@
25 25 <h1>站点停靠时间记录</h1>
26 26 </div>
27 27 </div>
28   -
29   -<div class="row">
30   - <div class="col-md-12">
31   - <div class="portlet light porttlet-fit bordered">
  28 + <div class="col-md-12 portlet light porttlet-fit bordered" style="height:calc(100% - 56px)">
32 29 <div class="portlet-title">
33 30 <form class="form-inline" action="">
34   - <div>
35   - <!-- <div style="display: inline-block; margin-left: 33px;"
36   - id="gsdmDiv">
37   - <span class="item-label" style="width: 80px;">公司: </span> <select
38   - class="form-control" name="company" id="gsdm"
39   - style="width: 180px;"></select>
40   - </div>
41   - <div style="display: inline-block; margin-left: 24px;"
42   - id="fgsdmDiv">
43   - <span class="item-label" style="width: 80px;">分公司: </span> <select
44   - class="form-control" name="subCompany" id="fgsdm"
45   - style="width: 180px;"></select>
46   - </div> -->
47 31 <div style="display: inline-block; margin-left: 15px;">
48 32 <span class="item-label" style="width: 80px;">线路: </span> <select
49 33 class="form-control sreach-zd" name="line" id="line"
... ... @@ -72,12 +56,10 @@
72 56 <input class="btn btn-default" type="button" id="query" value="查询" />
73 57 <a class="btn btn-default" data-type="xls" href="javascript:;" id="export" >导出</a>
74 58 </div>
75   - </div>
76   -
77 59 </form>
78 60 </div>
79   - <div class="portlet-body" >
80   - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 506px;">
  61 + <div class="portlet-body" style="overflow:auto;height: calc(100% - 80px)">
  62 + <div class="table-container" style="margin-top: 10px;min-width: 906px;">
81 63 <table class="table table-bordered table-hover table-checkable" id="forms">
82 64 <tbody class="ludan_ll_1">
83 65  
... ... @@ -86,8 +68,7 @@
86 68 </div>
87 69 </div>
88 70 </div>
89   - </div>
90   -</div>
  71 +
91 72  
92 73 <script>
93 74 $(function(){
... ...
src/main/resources/static/pages/report/sheet/calcList.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 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<div class="page-head">
  20 + <div class="page-title" style="margin-left: 20px">
  21 + <button id="exportList">数据导出</button>
  22 + </div>
  23 +</div>
  24 +
  25 +<div class="row" id="calcSheetList">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-body">
  29 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 600px">
  30 + <table class="table table-bordered table-hover table-checkable" id="forms_2">
  31 + <thead>
  32 + <tr>
  33 + <td></td>
  34 + <td>日期</td>
  35 + <td>线路</td>
  36 + <td>站点</td>
  37 + <td>计划时间</td>
  38 + <td>实际时间</td>
  39 + <td>是否准点</td>
  40 + </tr>
  41 + </thead>
  42 +
  43 + <tbody>
  44 +
  45 + </tbody>
  46 + </table>
  47 + </div>
  48 + </div>
  49 + </div>
  50 + </div>
  51 +</div>
  52 +<script src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script>
  53 +<script>
  54 + $(function(){
  55 + // 关闭左侧栏
  56 + if (!$('body').hasClass('page-sidebar-closed'))
  57 + $('.menu-toggler.sidebar-toggler').click();
  58 + var no="";
  59 + var dates="";
  60 + var dir="";
  61 + $("#calcSheetList").on('init', function (e, id) {
  62 + no=id.split(",")[0];
  63 + dates = id.split(",")[1];
  64 + dir =id.split(",")[2];
  65 + var i = layer.load(2);
  66 + $get('/calcSheet/calcSheet',{line:no,date:dates,dir:dir,type:'query'},function(result){
  67 + layer.close(i);
  68 + var calcSheetList_2 = template('calcSheetList_2',{list:result});
  69 + $('#forms_2 tbody').html(calcSheetList_2);
  70 + });
  71 + })
  72 + $("#exportList").on('click',function(){
  73 + var i = layer.load(2);
  74 + var name="";
  75 + if(dir=="1"){
  76 + fileName="发车准点率"+dates;
  77 + }else{
  78 + fileName="到站准点率"+dates;
  79 + }
  80 + $get('/calcSheet/calcSheet',{line:no,date:dates,dir:dir,type:'export'},function(result){
  81 + window.open("/downloadFile/download?fileName="+fileName);
  82 + layer.close(i);
  83 + });
  84 + });
  85 +
  86 +
  87 + });
  88 +</script>
  89 +<script type="text/html" id="calcSheetList_2">
  90 + {{each list as obj i}}
  91 + <tr {{if obj.sfzd!="准点"}}style="color: red" {{/if}}>
  92 + <td>{{i+1}}</td>
  93 + <td>{{obj.date}}</td>
  94 + <td>{{obj.line}}</td>
  95 + <td>{{obj.zdname}}</td>
  96 + <td>{{obj.jhsj}}</td>
  97 + <td>{{obj.sjsj}}</td>
  98 + <td>{{obj.sfzd}}</td>
  99 + </tr>
  100 + {{/each}}
  101 + {{if list.length == 0}}
  102 + <tr>
  103 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  104 + </tr>
  105 + {{/if}}
  106 +</script>
0 107 \ No newline at end of file
... ...
src/main/resources/static/pages/report/sheet/calcList2.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 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<div class="page-head">
  20 + <div class="page-title" style="margin-left: 20px">
  21 + <button id="exportList">数据导出</button>
  22 + </div>
  23 +</div>
  24 +
  25 +<div class="row" id="calcSheetList">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-body">
  29 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 600px">
  30 + <table class="table table-bordered table-hover table-checkable" id="forms_2">
  31 + <thead>
  32 + <tr>
  33 + <td></td>
  34 + <td>日期</td>
  35 + <td>线路</td>
  36 + <td>站点</td>
  37 + <td>计划时间</td>
  38 + <td>实际时间</td>
  39 + <td>是否准点</td>
  40 + </tr>
  41 + </thead>
  42 +
  43 + <tbody>
  44 +
  45 + </tbody>
  46 + </table>
  47 + </div>
  48 + </div>
  49 + </div>
  50 + </div>
  51 +</div>
  52 +<script src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script>
  53 +<script>
  54 + $(function(){
  55 + // 关闭左侧栏
  56 + if (!$('body').hasClass('page-sidebar-closed'))
  57 + $('.menu-toggler.sidebar-toggler').click();
  58 + var no="";
  59 + var dates="";
  60 + $("#calcSheetList").on('init', function (e, id) {
  61 + no=id.split(",")[0];
  62 + dates = id.split(",")[1];
  63 + var i = layer.load(2);
  64 + $get('/calcSheet/calcSheet',{line:no,date:dates,type:'query'},function(result){
  65 + var calcSheetList_2 = template('calcSheetList_2',{list:result});
  66 + $('#forms_2 tbody').html(calcSheetList_2);
  67 + layer.close(i);
  68 + });
  69 + })
  70 + $("#exportList").on('click',function(){
  71 + var i = layer.load(2);
  72 + $get('/calcSheet/calcSheet',{line:no,date:dates,type:'export'},function(result){
  73 + window.open("/downloadFile/download?fileName=发车准点率"+dates);
  74 + layer.close(i);
  75 + });
  76 + });
  77 +
  78 +
  79 + });
  80 +</script>
  81 +<script type="text/html" id="calcSheetList_2">
  82 + {{each list as obj i}}
  83 + <tr {{if obj.sfzd!="准点"}}style="color: red" {{/if}}>
  84 + <td>{{i+1}}</td>
  85 + <td>{{obj.date}}</td>
  86 + <td>{{obj.line}}</td>
  87 + <td>{{obj.zdname}}</td>
  88 + <td>{{obj.jhsj}}</td>
  89 + <td>{{obj.sjsj}}</td>
  90 + <td>{{obj.sfzd}}</td>
  91 + </tr>
  92 + {{/each}}
  93 + {{if list.length == 0}}
  94 + <tr>
  95 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  96 + </tr>
  97 + {{/if}}
  98 +</script>
0 99 \ No newline at end of file
... ...
src/main/resources/static/pages/report/sheet/calcSheetList.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 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<div class="page-head">
  20 + <div class="page-title">
  21 + <h1>发车准点率</h1>
  22 + </div>
  23 +</div>
  24 +
  25 +<div class="row">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-title">
  29 + <form class="form-inline" action="">
  30 + <div style="display: inline-block; margin-left: 61px;" id="gsdmDiv">
  31 + <span class="item-label" style="width: 80px;">公司: </span> <select
  32 + class="form-control" name="company" id="gsdm"
  33 + style="width: 180px;"></select>
  34 + </div>
  35 + <div style="display: inline-block; margin-left: 38px;"
  36 + id="fgsdmDiv">
  37 + <span class="item-label" style="width: 80px;">分公司: </span> <select
  38 + class="form-control" name="subCompany" id="fgsdm"
  39 + style="width: 180px;"></select>
  40 + </div>
  41 +
  42 + <div style="display: inline-block; margin-left: 53px;">
  43 + <span class="item-label" style="width: 80px;">线路: </span> <select
  44 + class="form-control" name="line" id="line" style="width: 180px;"></select>
  45 + </div>
  46 + <div style="margin-top: 10px"></div>
  47 + <div style="display: inline-block; margin-left: 33px;">
  48 + <span class="item-label" style="width: 80px;">线路性质: </span> <select
  49 + class="form-control" name="nature" id="nature"
  50 + style="width: 180px;">
  51 + <option value="0">全部线路</option>
  52 + <option value="1" selected="selected">营运线路</option>
  53 + <option value="2">非营运线路</option>
  54 + </select>
  55 + </div>
  56 + <div style="display: inline-block;">
  57 + <span class="item-label" style="width: 80px; margin-left: 24px;">开始时间:
  58 + </span> <input class="form-control" type="text" id="date"
  59 + style="width: 180px;" />
  60 + </div>
  61 + <div style="display: inline-block;">
  62 + <span class="item-label" style="width: 80px; margin-left: 24px;">结束时间:
  63 + </span> <input class="form-control" type="text" id="endDate"
  64 + style="width: 180px;" />
  65 + </div>
  66 +
  67 + <div class="form-group">
  68 + <input type="hidden" id="id" /> <input class="btn btn-default"
  69 + type="button" id="query" value="查询" /> <input
  70 + class="btn btn-default" type="button" id="export" value="导出" />
  71 + </div>
  72 + </form>
  73 + </div>
  74 + <div class="portlet-body">
  75 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  76 + <table class="table table-bordered table-hover table-checkable" id="forms">
  77 + <thead>
  78 + <tr>
  79 + <td>公司</td>
  80 + <td>分公司</td>
  81 + <td>线路</td>
  82 + <td>班次数</td>
  83 + <td>发车准点数</td>
  84 + <td>发车准点率</td>
  85 + <td>到站准点数</td>
  86 + <td>到站准点率</td>
  87 + <td>查看</td>
  88 + </tr>
  89 + </thead>
  90 +
  91 + <tbody>
  92 +
  93 + </tbody>
  94 + </table>
  95 +
  96 +
  97 + </div>
  98 +
  99 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  100 + <input class="btn btn-default hidden" type="button" id="export_1" value="导出"/>
  101 + <table class="table table-bordered table-hover table-checkable" id="forms_1">
  102 + <thead>
  103 + <tr class="hidden">
  104 + <td>公司</td>
  105 + <td>分公司</td>
  106 + <td>日期</td>
  107 + <td>线路</td>
  108 + <td>班次数</td>
  109 + <td>发车准点次数</td>
  110 + <td>发车准点率</td>
  111 + <td>查看</td>
  112 + <td>到站准点次数</td>
  113 + <td>到站准点率</td>
  114 + <td>查看</td>
  115 + </tr>
  116 + </thead>
  117 +
  118 + <tbody>
  119 +
  120 + </tbody>
  121 + </table>
  122 +
  123 + </div>
  124 + </div>
  125 + </div>
  126 + </div>
  127 +</div>
  128 +<script src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script>
  129 +<script>
  130 + $(function(){
  131 + // 关闭左侧栏
  132 + if (!$('body').hasClass('page-sidebar-closed'))
  133 + $('.menu-toggler.sidebar-toggler').click();
  134 +
  135 + var d = new Date();
  136 + d.setTime(d.getTime() - 1*1000*60*60*24);
  137 + var year = d.getFullYear();
  138 + var month = d.getMonth() + 1;
  139 + var day = d.getDate();
  140 + if(month < 10)
  141 + month = "0"+month;
  142 + if(day < 10)
  143 + day = "0"+day;
  144 + var dateTime = year + "-" + month + "-" + day;
  145 + $("#date").datetimepicker({
  146 + format : 'YYYY-MM-DD',
  147 + locale : 'zh-cn',
  148 + maxDate : dateTime
  149 + });
  150 + $("#endDate").datetimepicker({
  151 + format : 'YYYY-MM-DD',
  152 + locale : 'zh-cn',
  153 + maxDate : dateTime
  154 + });
  155 + $("#date").val(dateTime);
  156 + $("#endDate").val(dateTime);
  157 +
  158 + var fage=true;
  159 + var obj = [];
  160 + var xlList;
  161 + $.get('/report/lineList',function(result){
  162 + xlList=result;
  163 +
  164 + $.get('/user/companyData', function(result){
  165 + obj = result;
  166 + var options = '';
  167 + for(var i = 0; i < obj.length; i++){
  168 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  169 + }
  170 + if(obj.length ==0){
  171 + $("#gsdmDiv").css('display','none');
  172 + }else if(obj.length ==1){
  173 + $("#gsdmDiv").css('display','none');
  174 + if(obj[0].children.length == 1 || obj[0].children.length ==0){
  175 + $('#fgsdmDiv').css('display','none');
  176 + fage=false;
  177 + }
  178 + }
  179 + $('#gsdm').html(options);
  180 +
  181 + updateCompany();
  182 + });
  183 + });
  184 +
  185 + $("#gsdm").on("change",updateCompany);
  186 + function updateCompany(){
  187 + var company = $('#gsdm').val();
  188 + var options ='';
  189 + if(fage){
  190 + options = '<option value="">请选择</option>';
  191 + }
  192 + for(var i = 0; i < obj.length; i++){
  193 + if(obj[i].companyCode == company){
  194 + var children = obj[i].children;
  195 + for(var j = 0; j < children.length; j++){
  196 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  197 + }
  198 + }
  199 + }
  200 + $('#fgsdm').html(options);
  201 + }
  202 +
  203 + var tempData = {};
  204 + $.get('/report/lineList',function(xlList){
  205 + var data = [];
  206 + data.push({id: " ", text: "全部线路"});
  207 + $.get('/user/companyData', function(result){
  208 + for(var i = 0; i < result.length; i++){
  209 + var companyCode = result[i].companyCode;
  210 + var children = result[i].children;
  211 + for(var j = 0; j < children.length; j++){
  212 + var code = children[j].code;
  213 + for(var k=0;k < xlList.length;k++ ){
  214 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  215 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  216 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  217 + }
  218 + }
  219 + }
  220 + }
  221 + initPinYinSelect2('#line',data,'');
  222 +
  223 + });
  224 + });
  225 +
  226 + $("#line").on("change", function(){
  227 + if($("#line").val() == " "){
  228 + $("#gsdm").attr("disabled", false);
  229 + $("#fgsdm").attr("disabled", false);
  230 + } else {
  231 + var temp = tempData[$("#line").val()].split(":");
  232 + $("#gsdm").val(temp[0]);
  233 + updateCompany();
  234 + $("#fgsdm").val(temp[1]);
  235 + $("#nature").val(0);
  236 + $("#gsdm").attr("disabled", true);
  237 + $("#fgsdm").attr("disabled", true);
  238 + }
  239 + });
  240 +
  241 + $("#export").attr('disabled',"true");
  242 +
  243 + //查询
  244 + $("#query").on('click',function(){
  245 + var line = $("#line").val();
  246 + var date = $("#date").val();
  247 + var endDate = $("#endDate").val();
  248 + var fgs=$('#fgsdm').val();
  249 + var gs=$('#gsdm').val();
  250 + var nature=$("#nature").val();
  251 + var i = layer.load(2);
  252 + $get('/calcSheet/countList',{line:line,date:date,endDate:endDate,gs:gs,fgs:fgs,nature:nature,type:'query'},function(result){
  253 + layer.close(i);
  254 + var calcSheetList = template('calcSheetList',{list:result});
  255 + $('#forms tbody').html(calcSheetList);
  256 + $('.btn-calcSheetList').on('click', showcalcSheetList);
  257 +
  258 + if(result.length == 0)
  259 + $("#export").attr('disabled',"true");
  260 + else
  261 + $("#export").removeAttr("disabled");
  262 + });
  263 +// $post('/sheet/saveListSheet',function(result){
  264 +// });
  265 + });
  266 + function showcalcSheetList(){
  267 + var id = $(this).data('id');
  268 + var date = $("#date").val();
  269 + var endDate = $("#endDate").val();
  270 + $("#id").val(id);
  271 + $get('/calcSheet/calcListSheet',{line:id,date:date,endDate:endDate,type:'query'},function(result){
  272 + var calcSheetList = template('calcSheetList_1',{list:result});
  273 + $('#forms_1 tbody').html(calcSheetList);
  274 + $('.btn-calcSheetList_1').on('click', opencalcSheetList);
  275 + $('.btn-calcSheetList_2').on('click', opencalcSheetList2);
  276 + $("#forms_1 .hidden").removeClass("hidden");
  277 + $("html,body").animate({scrollTop:$("#forms_1").offset().top},1000);
  278 + $("#export_1").removeClass("hidden");
  279 + });
  280 + }
  281 + function opencalcSheetList(){
  282 + var id = $(this).data('id');
  283 + id += ","+$(this).data('date')+",1";
  284 + $.get('/pages/report/sheet/calcList.html', function (content) {
  285 + layer.open({
  286 + type: 1,
  287 + area: ['800px', '600px'],
  288 + content: content,
  289 + title: '线路准点率详细',
  290 + shift: 5,
  291 + scrollbar: false,
  292 + success: function () {
  293 + $('#calcSheetList').trigger('init', id);
  294 + }
  295 + });
  296 + });
  297 + }
  298 +
  299 + function opencalcSheetList2(){
  300 + var id = $(this).data('id');
  301 + id += ","+$(this).data('date')+",2";
  302 + $.get('/pages/report/sheet/calcList.html', function (content) {
  303 + layer.open({
  304 + type: 1,
  305 + area: ['800px', '600px'],
  306 + content: content,
  307 + title: '线路准点率详细',
  308 + shift: 5,
  309 + scrollbar: false,
  310 + success: function () {
  311 + $('#calcSheetList').trigger('init', id);
  312 + }
  313 + });
  314 + });
  315 + }
  316 + $("#export").on("click",function(){
  317 + var line = $("#line").val();
  318 + var date = $("#date").val();
  319 + var endDate = $("#endDate").val();
  320 + var fgs=$('#fgsdm').val();
  321 + var gs=$('#gsdm').val();
  322 + var nature=$("#nature").val();
  323 + var lineName = $('#line option:selected').text();
  324 + if(lineName == "全部线路")
  325 + lineName = $('#fgsdm option:selected').text();
  326 + if(lineName == "请选择")
  327 + lineName =$('#gsdm option:selected').text();
  328 + var i = layer.load(2);
  329 + $get('/calcSheet/countList',{line:line,date:date,endDate:endDate,gs:gs,fgs:fgs,nature:nature,type:'export'},function(result){
  330 + var dateTime = "";
  331 + if(date == endDate){
  332 + dateTime = moment(date).format("YYYYMMDD");
  333 + } else {
  334 + dateTime = moment(date).format("YYYYMMDD")+"-"+
  335 + moment(endDate).format("YYYYMMDD");
  336 + }
  337 + window.open("/downloadFile/download?fileName="
  338 + +dateTime+"-"+lineName+"-发车到站准点率");
  339 + layer.close(i);
  340 + });
  341 +// $("#forms_h").table2excel({
  342 +// // 不被导出的表格行的CSS class类
  343 +// exclude: ".noExl",
  344 +// // 导出的Excel文档的名称,(没看到作用)
  345 +// name: "Excel Document Name.xlsx",
  346 +// // Excel文件的名称
  347 +// filename: date+"-"+endDate+"班次准点率"
  348 +// });
  349 + });
  350 +
  351 + $("#export_1").on("click",function(){
  352 + var id = $("#id").val();
  353 + var date = $("#date").val();
  354 + var endDate = $("#endDate").val();
  355 + var i = layer.load(2);
  356 + $get('/calcSheet/calcListSheet',{line:id,date:date,endDate:endDate,type:'export'},function(result){
  357 + window.open("/downloadFile/download?fileName=发车到站准点率"+moment(date).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD"));
  358 + layer.close(i);
  359 + });
  360 + })
  361 +
  362 + });
  363 +</script>
  364 +<script type="text/html" id="calcSheetList">
  365 + {{each list as obj i}}
  366 + <tr>
  367 + <td>{{obj.gsname}}</td>
  368 + <td>{{obj.fgsname}}</td>
  369 + <td>{{obj.xlName}}</td>
  370 + <td>{{obj.jhszfcs}}</td>
  371 + <td>{{obj.sjszfczds}}</td>
  372 + <td>{{obj.szfczdl}}</td>
  373 + <td>{{obj.sjszddzds}}</td>
  374 + <td>{{obj.szddzdl}}</td>
  375 + <td>
  376 + <button type="button" class="btn btn-sm blue btn-calcSheetList"
  377 + data-id="{{obj.xl}}">查看</button>
  378 + </td>
  379 + </tr>
  380 + {{/each}}
  381 + {{if list.length == 0}}
  382 + <tr>
  383 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  384 + </tr>
  385 + {{/if}}
  386 +</script>
  387 +
  388 +
  389 +
  390 +<script type="text/html" id="calcSheetList_1">
  391 + {{each list as obj i}}
  392 + <tr>
  393 + <td>{{obj.gsname}}</td>
  394 + <td>{{obj.fgsname}}</td>
  395 + <td>{{obj.xlName}}</td>
  396 + <td>{{obj.date}}</td>
  397 + <td>{{obj.jhszfcs}}</td>
  398 + <td>{{obj.sjszfczds}}</td>
  399 + <td>{{obj.szfczdl}}</td>
  400 + <td>
  401 + <button type="button" class="btn btn-sm blue btn-calcSheetList_1"
  402 + data-id="{{obj.xl}}" data-date="{{obj.date}}">详细</button>
  403 + </td>
  404 + <td>{{obj.sjszddzds}}</td>
  405 + <td>{{obj.szddzdl}}</td>
  406 + <td>
  407 + <button type="button" class="btn btn-sm blue btn-calcSheetList_2"
  408 + data-id="{{obj.xl}}" data-date="{{obj.date}}" >详细</button>
  409 + </td>
  410 + </tr>
  411 + {{/each}}
  412 + {{if list.length == 0}}
  413 + <tr>
  414 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  415 + </tr>
  416 + {{/if}}
  417 +</script>
  418 +
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html
... ... @@ -167,11 +167,23 @@
167 167 <!--</div>-->
168 168  
169 169 <div class="form-group has-success has-feedback">
170   - <label class="col-md-2 control-label">启用日期*:</label>
  170 + <label class="col-md-2 control-label">启用日期:</label>
171 171 <div class="col-md-3">
172   - <input type="text" class="form-control"
173   - name="qyrq" uib-datepicker-popup="yyyy年MM月dd日 HH:mm"
174   - ng-model="ctrl.deviceInfoForSave.qyrq" readonly/>
  172 + <div class="input-group">
  173 + <input type="datetime-local" class="form-control" name="qyrq"
  174 + ng-model="ctrl.deviceInfoForSave.qyrq" required
  175 + remote-Validation
  176 + remotevtype="cde1"
  177 + remotevparam="{{ {'qyrq_eq': ctrl.deviceInfoForSave.qyrq, 'xl_eq': ctrl.deviceInfoForSave.xl, 'cl_eq': ctrl.deviceInfoForSave.cl} | json}}" />
  178 +
  179 + </div>
  180 + </div>
  181 + <!-- 隐藏块,显示验证信息 -->
  182 + <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">
  183 + 启用日期必须选择,精确到具体时间
  184 + </div>
  185 + <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote">
  186 + {{$remote_msg}}
175 187 </div>
176 188 </div>
177 189  
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html
... ... @@ -166,26 +166,26 @@
166 166 <!--</div>-->
167 167 <!--</div>-->
168 168  
169   - <div class="form-group has-success has-feedback">
170   - <label class="col-md-2 control-label">启用日期:</label>
171   - <div class="col-md-3">
172   - <div class="input-group">
173   - <input type="datetime-local" class="form-control" name="qyrq"
174   - ng-model="ctrl.deviceInfoForSave.qyrq" required
175   - remote-Validation
176   - remotevtype="cde1"
177   - remotevparam="{{ {'qyrq_eq': ctrl.deviceInfoForSave.qyrq, 'xl_eq': ctrl.deviceInfoForSave.xl, 'cl_eq': ctrl.deviceInfoForSave.cl} | json}}" />
178   -
179   - </div>
180   - </div>
181   - <!-- 隐藏块,显示验证信息 -->
182   - <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">
183   - 启用日期必须选择,精确到具体时间
184   - </div>
185   - <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote">
186   - {{$remote_msg}}
187   - </div>
188   - </div>
  169 + <!--<div class="form-group has-success has-feedback">-->
  170 + <!--<label class="col-md-2 control-label">启用日期:</label>-->
  171 + <!--<div class="col-md-3">-->
  172 + <!--<div class="input-group">-->
  173 + <!--<input type="datetime-local" class="form-control" name="qyrq"-->
  174 + <!--ng-model="ctrl.deviceInfoForSave.qyrq" required-->
  175 + <!--remote-Validation-->
  176 + <!--remotevtype="cde1"-->
  177 + <!--remotevparam="{{ {'qyrq_eq': ctrl.deviceInfoForSave.qyrq, 'xl_eq': ctrl.deviceInfoForSave.xl, 'cl_eq': ctrl.deviceInfoForSave.cl} | json}}" />-->
  178 +
  179 + <!--</div>-->
  180 + <!--</div>-->
  181 + <!--&lt;!&ndash; 隐藏块,显示验证信息 &ndash;&gt;-->
  182 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">-->
  183 + <!--启用日期必须选择,精确到具体时间-->
  184 + <!--</div>-->
  185 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.remote">-->
  186 + <!--{{$remote_msg}}-->
  187 + <!--</div>-->
  188 + <!--</div>-->
189 189  
190 190 <!-- 其他form-group -->
191 191  
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html
... ... @@ -101,13 +101,13 @@
101 101 <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>-->
102 102 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
103 103 <a ui-sref="deviceInfoManage_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a>
104   - <a ui-sref="deviceInfoManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a>
105   - <a sweetalert
106   - sweet-options="{title: '是否作废车辆设备历史信息?',text: '内部编号:' + info.clZbh, html: true,type: 'warning',showCancelButton: true,confirmButtonColor: '#DD6B55',confirmButtonText: '是',cancelButtonText: '取消'}"
107   - sweet-on-confirm="ctrl.toggleCarDevice(info.id)"
108   - class="btn btn-danger btn-sm"
109   - ng-if="info.isCancel == '0'">作废</a>
110   - <a ng-click="ctrl.toggleCarDevice(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a>
  104 + <!--<a ui-sref="deviceInfoManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a>-->
  105 + <!--<a sweetalert-->
  106 + <!--sweet-options="{title: '是否作废车辆设备历史信息?',text: '内部编号:' + info.clZbh, html: true,type: 'warning',showCancelButton: true,confirmButtonColor: '#DD6B55',confirmButtonText: '是',cancelButtonText: '取消'}"-->
  107 + <!--sweet-on-confirm="ctrl.toggleCarDevice(info.id)"-->
  108 + <!--class="btn btn-danger btn-sm"-->
  109 + <!--ng-if="info.isCancel == '0'">作废</a>-->
  110 + <!--<a ng-click="ctrl.toggleCarDevice(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a>-->
111 111 </td>
112 112 </tr>
113 113 </tbody>
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js
... ... @@ -163,6 +163,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
163 163 // 提交方法
164 164 self.submit = function() {
165 165 console.log(self.deviceInfoForSave);
  166 + // 修改逻辑,只有新增,没有修改,作废,启用日期就是保存的日期
  167 + self.deviceInfoForSave.qyrq = new Date().getTime();
166 168  
167 169 // 保存或者更新
168 170 self.deviceInfoForSave.$save(function() {
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice-legacy.js
... ... @@ -453,6 +453,18 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
453 453 }
454 454 )
455 455 },
  456 + ec_jsy_config: { // 驾驶员是否配置在指定线路中
  457 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'jsy.id_eq': -1}, // 查询参数模版
  458 + remote: $resource( // $resource封装对象
  459 + '/eci/validate_jsy_config',
  460 + {},
  461 + {
  462 + do: {
  463 + method: 'GET'
  464 + }
  465 + }
  466 + )
  467 + },
456 468 ec_spy: { // 售票员不能重复配置
457 469 template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版
458 470 remote: $resource( // $resource封装对象
... ... @@ -465,6 +477,18 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
465 477 }
466 478 )
467 479 },
  480 + ec_spy_config: { // 售票员是否配置在指定线路中
  481 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版
  482 + remote: $resource( // $resource封装对象
  483 + '/eci/validate_spy_config',
  484 + {},
  485 + {
  486 + do: {
  487 + method: 'GET'
  488 + }
  489 + }
  490 + )
  491 + },
468 492  
469 493 cde1: { // 车辆设备启用日期验证
470 494 template: {'xl_eq': -1, 'cl_eq': -1, 'qyrq_eq': 1}, // 日期毫秒
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -1331,6 +1331,18 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
1331 1331 }
1332 1332 )
1333 1333 },
  1334 + ec_jsy_config: { // 驾驶员是否配置在指定线路中
  1335 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'jsy.id_eq': -1}, // 查询参数模版
  1336 + remote: $resource( // $resource封装对象
  1337 + '/eci/validate_jsy_config',
  1338 + {},
  1339 + {
  1340 + do: {
  1341 + method: 'GET'
  1342 + }
  1343 + }
  1344 + )
  1345 + },
1334 1346 ec_spy: { // 售票员不能重复配置
1335 1347 template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版
1336 1348 remote: $resource( // $resource封装对象
... ... @@ -1343,6 +1355,18 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
1343 1355 }
1344 1356 )
1345 1357 },
  1358 + ec_spy_config: { // 售票员是否配置在指定线路中
  1359 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版
  1360 + remote: $resource( // $resource封装对象
  1361 + '/eci/validate_spy_config',
  1362 + {},
  1363 + {
  1364 + do: {
  1365 + method: 'GET'
  1366 + }
  1367 + }
  1368 + )
  1369 + },
1346 1370  
1347 1371 cde1: { // 车辆设备启用日期验证
1348 1372 template: {'xl_eq': -1, 'cl_eq': -1, 'qyrq_eq': 1}, // 日期毫秒
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html
... ... @@ -129,6 +129,14 @@
129 129 <div class="alert alert-danger well-sm" ng-show="myForm.j1.$error.required">
130 130 驾驶员必须选择
131 131 </div>
  132 +
  133 + <input type="hidden" name="j1_h" ng-model="ctrl.formData.j1.id"
  134 + remote-Validation
  135 + remotevtype="ec_jsy_config"
  136 + remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j1.id} | json}}" />
  137 + <div class="alert alert-danger well-sm" ng-show="myForm.j1_h.$error.remote">
  138 + {{$remote_msg}}
  139 + </div>
132 140 </div>
133 141  
134 142 <div class="form-group">
... ... @@ -147,6 +155,14 @@
147 155 >
148 156 </sa-Select5>
149 157 </div>
  158 +
  159 + <input type="hidden" name="s1_h" ng-model="ctrl.formData.s1.id"
  160 + remote-Validation
  161 + remotevtype="ec_spy_config"
  162 + remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s1.id} | json}}" />
  163 + <div class="alert alert-danger well-sm" ng-show="myForm.s1_h.$error.remote">
  164 + {{$remote_msg}}
  165 + </div>
150 166 </div>
151 167  
152 168 <div class="form-group">
... ... @@ -165,6 +181,14 @@
165 181 >
166 182 </sa-Select5>
167 183 </div>
  184 +
  185 + <input type="hidden" name="j2_h" ng-model="ctrl.formData.j2.id"
  186 + remote-Validation
  187 + remotevtype="ec_jsy_config"
  188 + remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j2.id} | json}}" />
  189 + <div class="alert alert-danger well-sm" ng-show="myForm.j2_h.$error.remote">
  190 + {{$remote_msg}}
  191 + </div>
168 192 </div>
169 193  
170 194 <div class="form-group">
... ... @@ -183,6 +207,14 @@
183 207 >
184 208 </sa-Select5>
185 209 </div>
  210 +
  211 + <input type="hidden" name="s2_h" ng-model="ctrl.formData.s2.id"
  212 + remote-Validation
  213 + remotevtype="ec_spy_config"
  214 + remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s2.id} | json}}" />
  215 + <div class="alert alert-danger well-sm" ng-show="myForm.s2_h.$error.remote">
  216 + {{$remote_msg}}
  217 + </div>
186 218 </div>
187 219  
188 220 <div class="form-group">
... ... @@ -201,6 +233,14 @@
201 233 >
202 234 </sa-Select5>
203 235 </div>
  236 +
  237 + <input type="hidden" name="j3_h" ng-model="ctrl.formData.j3.id"
  238 + remote-Validation
  239 + remotevtype="ec_jsy_config"
  240 + remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'jsy.id_eq': ctrl.formData.j3.id} | json}}" />
  241 + <div class="alert alert-danger well-sm" ng-show="myForm.j3_h.$error.remote">
  242 + {{$remote_msg}}
  243 + </div>
204 244 </div>
205 245  
206 246 <div class="form-group">
... ... @@ -219,6 +259,14 @@
219 259 >
220 260 </sa-Select5>
221 261 </div>
  262 +
  263 + <input type="hidden" name="s3_h" ng-model="ctrl.formData.s3.id"
  264 + remote-Validation
  265 + remotevtype="ec_spy_config"
  266 + remotevparam="{{ {'xl.id_eq': ctrl.xlId, 'xl.name_eq': ctrl.xlName, 'spy.id_eq': ctrl.formData.s3.id} | json}}" />
  267 + <div class="alert alert-danger well-sm" ng-show="myForm.s3_h.$error.remote">
  268 + {{$remote_msg}}
  269 + </div>
222 270 </div>
223 271  
224 272 <div class="form-group">
... ...
src/main/resources/static/pages/trafficManage/lineStationUpload.html
... ... @@ -9,7 +9,7 @@
9 9 <form class="form-inline" action="">
10 10 <div style="display: inline-block;" class="param">
11 11 <span class="item-label" style="width: 80px;">线路名称: </span>
12   - <select class="form-control" name="lineCode_like" id="line" style="width: 180px;"></select>
  12 + <select class="form-control" name="id_eq" id="line" style="width: 180px;"></select>
13 13 </div>
14 14 <div class="form-group" style="display: inline-block;margin-left: 15px;">
15 15 <input class="btn btn-default" type="button" id="search" value="查询"/>
... ...
src/main/resources/static/real_control_v2/css/main.css
... ... @@ -2081,4 +2081,50 @@ dl.active &gt; dd.disabled {
2081 2081 .tp_info_icon{
2082 2082 font-size: 14px;
2083 2083 cursor: pointer;
  2084 +}
  2085 +
  2086 +g.gps-wrap rect.twinkle[updown="0"] {
  2087 + animation: anim_bg_twinkle_up 1.4s;
  2088 +}
  2089 +
  2090 +@keyframes anim_bg_twinkle_up {
  2091 + 0% {
  2092 + fill: yellow;
  2093 + stroke: yellow;
  2094 + }
  2095 + 25% {
  2096 + stroke: rgb(62, 80, 179);
  2097 + fill: rgb(62, 80, 179);
  2098 + }
  2099 + 50% {
  2100 + fill: yellow;
  2101 + stroke: yellow;
  2102 + }
  2103 + 100% {
  2104 + stroke: rgb(62, 80, 179);
  2105 + fill: rgb(62, 80, 179);
  2106 + }
  2107 +}
  2108 +
  2109 +g.gps-wrap rect.twinkle[updown="1"] {
  2110 + animation: anim_bg_twinkle_down 1.4s;
  2111 +}
  2112 +
  2113 +@keyframes anim_bg_twinkle_down {
  2114 + 0% {
  2115 + fill: yellow;
  2116 + stroke: yellow;
  2117 + }
  2118 + 25% {
  2119 + stroke: #c94f21;
  2120 + fill: #c94f21;
  2121 + }
  2122 + 50% {
  2123 + fill: yellow;
  2124 + stroke: yellow;
  2125 + }
  2126 + 100% {
  2127 + stroke: #c94f21;
  2128 + fill: #c94f21;
  2129 + }
2084 2130 }
2085 2131 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/main.html
... ... @@ -519,16 +519,18 @@
519 519  
520 520 function calcMileageByRoutes(routes, s, e) {
521 521 var code, flag, mileage = 0;
522   - $.each(routes, function () {
  522 + $.each(routes, function (i) {
523 523 code = this['stationCode'];
524 524 if (flag) {
525 525 if (!this.distances)
526 526 this.distances = 0;
527 527 mileage = gb_common.accAdd(mileage, this.distances);
528 528 }
529   - if (code == s)
  529 + if (code == s){
530 530 flag = true;
531   - if (code == e)
  531 + return true;
  532 + }
  533 + if (i > 0 && code == e)
532 534 return false;
533 535 });
534 536 return mileage;
... ...
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
... ... @@ -414,6 +414,19 @@ var gb_schedule_table = (function () {
414 414 }
415 415 }
416 416 });
  417 +
  418 + //车辆rect 闪烁、
  419 + var wrap = $(that).parents('li.line_schedule');
  420 + var nbbm = $(that).parents('dl').find('dd:eq(2)').data('nbbm');
  421 + var device = gb_data_basic.nbbm2deviceMap()[nbbm];
  422 + var $rect = $('svg.line-chart g.gps-wrap rect[_id=rct_' + device + ']', wrap);
  423 +
  424 + //merge_hide
  425 + if ($rect.hasClass('merge_hide') || $rect.attr('y') < 0)
  426 + return;
  427 + $rect.attr('class', 'twinkle').one('animationend', function () {
  428 + $(this).removeAttr('class');
  429 + });
417 430 });
418 431  
419 432 //拖拽选中...
... ...
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v3/layout.html
... ... @@ -53,7 +53,7 @@
53 53 {{/if}}
54 54 </dd>
55 55 <dd>{{obj.section_name}}</dd>
56   - <dd>{{obj.lineName}}</dd>
  56 + <dd title="{{obj.lineName}}">{{obj.lineName}}</dd>
57 57 </dl>
58 58 {{/each}}
59 59 {{if array.length==0}}
... ...