Commit 367d87c118d5c6c9fbfe24542788f318b0b88712

Authored by 潘钊
2 parents af2009fe 68cd3a2c

Merge branch 'minhang' into pudong

Showing 26 changed files with 1588 additions and 51 deletions

Too many changes to show.

To preserve performance only 26 of 65 files are displayed.

src/main/java/com/bsth/controller/forms/MCY_FormsController.java 0 → 100644
  1 +package com.bsth.controller.forms;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.web.bind.annotation.RequestMapping;
  8 +import org.springframework.web.bind.annotation.RequestMethod;
  9 +import org.springframework.web.bind.annotation.RequestParam;
  10 +import org.springframework.web.bind.annotation.RestController;
  11 +
  12 +import com.bsth.entity.mcy_forms.Changetochange;
  13 +import com.bsth.entity.mcy_forms.Linepasswengerflow;
  14 +import com.bsth.entity.mcy_forms.Operationservice;
  15 +import com.bsth.entity.mcy_forms.Shifday;
  16 +import com.bsth.entity.mcy_forms.Shiftuehiclemanth;
  17 +import com.bsth.entity.mcy_forms.Singledata;
  18 +import com.bsth.entity.mcy_forms.Vehicleloading;
  19 +import com.bsth.entity.mcy_forms.Waybillday;
  20 +import com.bsth.service.forms.FormsService;
  21 +import com.bsth.service.realcontrol.ScheduleRealInfoService;
  22 +
  23 +@RestController
  24 +@RequestMapping("mcy_forms")
  25 +public class MCY_FormsController {
  26 +
  27 + @Autowired
  28 + FormsService formsService;
  29 +
  30 + @Autowired
  31 + ScheduleRealInfoService scheduleRealInfoService;
  32 +
  33 + //行车路单日报表
  34 + @RequestMapping(value = "/waybillday",method = RequestMethod.POST)
  35 + public List<Waybillday> waybillday(@RequestParam Map<String, Object> map){
  36 +
  37 +
  38 +// scheduleRealInfoService.findKMBC(jName, clZbh, lpName, date)
  39 + return formsService.waybillday(map);
  40 + }
  41 +
  42 + @RequestMapping(value = "/waybilldayExcel")
  43 + public List<Waybillday> dailyInfo(@RequestParam Map<String, Object> map) {
  44 + return formsService.waybilldayExcel(map);
  45 + }
  46 +
  47 +
  48 + //线路客流量报表
  49 + @RequestMapping(value = "/linepasswengerflow",method = RequestMethod.POST)
  50 + public List<Linepasswengerflow> linepasswengerflow(@RequestParam Map<String, Object> map){
  51 +
  52 + return formsService.linepasswengerflow(map);
  53 + }
  54 +
  55 +
  56 +
  57 + //班次车辆人员月报表
  58 + @RequestMapping(value = "/shiftuehiclemanth",method = RequestMethod.POST)
  59 + public List<Shiftuehiclemanth> shiftuehiclemanth(@RequestParam Map<String, Object> map){
  60 +
  61 + return formsService.shiftuehiclemanth(map);
  62 + }
  63 +
  64 +
  65 + //班次车辆人员日统计
  66 + @RequestMapping(value = "/shifday",method = RequestMethod.POST)
  67 + public List<Shifday> shifday(@RequestParam Map<String, Object> map){
  68 +
  69 + return formsService.shifday(map);
  70 + }
  71 +
  72 + //换人换车情况统计表
  73 + @RequestMapping(value = "/changetochange",method = RequestMethod.POST)
  74 + public List<Changetochange> changetochange(@RequestParam Map<String, Object> map){
  75 +
  76 + return formsService.changetochange(map);
  77 + }
  78 +
  79 + //路单数据
  80 + @RequestMapping(value = "/singledata",method = RequestMethod.POST)
  81 + public List<Singledata> singledata(@RequestParam Map<String, Object> map){
  82 +
  83 + return formsService.singledata(map);
  84 + }
  85 +
  86 + //车辆加注
  87 + @RequestMapping(value = "/vehicleloading",method = RequestMethod.POST)
  88 + public List<Vehicleloading> vehicleloading(@RequestParam String line ,@RequestParam String data){
  89 + return formsService.vehicleloading(line,data);
  90 + }
  91 + //运营服务阶段报表
  92 + @RequestMapping(value = "/operationservice",method = RequestMethod.POST)
  93 + public List<Operationservice> operationservice(@RequestParam Map<String, Object> map){
  94 +
  95 + return formsService.operationservice(map);
  96 + }
  97 +
  98 +
  99 +}
... ...
src/main/java/com/bsth/controller/realcontrol/RealChartsController.java
... ... @@ -3,6 +3,7 @@ package com.bsth.controller.realcontrol;
3 3 import com.bsth.service.realcontrol.RealChartsService;
4 4 import com.bsth.service.realcontrol.dto.CarOutRate;
5 5 import com.bsth.service.realcontrol.dto.DeviceOnlineRate;
  6 +import com.bsth.service.realcontrol.dto.ScheduleExecRate;
6 7 import com.bsth.service.realcontrol.dto.StratEndPunctualityRate;
7 8 import org.springframework.beans.factory.annotation.Autowired;
8 9 import org.springframework.web.bind.annotation.RequestMapping;
... ... @@ -32,13 +33,18 @@ public class RealChartsController {
32 33 return realChartsService.carOutRate(month, idx);
33 34 }
34 35  
35   - @RequestMapping("stratEndPunctualityRate")
  36 +/* @RequestMapping("stratEndPunctualityRate")
36 37 public List<StratEndPunctualityRate> stratEndPunctualityRate(@RequestParam String idx, @RequestParam String month){
37 38 return realChartsService.stratEndPunctualityRate(month, idx);
38   - }
  39 + }*/
39 40  
40 41 @RequestMapping("sePunctualityRateLine")
41 42 public List<StratEndPunctualityRate> sePunctualityRateLine(@RequestParam String idx, @RequestParam String month){
42 43 return realChartsService.sePunctualityRateLine(month, idx);
43 44 }
  45 +
  46 + @RequestMapping("scheduleExecRates")
  47 + public List<ScheduleExecRate> scheduleExecRates(@RequestParam String idx, @RequestParam String date){
  48 + return realChartsService.scheduleExecRates(date, idx);
  49 + }
44 50 }
... ...
src/main/java/com/bsth/controller/schedule/TTInfoDetailController.java
... ... @@ -116,6 +116,7 @@ public class TTInfoDetailController extends BaseController&lt;TTInfoDetail, Long&gt; {
116 116 if (sheet.getRows() == 0 || sheet.getColumns() == 0) { // 工作区是否为空
117 117 rtn.put("status", ResponseCode.ERROR);
118 118 rtn.put("msg", String.format("%s 工作区没有数据!", sheetname));
  119 + return rtn;
119 120 } else {
120 121 if (sheet.getRows() <= 1 || sheet.getColumns() <= 1) {
121 122 rtn.put("status", ResponseCode.ERROR);
... ... @@ -147,11 +148,11 @@ public class TTInfoDetailController extends BaseController&lt;TTInfoDetail, Long&gt; {
147 148 List<StationRoute> stationRouteList = (List<StationRoute>) stationRouteService.list(p1);
148 149 if (CollectionUtils.isEmpty(stationRouteList)) {
149 150 rtn.put("status", ResponseCode.ERROR);
150   - rtn.put("msg", String.format("第1行,第%d列数据在%s站点路由中不是起点站", i + 1, linename));
  151 + rtn.put("msg", String.format("第1行,第%d列数据%s在%s站点路由中不是起点站", i + 1, cell_con.trim(), linename));
151 152 return rtn;
152 153 } else if (stationRouteList.size() > 1) {
153 154 rtn.put("status", ResponseCode.ERROR);
154   - rtn.put("msg", String.format("第1行,第%d列数据在%s站点路由中上下行都是起点站", i + 1, linename));
  155 + rtn.put("msg", String.format("第1行,第%d列数据%s在%s站点路由中上下行都是起点站", i + 1, cell_con.trim(), linename));
155 156 return rtn;
156 157 }
157 158 }
... ... @@ -363,6 +364,7 @@ public class TTInfoDetailController extends BaseController&lt;TTInfoDetail, Long&gt; {
363 364  
364 365 ttInfoDetailService.fileDataImport(
365 366 new File(filename + "_temp.xls"),
  367 + (String) form.get("sheetname"),
366 368 (String) form.get("xlname"),
367 369 (String) form.get("ttname"),
368 370 tccname
... ...
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
... ... @@ -51,7 +51,7 @@ public class SchAttrCalculator {
51 51  
52 52  
53 53 if(sch.getFcsj().compareTo(conf.getStartOpt()) < 0){
54   - sch.setFcsjAll(sch.getFcsjT() + DAY_TIME);
  54 + sch.setFcsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsj()) + DAY_TIME);
55 55 }
56 56  
57 57 sch.setRealExecDate(fmtyyyyMMdd.print(sch.getFcsjT()));
... ...
src/main/java/com/bsth/entity/mcy_forms/Changetochange.java 0 → 100644
  1 +package com.bsth.entity.mcy_forms;
  2 +
  3 +public class Changetochange {
  4 +
  5 +
  6 +}
... ...
src/main/java/com/bsth/entity/mcy_forms/Linepasswengerflow.java 0 → 100644
  1 +package com.bsth.entity.mcy_forms;
  2 +
  3 +public class Linepasswengerflow {
  4 +
  5 + private String stationName;//站点名字
  6 +
  7 + public String getStationName() {
  8 + return stationName;
  9 + }
  10 +
  11 + public void setStationName(String stationName) {
  12 + this.stationName = stationName;
  13 + }
  14 +
  15 +
  16 +
  17 +}
... ...
src/main/java/com/bsth/entity/mcy_forms/Operationservice.java 0 → 100644
  1 +package com.bsth.entity.mcy_forms;
  2 +
  3 +public class Operationservice {
  4 +
  5 + private String xlName;//线路
  6 +
  7 + private String jzl;//加注量
  8 +
  9 + private String xhl;//消耗量
  10 +
  11 + private String xsgl;//行驶公里
  12 +
  13 + private String emptMileage;//空驶里程
  14 +
  15 + private String sjbc;//实际班次
  16 +
  17 + public String getXlName() {
  18 + return xlName;
  19 + }
  20 +
  21 + public void setXlName(String xlName) {
  22 + this.xlName = xlName;
  23 + }
  24 +
  25 + public String getJzl() {
  26 + return jzl;
  27 + }
  28 +
  29 + public void setJzl(String jzl) {
  30 + this.jzl = jzl;
  31 + }
  32 +
  33 + public String getXhl() {
  34 + return xhl;
  35 + }
  36 +
  37 + public void setXhl(String xhl) {
  38 + this.xhl = xhl;
  39 + }
  40 +
  41 + public String getXsgl() {
  42 + return xsgl;
  43 + }
  44 +
  45 + public void setXsgl(String xsgl) {
  46 + this.xsgl = xsgl;
  47 + }
  48 +
  49 + public String getEmptMileage() {
  50 + return emptMileage;
  51 + }
  52 +
  53 + public void setEmptMileage(String emptMileage) {
  54 + this.emptMileage = emptMileage;
  55 + }
  56 +
  57 + public String getSjbc() {
  58 + return sjbc;
  59 + }
  60 +
  61 + public void setSjbc(String sjbc) {
  62 + this.sjbc = sjbc;
  63 + }
  64 +
  65 +
  66 +}
... ...
src/main/java/com/bsth/entity/mcy_forms/Shifday.java 0 → 100644
  1 +package com.bsth.entity.mcy_forms;
  2 +
  3 +public class Shifday {
  4 +
  5 + private String jName;//驾驶员
  6 +
  7 + private String sName;//售票员
  8 +
  9 + private String lpName;//路牌
  10 +
  11 + private String carPlate;//车辆
  12 +
  13 + private String jhlc;//计划里程
  14 +
  15 + private String sjjhlc;//实际计划里程
  16 +
  17 + private String yygl;//运营里程
  18 +
  19 + private String emptMileage;//空驶里程
  20 +
  21 + private String remMileage;//实际公里
  22 +
  23 + private String addMileage;//增加公里
  24 +
  25 + private String totalm;//总公里
  26 +
  27 + private String jhbc;//计划班次
  28 +
  29 + private String sjjhbc;//实际计划班次
  30 +
  31 + private String cjbc;//抽减班次
  32 +
  33 + private String ljbc;//增加班次
  34 +
  35 + private String sjbc;//实际班次
  36 +
  37 +
  38 + public String getJhlc() {
  39 + return jhlc;
  40 + }
  41 +
  42 + public void setJhlc(String jhlc) {
  43 + this.jhlc = jhlc;
  44 + }
  45 +
  46 + public String getSjjhlc() {
  47 + return sjjhlc;
  48 + }
  49 +
  50 + public void setSjjhlc(String sjjhlc) {
  51 + this.sjjhlc = sjjhlc;
  52 + }
  53 +
  54 + public String getYygl() {
  55 + return yygl;
  56 + }
  57 +
  58 + public void setYygl(String yygl) {
  59 + this.yygl = yygl;
  60 + }
  61 +
  62 + public String getEmptMileage() {
  63 + return emptMileage;
  64 + }
  65 +
  66 + public void setEmptMileage(String emptMileage) {
  67 + this.emptMileage = emptMileage;
  68 + }
  69 +
  70 + public String getRemMileage() {
  71 + return remMileage;
  72 + }
  73 +
  74 + public void setRemMileage(String remMileage) {
  75 + this.remMileage = remMileage;
  76 + }
  77 +
  78 + public String getAddMileage() {
  79 + return addMileage;
  80 + }
  81 +
  82 + public void setAddMileage(String addMileage) {
  83 + this.addMileage = addMileage;
  84 + }
  85 +
  86 + public String getTotalm() {
  87 + return totalm;
  88 + }
  89 +
  90 + public void setTotalm(String totalm) {
  91 + this.totalm = totalm;
  92 + }
  93 +
  94 + public String getJhbc() {
  95 + return jhbc;
  96 + }
  97 +
  98 + public void setJhbc(String jhbc) {
  99 + this.jhbc = jhbc;
  100 + }
  101 +
  102 + public String getSjjhbc() {
  103 + return sjjhbc;
  104 + }
  105 +
  106 + public void setSjjhbc(String sjjhbc) {
  107 + this.sjjhbc = sjjhbc;
  108 + }
  109 +
  110 + public String getCjbc() {
  111 + return cjbc;
  112 + }
  113 +
  114 + public void setCjbc(String cjbc) {
  115 + this.cjbc = cjbc;
  116 + }
  117 +
  118 + public String getLjbc() {
  119 + return ljbc;
  120 + }
  121 +
  122 + public void setLjbc(String ljbc) {
  123 + this.ljbc = ljbc;
  124 + }
  125 +
  126 + public String getSjbc() {
  127 + return sjbc;
  128 + }
  129 +
  130 + public void setSjbc(String sjbc) {
  131 + this.sjbc = sjbc;
  132 + }
  133 +
  134 +
  135 + public String getjName() {
  136 + return jName;
  137 + }
  138 +
  139 + public void setjName(String jName) {
  140 + this.jName = jName;
  141 + }
  142 +
  143 + public String getsName() {
  144 + return sName;
  145 + }
  146 +
  147 + public void setsName(String sName) {
  148 + this.sName = sName;
  149 + }
  150 +
  151 + public String getLpName() {
  152 + return lpName;
  153 + }
  154 +
  155 + public void setLpName(String lpName) {
  156 + this.lpName = lpName;
  157 + }
  158 +
  159 + public String getCarPlate() {
  160 + return carPlate;
  161 + }
  162 +
  163 + public void setCarPlate(String carPlate) {
  164 + this.carPlate = carPlate;
  165 + }
  166 +
  167 +
  168 +}
... ...
src/main/java/com/bsth/entity/mcy_forms/Shiftuehiclemanth.java 0 → 100644
  1 +package com.bsth.entity.mcy_forms;
  2 +
  3 +public class Shiftuehiclemanth {
  4 +
  5 + private String jName;//驾驶员名字
  6 +
  7 + private String jhlc;//运营里程
  8 +
  9 + private String emptMileage;//空驶里程
  10 +
  11 + private String remMileage;//抽减公里
  12 +
  13 + private String addMileage;//增加公里
  14 +
  15 + private String totalm;//总公里
  16 +
  17 + private String cjbc;//抽减班次
  18 +
  19 + private String ljbc;//增加班次
  20 +
  21 + private String sjbc;//实际班次
  22 +
  23 +
  24 + public String getCjbc() {
  25 + return cjbc;
  26 + }
  27 +
  28 + public void setCjbc(String cjbc) {
  29 + this.cjbc = cjbc;
  30 + }
  31 +
  32 + public String getLjbc() {
  33 + return ljbc;
  34 + }
  35 +
  36 + public void setLjbc(String ljbc) {
  37 + this.ljbc = ljbc;
  38 + }
  39 +
  40 + public String getSjbc() {
  41 + return sjbc;
  42 + }
  43 +
  44 + public void setSjbc(String sjbc) {
  45 + this.sjbc = sjbc;
  46 + }
  47 +
  48 +
  49 + public String getjName() {
  50 + return jName;
  51 + }
  52 +
  53 + public void setjName(String jName) {
  54 + this.jName = jName;
  55 + }
  56 +
  57 + public String getJhlc() {
  58 + return jhlc;
  59 + }
  60 +
  61 + public void setJhlc(String jhlc) {
  62 + this.jhlc = jhlc;
  63 + }
  64 +
  65 + public String getEmptMileage() {
  66 + return emptMileage;
  67 + }
  68 +
  69 + public void setEmptMileage(String emptMileage) {
  70 + this.emptMileage = emptMileage;
  71 + }
  72 +
  73 + public String getRemMileage() {
  74 + return remMileage;
  75 + }
  76 +
  77 + public void setRemMileage(String remMileage) {
  78 + this.remMileage = remMileage;
  79 + }
  80 +
  81 + public String getAddMileage() {
  82 + return addMileage;
  83 + }
  84 +
  85 + public void setAddMileage(String addMileage) {
  86 + this.addMileage = addMileage;
  87 + }
  88 +
  89 + public String getTotalm() {
  90 + return totalm;
  91 + }
  92 +
  93 + public void setTotalm(String totalm) {
  94 + this.totalm = totalm;
  95 + }
  96 +
  97 +
  98 +
  99 +
  100 +
  101 +
  102 +
  103 +}
... ...
src/main/java/com/bsth/entity/mcy_forms/Singledata.java 0 → 100644
  1 +package com.bsth.entity.mcy_forms;
  2 +
  3 +public class Singledata {
  4 +
  5 + private String rQ;//日期
  6 +
  7 + private String gS;//所属公司
  8 +
  9 + private String xL;//线路
  10 +
  11 + private String clzbh;//车号
  12 +
  13 + private String jsy;//驾驶员职号
  14 +
  15 + private String jName;//驾驶员名字
  16 +
  17 + private String sgh;//售票员职号
  18 +
  19 + private String sName;//售票员名称
  20 +
  21 + private String jhlc;//运营里程
  22 +
  23 + private String emptMileage;//空驶里程
  24 +
  25 + private String hyl;//耗油量
  26 +
  27 + private String jzl;//加注量
  28 +
  29 + private String unyyyl;//非商业用油
  30 +
  31 + private String jhjl;//计划公里
  32 +
  33 + public String getrQ() {
  34 + return rQ;
  35 + }
  36 +
  37 + public void setrQ(String rQ) {
  38 + this.rQ = rQ;
  39 + }
  40 +
  41 + public String getgS() {
  42 + return gS;
  43 + }
  44 +
  45 + public void setgS(String gS) {
  46 + this.gS = gS;
  47 + }
  48 +
  49 + public String getxL() {
  50 + return xL;
  51 + }
  52 +
  53 + public void setxL(String xL) {
  54 + this.xL = xL;
  55 + }
  56 +
  57 + public String getClzbh() {
  58 + return clzbh;
  59 + }
  60 +
  61 + public void setClzbh(String clzbh) {
  62 + this.clzbh = clzbh;
  63 + }
  64 +
  65 + public String getJsy() {
  66 + return jsy;
  67 + }
  68 +
  69 + public void setJsy(String jsy) {
  70 + this.jsy = jsy;
  71 + }
  72 +
  73 + public String getjName() {
  74 + return jName;
  75 + }
  76 +
  77 + public void setjName(String jName) {
  78 + this.jName = jName;
  79 + }
  80 +
  81 + public String getSgh() {
  82 + return sgh;
  83 + }
  84 +
  85 + public void setSgh(String sgh) {
  86 + this.sgh = sgh;
  87 + }
  88 +
  89 + public String getsName() {
  90 + return sName;
  91 + }
  92 +
  93 + public void setsName(String sName) {
  94 + this.sName = sName;
  95 + }
  96 +
  97 + public String getJhlc() {
  98 + return jhlc;
  99 + }
  100 +
  101 + public void setJhlc(String jhlc) {
  102 + this.jhlc = jhlc;
  103 + }
  104 +
  105 + public String getEmptMileage() {
  106 + return emptMileage;
  107 + }
  108 +
  109 + public void setEmptMileage(String emptMileage) {
  110 + this.emptMileage = emptMileage;
  111 + }
  112 +
  113 + public String getHyl() {
  114 + return hyl;
  115 + }
  116 +
  117 + public void setHyl(String hyl) {
  118 + this.hyl = hyl;
  119 + }
  120 +
  121 + public String getJzl() {
  122 + return jzl;
  123 + }
  124 +
  125 + public void setJzl(String jzl) {
  126 + this.jzl = jzl;
  127 + }
  128 +
  129 + public String getUnyyyl() {
  130 + return unyyyl;
  131 + }
  132 +
  133 + public void setUnyyyl(String unyyyl) {
  134 + this.unyyyl = unyyyl;
  135 + }
  136 +
  137 + public String getJhjl() {
  138 + return jhjl;
  139 + }
  140 +
  141 + public void setJhjl(String jhjl) {
  142 + this.jhjl = jhjl;
  143 + }
  144 +
  145 +
  146 +
  147 +}
... ...
src/main/java/com/bsth/entity/mcy_forms/Vehicleloading.java 0 → 100644
  1 +package com.bsth.entity.mcy_forms;
  2 +
  3 +public class Vehicleloading {
  4 +
  5 + private String rQ;//日期
  6 +
  7 + private String gS;//所属公司
  8 +
  9 + private String xL;//线路
  10 +
  11 + private String clzbh;//车号
  12 +
  13 + private String hyl;//耗油量
  14 +
  15 + private String jzl;//加注量
  16 +
  17 + private String ls;//尿素
  18 +
  19 + private String jhlc;//实际里程
  20 +
  21 + private String unyyyl;//非商业用油
  22 +
  23 + private String jhbc;//计划班次
  24 +
  25 + private String sjbc;//实际班次
  26 +
  27 + public String getLs() {
  28 + return ls;
  29 + }
  30 +
  31 + public void setLs(String ls) {
  32 + this.ls = ls;
  33 + }
  34 +
  35 +
  36 +
  37 + public String getrQ() {
  38 + return rQ;
  39 + }
  40 +
  41 + public void setrQ(String rQ) {
  42 + this.rQ = rQ;
  43 + }
  44 +
  45 + public String getgS() {
  46 + return gS;
  47 + }
  48 +
  49 + public void setgS(String gS) {
  50 + this.gS = gS;
  51 + }
  52 +
  53 + public String getxL() {
  54 + return xL;
  55 + }
  56 +
  57 + public void setxL(String xL) {
  58 + this.xL = xL;
  59 + }
  60 +
  61 + public String getClzbh() {
  62 + return clzbh;
  63 + }
  64 +
  65 + public void setClzbh(String clzbh) {
  66 + this.clzbh = clzbh;
  67 + }
  68 +
  69 + public String getHyl() {
  70 + return hyl;
  71 + }
  72 +
  73 + public void setHyl(String hyl) {
  74 + this.hyl = hyl;
  75 + }
  76 +
  77 + public String getJzl() {
  78 + return jzl;
  79 + }
  80 +
  81 + public void setJzl(String jzl) {
  82 + this.jzl = jzl;
  83 + }
  84 +
  85 + public String getJhlc() {
  86 + return jhlc;
  87 + }
  88 +
  89 + public void setJhlc(String jhlc) {
  90 + this.jhlc = jhlc;
  91 + }
  92 +
  93 + public String getUnyyyl() {
  94 + return unyyyl;
  95 + }
  96 +
  97 + public void setUnyyyl(String unyyyl) {
  98 + this.unyyyl = unyyyl;
  99 + }
  100 +
  101 +
  102 +
  103 + public String getJhbc() {
  104 + return jhbc;
  105 + }
  106 +
  107 + public void setJhbc(String jhbc) {
  108 + this.jhbc = jhbc;
  109 + }
  110 +
  111 + public String getSjbc() {
  112 + return sjbc;
  113 + }
  114 +
  115 + public void setSjbc(String sjbc) {
  116 + this.sjbc = sjbc;
  117 + }
  118 +
  119 +
  120 +
  121 +
  122 +}
... ...
src/main/java/com/bsth/entity/mcy_forms/Waybillday.java 0 → 100644
  1 +package com.bsth.entity.mcy_forms;
  2 +
  3 +/**
  4 + *
  5 + * @author 马陈艳
  6 + * 线路调度日报表统计
  7 + *
  8 + */
  9 +public class Waybillday {
  10 +
  11 + private String carPlate;//车牌号
  12 +
  13 + private String jzl;//加注量
  14 +
  15 + private String jzl1;//空驶公里
  16 +
  17 + private String yh;//油耗
  18 +
  19 + private String jName;//驾驶员
  20 +
  21 + private String zlc;//里程
  22 +
  23 + private String yl;//用油
  24 +
  25 + private String nbbm;//机油
  26 +
  27 + public String getCarPlate() {
  28 + return carPlate;
  29 + }
  30 +
  31 + public void setCarPlate(String carPlate) {
  32 + this.carPlate = carPlate;
  33 + }
  34 +
  35 +
  36 + public String getJzl1() {
  37 + return jzl1;
  38 + }
  39 +
  40 + public void setJzl1(String jzl1) {
  41 + this.jzl1 = jzl1;
  42 + }
  43 +
  44 +
  45 + public String getJzl() {
  46 + return jzl;
  47 + }
  48 +
  49 + public void setJzl(String jzl) {
  50 + this.jzl = jzl;
  51 + }
  52 +
  53 + public String getYh() {
  54 + return yh;
  55 + }
  56 +
  57 + public void setYh(String yh) {
  58 + this.yh = yh;
  59 + }
  60 +
  61 + public String getjName() {
  62 + return jName;
  63 + }
  64 +
  65 + public void setjName(String jName) {
  66 + this.jName = jName;
  67 + }
  68 +
  69 + public String getZlc() {
  70 + return zlc;
  71 + }
  72 +
  73 + public void setZlc(String string) {
  74 + this.zlc = string;
  75 + }
  76 +
  77 +
  78 + public String getNbbm() {
  79 + return nbbm;
  80 + }
  81 +
  82 + public void setNbbm(String nbbm) {
  83 + this.nbbm = nbbm;
  84 + }
  85 +
  86 + public String getYl() {
  87 + return yl;
  88 + }
  89 +
  90 + public void setYl(String yl) {
  91 + this.yl = yl;
  92 + }
  93 +
  94 +
  95 +}
... ...
src/main/java/com/bsth/entity/schedule/SchedulePlan.java
... ... @@ -38,6 +38,15 @@ public class SchedulePlan {
38 38 @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
39 39 private ScheduleRule1 scheduleRule1;
40 40  
  41 + // TODO: 新字段,测试完后删除旧的字段
  42 +
  43 + /** 使用的时刻表名字列表(用逗号连接) */
  44 + private String ttInfoNames;
  45 + /** 使用的时刻表id列表(用逗号连接) */
  46 + private String ttInfoId;
  47 + /** 使用的规则1列表(用逗号连接) */
  48 + private String rule1Ids;
  49 +
41 50 /** 排班计划的开始时间 */
42 51 @Column(nullable = false)
43 52 private Date scheduleFromTime;
... ... @@ -150,4 +159,28 @@ public class SchedulePlan {
150 159 public void setUpdateDate(Date updateDate) {
151 160 this.updateDate = updateDate;
152 161 }
  162 +
  163 + public String getTtInfoNames() {
  164 + return ttInfoNames;
  165 + }
  166 +
  167 + public void setTtInfoNames(String ttInfoNames) {
  168 + this.ttInfoNames = ttInfoNames;
  169 + }
  170 +
  171 + public String getTtInfoId() {
  172 + return ttInfoId;
  173 + }
  174 +
  175 + public void setTtInfoId(String ttInfoId) {
  176 + this.ttInfoId = ttInfoId;
  177 + }
  178 +
  179 + public String getRule1Ids() {
  180 + return rule1Ids;
  181 + }
  182 +
  183 + public void setRule1Ids(String rule1Ids) {
  184 + this.rule1Ids = rule1Ids;
  185 + }
153 186 }
... ...
src/main/java/com/bsth/entity/schedule/SchedulePlanInfo.java
... ... @@ -121,6 +121,13 @@ public class SchedulePlanInfo {
121 121 @Column(nullable = false)
122 122 private String bcType;
123 123  
  124 + // 重要的新增字段
  125 + /** 关联的时刻表id */
  126 + private Long ttInfo;
  127 + /** 关联的时刻表名字 */
  128 + private String ttInfoName;
  129 +
  130 +
124 131 /** 创建人 */
125 132 @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
126 133 private SysUser createBy;
... ... @@ -555,4 +562,20 @@ public class SchedulePlanInfo {
555 562 public void setSchedulePlan(SchedulePlan schedulePlan) {
556 563 this.schedulePlan = schedulePlan;
557 564 }
  565 +
  566 + public Long getTtInfo() {
  567 + return ttInfo;
  568 + }
  569 +
  570 + public void setTtInfo(Long ttInfo) {
  571 + this.ttInfo = ttInfo;
  572 + }
  573 +
  574 + public String getTtInfoName() {
  575 + return ttInfoName;
  576 + }
  577 +
  578 + public void setTtInfoName(String ttInfoName) {
  579 + this.ttInfoName = ttInfoName;
  580 + }
558 581 }
... ...
src/main/java/com/bsth/entity/search/PredicatesBuilder.java
1 1 package com.bsth.entity.search;
2 2  
  3 +import org.joda.time.DateTime;
  4 +
3 5 import javax.persistence.criteria.CriteriaBuilder;
4 6 import javax.persistence.criteria.Path;
5 7 import javax.persistence.criteria.Predicate;
... ... @@ -27,7 +29,26 @@ public class PredicatesBuilder {
27 29 }
28 30  
29 31 public static Predicate eq(CriteriaBuilder cb,Path<?> expression, Object object){
30   - return cb.equal(expression, object);
  32 + Class<?> leftType = expression.getJavaType();
  33 + Class<?> rightType = object.getClass();
  34 +
  35 + if (Number.class.isAssignableFrom(leftType) &&
  36 + (Number.class.isAssignableFrom(rightType) || String.class.isAssignableFrom(rightType))) { // Number == Number/String
  37 + return cb.equal(expression, object);
  38 + } else if (String.class.isAssignableFrom(leftType) &&
  39 + (String.class.isAssignableFrom(rightType) || Number.class.isAssignableFrom(rightType))) { // String == String/Number
  40 + return cb.equal(expression, object);
  41 + } else if (Date.class.isAssignableFrom(leftType) &&
  42 + Date.class.isAssignableFrom(rightType)) { // Date == Date
  43 + return cb.equal(expression, object);
  44 + } else if (Date.class.isAssignableFrom(leftType) &&
  45 + String.class.isAssignableFrom(rightType)) { // Date == String
  46 + DateTime dateTime = new DateTime(object);
  47 + return cb.equal(expression, dateTime.toDate());
  48 + } else {
  49 + throw new RuntimeException("eq 不支持类型组合:" + expression.getJavaType() + "==" + object.getClass());
  50 + }
  51 +
31 52 }
32 53  
33 54 public static Predicate ne(CriteriaBuilder cb,Path<?> expression, Object object){
... ... @@ -47,15 +68,19 @@ public class PredicatesBuilder {
47 68 Class<?> leftType = expression.getJavaType();
48 69 Class<?> rightType = object.getClass();
49 70  
50   - if (leftType.isAssignableFrom(Number.class) &&
51   - rightType.isAssignableFrom(Number.class)) { // 判定是否是Number类型的子类
  71 + if (Number.class.isAssignableFrom(leftType) &&
  72 + (Number.class.isAssignableFrom(rightType) || String.class.isAssignableFrom(rightType))) { // Number >= Number/String
52 73 return cb.ge((Path<Number>) expression, (Number) object);
53   - } else if (leftType.isAssignableFrom(String.class) &&
54   - rightType.isAssignableFrom(String.class)) { // 判定是否是String类型的子类
  74 + } else if (String.class.isAssignableFrom(leftType) &&
  75 + (String.class.isAssignableFrom(rightType) || Number.class.isAssignableFrom(rightType))) { // String >= String/Number
55 76 return cb.greaterThanOrEqualTo((Path<String>) expression, (String) object);
56   - } else if (leftType.isAssignableFrom(Date.class) &&
57   - rightType.isAssignableFrom(Date.class)) { // 判定是否是Date类型的子类
  77 + } else if (Date.class.isAssignableFrom(leftType) &&
  78 + Date.class.isAssignableFrom(rightType)) { // Date >= Date
58 79 return cb.greaterThanOrEqualTo((Path<Date>) expression, (Date) object);
  80 + } else if (Date.class.isAssignableFrom(leftType) &&
  81 + String.class.isAssignableFrom(rightType)) { // Date >= String
  82 + DateTime dateTime = new DateTime(object);
  83 + return cb.greaterThanOrEqualTo((Path<Date>) expression, dateTime.toDate());
59 84 } else {
60 85 throw new RuntimeException("ge 不支持类型组合:" + expression.getJavaType() + ">=" + object.getClass());
61 86 }
... ... @@ -74,17 +99,22 @@ public class PredicatesBuilder {
74 99 Class<?> leftType = expression.getJavaType();
75 100 Class<?> rightType = object.getClass();
76 101  
77   - if (leftType.isAssignableFrom(Number.class) &&
78   - rightType.isAssignableFrom(Number.class)) { // 判定是否是Number类型的子类
  102 +
  103 + if (Number.class.isAssignableFrom(leftType) &&
  104 + (Number.class.isAssignableFrom(rightType) || String.class.isAssignableFrom(rightType))) { // Number <= Number/String
79 105 return cb.le((Path<Number>) expression, (Number) object);
80   - } else if (leftType.isAssignableFrom(String.class) &&
81   - rightType.isAssignableFrom(String.class)) { // 判定是否是String类型的子类
  106 + } else if (String.class.isAssignableFrom(leftType) &&
  107 + (String.class.isAssignableFrom(rightType) || Number.class.isAssignableFrom(rightType))) { // String <= String/Number
82 108 return cb.lessThanOrEqualTo((Path<String>) expression, (String) object);
83   - } else if (leftType.isAssignableFrom(Date.class) &&
84   - rightType.isAssignableFrom(Date.class)) { // 判定是否是Date类型的子类
  109 + } else if (Date.class.isAssignableFrom(leftType) &&
  110 + Date.class.isAssignableFrom(rightType)) { // Date <= Date
85 111 return cb.lessThanOrEqualTo((Path<Date>) expression, (Date) object);
  112 + } else if (Date.class.isAssignableFrom(leftType) &&
  113 + String.class.isAssignableFrom(rightType)) { // Date <= String
  114 + DateTime dateTime = new DateTime(object);
  115 + return cb.lessThanOrEqualTo((Path<Date>) expression, dateTime.toDate());
86 116 } else {
87   - throw new RuntimeException("ge 不支持类型组合:" + expression.getJavaType() + ">=" + object.getClass());
  117 + throw new RuntimeException("le 不支持类型组合:" + expression.getJavaType() + "<=" + object.getClass());
88 118 }
89 119 }
90 120  
... ...
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
... ... @@ -81,8 +81,8 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
81 81 @Query(value="select s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and bcType='normal' order by bcs")
82 82 List<ScheduleRealInfo> queryListWaybill2(String jName,String clZbh,String lpName,String date);
83 83  
84   - @Query(value="select s from ScheduleRealInfo s where s.jGh = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and bcType='normal' order by bcs")
85   - List<ScheduleRealInfo> queryListWaybill3(String jName,String clZbh,String lpName,String date);
  84 + @Query(value="select s from ScheduleRealInfo s where s.jGh = ?1 and s.clZbh = ?2 and s.scheduleDate = str_to_date(?3,'%Y-%m-%d') and bcType='normal' order by bcs")
  85 + List<ScheduleRealInfo> queryListWaybill3(String jName,String clZbh,String date);
86 86  
87 87 @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2")
88 88 List<ScheduleRealInfo> scheduleDaily(String line,String date);
... ...
src/main/java/com/bsth/service/forms/FormsService.java 0 → 100644
  1 +package com.bsth.service.forms;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import com.bsth.entity.mcy_forms.Changetochange;
  7 +import com.bsth.entity.mcy_forms.Linepasswengerflow;
  8 +import com.bsth.entity.mcy_forms.Operationservice;
  9 +import com.bsth.entity.mcy_forms.Shifday;
  10 +import com.bsth.entity.mcy_forms.Shiftuehiclemanth;
  11 +import com.bsth.entity.mcy_forms.Singledata;
  12 +import com.bsth.entity.mcy_forms.Vehicleloading;
  13 +import com.bsth.entity.mcy_forms.Waybillday;
  14 +
  15 +
  16 +public interface FormsService {
  17 +
  18 + public List<Waybillday> waybillday(Map<String, Object> map);
  19 +
  20 + List<Waybillday> waybilldayExcel(Map<String, Object> map);
  21 +
  22 + public List<Linepasswengerflow> linepasswengerflow(Map<String, Object> map);
  23 +
  24 + public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map);
  25 +
  26 + public List<Changetochange> changetochange(Map<String, Object> map);
  27 +
  28 + public List<Shifday> shifday(Map<String, Object> map);
  29 +
  30 + public List<Singledata> singledata(Map<String, Object> map);
  31 +
  32 + public List<Vehicleloading> vehicleloading(String line,String data);
  33 +
  34 + public List<Operationservice> operationservice(Map<String, Object> map);
  35 +}
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java 0 → 100644
  1 +package com.bsth.service.forms.impl;
  2 +
  3 +import java.sql.ResultSet;
  4 +import java.sql.SQLException;
  5 +import java.text.DecimalFormat;
  6 +import java.text.SimpleDateFormat;
  7 +import java.util.ArrayList;
  8 +import java.util.HashMap;
  9 +import java.util.Iterator;
  10 +import java.util.List;
  11 +import java.util.Map;
  12 +
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.jdbc.core.JdbcTemplate;
  15 +import org.springframework.jdbc.core.RowMapper;
  16 +import org.springframework.stereotype.Service;
  17 +
  18 +import com.bsth.entity.mcy_forms.Linepasswengerflow;
  19 +import com.bsth.entity.mcy_forms.Operationservice;
  20 +import com.bsth.entity.mcy_forms.Shifday;
  21 +import com.bsth.entity.mcy_forms.Shiftuehiclemanth;
  22 +import com.bsth.entity.mcy_forms.Singledata;
  23 +import com.bsth.entity.mcy_forms.Vehicleloading;
  24 +import com.bsth.entity.mcy_forms.Waybillday;
  25 +import com.bsth.entity.mcy_forms.Changetochange;
  26 +import com.bsth.service.forms.FormsService;
  27 +import com.bsth.service.realcontrol.ScheduleRealInfoService;
  28 +import com.bsth.util.ReportRelatedUtils;
  29 +import com.bsth.util.ReportUtils;
  30 +
  31 +@Service
  32 +public class FormsServiceImpl implements FormsService{
  33 +
  34 + @Autowired
  35 + JdbcTemplate jdbcTemplate;
  36 +
  37 + @Autowired
  38 + ScheduleRealInfoService scheduleRealInfoService;
  39 +
  40 + //行车路单日报表
  41 + @Override
  42 + public List<Waybillday> waybillday(Map<String, Object> map) {
  43 + List list1=new ArrayList<>();//
  44 + String sql = "select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH,y.YH,c.personnel_name from bsth_c_ylb y" +
  45 + " LEFT JOIN bsth_c_personnel c ON c.job_code=y.JSY " +
  46 + " where to_days(y.RQ)=to_days('"+map.get("date").toString()+"') " +
  47 + " and y.XLBM="+map.get("line").toString()+
  48 + " GROUP BY y.NBBM";
  49 +
  50 + List<Waybillday> list = jdbcTemplate.query(sql, new RowMapper<Waybillday>() {
  51 + @Override
  52 + public Waybillday mapRow(ResultSet arg0, int arg1) throws SQLException {
  53 + Waybillday wbd = new Waybillday();
  54 + wbd.setCarPlate(arg0.getString("NBBM"));
  55 + wbd.setJzl(arg0.getString("JZL"));
  56 + wbd.setYh(arg0.getString("YH"));
  57 + wbd.setjName(arg0.getString("personnel_name"));
  58 + //wbd.setZlc(arg0.getInt("zlc"));
  59 + //System.out.println(arg0.getObject("yl"));
  60 + //wbd.setYl(arg0.getString("yl"));
  61 + //wbd.setNbbm(arg0.getString("nbbm"));
  62 + Map<String, Object> maps=new HashMap<>();
  63 + maps=scheduleRealInfoService.findKMBC2(arg0.getString("JSY"), arg0.getString("nbbm"), arg0.getString("RQ"));
  64 + wbd.setJzl1(maps.get("ksgl").toString());
  65 + wbd.setZlc(maps.get("realMileage").toString());
  66 +// {realMileage=211.20, cjbc=2, ljbc=0, remMileage=38.40, ksgl=0.00,
  67 +// jhlc=211.20, sjbc=9, jhbc=11, addMileage=0.00, yygl=211.20
  68 +
  69 + return wbd;
  70 +
  71 + }
  72 + });
  73 + return list;
  74 + }
  75 +
  76 +
  77 +
  78 + //线路客流量报表
  79 + @Override
  80 + public List<Linepasswengerflow> linepasswengerflow(Map<String, Object> map) {
  81 + String sql = " SELECT s.station_name,l.name,l.create_date from bsth_c_stationroute s " +
  82 + " LEFT JOIN bsth_c_line l on s.line_code=l.line_code " +
  83 + " where to_days(l.create_date)=to_days('"+map.get("date").toString()+"') " +
  84 + " and l.line_code="+map.get("line").toString()+
  85 + " GROUP BY s.station_name ";
  86 +
  87 + List<Linepasswengerflow> list = jdbcTemplate.query(sql, new RowMapper<Linepasswengerflow>() {
  88 +
  89 + @Override
  90 + public Linepasswengerflow mapRow(ResultSet arg0, int arg1) throws SQLException {
  91 + Linepasswengerflow lin = new Linepasswengerflow();
  92 + lin.setStationName(arg0.getString("station_name"));
  93 +
  94 + return lin;
  95 + }
  96 + });
  97 + return list;
  98 + }
  99 +
  100 +
  101 + //导出
  102 + @Override
  103 + public List<Waybillday> waybilldayExcel(Map<String,Object> map) {
  104 + ReportUtils ee = new ReportUtils();
  105 + ReportRelatedUtils rru = new ReportRelatedUtils();
  106 + List<Iterator<?>> list = new ArrayList<Iterator<?>>();
  107 + List<Waybillday> Waybilldays = waybillday(map);
  108 + List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>();
  109 +
  110 + DecimalFormat format = new DecimalFormat("0.00");
  111 + String jName=null;
  112 + Map<String,Object> map1 = new HashMap<>();
  113 + for(Waybillday Waybillday : Waybilldays){
  114 + map1.put("carPlate", Waybillday.getCarPlate());
  115 + map1.put("jzl1", Waybillday.getJzl1());
  116 + map1.put("jzl", Waybillday.getJzl());
  117 + map1.put("yh", Waybillday.getYh());
  118 + map1.put("jName", Waybillday.getjName());
  119 + jName=Waybillday.getjName();
  120 + map1.put("zlc", Waybillday.getZlc());
  121 + }
  122 +//
  123 +// //计算里程和班次数,并放入Map里
  124 +// map1 = new HashMap<String, Object>();
  125 +// map1.put("jhlc", format.format(jhlc));
  126 +// map1.put("remMileage", format.format(remMileage));
  127 +// map1.put("addMileage", format.format(addMileage));
  128 +// map1.put("yygl", format.format(yygl));
  129 +// map1.put("ksgl", format.format(ksgl));
  130 +// map1.put("realMileage", format.format(yygl+ksgl));
  131 +// map1.put("jhbc", jhbc);
  132 +// map1.put("cjbc", cjbc);
  133 +// map1.put("ljbc", ljbc);
  134 +// map1.put("sjbc", jhbc-cjbc+ljbc);
  135 +
  136 + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\";
  137 +
  138 + list.add(listMap.iterator());
  139 + ee.excelReplace(list, new Object[] { Waybilldays.get(0),map1 }, path+"mould\\waybill_minhang.xls",
  140 + path+"export\\" + jName + ".xls");
  141 + return Waybilldays;
  142 + }
  143 +
  144 +
  145 + //班次车辆人员月统计
  146 + String startDate;
  147 + String endDate;
  148 + @Override
  149 + public List<Shiftuehiclemanth> shiftuehiclemanth( Map<String, Object> map) {
  150 + List list1=new ArrayList<>();//
  151 + String sql = "select r.j_name,r.schedule_date_str,r.update_date,r.cl_zbh " +
  152 + " from bsth_c_s_sp_info_real r " +
  153 + " LEFT JOIN bsth_c_s_ttinfo_detail d on r.lp_name=d.lp " +
  154 + " LEFT JOIN bsth_c_line_information l on l.line=r.lp_name " +
  155 + " where to_days(r.schedule_date_str) BETWEEN to_days('"+map.get("startDate").toString()+"') " +
  156 + " and to_days('"+map.get("endDate").toString()+"') " +
  157 + " and r.xl_bm='"+map.get("line").toString() +"' " +
  158 + " GROUP BY r.j_name" +
  159 + " ORDER BY r.j_name";
  160 + startDate=map.get("startDate").toString();
  161 + endDate=map.get("endDate").toString();
  162 + List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() {
  163 +
  164 + @Override
  165 + public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException {
  166 + Shiftuehiclemanth shif = new Shiftuehiclemanth();
  167 + shif.setjName(arg0.getString("j_name"));
  168 +
  169 + Map<String, Object> maps=new HashMap<>();
  170 +
  171 + maps=scheduleRealInfoService.findKMBC1(arg0.getString("j_name"), arg0.getString("cl_zbh"), startDate , endDate );
  172 + shif.setJhlc(maps.get("jhlc").toString());
  173 + shif.setEmptMileage(maps.get("ksgl").toString());
  174 + shif.setRemMileage(maps.get("remMileage").toString());
  175 + shif.setAddMileage(maps.get("addMileage").toString());
  176 + shif.setTotalm(maps.get("realMileage").toString());
  177 + shif.setCjbc(maps.get("cjbc").toString());
  178 + shif.setLjbc(maps.get("ljbc").toString());
  179 + shif.setSjbc(maps.get("sjbc").toString());
  180 +
  181 + return shif;
  182 +
  183 + }
  184 + });
  185 +
  186 + return list;
  187 + }
  188 +
  189 +
  190 + //班次车辆人员日统计
  191 + @Override
  192 + public List<Shifday> shifday(Map<String, Object> map) {
  193 + String sql = " select r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,r.schedule_date,r.cl_zbh,r.j_gh " +
  194 + " FROM bsth_c_s_sp_info_real r " +
  195 + " where to_days(r.schedule_date)=to_days('"+map.get("date").toString()+"') and r.xl_bm="+map.get("line").toString()+
  196 + " GROUP BY r.j_name ";
  197 +
  198 + List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() {
  199 +
  200 + @Override
  201 + public Shifday mapRow(ResultSet arg0, int arg1) throws SQLException {
  202 + Shifday shifday = new Shifday();
  203 + shifday.setjName(arg0.getString("j_name").toString());
  204 + shifday.setsName(arg0.getString("s_name")==null?"":arg0.getString("s_name").toString());
  205 + shifday.setLpName(arg0.getString("r.lp_name").toString());
  206 + shifday.setCarPlate(arg0.getString("cl_zbh").toString());
  207 +
  208 + Map<String, Object> map=new HashMap<>();
  209 + map=scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"), arg0.getString("schedule_date"));
  210 + shifday.setJhlc(map.get("jhlc").toString());//计划里程
  211 + //shifday.setSjjhlc(map.get("remMileage").toString());//实际计划里程
  212 + shifday.setYygl(map.get("yygl").toString());//营运里程
  213 + shifday.setEmptMileage(map.get("ksgl").toString());//空驶里程
  214 + shifday.setRemMileage(map.get("remMileage").toString());//抽减里程
  215 + shifday.setAddMileage(map.get("addMileage").toString());//增加里程
  216 + shifday.setTotalm(map.get("realMileage").toString());//总里程
  217 + shifday.setJhbc(map.get("jhbc").toString());//计划班次
  218 + //shifday.setSjjhbc(map.get("sjjhbc").toString());//实际计划班次
  219 + shifday.setCjbc(map.get("cjbc").toString());//抽减班次
  220 + shifday.setLjbc(map.get("ljbc").toString());//增加班次
  221 + shifday.setSjbc(map.get("sjbc").toString());//实际班次
  222 + return shifday;
  223 + }
  224 + });
  225 + return list;
  226 + }
  227 +
  228 + //换人换车情况日统计
  229 + @Override
  230 + public List<Changetochange> changetochange(Map<String, Object> map) {
  231 +
  232 + return null;
  233 + }
  234 +
  235 +
  236 + //路单数据
  237 + @Override
  238 + public List<Singledata> singledata(Map<String, Object> map) {
  239 +
  240 + String sql = " SELECT y.RQ,y.SSGSDM,y.XLBM,y.NBBM,y.JSY,y.YH,y.JZL " +
  241 + " FROM bsth_c_ylb y" +
  242 + " where y.RQ BETWEEN '"+map.get("startDate").toString() +"'" +
  243 + " and '"+map.get("endDate").toString()+"'"+
  244 + " and y.XLBM='"+map.get("line").toString()+"'"+
  245 + " GROUP BY y.NBBM ";
  246 +
  247 + List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
  248 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
  249 + @Override
  250 + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
  251 + Singledata sin = new Singledata();
  252 + sin.setrQ(sdf.format(arg0.getDate("rq")));
  253 + sin.setgS(arg0.getString("SSGSDM").toString());
  254 + sin.setxL(arg0.getString("XLBM").toString());
  255 + sin.setClzbh(arg0.getString("NBBM").toString());
  256 + sin.setJsy(arg0.getString("JSY").toString());
  257 + sin.setHyl(arg0.getString("YH").toString());
  258 + sin.setJzl(arg0.getString("JZL").toString());
  259 + // sin.setJzl(arg0.getString(""));//非营业性用油
  260 + sin.setJhjl(arg0.getString("JZL"));
  261 + Map<String, Object> maps=new HashMap<>();
  262 + maps=scheduleRealInfoService.findKMBC2(sin.getJsy(),sin.getClzbh(),sin.getrQ());
  263 + sin.setjName(maps.get("j_name")==null?"":maps.get("j_name").toString());
  264 + sin.setSgh(maps.get("s_gh")==null?"":maps.get("s_gh").toString());
  265 + sin.setsName(maps.get("s_name")==null?"":maps.get("s_name").toString());
  266 + sin.setJhlc(maps.get("yygl")==null?"":maps.get("yygl").toString());
  267 + sin.setEmptMileage(maps.get("ksgl")==null?"":maps.get("ksgl").toString());
  268 + sin.setJhjl(maps.get("jhlc")==null?"":maps.get("jhlc").toString());
  269 +
  270 + return sin;
  271 + }
  272 + });
  273 + return list;
  274 +}
  275 +
  276 +
  277 + //运营服务阶段报表
  278 + @Override
  279 + public List<Operationservice> operationservice(Map<String, Object> map) {
  280 +
  281 + String sql = " SELECT y.RQ,y.XLBM,y.NBBM,y.JSY,y.YH,y.JZL " +
  282 + " FROM bsth_c_ylb y" +
  283 + " where y.RQ BETWEEN '"+map.get("startDate").toString() +"'" +
  284 + " and '"+map.get("endDate").toString()+"'"+
  285 + " and y.XLBM='"+map.get("line").toString()+"'"+
  286 + " GROUP BY y.NBBM ";
  287 +
  288 + List<Operationservice> list = jdbcTemplate.query(sql, new RowMapper<Operationservice>() {
  289 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
  290 + @Override
  291 + public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException {
  292 + Singledata sin = new Singledata();
  293 + Operationservice op = new Operationservice();
  294 + op.setXlName(arg0.getString("XLBM").toString());
  295 + op.setJzl(arg0.getString("JZL").toString());
  296 + op.setXhl(arg0.getString("YH").toString());
  297 + Map<String, Object> maps=new HashMap<>();
  298 + maps=scheduleRealInfoService.findKMBC2(sin.getJsy(),sin.getClzbh(),sin.getrQ());
  299 + op.setXsgl(maps.get("yygl").toString()==null?"":maps.get("yygl").toString());
  300 + op.setEmptMileage(maps.get("ksgl").toString()==null?"":maps.get("ksgl").toString());
  301 + op.setSjbc(maps.get("sjbc").toString()==null?"":maps.get("sjbc").toString());
  302 + return op;
  303 + }
  304 + });
  305 + return list;
  306 + }
  307 +
  308 +
  309 + //车辆加注
  310 + @Override
  311 + public List<Vehicleloading> vehicleloading(String line,String data) {
  312 +
  313 + String sql = " SELECT y.RQ,y.SSGSDM,y.XLBM,y.NBBM,y.JSY,y.YH,y.JZL " +
  314 + " FROM bsth_c_ylb y " +
  315 + " where to_days(y.RQ)=to_days('"+data +"')" +
  316 + " and y.XLBM='"+line+"' "+
  317 + " GROUP BY y.NBBM ";
  318 +
  319 + List<Vehicleloading> list = jdbcTemplate.query(sql, new RowMapper<Vehicleloading>() {
  320 + @Override
  321 + public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException {
  322 + Vehicleloading ve = new Vehicleloading();
  323 + ve.setrQ(arg0.getString("RQ").toString());
  324 + ve.setgS(arg0.getString("SSGSDM").toString());
  325 + ve.setxL(arg0.getString("XLBM").toString());
  326 + ve.setClzbh(arg0.getString("NBBM").toString());
  327 + ve.setHyl(arg0.getString("YH").toString());
  328 + ve.setJzl(arg0.getString("JZL").toString());
  329 + //ve.setLs(arg0.getString("").toString());//尿素
  330 + Map<String, Object> maps=new HashMap<>();
  331 + maps=scheduleRealInfoService.findKMBC2(arg0.getString("JSY"), arg0.getString("NBBM"), arg0.getString("RQ"));
  332 + ve.setJhlc(maps.get("yygl")==null?"":maps.get("yygl").toString());
  333 + ve.setJhbc(maps.get("jhbc").toString()==null?"":maps.get("jhbc").toString());//计划班次
  334 + ve.setSjbc(maps.get("sjbc").toString()==null?"":maps.get("sjbc").toString());//实际班次
  335 + return ve;
  336 + }
  337 + });
  338 + return list;
  339 + }
  340 +
  341 +
  342 +}
... ...
src/main/java/com/bsth/service/realcontrol/RealChartsService.java
... ... @@ -2,6 +2,7 @@ package com.bsth.service.realcontrol;
2 2  
3 3 import com.bsth.service.realcontrol.dto.CarOutRate;
4 4 import com.bsth.service.realcontrol.dto.DeviceOnlineRate;
  5 +import com.bsth.service.realcontrol.dto.ScheduleExecRate;
5 6 import com.bsth.service.realcontrol.dto.StratEndPunctualityRate;
6 7  
7 8 import java.util.List;
... ... @@ -15,7 +16,9 @@ public interface RealChartsService {
15 16  
16 17 List<CarOutRate> carOutRate(String month, String idx);
17 18  
18   - List<StratEndPunctualityRate> stratEndPunctualityRate(String month, String idx);
  19 + /*List<StratEndPunctualityRate> stratEndPunctualityRate(String month, String idx);*/
19 20  
20 21 List<StratEndPunctualityRate> sePunctualityRateLine(String month, String idx);
  22 +
  23 + List<ScheduleExecRate> scheduleExecRates(String date, String idx);
21 24 }
... ...
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
... ... @@ -86,8 +86,12 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
86 86  
87 87 List<Map<String,String>> findLine(String line);
88 88  
  89 + Map<String,Object> findKMBC1(String jName,String clZbh, String date,String enddate);
  90 +
89 91 Map<String,Object> findKMBC(String jName,String clZbh,String lpName,String date);
90 92  
  93 + Map<String,Object> findKMBC2(String jName,String clZbh,String date);
  94 +
91 95 List<Map<String,String>> findLpName(String lpName);
92 96  
93 97 List<Map<String,Object>> account(String line,String date,String code,String xlName);
... ...
src/main/java/com/bsth/service/realcontrol/dto/ScheduleExecRate.java 0 → 100644
  1 +package com.bsth.service.realcontrol.dto;
  2 +
  3 +/**
  4 + * 班次执行率DTO
  5 + * Created by panzhao on 2016/11/14.
  6 + */
  7 +public class ScheduleExecRate {
  8 +
  9 + private long id;
  10 + private String dfsj;
  11 + private String fcsjActual;
  12 + private String zdsj;
  13 + private String zdsjActual;
  14 + private int status;
  15 + private String lineCode;
  16 +
  17 + public long getId() {
  18 + return id;
  19 + }
  20 +
  21 + public void setId(long id) {
  22 + this.id = id;
  23 + }
  24 +
  25 + public String getDfsj() {
  26 + return dfsj;
  27 + }
  28 +
  29 + public void setDfsj(String dfsj) {
  30 + this.dfsj = dfsj;
  31 + }
  32 +
  33 + public String getFcsjActual() {
  34 + return fcsjActual;
  35 + }
  36 +
  37 + public void setFcsjActual(String fcsjActual) {
  38 + this.fcsjActual = fcsjActual;
  39 + }
  40 +
  41 + public String getZdsj() {
  42 + return zdsj;
  43 + }
  44 +
  45 + public void setZdsj(String zdsj) {
  46 + this.zdsj = zdsj;
  47 + }
  48 +
  49 + public String getZdsjActual() {
  50 + return zdsjActual;
  51 + }
  52 +
  53 + public void setZdsjActual(String zdsjActual) {
  54 + this.zdsjActual = zdsjActual;
  55 + }
  56 +
  57 + public int getStatus() {
  58 + return status;
  59 + }
  60 +
  61 + public void setStatus(int status) {
  62 + this.status = status;
  63 + }
  64 +
  65 + public String getLineCode() {
  66 + return lineCode;
  67 + }
  68 +
  69 + public void setLineCode(String lineCode) {
  70 + this.lineCode = lineCode;
  71 + }
  72 +}
... ...
src/main/java/com/bsth/service/realcontrol/dto/StratEndPunctualityRate.java
... ... @@ -10,17 +10,17 @@ public class StratEndPunctualityRate {
10 10  
11 11 private String lineCode;
12 12  
13   - private String nbbm;
14   -
15 13 //首班时间 06:00/06:01
16 14 private String startTime;
17 15  
18 16 //末班时间 20:30/20:31
19 17 private String endTime;
20 18  
21   - //末班真实执行日期
22   - private String etRealExecDate;
  19 + //上下行
  20 + private int updown;
23 21  
  22 + //真实执行日期
  23 + private String etRealExecDate;
24 24  
25 25 public String getDateStr() {
26 26 return dateStr;
... ... @@ -38,14 +38,6 @@ public class StratEndPunctualityRate {
38 38 this.lineCode = lineCode;
39 39 }
40 40  
41   - public String getNbbm() {
42   - return nbbm;
43   - }
44   -
45   - public void setNbbm(String nbbm) {
46   - this.nbbm = nbbm;
47   - }
48   -
49 41 public String getStartTime() {
50 42 return startTime;
51 43 }
... ... @@ -62,6 +54,14 @@ public class StratEndPunctualityRate {
62 54 this.endTime = endTime;
63 55 }
64 56  
  57 + public int getUpdown() {
  58 + return updown;
  59 + }
  60 +
  61 + public void setUpdown(int updown) {
  62 + this.updown = updown;
  63 + }
  64 +
65 65 public String getEtRealExecDate() {
66 66 return etRealExecDate;
67 67 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/RealChartsServiceImpl.java
... ... @@ -4,10 +4,7 @@ import com.bsth.data.BasicData;
4 4 import com.bsth.data.LineConfigData;
5 5 import com.bsth.entity.realcontrol.LineConfig;
6 6 import com.bsth.service.realcontrol.RealChartsService;
7   -import com.bsth.service.realcontrol.dto.CarOutRate;
8   -import com.bsth.service.realcontrol.dto.DeviceOnlineRate;
9   -import com.bsth.service.realcontrol.dto.RealOnline;
10   -import com.bsth.service.realcontrol.dto.StratEndPunctualityRate;
  7 +import com.bsth.service.realcontrol.dto.*;
11 8 import com.bsth.util.db.DBUtils_MS;
12 9 import com.google.common.base.Splitter;
13 10 import org.apache.commons.lang3.StringUtils;
... ... @@ -37,7 +34,8 @@ public class RealChartsServiceImpl implements RealChartsService {
37 34 LineConfigData lineConfigData;
38 35  
39 36  
40   - private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd");
  37 + private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd")
  38 + ,fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm");
41 39  
42 40 private final static long DAY_TIME = 1000 * 60 * 60 * 24L;
43 41 /**
... ... @@ -164,7 +162,7 @@ public class RealChartsServiceImpl implements RealChartsService {
164 162 * @param idx
165 163 * @return
166 164 */
167   - @Override
  165 +/* @Override
168 166 public List<StratEndPunctualityRate> stratEndPunctualityRate(String month, String idx) {
169 167 List<String> idArray = Splitter.on(",").splitToList(idx);
170 168 //拼接in语句
... ... @@ -208,7 +206,7 @@ public class RealChartsServiceImpl implements RealChartsService {
208 206 }
209 207 });
210 208 return list;
211   - }
  209 + }*/
212 210  
213 211 @Override
214 212 public List<StratEndPunctualityRate> sePunctualityRateLine(String month, String idx) {
... ... @@ -220,10 +218,7 @@ public class RealChartsServiceImpl implements RealChartsService {
220 218 }
221 219 inStr = " (" + inStr.substring(1) + ")";
222 220  
223   - String sql = "select SCHEDULE_DATE_STR,XL_BM, min(sj) as STARTDATE, max(sj) as ENDDATE " +
224   - "from (select SCHEDULE_DATE_STR,dfsj, concat_ws('/',dfsj, fcsj_actual) as sj,XL_BM from bsth_c_s_sp_info_real " +
225   - "where schedule_date_str like :month and bc_type='normal' and dfsj is not null and xl_bm in "+inStr+") t group by SCHEDULE_DATE_STR,XL_BM";
226   -
  221 + String sql = "select min(DFSJ) as STARTDATE,max(DFSJ) as ENDDATE,SCHEDULE_DATE_STR,XL_BM,XL_DIR,REAL_EXEC_DATE from (SELECT SCHEDULE_DATE_STR,concat_ws('_',concat_ws('/', dfsj, fcsj_actual),fcno) AS DFSJ,XL_BM,XL_DIR,REAL_EXEC_DATE FROM bsth_c_s_sp_info_real WHERE schedule_date_str LIKE :month AND bc_type = 'normal' AND dfsj IS NOT NULL AND xl_bm IN "+inStr+") t group by SCHEDULE_DATE_STR,XL_BM,XL_DIR,REAL_EXEC_DATE";
227 222 MapSqlParameterSource parameters = new MapSqlParameterSource();
228 223 parameters.addValue("month", month+"-%");
229 224  
... ... @@ -235,10 +230,11 @@ public class RealChartsServiceImpl implements RealChartsService {
235 230 obj.setDateStr(rs.getString("SCHEDULE_DATE_STR"));
236 231 obj.setStartTime(rs.getString("STARTDATE"));
237 232 obj.setEndTime(rs.getString("ENDDATE"));
238   - obj.setEtRealExecDate(obj.getDateStr());
  233 + obj.setUpdown(rs.getInt("XL_DIR"));
  234 + obj.setEtRealExecDate(rs.getString("REAL_EXEC_DATE"));
239 235  
240   - if(obj.getEndTime().length() == 11){
241   - //末班真实执行日期
  236 + if(obj.getEndTime().length() >= 11){
  237 + //末班真实执行日期,末班可能跨过12点。
242 238 LineConfig conf =lineConfigData.get(obj.getLineCode());
243 239 String fcsjActual=obj.getEndTime().split("/")[1];
244 240  
... ... @@ -247,7 +243,40 @@ public class RealChartsServiceImpl implements RealChartsService {
247 243 obj.setEtRealExecDate(fmtyyyyMMdd.print(fmtyyyyMMdd.parseMillis(obj.getEtRealExecDate()) + DAY_TIME));
248 244 }
249 245 }
  246 + return obj;
  247 + }
  248 + });
  249 + return list;
  250 + }
  251 +
  252 + @Override
  253 + public List<ScheduleExecRate> scheduleExecRates(String date, String idx) {
  254 + List<String> idArray = Splitter.on(",").splitToList(idx);
  255 + //拼接in语句
  256 + String inStr = "";
  257 + for (String code : idArray) {
  258 + inStr += (",'" + code+"'");
  259 + }
  260 + inStr = " (" + inStr.substring(1) + ")";
250 261  
  262 + String sql = "SELECT ID,DFSJ,FCSJ_ACTUAL,ZDSJ,ZDSJ_ACTUAL,`STATUS`,XL_BM FROM bsth_c_s_sp_info_real WHERE schedule_date_str=:date AND concat_ws('', real_exec_date, dfsj)<:cdate and xl_bm in "+inStr+" ORDER BY dfsj";
  263 +
  264 + MapSqlParameterSource parameters = new MapSqlParameterSource();
  265 + parameters.addValue("date", date);
  266 + parameters.addValue("cdate", fmtyyyyMMddHHmm.print(new Date().getTime()));
  267 +
  268 +
  269 + List<ScheduleExecRate> list = jdbcTemplate.query(sql, parameters, new RowMapper<ScheduleExecRate>() {
  270 + @Override
  271 + public ScheduleExecRate mapRow(ResultSet rs, int rowNum) throws SQLException {
  272 + ScheduleExecRate obj = new ScheduleExecRate();
  273 + obj.setId(rs.getLong("ID"));
  274 + obj.setDfsj(rs.getString("DFSJ"));
  275 + obj.setFcsjActual(rs.getString("FCSJ_ACTUAL"));
  276 + obj.setZdsj(rs.getString("ZDSJ"));
  277 + obj.setZdsjActual(rs.getString("ZDSJ_ACTUAL"));
  278 + obj.setStatus(rs.getInt("STATUS"));
  279 + obj.setLineCode(rs.getString("XL_BM"));
251 280 return obj;
252 281 }
253 282 });
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -1046,6 +1046,74 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1046 1046 }
1047 1047  
1048 1048 @Override
  1049 + public Map<String, Object> findKMBC2(String jName, String clZbh,String date) {
  1050 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill3(jName, clZbh , date);
  1051 +
  1052 + DecimalFormat format = new DecimalFormat("0.00");
  1053 +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
  1054 +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
  1055 + int jhbc = 0,cjbc = 0,ljbc = 0;
  1056 + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0;
  1057 + float addMileage = 0l,remMileage = 0l;
  1058 + String j_Name="";
  1059 + Map<String,Object> map = new HashMap<String, Object>();
  1060 + for(ScheduleRealInfo scheduleRealInfo : list){
  1061 + if(scheduleRealInfo != null){
  1062 + j_Name=scheduleRealInfo.getjName();
  1063 + //计划里程(主任务过滤掉临加班次),
  1064 + //烂班里程(主任务烂班),
  1065 + //临加里程(主任务临加),
  1066 + //计划班次,烂班班次,增加班次
  1067 + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  1068 + if(scheduleRealInfo.isSflj()){
  1069 + addMileage += tempJhlc;
  1070 + ljbc++;
  1071 + }else{
  1072 + jhlc += tempJhlc;
  1073 + jhbc++;
  1074 + if(scheduleRealInfo.getStatus() == -1){
  1075 + remMileage += tempJhlc;
  1076 + cjbc++;
  1077 + }
  1078 + }
  1079 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  1080 + //计算营运里程,空驶里程
  1081 + if(childTaskPlans.isEmpty()){
  1082 + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  1083 + || scheduleRealInfo.getBcType().equals("venting")){
  1084 + ksgl += tempJhlc;
  1085 + }else{
  1086 + yygl += tempJhlc;
  1087 + }
  1088 + }else{
  1089 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  1090 + while(it.hasNext()){
  1091 + ChildTaskPlan childTaskPlan = it.next();
  1092 + if(childTaskPlan.getMileageType().equals("empty")){
  1093 + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1094 + }else{
  1095 + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1096 + }
  1097 + }
  1098 + }
  1099 + }
  1100 + }
  1101 + map.put("j_name", j_Name);
  1102 + map.put("jhlc", format.format(jhlc));
  1103 + map.put("remMileage", format.format(remMileage));
  1104 + map.put("addMileage", format.format(addMileage));
  1105 + map.put("yygl", format.format(yygl));
  1106 + map.put("ksgl", format.format(ksgl));
  1107 + map.put("realMileage", format.format(yygl+ksgl));
  1108 + map.put("jhbc", jhbc);
  1109 + map.put("cjbc", cjbc);
  1110 + map.put("ljbc", ljbc);
  1111 + map.put("sjbc", jhbc-cjbc+ljbc);
  1112 + return map;
  1113 + }
  1114 +
  1115 +
  1116 + @Override
1049 1117 public Map<String, Object> findKMBC(String jName, String clZbh,
1050 1118 String lpName,String date) {
1051 1119 List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date);
... ... @@ -1592,6 +1660,71 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1592 1660 rs.put("ts", list);
1593 1661 return rs;
1594 1662 }
  1663 +
  1664 +
  1665 + @Override
  1666 + public Map<String, Object> findKMBC1(String jName, String clZbh,
  1667 + String date, String enddate) {
  1668 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill2(jName, clZbh, date, enddate);
  1669 + DecimalFormat format = new DecimalFormat("0.00");
  1670 +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
  1671 +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
  1672 + int jhbc = 0,cjbc = 0,ljbc = 0;
  1673 + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0;
  1674 + float addMileage = 0l,remMileage = 0l;
  1675 + Map<String,Object> map = new HashMap<String, Object>();
  1676 + for(ScheduleRealInfo scheduleRealInfo : list){
  1677 + if(scheduleRealInfo != null){
  1678 + //计划里程(主任务过滤掉临加班次),
  1679 + //烂班里程(主任务烂班),
  1680 + //临加里程(主任务临加),
  1681 + //计划班次,烂班班次,增加班次
  1682 + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  1683 + if(scheduleRealInfo.isSflj()){
  1684 + addMileage += tempJhlc;
  1685 + ljbc++;
  1686 + }else{
  1687 + jhlc += tempJhlc;
  1688 + jhbc++;
  1689 + if(scheduleRealInfo.getStatus() == -1){
  1690 + remMileage += tempJhlc;
  1691 + cjbc++;
  1692 + }
  1693 + }
  1694 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  1695 + //计算营运里程,空驶里程
  1696 + if(childTaskPlans.isEmpty()){
  1697 + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  1698 + || scheduleRealInfo.getBcType().equals("venting")){
  1699 + ksgl += tempJhlc;
  1700 + }else{
  1701 + yygl += tempJhlc;
  1702 + }
  1703 + }else{
  1704 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  1705 + while(it.hasNext()){
  1706 + ChildTaskPlan childTaskPlan = it.next();
  1707 + if(childTaskPlan.getMileageType().equals("empty")){
  1708 + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1709 + }else{
  1710 + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1711 + }
  1712 + }
  1713 + }
  1714 + }
  1715 + }
  1716 + map.put("jhlc", format.format(jhlc));
  1717 + map.put("remMileage", format.format(remMileage));
  1718 + map.put("addMileage", format.format(addMileage));
  1719 + map.put("yygl", format.format(yygl));
  1720 + map.put("ksgl", format.format(ksgl));
  1721 + map.put("realMileage", format.format(yygl+ksgl));
  1722 + map.put("jhbc", jhbc);
  1723 + map.put("cjbc", cjbc);
  1724 + map.put("ljbc", ljbc);
  1725 + map.put("sjbc", jhbc-cjbc+ljbc);
  1726 + return map;
  1727 + }
1595 1728  
1596 1729 /**
1597 1730 * 调整班次类型
... ...
src/main/java/com/bsth/service/schedule/TTInfoDetailService.java
... ... @@ -136,7 +136,7 @@ public interface TTInfoDetailService extends BaseService&lt;TTInfoDetail, Long&gt; {
136 136 String ttinfoname,
137 137 String tccname) throws Exception;
138 138  
139   - void fileDataImport(File file, String xlmc, String ttinfoname, String tccname) throws Exception;
  139 + void fileDataImport(File file, String sheetname, String xlmc, String ttinfoname, String tccname) throws Exception;
140 140  
141 141  
142 142 }
... ...
src/main/java/com/bsth/service/schedule/TTInfoDetailServiceImpl.java
... ... @@ -114,6 +114,7 @@ public class TTInfoDetailServiceImpl extends BaseServiceImpl&lt;TTInfoDetail, Long&gt;
114 114 return editInfo;
115 115 }
116 116  
  117 + @Override
117 118 /**
118 119 * 上传并导入数据,和DataImportExportService的同名方法有差别。
119 120 * @param datafile form上传文件
... ... @@ -128,12 +129,12 @@ public class TTInfoDetailServiceImpl extends BaseServiceImpl&lt;TTInfoDetail, Long&gt;
128 129 String tccname) throws Exception {
129 130 // 上传数据文件
130 131 File uploadFile = dataImportExportService.uploadFile(datafile);
131   - fileDataImport(uploadFile, xlmc, ttinfoname, tccname);
  132 + fileDataImport(uploadFile, "工作表1", xlmc, ttinfoname, tccname);
132 133  
133 134 }
134 135  
135 136 @Override
136   - public void fileDataImport(File uploadFile, String xlmc, String ttinfoname, String tccname) throws Exception {
  137 + public void fileDataImport(File uploadFile, String sheetname, String xlmc, String ttinfoname, String tccname) throws Exception {
137 138 // 1、上传数据文件
138 139 System.out.println("线路名称:" + xlmc);
139 140 System.out.println("时刻表名称:" + ttinfoname);
... ... @@ -162,6 +163,7 @@ public class TTInfoDetailServiceImpl extends BaseServiceImpl&lt;TTInfoDetail, Long&gt;
162 163 // 2.3、设定命名参数,用于指定数据文件,注意每个ktr必须都有以下指定的命名参数
163 164 trans.setParameterValue("injectktrfile", ktrFile2.getAbsolutePath()); // 注入元数据的ktr文件
164 165 trans.setParameterValue("filepath", uploadFile.getAbsolutePath()); // 指定导入数据文件的位置
  166 + trans.setParameterValue("sheetname", sheetname); // sheet工作区的名字
165 167 trans.setParameterValue("erroroutputdir", dataToolsProperties.getTransErrordir()); // ktr转换错误输出目录
166 168 trans.setParameterValue("xlname", xlmc); // 线路名称
167 169 trans.setParameterValue("ttinfoname", ttinfoname); // 时刻表名称
... ...