Commit 7c7f4b13365a3a5730b919c3c2ccd964625346ae

Authored by 王通
2 parents 227d3a18 25f3363e

Merge remote-tracking branch 'origin/qingpu_20180808' into qingpu_20180808

Showing 35 changed files with 2211 additions and 93 deletions
src/main/java/com/bsth/controller/calc/CalcExportController.java 0 → 100644
  1 +package com.bsth.controller.calc;
  2 +
  3 +import java.text.SimpleDateFormat;
  4 +import java.util.ArrayList;
  5 +import java.util.HashMap;
  6 +import java.util.Iterator;
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.web.bind.annotation.RequestMapping;
  12 +import org.springframework.web.bind.annotation.RequestMethod;
  13 +import org.springframework.web.bind.annotation.RequestParam;
  14 +import org.springframework.web.bind.annotation.RestController;
  15 +
  16 +import com.bsth.common.ResponseCode;
  17 +import com.bsth.entity.calc.CalcWaybill;
  18 +import com.bsth.entity.mcy_forms.Waybillday;
  19 +import com.bsth.service.calc.CalcMixService;
  20 +import com.bsth.service.calc.CalcWaybillService;
  21 +import com.bsth.util.ReportUtils;
  22 +
  23 +@RestController
  24 +@RequestMapping("calc_export")
  25 +public class CalcExportController {
  26 +
  27 + @Autowired
  28 + CalcWaybillService service;
  29 +
  30 + @Autowired
  31 + CalcMixService clacMixService;
  32 +
  33 + @RequestMapping(value = "/waybilldayExport", method = RequestMethod.GET)
  34 + public Map<String, Object> calcjsyspyExport(@RequestParam Map<String, Object> map) {
  35 +
  36 + String line="";
  37 + if(map.get("line")!=null){
  38 + line=map.get("line").toString().trim();
  39 + }
  40 + String lineName="";
  41 + if(map.get("lineName")!=null){
  42 + lineName=map.get("lineName").toString().trim();
  43 + }
  44 + String startDate="";
  45 + if(map.get("startDate")!=null){
  46 + startDate=map.get("startDate").toString().trim();
  47 + }
  48 + String endDate="";
  49 + if(map.get("endDate")!=null){
  50 + endDate=map.get("endDate").toString().trim();
  51 + }
  52 + String cont="";
  53 + if(map.get("cont")!=null){
  54 + cont=map.get("cont").toString().trim();
  55 + }
  56 + String empnames="";
  57 + if(map.get("empnames")!=null){
  58 + empnames=map.get("empnames").toString().trim();
  59 + }
  60 + String gsdmManth="";
  61 + if(map.get("gsdmManth")!=null){
  62 + gsdmManth=map.get("gsdmManth").toString().trim();
  63 + }
  64 + String fgsdmManth="";
  65 + if(map.get("fgsdmManth")!=null){
  66 + fgsdmManth=map.get("fgsdmManth").toString().trim();
  67 + }
  68 +
  69 + Map<String, Object> resMap = new HashMap<String, Object>();
  70 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  71 + List<Map<String, Object>> list = clacMixService.calcjsyspy(line, startDate, endDate, empnames, cont, gsdmManth, fgsdmManth);
  72 +
  73 + Map<String, Object> temp = new HashMap<String, Object>();
  74 + temp.put("i", "序号");
  75 + temp.put("jName", empnames);
  76 + temp.put("jhyybc", "计划营运班次");
  77 + temp.put("jhfyybc", "计划空驶班次");
  78 + temp.put("sjyybc", "实际营运班次");
  79 + temp.put("sjfyybc", "实际空驶班次");
  80 + temp.put("lbbc", "烂班班次");
  81 + temp.put("ljbc", "临加班次");
  82 + temp.put("jhzlc", "计划总里程");
  83 + temp.put("jhyylc", "计划营运里程");
  84 + temp.put("jhfyylc", "计划空驶里程");
  85 + temp.put("sjzlc", "实际总里程");
  86 + temp.put("sjyylc", "实际营运里程");
  87 + temp.put("sjfyylc", "实际空驶里程");
  88 + temp.put("lblc", "烂班里程");
  89 + temp.put("ljyylc", "临加营运里程");
  90 + temp.put("ljfyylc", "临加空驶里程");
  91 + resList.add(temp);
  92 + for(int i = 0; i < list.size(); i++){
  93 + temp = list.get(i);
  94 + temp.put("i", i+1);
  95 + resList.add(temp);
  96 + }
  97 +
  98 + String date = startDate.replaceAll("-", "");
  99 + if(!startDate.equals(endDate)){
  100 + date = startDate.replaceAll("-", "") + "-" + endDate.replaceAll("-", "");
  101 + }
  102 +
  103 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  104 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  105 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  106 + Map<String,Object> mm = new HashMap<String, Object>();
  107 + ReportUtils ee = new ReportUtils();
  108 +
  109 + try {
  110 + listI.add(resList.iterator());
  111 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  112 + ee.excelReplace(listI, new Object[] { mm }, path+"mould/calcjsyspy.xls",
  113 + path+"export/"+date+"-"+lineName+"-人车班次公里统计.xls");
  114 + resMap.put("status", ResponseCode.SUCCESS);
  115 + } catch (Exception e) {
  116 + e.printStackTrace();
  117 + resMap.put("status", ResponseCode.ERROR);
  118 + }
  119 + return resMap;
  120 + }
  121 +
  122 + @RequestMapping(value = "/singledataExportTj", method = RequestMethod.GET)
  123 + public Map<String, Object> singledataExportTj(@RequestParam Map<String, Object> map) {
  124 +
  125 + String line="";
  126 + if(map.get("line")!=null){
  127 + line=map.get("line").toString().trim();
  128 + }
  129 + String lineName="";
  130 + if(map.get("lineName")!=null){
  131 + lineName=map.get("lineName").toString().trim();
  132 + }
  133 + String startDate="";
  134 + if(map.get("startDate")!=null){
  135 + startDate=map.get("startDate").toString().trim();
  136 + }
  137 + String endDate="";
  138 + if(map.get("endDate")!=null){
  139 + endDate=map.get("endDate").toString().trim();
  140 + }
  141 + String tjtype="";
  142 + if(map.get("tjtype")!=null){
  143 + tjtype=map.get("tjtype").toString().trim();
  144 + }
  145 + String cont="";
  146 + if(map.get("cont")!=null){
  147 + cont=map.get("cont").toString().trim();
  148 + }
  149 + String gsdmSing="";
  150 + if(map.get("gsdmSing")!=null){
  151 + gsdmSing=map.get("gsdmSing").toString().trim();
  152 + }
  153 + String fgsdmSing="";
  154 + if(map.get("fgsdmSing")!=null){
  155 + fgsdmSing=map.get("fgsdmSing").toString().trim();
  156 + }
  157 +
  158 + Map<String, Object> resMap = new HashMap<String, Object>();
  159 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  160 + List<Map<String, Object>> list = clacMixService.singledatatj(line, startDate, endDate, tjtype, cont, gsdmSing, fgsdmSing);
  161 +
  162 + Map<String, Object> temp = new HashMap<String, Object>();
  163 + temp.put("i", "序号");
  164 + temp.put("gS", "所属公司");
  165 + temp.put("xlName", "线路");
  166 + temp.put("jName", tjtype);
  167 + temp.put("jhzlc", "计划公里");
  168 + temp.put("sjzlc", "行驶里程(包括空放)");
  169 + temp.put("sjfyylc", "空驶里程");
  170 + temp.put("hyl", "耗油量");
  171 + temp.put("jzl", "加注量");
  172 + temp.put("sh", "非营业用油");
  173 +
  174 + resList.add(temp);
  175 + for(int i = 0; i < list.size(); i++){
  176 + temp = list.get(i);
  177 + temp.put("i", i+1);
  178 + if(temp.get("xlName") == null){
  179 + temp.put("xlName", "");
  180 + }
  181 + resList.add(temp);
  182 + }
  183 +
  184 + String date = startDate.replaceAll("-", "");
  185 + if(!startDate.equals(endDate)){
  186 + date = startDate.replaceAll("-", "") + "-" + endDate.replaceAll("-", "");
  187 + }
  188 +
  189 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  190 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  191 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  192 + Map<String,Object> mm = new HashMap<String, Object>();
  193 + ReportUtils ee = new ReportUtils();
  194 +
  195 + try {
  196 + listI.add(resList.iterator());
  197 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  198 + ee.excelReplace(listI, new Object[] { mm }, path+"mould/calcsingledata.xls",
  199 + path+"export/"+date+"-"+lineName+"-路单数据(统计).xls");
  200 + resMap.put("status", ResponseCode.SUCCESS);
  201 + } catch (Exception e) {
  202 + e.printStackTrace();
  203 + resMap.put("status", ResponseCode.ERROR);
  204 + }
  205 + return resMap;
  206 + }
  207 +
  208 +}
src/main/java/com/bsth/controller/calc/CalcMixController.java 0 → 100644
  1 +package com.bsth.controller.calc;
  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.service.calc.CalcMixService;
  13 +
  14 +@RestController
  15 +@RequestMapping("calc_mix")
  16 +public class CalcMixController {
  17 +
  18 + @Autowired
  19 + CalcMixService service;
  20 +
  21 + @RequestMapping(value="/calcjsyspy")
  22 + public List<Map<String, Object>> calcjsyspy(@RequestParam Map<String, Object> map){
  23 + String line="";
  24 + if(map.get("line")!=null){
  25 + line=map.get("line").toString().trim();
  26 + }
  27 + String startDate="";
  28 + if(map.get("startDate")!=null){
  29 + startDate=map.get("startDate").toString().trim();
  30 + }
  31 + String endDate="";
  32 + if(map.get("endDate")!=null){
  33 + endDate=map.get("endDate").toString().trim();
  34 + }
  35 + String empnames="";
  36 + if(map.get("empnames")!=null){
  37 + empnames=map.get("empnames").toString().trim();
  38 + }
  39 + String cont="";
  40 + if(map.get("cont")!=null){
  41 + cont=map.get("cont").toString().trim();
  42 + }
  43 + String gsdmManth="";
  44 + if(map.get("gsdmManth")!=null){
  45 + gsdmManth=map.get("gsdmManth").toString().trim();
  46 + }
  47 + String fgsdmManth="";
  48 + if(map.get("fgsdmManth")!=null){
  49 + fgsdmManth=map.get("fgsdmManth").toString().trim();
  50 + }
  51 + return service.calcjsyspy(line, startDate, endDate, empnames, cont, gsdmManth, fgsdmManth);
  52 + }
  53 +
  54 + @RequestMapping(value = "/singledatatj", method = RequestMethod.GET)
  55 + public List<Map<String, Object>> singledatatj(@RequestParam Map<String, Object> map) {
  56 + String line="";
  57 + if(map.get("line")!=null){
  58 + line=map.get("line").toString().trim();
  59 + }
  60 + String startDate="";
  61 + if(map.get("startDate")!=null){
  62 + startDate=map.get("startDate").toString().trim();
  63 + }
  64 + String endDate="";
  65 + if(map.get("endDate")!=null){
  66 + endDate=map.get("endDate").toString().trim();
  67 + }
  68 + String tjtype="";
  69 + if(map.get("tjtype")!=null){
  70 + tjtype=map.get("tjtype").toString().trim();
  71 + }
  72 + String cont="";
  73 + if(map.get("cont")!=null){
  74 + cont=map.get("cont").toString().trim();
  75 + }
  76 + String gsdmSing="";
  77 + if(map.get("gsdmSing")!=null){
  78 + gsdmSing=map.get("gsdmSing").toString().trim();
  79 + }
  80 + String fgsdmSing="";
  81 + if(map.get("fgsdmSing")!=null){
  82 + fgsdmSing=map.get("fgsdmSing").toString().trim();
  83 + }
  84 + return service.singledatatj(line, startDate, endDate, tjtype, cont, gsdmSing, fgsdmSing);
  85 + }
  86 +
  87 +}
src/main/java/com/bsth/controller/oil/DlbController.java
@@ -152,7 +152,11 @@ public class DlbController extends BaseController&lt;Dlb, Integer&gt;{ @@ -152,7 +152,11 @@ public class DlbController extends BaseController&lt;Dlb, Integer&gt;{
152 m.put("rq", y.getRq()); 152 m.put("rq", y.getRq());
153 m.put("gsname",y.getGsname() ); 153 m.put("gsname",y.getGsname() );
154 m.put("fgsname", y.getFgsname()); 154 m.put("fgsname", y.getFgsname());
155 - m.put("xlname", y.getXlname()); 155 + if(y.getLinename()==null){
  156 + m.put("xlname", y.getXlname()==null?"":y.getXlname());
  157 + }else{
  158 + m.put("xlname", y.getLinename());
  159 + }
156 m.put("nbbm", y.getNbbm()); 160 m.put("nbbm", y.getNbbm());
157 m.put("jsy", y.getJsy()); 161 m.put("jsy", y.getJsy());
158 m.put("name", y.getName()); 162 m.put("name", y.getName());
src/main/java/com/bsth/controller/oil/YlbController.java
@@ -255,7 +255,11 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -255,7 +255,11 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
255 m.put("rq", sdfMonth.format(y.getRq())); 255 m.put("rq", sdfMonth.format(y.getRq()));
256 m.put("gsname",y.getGsname() ); 256 m.put("gsname",y.getGsname() );
257 m.put("fgsname", y.getFgsname()); 257 m.put("fgsname", y.getFgsname());
258 - m.put("xlname", y.getXlname()==null?"":y.getXlname()); 258 + if(y.getLinename()==null){
  259 + m.put("xlname", y.getXlname()==null?"":y.getXlname());
  260 + }else{
  261 + m.put("xlname", y.getLinename());
  262 + }
259 m.put("nbbm", y.getNbbm()); 263 m.put("nbbm", y.getNbbm());
260 m.put("jsy", y.getJsy()); 264 m.put("jsy", y.getJsy());
261 m.put("name", y.getName()); 265 m.put("name", y.getName());
src/main/java/com/bsth/controller/report/ReportController.java
@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject; @@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
19 import com.bsth.data.BasicData; 19 import com.bsth.data.BasicData;
20 import com.bsth.entity.StationRoute; 20 import com.bsth.entity.StationRoute;
21 import com.bsth.entity.excep.ArrivalInfo; 21 import com.bsth.entity.excep.ArrivalInfo;
  22 +import com.bsth.entity.mcy_forms.Singledata;
22 import com.bsth.entity.realcontrol.ScheduleRealInfo; 23 import com.bsth.entity.realcontrol.ScheduleRealInfo;
23 import com.bsth.service.report.ReportService; 24 import com.bsth.service.report.ReportService;
24 import com.bsth.util.ReportUtils; 25 import com.bsth.util.ReportUtils;
@@ -357,10 +358,17 @@ public class ReportController { @@ -357,10 +358,17 @@ public class ReportController {
357 358
358 return lMap; 359 return lMap;
359 } 360 }
360 -  
361 -  
362 @RequestMapping(value="/online") 361 @RequestMapping(value="/online")
363 public Map<String, Object> online(@RequestParam Map<String, Object> map){ 362 public Map<String, Object> online(@RequestParam Map<String, Object> map){
364 return service.online(map); 363 return service.online(map);
365 } 364 }
  365 +
  366 +
  367 +
  368 + @RequestMapping(value = "/singledatatj", method = RequestMethod.GET)
  369 + public List<Singledata> singledatatj(@RequestParam Map<String, Object> map) {
  370 +
  371 + return service.singledatatj(map);
  372 + }
  373 +
366 } 374 }
src/main/java/com/bsth/data/BasicData.java
@@ -55,6 +55,7 @@ public class BasicData { @@ -55,6 +55,7 @@ public class BasicData {
55 //线路编码和名称对照 55 //线路编码和名称对照
56 public static Map<String, String> lineCode2NameMap; 56 public static Map<String, String> lineCode2NameMap;
57 57
  58 + public static Map<String, String> lineCodeAllNameMap;
58 //停车场 59 //停车场
59 public static List<String> parkCodeList; 60 public static List<String> parkCodeList;
60 61
@@ -315,6 +316,14 @@ public class BasicData { @@ -315,6 +316,14 @@ public class BasicData {
315 lineId2ShangHaiCodeMap = id2SHcode; 316 lineId2ShangHaiCodeMap = id2SHcode;
316 lineCode2ShangHaiCodeMap = code2SHcode; 317 lineCode2ShangHaiCodeMap = code2SHcode;
317 stationName2YgcNumber = tempStationName2YgcNumber; 318 stationName2YgcNumber = tempStationName2YgcNumber;
  319 +
  320 + Map<String, String> code2nameAll = new HashMap<>();
  321 + Iterator<Line> iteratorAll = lineRepository.findAll().iterator();
  322 + while (iteratorAll.hasNext()) {
  323 + line = iteratorAll.next();
  324 + code2nameAll.put(line.getLineCode(), line.getName());
  325 + }
  326 + lineCodeAllNameMap=code2nameAll;
318 } 327 }
319 328
320 /** 329 /**
src/main/java/com/bsth/entity/oil/Dlb.java
@@ -22,6 +22,7 @@ public class Dlb { @@ -22,6 +22,7 @@ public class Dlb {
22 @DateTimeFormat(pattern="yyyy-MM-dd") 22 @DateTimeFormat(pattern="yyyy-MM-dd")
23 private Date rq; 23 private Date rq;
24 private String xlbm; 24 private String xlbm;
  25 + private String linename;
25 private String ssgsdm; 26 private String ssgsdm;
26 private String fgsdm; 27 private String fgsdm;
27 private String nbbm; 28 private String nbbm;
@@ -102,6 +103,14 @@ public class Dlb { @@ -102,6 +103,14 @@ public class Dlb {
102 this.xlbm = xlbm; 103 this.xlbm = xlbm;
103 } 104 }
104 105
  106 + public String getLinename() {
  107 + return linename;
  108 + }
  109 +
  110 + public void setLinename(String linename) {
  111 + this.linename = linename;
  112 + }
  113 +
105 public String getSsgsdm() { 114 public String getSsgsdm() {
106 return ssgsdm; 115 return ssgsdm;
107 } 116 }
@@ -348,7 +357,7 @@ public class Dlb { @@ -348,7 +357,7 @@ public class Dlb {
348 } 357 }
349 358
350 public String getXlname() { 359 public String getXlname() {
351 - return BasicData.lineCode2NameMap.get(this.xlbm); 360 + return BasicData.lineCodeAllNameMap.get(this.xlbm);
352 } 361 }
353 362
354 public void setXlname(String xlname) { 363 public void setXlname(String xlname) {
src/main/java/com/bsth/entity/oil/Ylb.java
@@ -22,6 +22,7 @@ public class Ylb { @@ -22,6 +22,7 @@ public class Ylb {
22 @DateTimeFormat(pattern="yyyy-MM-dd") 22 @DateTimeFormat(pattern="yyyy-MM-dd")
23 private Date rq; 23 private Date rq;
24 private String xlbm; 24 private String xlbm;
  25 + private String linename;
25 private String ssgsdm; 26 private String ssgsdm;
26 private String fgsdm; 27 private String fgsdm;
27 private String nbbm; 28 private String nbbm;
@@ -95,6 +96,15 @@ public class Ylb { @@ -95,6 +96,15 @@ public class Ylb {
95 public void setXlbm(String xlbm) { 96 public void setXlbm(String xlbm) {
96 this.xlbm = xlbm; 97 this.xlbm = xlbm;
97 } 98 }
  99 +
  100 + public String getLinename() {
  101 + return linename;
  102 + }
  103 +
  104 + public void setLinename(String linename) {
  105 + this.linename = linename;
  106 + }
  107 +
98 public String getSsgsdm() { 108 public String getSsgsdm() {
99 return ssgsdm; 109 return ssgsdm;
100 } 110 }
@@ -292,7 +302,7 @@ public class Ylb { @@ -292,7 +302,7 @@ public class Ylb {
292 } 302 }
293 303
294 public String getXlname() { 304 public String getXlname() {
295 - return BasicData.lineCode2NameMap.get(this.xlbm); 305 + return BasicData.lineCodeAllNameMap.get(this.xlbm);
296 } 306 }
297 307
298 public void setXlname(String xlname) { 308 public void setXlname(String xlname) {
src/main/java/com/bsth/repository/LineRepository.java
@@ -51,6 +51,8 @@ public interface LineRepository extends BaseRepository&lt;Line, Integer&gt; { @@ -51,6 +51,8 @@ public interface LineRepository extends BaseRepository&lt;Line, Integer&gt; {
51 @Query("SELECT L FROM Line L where L.destroy=0 and L.remove !=1") 51 @Query("SELECT L FROM Line L where L.destroy=0 and L.remove !=1")
52 List<Line> findAllService(); 52 List<Line> findAllService();
53 53
  54 + @Query("SELECT L FROM Line L")
  55 + List<Line> findAll();
54 56
55 @Modifying 57 @Modifying
56 @Query(value = "UPDATE Line l set l.name=?1 , l.company=?2, l.brancheCompany=?3, " 58 @Query(value = "UPDATE Line l set l.name=?1 , l.company=?2, l.brancheCompany=?3, "
src/main/java/com/bsth/repository/calc/CalcWaybillRepository.java
@@ -58,4 +58,15 @@ public interface CalcWaybillRepository extends BaseRepository&lt;CalcWaybill, Integ @@ -58,4 +58,15 @@ public interface CalcWaybillRepository extends BaseRepository&lt;CalcWaybill, Integ
58 @Query("select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr=?1") 58 @Query("select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr=?1")
59 List<ScheduleRealInfo> findAllScheduleByDate(String schDate); 59 List<ScheduleRealInfo> findAllScheduleByDate(String schDate);
60 60
  61 +
  62 + //按照时间段统计,公司下线路 (驾驶员)
  63 + @Query(value="select DISTINCT c from CalcWaybill c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% and CONCAT(jGh,'/',jName) like %?6% order by c.xl")
  64 + List<CalcWaybill> scheduleByJsy(String line,String date,String date2,String gsdm,String fgsdm,String jsy);
  65 + //按照时间段统计,公司下线路 (售票员)
  66 + @Query(value="select DISTINCT c from CalcWaybill c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% and CONCAT(sGh,'/',sName) like %?6% order by c.xl")
  67 + List<CalcWaybill> scheduleBySpy(String line,String date,String date2,String gsdm,String fgsdm,String spy);
  68 + //按照时间段统计,公司下线路 (车辆自编号)
  69 + @Query(value="select DISTINCT c from CalcWaybill c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% and cl like %?6% order by c.xl")
  70 + List<CalcWaybill> scheduleByZbh(String line,String date,String date2,String gsdm,String fgsdm,String zbh);
  71 +
61 } 72 }
src/main/java/com/bsth/repository/oil/CwjyRepository.java
@@ -22,8 +22,8 @@ public interface CwjyRepository extends BaseRepository&lt;Cwjy, Integer&gt;{ @@ -22,8 +22,8 @@ public interface CwjyRepository extends BaseRepository&lt;Cwjy, Integer&gt;{
22 */ 22 */
23 @Query(value="SELECT a.gsdm as gsdm,a.nbbm as nbbm,b.jsy as jsy,b.jzl as jzl ,b.stationid as stationid," 23 @Query(value="SELECT a.gsdm as gsdm,a.nbbm as nbbm,b.jsy as jsy,b.jzl as jzl ,b.stationid as stationid,"
24 + "b.nylx as nylx,b.yj as yj,b.bz as bz,c.jsy as ldgh FROM bsth_c_cwjy a "+ 24 + "b.nylx as nylx,b.yj as yj,b.bz as bz,c.jsy as ldgh FROM bsth_c_cwjy a "+
25 - " left join ( select * from bsth_c_ylxxb b where to_days(b.yyrq)=to_days(?1) and jylx=1) b " +  
26 - " on a.nbbm=b.nbbm left join (select nbbm,group_concat(jsy) as jsy from bsth_c_ylb where to_days(rq)= to_days(?1 ) group by nbbm "+ 25 + " left join ( select * from bsth_c_ylxxb b where b.yyrq=?1 and jylx=1) b " +
  26 + " on a.nbbm=b.nbbm left join (select nbbm,group_concat(jsy) as jsy from bsth_c_ylb where rq= ?1 group by nbbm "+
27 " ) c on a.nbbm=c.nbbm where a.nbbm like %?2% ",nativeQuery=true) 27 " ) c on a.nbbm=c.nbbm where a.nbbm like %?2% ",nativeQuery=true)
28 List<Object[]> obtainCwjycl(String rq,String nbbm); 28 List<Object[]> obtainCwjycl(String rq,String nbbm);
29 29
src/main/java/com/bsth/repository/oil/DlbRepository.java
@@ -28,13 +28,13 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{ @@ -28,13 +28,13 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{
28 * @param rq 28 * @param rq
29 * @return 29 * @return
30 */ 30 */
31 - @Query(value="SELECT * FROM bsth_c_dlb where to_days(?1)=to_days(rq) and ssgsdm like %?2% " 31 + @Query(value="SELECT * FROM bsth_c_dlb where rq=?1 and ssgsdm like %?2% "
32 + " and fgsdm like %?3%" 32 + " and fgsdm like %?3%"
33 + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc",nativeQuery=true) 33 + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc",nativeQuery=true)
34 List<Dlb> obtainDl(String rq,String gsbm,String fgsdm,String xlbm,String nbbm,String px); 34 List<Dlb> obtainDl(String rq,String gsbm,String fgsdm,String xlbm,String nbbm,String px);
35 35
36 @Query(value="select s from Dlb s " 36 @Query(value="select s from Dlb s "
37 - + " where to_days(?1)=to_days(s.rq) " 37 + + " where to_days(s.rq)=to_days(?1) "
38 + " and s.ssgsdm like %?2% " 38 + " and s.ssgsdm like %?2% "
39 + " and s.fgsdm like %?3%" 39 + " and s.fgsdm like %?3%"
40 + " and s.xlbm like %?4% " 40 + " and s.xlbm like %?4% "
@@ -49,14 +49,14 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{ @@ -49,14 +49,14 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{
49 * @param xlbm 49 * @param xlbm
50 * @return 50 * @return
51 */ 51 */
52 - @Query(value="select nbbm,count(nbbm) from bsth_c_dlb where to_days(?1)=to_days(rq) and " 52 + @Query(value="select nbbm,count(nbbm) from bsth_c_dlb where rq=?1 and "
53 + " ssgsdm like %?2% " 53 + " ssgsdm like %?2% "
54 + " and fgsdm like %?3%" 54 + " and fgsdm like %?3%"
55 + " and xlbm like %?4% and nbbm like %?5% " 55 + " and xlbm like %?4% and nbbm like %?5% "
56 + " group by nbbm,rq,ssgsdm,fgsdm",nativeQuery=true) 56 + " group by nbbm,rq,ssgsdm,fgsdm",nativeQuery=true)
57 List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm); 57 List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm);
58 58
59 - @Query(value="select nbbm,sum(cdl*100) as cdl ,sum(zlc*100) as zlc from bsth_c_dlb where to_days(?1)=to_days(rq) and " 59 + @Query(value="select nbbm,sum(cdl*100) as cdl ,sum(zlc*100) as zlc from bsth_c_dlb where rq= ?1 and "
60 + " ssgsdm like %?2% " 60 + " ssgsdm like %?2% "
61 + " and fgsdm like %?3%" 61 + " and fgsdm like %?3%"
62 + " and xlbm like %?4% and nbbm like %?5% " 62 + " and xlbm like %?4% and nbbm like %?5% "
@@ -66,7 +66,7 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{ @@ -66,7 +66,7 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{
66 66
67 67
68 @Query(value="select cdl,hd,sh from Dlb s " 68 @Query(value="select cdl,hd,sh from Dlb s "
69 - + " where to_days(?1)=to_days(s.rq) " 69 + + " where to_days(s.rq)=to_days(?1) "
70 + " and s.ssgsdm like %?2% " 70 + " and s.ssgsdm like %?2% "
71 + " and s.fgsdm like %?3%" 71 + " and s.fgsdm like %?3%"
72 + " and s.xlbm like %?4% " 72 + " and s.xlbm like %?4% "
@@ -74,7 +74,7 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{ @@ -74,7 +74,7 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{
74 List<Object[]> sumDlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); 74 List<Object[]> sumDlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm);
75 75
76 @Query(value="select ifnull(cdl,0),ifnull(hd,0),ifnull(sh,0) from bsth_c_dlb " 76 @Query(value="select ifnull(cdl,0),ifnull(hd,0),ifnull(sh,0) from bsth_c_dlb "
77 - + " where to_days(?1)=to_days(rq) " 77 + + " where rq=?1 "
78 + " and ssgsdm like %?2% " 78 + " and ssgsdm like %?2% "
79 + " and fgsdm like %?3%" 79 + " and fgsdm like %?3%"
80 + " and xlbm like %?4% " 80 + " and xlbm like %?4% "
@@ -93,10 +93,10 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{ @@ -93,10 +93,10 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{
93 " WHERE id = ?1", nativeQuery=true) 93 " WHERE id = ?1", nativeQuery=true)
94 public void dlbUpdate(Integer id,double czcd,double jzcd,double hd, double sh,String shyy,int yhlx); 94 public void dlbUpdate(Integer id,double czcd,double jzcd,double hd, double sh,String shyy,int yhlx);
95 95
96 - @Query(value="SELECT * FROM bsth_c_dlb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true) 96 + @Query(value="SELECT * FROM bsth_c_dlb where rq=?1 and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true)
97 List<Dlb> queryListDlb(String rq,String nbbm,String jgh,String xlbm); 97 List<Dlb> queryListDlb(String rq,String nbbm,String jgh,String xlbm);
98 98
99 - @Query(value="SELECT * FROM bsth_c_dlb where to_days(?1)=to_days(rq) and xlbm=?2",nativeQuery=true) 99 + @Query(value="SELECT * FROM bsth_c_dlb where rq=?1 and xlbm=?2",nativeQuery=true)
100 List<Dlb> queryDlbByRqXlbm(String rq, String xlbm); 100 List<Dlb> queryDlbByRqXlbm(String rq, String xlbm);
101 101
102 } 102 }
src/main/java/com/bsth/repository/oil/LsylbRepository.java
@@ -22,7 +22,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{ @@ -22,7 +22,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{
22 * @param xlbm 22 * @param xlbm
23 * @return 23 * @return
24 */ 24 */
25 - @Query(value="select nbbm,count(nbbm) from bsth_ls_ylb where to_days(?1)=to_days(rq) and " 25 + @Query(value="select nbbm,count(nbbm) from bsth_ls_ylb where rq=?1 and "
26 + " ssgsdm like %?2% " 26 + " ssgsdm like %?2% "
27 + " and fgsdm like %?3%" 27 + " and fgsdm like %?3%"
28 + " and xlbm like %?4% and nbbm like %?5% and nylx= ?6 " 28 + " and xlbm like %?4% and nbbm like %?5% and nylx= ?6 "
@@ -30,7 +30,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{ @@ -30,7 +30,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{
30 List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm,int nylx); 30 List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm,int nylx);
31 31
32 @Query(value="select s from Lsylb s " 32 @Query(value="select s from Lsylb s "
33 - + " where to_days(?1)=to_days(s.rq) " 33 + + " where to_days(s.rq)=to_days(?1) "
34 + " and s.ssgsdm =?2 " 34 + " and s.ssgsdm =?2 "
35 + " and s.fgsdm =?3 " 35 + " and s.fgsdm =?3 "
36 + " and s.xlbm like %?4% " 36 + " and s.xlbm like %?4% "
@@ -38,7 +38,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{ @@ -38,7 +38,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{
38 + " and s.nbbm in ?6 order by nbbm,jhsj") 38 + " and s.nbbm in ?6 order by nbbm,jhsj")
39 List<Lsylb> listYlb(String rq, String gsbm,String fgsbm,String xlbm,int nylx,List<String> listNbbm); 39 List<Lsylb> listYlb(String rq, String gsbm,String fgsbm,String xlbm,int nylx,List<String> listNbbm);
40 40
41 - @Query(value="select nbbm,sum(jzl*100) as jzl ,sum(zlc*100) as zlc from bsth_ls_ylb where to_days(?1)=to_days(rq) and " 41 + @Query(value="select nbbm,sum(jzl*100) as jzl ,sum(zlc*100) as zlc from bsth_ls_ylb where rq=?1 and "
42 + " ssgsdm like %?2% " 42 + " ssgsdm like %?2% "
43 + " and fgsdm like %?3%" 43 + " and fgsdm like %?3%"
44 + " and xlbm like %?4% and nbbm like %?5% and nylx =?6 " 44 + " and xlbm like %?4% and nbbm like %?5% and nylx =?6 "
@@ -47,7 +47,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{ @@ -47,7 +47,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{
47 47
48 48
49 @Query(value="select ifnull(jzl,0),ifnull(yh,0),ifnull(sh,0) from bsth_ls_ylb " 49 @Query(value="select ifnull(jzl,0),ifnull(yh,0),ifnull(sh,0) from bsth_ls_ylb "
50 - + " where to_days(?1)=to_days(rq) " 50 + + " where rq=?1 "
51 + " and ssgsdm like %?2% " 51 + " and ssgsdm like %?2% "
52 + " and fgsdm like %?3%" 52 + " and fgsdm like %?3%"
53 + " and xlbm like %?4% " 53 + " and xlbm like %?4% "
@@ -57,7 +57,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{ @@ -57,7 +57,7 @@ public interface LsylbRepository extends BaseRepository&lt;Lsylb, Integer&gt;{
57 57
58 58
59 @Query(value="select jzl,yh,sh from Lsylb s " 59 @Query(value="select jzl,yh,sh from Lsylb s "
60 - + " where to_days(?1)=to_days(s.rq) " 60 + + " where to_days(s.rq)=to_days(?1) "
61 + " and s.ssgsdm like %?2% " 61 + " and s.ssgsdm like %?2% "
62 + " and s.fgsdm like %?3%" 62 + " and s.fgsdm like %?3%"
63 + " and s.xlbm like %?4% " 63 + " and s.xlbm like %?4% "
src/main/java/com/bsth/repository/oil/YlbRepository.java
@@ -33,7 +33,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{ @@ -33,7 +33,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
33 @Query(value="select y.* from (select max(d.id) as id ,d.nbbm from (" 33 @Query(value="select y.* from (select max(d.id) as id ,d.nbbm from ("
34 + " select b.rq,b.nbbm,max(b.jcsx) as jcsx from (" 34 + " select b.rq,b.nbbm,max(b.jcsx) as jcsx from ("
35 + " select max(t.rq) as rq ,t.nbbm from bsth_c_ylb t " 35 + " select max(t.rq) as rq ,t.nbbm from bsth_c_ylb t "
36 - + " where to_days(t.rq)< to_days(?1) " 36 + + " where t.rq< ?1 "
37 + " and t.ssgsdm like %?2% and t.fgsdm like %?3% " 37 + " and t.ssgsdm like %?2% and t.fgsdm like %?3% "
38 + " and t.xlbm like %?4% and t.nbbm like %?5% group by nbbm ) a " 38 + " and t.xlbm like %?4% and t.nbbm like %?5% group by nbbm ) a "
39 + " left join bsth_c_ylb b on a.rq=b.rq and a.nbbm=b.nbbm " 39 + " left join bsth_c_ylb b on a.rq=b.rq and a.nbbm=b.nbbm "
@@ -63,29 +63,29 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{ @@ -63,29 +63,29 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
63 * @param rq 63 * @param rq
64 * @return 64 * @return
65 */ 65 */
66 - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and ssgsdm like %?2% " 66 + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and ssgsdm like %?2% "
67 + " and fgsdm like %?3%" 67 + " and fgsdm like %?3%"
68 + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc ",nativeQuery=true) 68 + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc ",nativeQuery=true)
69 List<Ylb> obtainYl(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px); 69 List<Ylb> obtainYl(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px);
70 70
71 - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and ssgsdm like %?2% " 71 + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and ssgsdm like %?2% "
72 + " and fgsdm like %?3%" 72 + " and fgsdm like %?3%"
73 + " and xlbm = ?4 and nbbm like %?5% order by ?6 asc ",nativeQuery=true) 73 + " and xlbm = ?4 and nbbm like %?5% order by ?6 asc ",nativeQuery=true)
74 List<Ylb> obtainYlEq(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px); 74 List<Ylb> obtainYlEq(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px);
75 75
76 - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and ssgsdm like %?2% " 76 + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and ssgsdm like %?2% "
77 + " and fgsdm like %?3%" 77 + " and fgsdm like %?3%"
78 + " and xlbm = ?4 and nbbm like %?5% order by ?6 asc ",nativeQuery=true) 78 + " and xlbm = ?4 and nbbm like %?5% order by ?6 asc ",nativeQuery=true)
79 List<Ylb> obtainYl_eq(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px); 79 List<Ylb> obtainYl_eq(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px);
80 80
81 81
82 - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true) 82 + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true)
83 List<Ylb> queryListYlb(String rq,String nbbm,String jgh,String xlbm); 83 List<Ylb> queryListYlb(String rq,String nbbm,String jgh,String xlbm);
84 84
85 - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and xlbm=?2",nativeQuery=true) 85 + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and xlbm=?2",nativeQuery=true)
86 List<Ylb> queryYlbByRqXlbm(String rq,String xlbm); 86 List<Ylb> queryYlbByRqXlbm(String rq,String xlbm);
87 87
88 - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4 order by ?5 asc",nativeQuery=true) 88 + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and nbbm =?2 and jsy=?3 and xlbm=?4 order by ?5 asc",nativeQuery=true)
89 List<Ylb> checkYlb(String rq,String nbbm,String jgh,String xlbm,String px); 89 List<Ylb> checkYlb(String rq,String nbbm,String jgh,String xlbm,String px);
90 /** 90 /**
91 * 查询当天总的加注量和总里程 91 * 查询当天总的加注量和总里程
@@ -102,7 +102,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{ @@ -102,7 +102,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
102 * @param xlbm 102 * @param xlbm
103 * @return 103 * @return
104 */ 104 */
105 - @Query(value="select nbbm,count(nbbm) from bsth_c_ylb where to_days(?1)=to_days(rq) and " 105 + @Query(value="select nbbm,count(nbbm) from bsth_c_ylb where rq=?1 and "
106 + " ssgsdm like %?2% " 106 + " ssgsdm like %?2% "
107 + " and fgsdm like %?3%" 107 + " and fgsdm like %?3%"
108 + " and xlbm like %?4% and nbbm like %?5% " 108 + " and xlbm like %?4% and nbbm like %?5% "
@@ -117,7 +117,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{ @@ -117,7 +117,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
117 * @param xlbm 117 * @param xlbm
118 * @return 118 * @return
119 */ 119 */
120 - @Query(value="select nbbm,sum(jzl*100) as jzl ,sum(zlc*100) as zlc from bsth_c_ylb where to_days(?1)=to_days(rq) and " 120 + @Query(value="select nbbm,sum(jzl*100) as jzl ,sum(zlc*100) as zlc from bsth_c_ylb where rq=?1 and "
121 + " ssgsdm like %?2% " 121 + " ssgsdm like %?2% "
122 + " and fgsdm like %?3%" 122 + " and fgsdm like %?3%"
123 + " and xlbm like %?4% and nbbm like %?5% " 123 + " and xlbm like %?4% and nbbm like %?5% "
@@ -126,7 +126,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{ @@ -126,7 +126,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
126 126
127 127
128 @Query(value="select jzl,yh,sh from Ylb s " 128 @Query(value="select jzl,yh,sh from Ylb s "
129 - + " where to_days(?1)=to_days(s.rq) " 129 + + " where to_days(s.rq)=to_days(?1) "
130 + " and s.ssgsdm like %?2% " 130 + " and s.ssgsdm like %?2% "
131 + " and s.fgsdm like %?3%" 131 + " and s.fgsdm like %?3%"
132 + " and s.xlbm like %?4% " 132 + " and s.xlbm like %?4% "
@@ -134,7 +134,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{ @@ -134,7 +134,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
134 List<Object[]> sumYlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); 134 List<Object[]> sumYlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm);
135 135
136 @Query(value="select ifnull(jzl,0),ifnull(yh,0),ifnull(sh,0) from bsth_c_ylb " 136 @Query(value="select ifnull(jzl,0),ifnull(yh,0),ifnull(sh,0) from bsth_c_ylb "
137 - + " where to_days(?1)=to_days(rq) " 137 + + " where rq=?1 "
138 + " and ssgsdm like %?2% " 138 + " and ssgsdm like %?2% "
139 + " and fgsdm like %?3%" 139 + " and fgsdm like %?3%"
140 + " and xlbm like %?4% " 140 + " and xlbm like %?4% "
@@ -144,7 +144,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{ @@ -144,7 +144,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
144 144
145 145
146 @Query(value="select s from Ylb s " 146 @Query(value="select s from Ylb s "
147 - + " where to_days(?1)=to_days(s.rq) " 147 + + " where to_days(s.rq)=to_days(?1) "
148 + " and s.ssgsdm =?2 " 148 + " and s.ssgsdm =?2 "
149 + " and s.fgsdm =?3 " 149 + " and s.fgsdm =?3 "
150 + " and s.xlbm like %?4% " 150 + " and s.xlbm like %?4% "
src/main/java/com/bsth/service/calc/CalcMixService.java 0 → 100644
  1 +package com.bsth.service.calc;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +/**
  7 + * Created by 19/02/28.
  8 + */
  9 +public interface CalcMixService {
  10 +
  11 + List<Map<String, Object>> calcjsyspy(String line, String startDate, String endDate, String cont, String empnames, String gsdmManth, String fgsdmManth);
  12 +
  13 + List<Map<String, Object>> singledatatj(String line, String startDate, String endDate, String tjtype, String cont, String gsdmSing, String fgsdmSing);
  14 +
  15 +}
src/main/java/com/bsth/service/calc/impl/CalcMixServiceImpl.java 0 → 100644
  1 +package com.bsth.service.calc.impl;
  2 +
  3 +import java.sql.ResultSet;
  4 +import java.sql.SQLException;
  5 +import java.util.ArrayList;
  6 +import java.util.HashMap;
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +
  10 +import com.bsth.data.BasicData;
  11 +import com.bsth.entity.calc.CalcWaybill;
  12 +import com.bsth.entity.mcy_forms.Singledata;
  13 +import com.bsth.repository.calc.CalcWaybillRepository;
  14 +import com.bsth.service.calc.CalcMixService;
  15 +import com.bsth.util.Arith;
  16 +
  17 +import org.slf4j.Logger;
  18 +import org.slf4j.LoggerFactory;
  19 +import org.springframework.beans.factory.annotation.Autowired;
  20 +import org.springframework.jdbc.core.JdbcTemplate;
  21 +import org.springframework.jdbc.core.RowMapper;
  22 +import org.springframework.stereotype.Service;
  23 +
  24 +/**
  25 + * Created by 19/02/28.
  26 + */
  27 +@Service
  28 +public class CalcMixServiceImpl implements CalcMixService {
  29 +
  30 + @Autowired
  31 + private CalcWaybillRepository calcRepository;
  32 +
  33 + @Autowired
  34 + JdbcTemplate jdbcTemplate;
  35 +
  36 +
  37 + Logger logger = LoggerFactory.getLogger(this.getClass());
  38 +
  39 +
  40 + @Override
  41 + public List<Map<String, Object>> calcjsyspy(String line, String date, String date2,
  42 + String empnames, String cont, String gsdm, String fgsdm) {
  43 +
  44 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  45 + List<CalcWaybill> list = null;
  46 +
  47 + int flag = 0;
  48 + if("驾驶员".equals(empnames)){
  49 + flag = 1;
  50 + list = calcRepository.scheduleByJsy(line, date, date2, gsdm, fgsdm, cont);
  51 + } else if("售票员".equals(empnames)){
  52 + flag = 2;
  53 + list = calcRepository.scheduleBySpy(line, date, date2, gsdm, fgsdm, cont);
  54 + } else if("车辆自编号".equals(empnames)){
  55 + flag = 3;
  56 + list = calcRepository.scheduleByZbh(line, date, date2, gsdm, fgsdm, cont);
  57 + }
  58 +
  59 + List<CalcWaybill> calcList = new ArrayList<CalcWaybill>();
  60 + Map<String, CalcWaybill> calcMap = new HashMap<String, CalcWaybill>();
  61 +
  62 + CalcWaybill zjCalc = this.initCalcWaybill();
  63 + zjCalc.setjName("合计");
  64 + for(CalcWaybill c : list){
  65 + String key = "";
  66 + if(flag == 1){
  67 + if(c.getjGh() != null && c.getjName() != null)
  68 + key = c.getjGh() + "/" + c.getjName();
  69 + } else if(flag == 2){
  70 + if(c.getsGh() != null && c.getsName() != null)
  71 + key = c.getsGh() + "/" + c.getsName();
  72 + } else if(flag == 3){
  73 + if(c.getCl() != null)
  74 + key = c.getCl();
  75 + }
  76 +
  77 + if(key.trim().length() == 0 || "/".equals(key))
  78 + continue;
  79 +
  80 + CalcWaybill calc = null;
  81 + if(calcMap.containsKey(key)){
  82 + calc = calcMap.get(key);
  83 + } else {
  84 + calc = this.initCalcWaybill();
  85 + calc.setjName(key);
  86 + calcList.add(calc);
  87 + calcMap.put(key, calc);
  88 + }
  89 +
  90 + this.summation(calc, c);
  91 +
  92 + this.summation(zjCalc, c);
  93 +
  94 + }
  95 + calcList.add(zjCalc);
  96 + calcMap.put("合计", zjCalc);
  97 +
  98 + for(CalcWaybill c : calcList){
  99 + Map<String, Object> m = new HashMap<String, Object>();
  100 + m.put("jName", c.getjName());
  101 + m.put("jhyybc", c.getJhyybc());
  102 + m.put("jhfyybc", c.getJhfyybc());
  103 + m.put("sjyybc", c.getSjyybc());
  104 + m.put("sjfyybc", c.getSjfyybc());
  105 + m.put("lbbc", c.getLbbc());
  106 + m.put("ljbc", c.getLjbc());
  107 + m.put("jhzlc", Arith.add(c.getJhyylc(), c.getJhfyylc()));
  108 + m.put("jhyylc", c.getJhyylc());
  109 + m.put("jhfyylc", c.getJhfyylc());
  110 + m.put("sjzlc", Arith.add(c.getSjyylc(), c.getSjfyylc()));
  111 + m.put("sjyylc", c.getSjyylc());
  112 + m.put("sjfyylc", c.getSjfyylc());
  113 + m.put("lblc", c.getLblc());
  114 + m.put("ljyylc", c.getLjyylc());
  115 + m.put("ljfyylc", c.getLjfyylc());
  116 + resList.add(m);
  117 + }
  118 +
  119 + return resList;
  120 + }
  121 +
  122 + public CalcWaybill initCalcWaybill(){
  123 + CalcWaybill calc = new CalcWaybill();
  124 + calc.setJhyybc(0);
  125 + calc.setJhyylc(0d);
  126 + calc.setJhfyybc(0);
  127 + calc.setJhfyylc(0d);
  128 + calc.setSjyybc(0);
  129 + calc.setSjyylc(0d);
  130 + calc.setSjfyybc(0);
  131 + calc.setSjfyylc(0d);
  132 + calc.setLbbc(0);
  133 + calc.setLblc(0d);
  134 + calc.setLjbc(0);
  135 + calc.setLjyylc(0d);
  136 + calc.setLjfyylc(0d);
  137 + return calc;
  138 + }
  139 +
  140 + public CalcWaybill summation(CalcWaybill c1, CalcWaybill c2){
  141 + c1.setJhyybc(c1.getJhyybc() + c2.getJhyybc());
  142 + c1.setJhyylc(Arith.add(c1.getJhyylc(), c2.getJhyylc()));
  143 + c1.setJhfyybc(c1.getJhfyybc() + c2.getJhfyybc());
  144 + c1.setJhfyylc(Arith.add(c1.getJhfyylc(), c2.getJhfyylc()));
  145 + c1.setSjyybc(c1.getSjyybc() + c2.getSjyybc());
  146 + c1.setSjyylc(Arith.add(c1.getSjyylc(), c2.getSjyylc()));
  147 + c1.setSjyylc(Arith.add(c1.getSjyylc(), c2.getLjyylc()));
  148 + c1.setSjfyybc(c1.getSjfyybc() + c2.getSjfyybc());
  149 + c1.setSjfyylc(Arith.add(c1.getSjfyylc(), c2.getSjfyylc()));
  150 + c1.setSjfyylc(Arith.add(c1.getSjfyylc(), c2.getLjfyylc()));
  151 + c1.setLbbc(c1.getLbbc() + c2.getLbbc());
  152 + c1.setLblc(Arith.add(c1.getLblc(), c2.getLblc()));
  153 + c1.setLjbc(c1.getLjbc() + c2.getLjbc());
  154 + c1.setLjyylc(Arith.add(c1.getLjyylc(), c2.getLjyylc()));
  155 + c1.setLjfyylc(Arith.add(c1.getLjfyylc(), c2.getLjfyylc()));
  156 + return c1;
  157 + }
  158 +
  159 + @Override
  160 + public List<Map<String, Object>> singledatatj(String line,
  161 + String date, String date2,
  162 + String tjtype, String cont,
  163 + String gsdm, String fgsdm) {
  164 +
  165 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  166 + List<CalcWaybill> list = null;
  167 +
  168 + int flag = 0;
  169 + if("驾驶员".equals(tjtype)){
  170 + flag = 1;
  171 + list = calcRepository.scheduleByJsy(line, date, date2, gsdm, fgsdm, cont);
  172 + } else if("售票员".equals(tjtype)){
  173 + flag = 2;
  174 + list = calcRepository.scheduleBySpy(line, date, date2, gsdm, fgsdm, cont);
  175 + } else if("车辆自编号".equals(tjtype)){
  176 + flag = 3;
  177 + list = calcRepository.scheduleByZbh(line, date, date2, gsdm, fgsdm, cont);
  178 + }
  179 +
  180 + List<CalcWaybill> calcList = new ArrayList<CalcWaybill>();
  181 + Map<String, CalcWaybill> calcMap = new HashMap<String, CalcWaybill>();
  182 +
  183 + CalcWaybill zjCalc = this.initCalcWaybill();
  184 + zjCalc.setjName("合计");
  185 + for(CalcWaybill c : list){
  186 + String key = "";
  187 + if(flag == 1){
  188 + if(c.getjGh() != null && c.getjName() != null)
  189 + key += c.getjGh() + "/" + c.getjName();
  190 + } else if(flag == 2){
  191 + if(c.getsGh() != null && c.getsName() != null)
  192 + key += c.getsGh() + "/" + c.getsName();
  193 + } else if(flag == 3){
  194 + if(c.getCl() != null)
  195 + key += c.getCl();
  196 + }
  197 +
  198 + if(key.trim().length() == 0 || "/".equals(key))
  199 + continue;
  200 +
  201 + String jName = key;
  202 + key = c.getXl() + "/" + key;
  203 +
  204 + CalcWaybill calc = null;
  205 + if(calcMap.containsKey(key)){
  206 + calc = calcMap.get(key);
  207 + } else {
  208 + calc = this.initCalcWaybill();
  209 + calc.setXlName(c.getXlName());
  210 + calc.setXl(c.getXl());
  211 + calc.setjName(jName);
  212 + calcList.add(calc);
  213 + calcMap.put(key, calc);
  214 + }
  215 +
  216 + this.summation(calc, c);
  217 +
  218 + this.summation(zjCalc, c);
  219 +
  220 + }
  221 + calcList.add(zjCalc);
  222 + calcMap.put("合计", zjCalc);
  223 +
  224 + Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>();
  225 + for(CalcWaybill c : calcList){
  226 + Map<String, Object> m = new HashMap<String, Object>();
  227 + m.put("gS", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  228 + m.put("xl", c.getXl());
  229 + m.put("xlName", c.getXlName());
  230 + m.put("jName", c.getjName());
  231 + m.put("jhyybc", c.getJhyybc());
  232 + m.put("jhfyybc", c.getJhfyybc());
  233 + m.put("sjyybc", c.getSjyybc());
  234 + m.put("sjfyybc", c.getSjfyybc());
  235 + m.put("lbbc", c.getLbbc());
  236 + m.put("ljbc", c.getLjbc());
  237 + m.put("jhzlc", Arith.add(c.getJhyylc(), c.getJhfyylc()));
  238 + m.put("jhyylc", c.getJhyylc());
  239 + m.put("jhfyylc", c.getJhfyylc());
  240 + m.put("sjzlc", Arith.add(c.getSjyylc(), c.getSjfyylc()));
  241 + m.put("sjyylc", c.getSjyylc());
  242 + m.put("sjfyylc", c.getSjfyylc());
  243 + m.put("lblc", c.getLblc());
  244 + m.put("ljyylc", c.getLjyylc());
  245 + m.put("ljfyylc", c.getLjfyylc());
  246 + if(flag != 2){
  247 + m.put("hyl", 0);
  248 + m.put("jzl", 0);
  249 + m.put("sh", 0);
  250 + }
  251 + resList.add(m);
  252 + keyMap.put(c.getXl() + "/" + c.getjName(), m);
  253 + }
  254 +
  255 + String linesql="";
  256 + if(!line.equals("")){
  257 + linesql +=" and xlbm ='"+line+"' ";
  258 + }
  259 + if(!gsdm.equals("")){
  260 + linesql +=" and ssgsdm ='"+gsdm+"' ";
  261 + }
  262 + if(!fgsdm.equals("")){
  263 + linesql +=" and fgsdm ='"+fgsdm+"' ";
  264 + }
  265 + String nysql="SELECT id,xlbm,nbbm,jsy,jzl as jzl,yh as yh,sh as sh,fgsdm FROM bsth_c_ylb"
  266 + + " WHERE rq >= '"+date+"' and rq <= '"+date2+"'"
  267 + + linesql
  268 + + " union"
  269 + + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh,fgsdm FROM bsth_c_dlb"
  270 + + " WHERE rq >= '"+date2+"' and rq <= '"+date2+"'"
  271 + + linesql;
  272 + List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() {
  273 + @Override
  274 + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
  275 + Singledata sin = new Singledata();
  276 + sin.setxL(arg0.getString("xlbm"));
  277 + sin.setJsy(arg0.getString("jsy"));
  278 + sin.setClzbh(arg0.getString("nbbm"));
  279 + sin.setJzl(arg0.getString("jzl"));
  280 + sin.setHyl(arg0.getString("yh"));
  281 + sin.setUnyyyl(arg0.getString("sh"));
  282 + sin.setgS(arg0.getString("fgsdm"));
  283 + return sin;
  284 + }
  285 + });
  286 +
  287 + if(flag != 2){
  288 + Map<String, Object> last = resList.get(resList.size()-1);
  289 + last.put("hyl", 0);
  290 + last.put("jzl", 0);
  291 + last.put("sh", 0);
  292 +
  293 + //统计油,电表中手动添加的或者有加注没里程的数据
  294 + for (int i = 0; i < listNy.size(); i++) {
  295 + Singledata sin_=listNy.get(i);
  296 + String xl=sin_.getxL();
  297 + String str = "";
  298 + if(flag == 1){
  299 + str = sin_.getJsy() + "/" + BasicData.allPerson.get(gsdm+"-"+sin_.getJsy());
  300 + } else {
  301 + str = sin_.getClzbh();
  302 + }
  303 +// boolean fages=true;
  304 + if(keyMap.containsKey(xl + "/" + str)){
  305 + Map<String, Object> m = keyMap.get(xl + "/" + str);
  306 + m.put("hyl", Arith.add(m.get("hyl"), sin_.getHyl()!=null?sin_.getHyl():0));
  307 + m.put("jzl", Arith.add(m.get("jzl"), sin_.getJzl()!=null?sin_.getJzl():0));
  308 + m.put("sh", Arith.add(m.get("sh"), sin_.getUnyyyl()!=null?sin_.getUnyyyl():0));
  309 + last.put("hyl", Arith.add(last.get("hyl"), m.get("hyl")));
  310 + last.put("jzl", Arith.add(last.get("jzl"), m.get("jzl")));
  311 + last.put("sh", Arith.add(last.get("sh"), m.get("sh")));
  312 + } else {
  313 + Map<String, Object> m = new HashMap<String, Object>();
  314 + m.put("gS", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  315 + m.put("xl", xl);
  316 + m.put("xlName", BasicData.lineCodeAllNameMap.get(xl));
  317 + m.put("jName", str);
  318 + m.put("jhzlc", 0);
  319 + m.put("sjzlc", 0);
  320 + m.put("sjfyylc", 0);
  321 + m.put("hyl", sin_.getHyl()!=null?sin_.getHyl():0);
  322 + m.put("jzl", sin_.getJzl()!=null?sin_.getJzl():0);
  323 + m.put("sh", sin_.getUnyyyl()!=null?sin_.getUnyyyl():0);
  324 + last.put("hyl", Arith.add(last.get("hyl"), m.get("hyl")));
  325 + last.put("jzl", Arith.add(last.get("jzl"), m.get("jzl")));
  326 + last.put("sh", Arith.add(last.get("sh"), m.get("sh")));
  327 +
  328 + keyMap.put(xl + "/" + str, m);
  329 + }
  330 + }
  331 + resList.remove(last);
  332 + resList.add(last);
  333 + }
  334 +
  335 + return resList;
  336 + }
  337 +
  338 +}
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
@@ -1729,7 +1729,7 @@ public class FormsServiceImpl implements FormsService { @@ -1729,7 +1729,7 @@ public class FormsServiceImpl implements FormsService {
1729 startDate = map.get("startDate").toString(); 1729 startDate = map.get("startDate").toString();
1730 1730
1731 String sql="select r.s_gh,r.s_name, " 1731 String sql="select r.s_gh,r.s_name, "
1732 - + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm" 1732 + + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm,xl_name"
1733 + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+startDate+"'"; 1733 + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+startDate+"'";
1734 if(!xlbm.equals("")){ 1734 if(!xlbm.equals("")){
1735 sql += " and r.xl_bm = '"+xlbm+"'"; 1735 sql += " and r.xl_bm = '"+xlbm+"'";
@@ -1741,7 +1741,7 @@ public class FormsServiceImpl implements FormsService { @@ -1741,7 +1741,7 @@ public class FormsServiceImpl implements FormsService {
1741 sql += " and r.fgs_bm='"+fgsdm+"'"; 1741 sql += " and r.fgs_bm='"+fgsdm+"'";
1742 } 1742 }
1743 sql += " group by r.s_gh,r.s_name," 1743 sql += " group by r.s_gh,r.s_name,"
1744 - + " 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"; 1744 + + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm,xl_name order by r.xl_bm,r.cl_zbh";
1745 1745
1746 List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { 1746 List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
1747 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 1747 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -1755,6 +1755,7 @@ public class FormsServiceImpl implements FormsService { @@ -1755,6 +1755,7 @@ public class FormsServiceImpl implements FormsService {
1755 sin.setjName(arg0.getString("j_name")); 1755 sin.setjName(arg0.getString("j_name"));
1756 sin.setSgh(arg0.getString("s_gh")); 1756 sin.setSgh(arg0.getString("s_gh"));
1757 sin.setsName(arg0.getString("s_name")); 1757 sin.setsName(arg0.getString("s_name"));
  1758 + sin.setXlmc(arg0.getString("xl_name"));
1758 sin.setgS(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs_bm")+"_"+arg0.getString("gs_bm"))); 1759 sin.setgS(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs_bm")+"_"+arg0.getString("gs_bm")));
1759 1760
1760 return sin; 1761 return sin;
@@ -1772,7 +1773,7 @@ public class FormsServiceImpl implements FormsService { @@ -1772,7 +1773,7 @@ public class FormsServiceImpl implements FormsService {
1772 String clzbh=sin.getClzbh(); 1773 String clzbh=sin.getClzbh();
1773 String xl=sin.getxL(); 1774 String xl=sin.getxL();
1774 String spy=sin.getSgh(); 1775 String spy=sin.getSgh();
1775 - sin.setxL(BasicData.lineCode2NameMap.get(xl)); 1776 + sin.setxL(sin.getXlmc());
1776 for (int j = 0; j < listReal.size(); j++) { 1777 for (int j = 0; j < listReal.size(); j++) {
1777 ScheduleRealInfo s=listReal.get(j); 1778 ScheduleRealInfo s=listReal.get(j);
1778 if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) 1779 if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)
@@ -1917,7 +1918,12 @@ public class FormsServiceImpl implements FormsService { @@ -1917,7 +1918,12 @@ public class FormsServiceImpl implements FormsService {
1917 sin.setEmptMileage(String.valueOf(zksgl)); 1918 sin.setEmptMileage(String.valueOf(zksgl));
1918 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); 1919 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
1919 sin.setxL(y.getXlbm()); 1920 sin.setxL(y.getXlbm());
1920 - sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm())); 1921 + if(y.getLinename()==null){
  1922 + sin.setXlmc(y.getXlname());
  1923 + }else{
  1924 + sin.setXlmc(y.getLinename());
  1925 + }
  1926 +
1921 sin.setClzbh(clzbh); 1927 sin.setClzbh(clzbh);
1922 sin.setJsy(jsy); 1928 sin.setJsy(jsy);
1923 sin.setrQ(startDate); 1929 sin.setrQ(startDate);
@@ -1999,8 +2005,11 @@ public class FormsServiceImpl implements FormsService { @@ -1999,8 +2005,11 @@ public class FormsServiceImpl implements FormsService {
1999 sin.setEmptMileage(String.valueOf(zksgl)); 2005 sin.setEmptMileage(String.valueOf(zksgl));
2000 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); 2006 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
2001 sin.setxL(y.getXlbm()); 2007 sin.setxL(y.getXlbm());
2002 - sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm()));  
2003 - sin.setClzbh(clzbh); 2008 + if(y.getLinename()==null){
  2009 + sin.setXlmc(y.getXlname());
  2010 + }else{
  2011 + sin.setXlmc(y.getLinename());
  2012 + } sin.setClzbh(clzbh);
2004 sin.setJsy(jsy); 2013 sin.setJsy(jsy);
2005 sin.setrQ(startDate); 2014 sin.setrQ(startDate);
2006 if(newList.size()>0){ 2015 if(newList.size()>0){
@@ -2024,7 +2033,7 @@ public class FormsServiceImpl implements FormsService { @@ -2024,7 +2033,7 @@ public class FormsServiceImpl implements FormsService {
2024 list.addAll(listD); 2033 list.addAll(listD);
2025 }else{ 2034 }else{
2026 String sql="select r.s_gh,r.s_name, " 2035 String sql="select r.s_gh,r.s_name, "
2027 - + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm" 2036 + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,r.xl_name"
2028 + " from bsth_c_s_sp_info_real r where " 2037 + " from bsth_c_s_sp_info_real r where "
2029 + " r.schedule_date_str = '"+startDate+"'" 2038 + " r.schedule_date_str = '"+startDate+"'"
2030 + " and r.s_gh !='' and r.s_gh is not null "; 2039 + " and r.s_gh !='' and r.s_gh is not null ";
@@ -2038,7 +2047,7 @@ public class FormsServiceImpl implements FormsService { @@ -2038,7 +2047,7 @@ public class FormsServiceImpl implements FormsService {
2038 sql += " and r.fgs_bm='"+fgsdm+"'"; 2047 sql += " and r.fgs_bm='"+fgsdm+"'";
2039 } 2048 }
2040 sql += " group by r.s_gh,r.s_name," 2049 sql += " group by r.s_gh,r.s_name,"
2041 - + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; 2050 + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,r.xl_name order by r.xl_bm,r.cl_zbh";
2042 2051
2043 list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { 2052 list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
2044 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 2053 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -2050,6 +2059,7 @@ public class FormsServiceImpl implements FormsService { @@ -2050,6 +2059,7 @@ public class FormsServiceImpl implements FormsService {
2050 sin.setClzbh(arg0.getString("cl_zbh")); 2059 sin.setClzbh(arg0.getString("cl_zbh"));
2051 sin.setSgh(arg0.getString("s_gh")); 2060 sin.setSgh(arg0.getString("s_gh"));
2052 sin.setsName(arg0.getString("s_name")); 2061 sin.setsName(arg0.getString("s_name"));
  2062 + sin.setXlmc(arg0.getString("xl_name"));
2053 return sin; 2063 return sin;
2054 } 2064 }
2055 }); 2065 });
@@ -2059,6 +2069,7 @@ public class FormsServiceImpl implements FormsService { @@ -2059,6 +2069,7 @@ public class FormsServiceImpl implements FormsService {
2059 String jsy=sin.getSgh(); 2069 String jsy=sin.getSgh();
2060 String line=sin.getxL(); 2070 String line=sin.getxL();
2061 String clzbh=sin.getClzbh(); 2071 String clzbh=sin.getClzbh();
  2072 + String xl_name=sin.getXlmc();
2062 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); 2073 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
2063 List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); 2074 List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>();
2064 2075
@@ -2091,7 +2102,7 @@ public class FormsServiceImpl implements FormsService { @@ -2091,7 +2102,7 @@ public class FormsServiceImpl implements FormsService {
2091 2102
2092 sin.setEmptMileage(String.valueOf(zksgl)); 2103 sin.setEmptMileage(String.valueOf(zksgl));
2093 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); 2104 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
2094 - sin.setXlmc(BasicData.lineCode2NameMap.get(line)); 2105 + sin.setXlmc(xl_name);
2095 sin.setClzbh(clzbh); 2106 sin.setClzbh(clzbh);
2096 sin.setJsy(""); 2107 sin.setJsy("");
2097 sin.setjName(""); 2108 sin.setjName("");
@@ -2197,8 +2208,11 @@ public class FormsServiceImpl implements FormsService { @@ -2197,8 +2208,11 @@ public class FormsServiceImpl implements FormsService {
2197 sin.setEmptMileage(String.valueOf(zksgl)); 2208 sin.setEmptMileage(String.valueOf(zksgl));
2198 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); 2209 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
2199 sin.setxL(y.getXlbm()); 2210 sin.setxL(y.getXlbm());
2200 - sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm()));  
2201 - sin.setClzbh(clzbh); 2211 + if(y.getLinename()==null){
  2212 + sin.setXlmc(y.getXlname());
  2213 + }else{
  2214 + sin.setXlmc(y.getLinename());
  2215 + } sin.setClzbh(clzbh);
2202 sin.setJsy(jsy); 2216 sin.setJsy(jsy);
2203 sin.setrQ(startDate); 2217 sin.setrQ(startDate);
2204 if(newList.size()>0){ 2218 if(newList.size()>0){
@@ -2279,7 +2293,11 @@ public class FormsServiceImpl implements FormsService { @@ -2279,7 +2293,11 @@ public class FormsServiceImpl implements FormsService {
2279 sin.setEmptMileage(String.valueOf(zksgl)); 2293 sin.setEmptMileage(String.valueOf(zksgl));
2280 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); 2294 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
2281 sin.setxL(y.getXlbm()); 2295 sin.setxL(y.getXlbm());
2282 - sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm())); 2296 + if(y.getLinename()==null){
  2297 + sin.setXlmc(y.getXlname());
  2298 + }else{
  2299 + sin.setXlmc(y.getLinename());
  2300 + }
2283 sin.setClzbh(clzbh); 2301 sin.setClzbh(clzbh);
2284 sin.setJsy(jsy); 2302 sin.setJsy(jsy);
2285 sin.setrQ(startDate); 2303 sin.setrQ(startDate);
@@ -2304,7 +2322,7 @@ public class FormsServiceImpl implements FormsService { @@ -2304,7 +2322,7 @@ public class FormsServiceImpl implements FormsService {
2304 list.addAll(listD); 2322 list.addAll(listD);
2305 }else{ 2323 }else{
2306 String sql="select r.s_gh,r.s_name, " 2324 String sql="select r.s_gh,r.s_name, "
2307 - + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm" 2325 + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,r.xl_name"
2308 + " from bsth_c_s_sp_info_real r where " 2326 + " from bsth_c_s_sp_info_real r where "
2309 + " r.schedule_date_str = '"+startDate+"'" 2327 + " r.schedule_date_str = '"+startDate+"'"
2310 + " and r.s_gh !='' and r.s_gh is not null "; 2328 + " and r.s_gh !='' and r.s_gh is not null ";
@@ -2318,7 +2336,7 @@ public class FormsServiceImpl implements FormsService { @@ -2318,7 +2336,7 @@ public class FormsServiceImpl implements FormsService {
2318 sql += " and r.fgs_bm='"+fgsdm+"'"; 2336 sql += " and r.fgs_bm='"+fgsdm+"'";
2319 } 2337 }
2320 sql += " group by r.s_gh,r.s_name," 2338 sql += " group by r.s_gh,r.s_name,"
2321 - + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; 2339 + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,xl_name order by r.xl_bm,r.cl_zbh";
2322 2340
2323 list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { 2341 list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
2324 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 2342 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -2330,6 +2348,7 @@ public class FormsServiceImpl implements FormsService { @@ -2330,6 +2348,7 @@ public class FormsServiceImpl implements FormsService {
2330 sin.setClzbh(arg0.getString("cl_zbh")); 2348 sin.setClzbh(arg0.getString("cl_zbh"));
2331 sin.setSgh(arg0.getString("s_gh")); 2349 sin.setSgh(arg0.getString("s_gh"));
2332 sin.setsName(arg0.getString("s_name")); 2350 sin.setsName(arg0.getString("s_name"));
  2351 + sin.setXlmc(arg0.getString("xl_name"));
2333 return sin; 2352 return sin;
2334 } 2353 }
2335 }); 2354 });
@@ -2339,6 +2358,7 @@ public class FormsServiceImpl implements FormsService { @@ -2339,6 +2358,7 @@ public class FormsServiceImpl implements FormsService {
2339 String jsy=sin.getSgh(); 2358 String jsy=sin.getSgh();
2340 String line=sin.getxL(); 2359 String line=sin.getxL();
2341 String clzbh=sin.getClzbh(); 2360 String clzbh=sin.getClzbh();
  2361 + String xl_name=sin.getXlmc();
2342 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); 2362 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
2343 List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); 2363 List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>();
2344 2364
@@ -2372,7 +2392,7 @@ public class FormsServiceImpl implements FormsService { @@ -2372,7 +2392,7 @@ public class FormsServiceImpl implements FormsService {
2372 2392
2373 sin.setEmptMileage(String.valueOf(zksgl)); 2393 sin.setEmptMileage(String.valueOf(zksgl));
2374 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); 2394 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
2375 - sin.setXlmc(BasicData.lineCode2NameMap.get(line)); 2395 + sin.setXlmc(xl_name);
2376 sin.setClzbh(clzbh); 2396 sin.setClzbh(clzbh);
2377 sin.setJsy(""); 2397 sin.setJsy("");
2378 sin.setjName(""); 2398 sin.setjName("");
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
@@ -505,7 +505,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -505,7 +505,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
505 } 505 }
506 506
507 String key = schedule.getXlBm() + "/" + schedule.getXlName() + "/" + schedule.getQdzName() 507 String key = schedule.getXlBm() + "/" + schedule.getXlName() + "/" + schedule.getQdzName()
508 - + "/" + schedule.getFgsName() + "/" + schedule.getFgsBm(); 508 + + "/" + schedule.getFgsBm();
509 if(!keyMap.containsKey(key)) 509 if(!keyMap.containsKey(key))
510 keyMap.put(key, new ArrayList<ScheduleRealInfo>()); 510 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
511 keyMap.get(key).add(schedule); 511 keyMap.get(key).add(schedule);
@@ -618,8 +618,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -618,8 +618,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
618 tempMap.put("line", split[1]); 618 tempMap.put("line", split[1]);
619 tempMap.put("qdz", split[2]); 619 tempMap.put("qdz", split[2]);
620 tempMap.put("company", companyName); 620 tempMap.put("company", companyName);
621 - tempMap.put("subCompany", split[3]);  
622 - tempMap.put("fgsbm", split[4]); 621 + tempMap.put("subCompany", subCompanyName);
  622 + tempMap.put("fgsbm", split[3]);
623 long jhInterval = 0l; 623 long jhInterval = 0l;
624 long sjInterval = 0l; 624 long sjInterval = 0l;
625 for(Long i : fcsjs) 625 for(Long i : fcsjs)
@@ -677,7 +677,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -677,7 +677,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
677 }else if(statu.equals("0")){ 677 }else if(statu.equals("0")){
678 List<Long> longList = new ArrayList<Long>(); 678 List<Long> longList = new ArrayList<Long>();
679 for(String key : keyList){ 679 for(String key : keyList){
680 - long xlBm = Long.valueOf(key.split("/")[4]) * 1000000l + Long.valueOf(key.split("/")[0]); 680 + long xlBm = Long.valueOf(key.split("/")[3]) * 1000000l + Long.valueOf(key.split("/")[0]);
681 if(!longList.contains(xlBm)) 681 if(!longList.contains(xlBm))
682 longList.add(xlBm); 682 longList.add(xlBm);
683 Collections.sort(longList); 683 Collections.sort(longList);
@@ -685,7 +685,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -685,7 +685,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
685 for(long xlBm : longList){ 685 for(long xlBm : longList){
686 for(String key : keyList){ 686 for(String key : keyList){
687 String[] split = key.split("/"); 687 String[] split = key.split("/");
688 - long kl = Long.valueOf(split[4]) * 1000000l + Long.valueOf(split[0]); 688 + long kl = Long.valueOf(split[3]) * 1000000l + Long.valueOf(split[0]);
689 if(kl == xlBm){ 689 if(kl == xlBm){
690 Map<String, Object> tempMap = new HashMap<String, Object>(); 690 Map<String, Object> tempMap = new HashMap<String, Object>();
691 List<Long> fcsjs = new ArrayList<Long>(); 691 List<Long> fcsjs = new ArrayList<Long>();
@@ -712,8 +712,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -712,8 +712,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
712 tempMap.put("line", split[1]); 712 tempMap.put("line", split[1]);
713 tempMap.put("qdz", split[2]); 713 tempMap.put("qdz", split[2]);
714 tempMap.put("company", companyName); 714 tempMap.put("company", companyName);
715 - tempMap.put("subCompany", split[3]);  
716 - tempMap.put("fgsbm", split[4]); 715 + tempMap.put("subCompany", subCompanyName);
  716 + tempMap.put("fgsbm", split[3]);
717 tempMap.put("jhInterval", fcsjs.size()>0?df.format((double)fcsj/fcsjs.size()):"/"); 717 tempMap.put("jhInterval", fcsjs.size()>0?df.format((double)fcsj/fcsjs.size()):"/");
718 tempMap.put("sjInterval", fcsjAs.size()>0?df.format((double)fcsjA/fcsjAs.size()):"/"); 718 tempMap.put("sjInterval", fcsjAs.size()>0?df.format((double)fcsjA/fcsjAs.size()):"/");
719 tempMap.put("MaxInterval", fcsjAs.size()>0?fcsjAs.get(fcsjAs.size() - 1):"/"); 719 tempMap.put("MaxInterval", fcsjAs.size()>0?fcsjAs.get(fcsjAs.size() - 1):"/");
src/main/java/com/bsth/service/oil/impl/CwjyServiceImpl.java
@@ -328,7 +328,7 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw @@ -328,7 +328,7 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw
328 } 328 }
329 329
330 String sql_ylb="SELECT nbbm,group_concat(jsy) AS jsy FROM bsth_c_ylb WHERE " 330 String sql_ylb="SELECT nbbm,group_concat(jsy) AS jsy FROM bsth_c_ylb WHERE "
331 - + " to_days(rq) = to_days('"+rq+"') AND ssgsdm = '"+gsdm+"' AND " 331 + + " rq = '"+rq+"' AND ssgsdm = '"+gsdm+"' AND "
332 + " fgsdm = '"+fgsdm+"' GROUP BY nbbm"; 332 + " fgsdm = '"+fgsdm+"' GROUP BY nbbm";
333 333
334 List<Map<String, String>> ylbList= jdbcTemplate.query(sql_ylb, 334 List<Map<String, String>> ylbList= jdbcTemplate.query(sql_ylb,
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
@@ -197,6 +197,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -197,6 +197,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
197 t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); 197 t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString());
198 t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString())))); 198 t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString()))));
199 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); 199 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
  200 + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString());
200 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); 201 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
201 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); 202 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
202 t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); 203 t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
@@ -464,6 +465,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -464,6 +465,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
464 t.setZlc(map.get("totalKilometers") == null ? 0.0 465 t.setZlc(map.get("totalKilometers") == null ? 0.0
465 : Double.parseDouble(map.get("totalKilometers").toString())); 466 : Double.parseDouble(map.get("totalKilometers").toString()));
466 t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString()); 467 t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString());
  468 + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString());
467 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); 469 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
468 t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString()); 470 t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString());
469 t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); 471 t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString());
@@ -884,7 +886,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -884,7 +886,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
884 String px) { 886 String px) {
885 // TODO Auto-generated method stub 887 // TODO Auto-generated method stub
886 String sql="SELECT * FROM bsth_c_dlb " 888 String sql="SELECT * FROM bsth_c_dlb "
887 - + " where to_days('"+rq+"')=to_days(rq) and ssgsdm like '%"+gsdm+"%' " 889 + + " where rq='"+rq+"' and ssgsdm like '%"+gsdm+"%' "
888 + " and fgsdm like '%"+fgsdm+"%'"; 890 + " and fgsdm like '%"+fgsdm+"%'";
889 if(xlbm.equals("")){ 891 if(xlbm.equals("")){
890 sql+= " and xlbm like '%"+xlbm+"%' "; 892 sql+= " and xlbm like '%"+xlbm+"%' ";
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
@@ -194,6 +194,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -194,6 +194,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
194 t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); 194 t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString());
195 t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(map.get("totalKilometers").toString())); 195 t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(map.get("totalKilometers").toString()));
196 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); 196 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
  197 + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString());
197 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); 198 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
198 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); 199 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
199 t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); 200 t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
@@ -492,6 +493,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -492,6 +493,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
492 t.setZlc(map.get("totalKilometers") == null ? 0.0 493 t.setZlc(map.get("totalKilometers") == null ? 0.0
493 : Double.parseDouble(map.get("totalKilometers").toString())); 494 : Double.parseDouble(map.get("totalKilometers").toString()));
494 t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString()); 495 t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString());
  496 + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString());
495 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); 497 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
496 t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString()); 498 t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString());
497 t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); 499 t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString());
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -3265,6 +3265,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3265,6 +3265,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3265 * 对计划发车时间相同的班次进行排序 out最前 in最后 3265 * 对计划发车时间相同的班次进行排序 out最前 in最后
3266 */ 3266 */
3267 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); 3267 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  3268 + SimpleDateFormat sdfnyr =new SimpleDateFormat("yyyy-MM-dd");
3268 String minfcsj = "02:00"; 3269 String minfcsj = "02:00";
3269 List<Line> lineList = lineRepository.findLineByCode(line); 3270 List<Line> lineList = lineRepository.findLineByCode(line);
3270 if (lineList.size() > 0) { 3271 if (lineList.size() > 0) {
@@ -3293,9 +3294,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3293,9 +3294,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3293 Calendar calendar = new GregorianCalendar(); 3294 Calendar calendar = new GregorianCalendar();
3294 calendar.setTime(s.getScheduleDate()); 3295 calendar.setTime(s.getScheduleDate());
3295 calendar.add(calendar.DATE, 1); 3296 calendar.add(calendar.DATE, 1);
3296 - s.setScheduleDate(calendar.getTime()); 3297 + Date date_sch= calendar.getTime();
3297 try { 3298 try {
3298 - fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime(); 3299 + fscjT = sdf.parse(sdfnyr.format(date_sch) + " " + s.getFcsj()).getTime();
3299 } catch (ParseException e) { 3300 } catch (ParseException e) {
3300 // TODO Auto-generated catch block 3301 // TODO Auto-generated catch block
3301 e.printStackTrace(); 3302 e.printStackTrace();
@@ -3307,15 +3308,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3307,15 +3308,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3307 } catch (ParseException e) { 3308 } catch (ParseException e) {
3308 // TODO Auto-generated catch block 3309 // TODO Auto-generated catch block
3309 e.printStackTrace(); 3310 e.printStackTrace();
3310 - }  
3311 - ; 3311 + };
3312 } 3312 }
3313 s.setFcsjT(fscjT); 3313 s.setFcsjT(fscjT);
3314 } 3314 }
3315 List<ScheduleRealInfo> listInfo2=new ArrayList<ScheduleRealInfo>(); 3315 List<ScheduleRealInfo> listInfo2=new ArrayList<ScheduleRealInfo>();
3316 listInfo2.addAll(listInfo); 3316 listInfo2.addAll(listInfo);
3317 Collections.sort(listInfo, new compareLpFcsjType()); 3317 Collections.sort(listInfo, new compareLpFcsjType());
3318 - System.out.println(listInfo);  
3319 Collections.sort(listInfo2,new compareDirLpFcsjType()); 3318 Collections.sort(listInfo2,new compareDirLpFcsjType());
3320 for (int i = 0; i < listInfo.size(); i++) { 3319 for (int i = 0; i < listInfo.size(); i++) {
3321 ScheduleRealInfo t = listInfo.get(i); 3320 ScheduleRealInfo t = listInfo.get(i);
@@ -3454,6 +3453,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3454,6 +3453,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3454 * 对计划发车时间相同的班次进行排序 out最前 in最后 3453 * 对计划发车时间相同的班次进行排序 out最前 in最后
3455 */ 3454 */
3456 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); 3455 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  3456 + SimpleDateFormat sdfnyr = new SimpleDateFormat("yyyy-MM-dd");
  3457 +
3457 String minfcsj = "02:00"; 3458 String minfcsj = "02:00";
3458 List<Line> lineList = lineRepository.findLineByCode(line); 3459 List<Line> lineList = lineRepository.findLineByCode(line);
3459 if (lineList.size() > 0) { 3460 if (lineList.size() > 0) {
@@ -3482,9 +3483,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3482,9 +3483,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3482 Calendar calendar = new GregorianCalendar(); 3483 Calendar calendar = new GregorianCalendar();
3483 calendar.setTime(s.getScheduleDate()); 3484 calendar.setTime(s.getScheduleDate());
3484 calendar.add(calendar.DATE, 1); 3485 calendar.add(calendar.DATE, 1);
3485 - s.setScheduleDate(calendar.getTime()); 3486 + Date date_sch=calendar.getTime();
3486 try { 3487 try {
3487 - fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime(); 3488 + fscjT = sdf.parse(sdfnyr.format(date_sch) + " " + s.getFcsj()).getTime();
3488 } catch (ParseException e) { 3489 } catch (ParseException e) {
3489 // TODO Auto-generated catch block 3490 // TODO Auto-generated catch block
3490 e.printStackTrace(); 3491 e.printStackTrace();
@@ -3773,6 +3774,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3773,6 +3774,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3773 boolean fage = true; 3774 boolean fage = true;
3774 String company = ""; 3775 String company = "";
3775 String bCompany = ""; 3776 String bCompany = "";
  3777 + String lineName="";
3776 List<ScheduleRealInfo> listS = new ArrayList<ScheduleRealInfo>(); 3778 List<ScheduleRealInfo> listS = new ArrayList<ScheduleRealInfo>();
3777 for (ScheduleRealInfo scheduleRealInfo : lists) { 3779 for (ScheduleRealInfo scheduleRealInfo : lists) {
3778 if (scheduleRealInfo.getjGh().equals(jName) 3780 if (scheduleRealInfo.getjGh().equals(jName)
@@ -3783,6 +3785,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3783,6 +3785,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3783 //根据线路代码获取公司 3785 //根据线路代码获取公司
3784 company = scheduleRealInfo.getGsBm(); 3786 company = scheduleRealInfo.getGsBm();
3785 bCompany = scheduleRealInfo.getFgsBm(); 3787 bCompany = scheduleRealInfo.getFgsBm();
  3788 + lineName = scheduleRealInfo.getXlName();
3786 fage = false; 3789 fage = false;
3787 } 3790 }
3788 Set<ChildTaskPlan> cts = scheduleRealInfo.getcTasks(); 3791 Set<ChildTaskPlan> cts = scheduleRealInfo.getcTasks();
@@ -3797,6 +3800,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3797,6 +3800,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3797 } 3800 }
3798 yesterdayDataList.get(x).put("company", company); 3801 yesterdayDataList.get(x).put("company", company);
3799 yesterdayDataList.get(x).put("bCompany", bCompany); 3802 yesterdayDataList.get(x).put("bCompany", bCompany);
  3803 + yesterdayDataList.get(x).put("lineName", lineName);
3800 Double ljgl = culateMieageService.culateLjgl(listS); 3804 Double ljgl = culateMieageService.culateLjgl(listS);
3801 Double sjgl = culateMieageService.culateSjgl(listS); 3805 Double sjgl = culateMieageService.culateSjgl(listS);
3802 Double ksgl = culateMieageService.culateKsgl(listS); 3806 Double ksgl = culateMieageService.culateKsgl(listS);
@@ -4565,6 +4569,37 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4565,6 +4569,37 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4565 s.setSjlc(String.valueOf(sjlc)); 4569 s.setSjlc(String.valueOf(sjlc));
4566 s.setRemarks(remarks); 4570 s.setRemarks(remarks);
4567 newList.add(s); 4571 newList.add(s);
  4572 +
  4573 + if (!childTaskPlans.isEmpty()) {
  4574 +// Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  4575 + List<ChildTaskPlan> listit = new ArrayList<ChildTaskPlan>(childTaskPlans);
  4576 + Collections.sort(listit, new ComparableChild());
  4577 + for (int j = 0; j < listit.size(); j++) {
  4578 + ScheduleRealInfo t = new ScheduleRealInfo();
  4579 + ChildTaskPlan childTaskPlan = listit.get(j);
  4580 + if (childTaskPlan.getCcId() == null) {
  4581 + if (childTaskPlan.isDestroy()) {
  4582 + t.setFcsjActual("");
  4583 + t.setZdsjActual("");
  4584 +// t.setJhlc(0.0);
  4585 + t.setSjlc("0.0");
  4586 + } else {
  4587 + t.setFcsjActual(childTaskPlan.getStartDate());
  4588 + t.setZdsjActual(childTaskPlan.getEndDate());
  4589 +// t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
  4590 + t.setSjlc(String.valueOf(childTaskPlan.getMileage()));
  4591 + }
  4592 + t.setFcsj(childTaskPlan.getStartDate());
  4593 + t.setZdsj(childTaskPlan.getEndDate());
  4594 + t.setQdzName(childTaskPlan.getStartStationName());
  4595 + t.setZdzName(childTaskPlan.getEndStationName());
  4596 + t.setRemarks(childTaskPlan.getRemarks());
  4597 + t.setAdjustExps("子");
  4598 + newList.add(t);
  4599 + }
  4600 + }
  4601 + }
  4602 +
4568 } 4603 }
4569 4604
4570 } 4605 }
src/main/java/com/bsth/service/report/ReportService.java
@@ -5,6 +5,7 @@ import java.util.Map; @@ -5,6 +5,7 @@ import java.util.Map;
5 5
6 import com.bsth.entity.StationRoute; 6 import com.bsth.entity.StationRoute;
7 import com.bsth.entity.excep.ArrivalInfo; 7 import com.bsth.entity.excep.ArrivalInfo;
  8 +import com.bsth.entity.mcy_forms.Singledata;
8 import com.bsth.entity.realcontrol.ScheduleRealInfo; 9 import com.bsth.entity.realcontrol.ScheduleRealInfo;
9 10
10 11
@@ -56,4 +57,6 @@ public interface ReportService { @@ -56,4 +57,6 @@ public interface ReportService {
56 List<Map<String, Object>> countDjg(Map<String, Object> map); 57 List<Map<String, Object>> countDjg(Map<String, Object> map);
57 58
58 Map<String, Object> online(Map<String, Object> map); 59 Map<String, Object> online(Map<String, Object> map);
  60 +
  61 + List<Singledata> singledatatj(Map<String, Object> map);
59 } 62 }
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -6,6 +6,7 @@ import com.bsth.entity.Personnel; @@ -6,6 +6,7 @@ import com.bsth.entity.Personnel;
6 import com.bsth.entity.StationRoute; 6 import com.bsth.entity.StationRoute;
7 import com.bsth.entity.excep.ArrivalInfo; 7 import com.bsth.entity.excep.ArrivalInfo;
8 import com.bsth.entity.mcy_forms.Daily; 8 import com.bsth.entity.mcy_forms.Daily;
  9 +import com.bsth.entity.mcy_forms.Singledata;
9 import com.bsth.entity.oil.Dlb; 10 import com.bsth.entity.oil.Dlb;
10 import com.bsth.entity.oil.Ylb; 11 import com.bsth.entity.oil.Ylb;
11 import com.bsth.entity.realcontrol.ChildTaskPlan; 12 import com.bsth.entity.realcontrol.ChildTaskPlan;
@@ -52,6 +53,9 @@ public class ReportServiceImpl implements ReportService{ @@ -52,6 +53,9 @@ public class ReportServiceImpl implements ReportService{
52 53
53 private Logger logger = LoggerFactory.getLogger(this.getClass()); 54 private Logger logger = LoggerFactory.getLogger(this.getClass());
54 55
  56 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  57 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  58 +
55 @Autowired 59 @Autowired
56 JdbcTemplate jdbcTemplate; 60 JdbcTemplate jdbcTemplate;
57 61
@@ -65,7 +69,10 @@ public class ReportServiceImpl implements ReportService{ @@ -65,7 +69,10 @@ public class ReportServiceImpl implements ReportService{
65 LineRepository lineRepository; 69 LineRepository lineRepository;
66 @Autowired 70 @Autowired
67 StationRouteRepository stationRouteRepository; 71 StationRouteRepository stationRouteRepository;
68 - 72 + @Autowired
  73 + CulateMileageService culateMileageService;
  74 +
  75 +
69 @Override 76 @Override
70 public List<ScheduleRealInfo> queryListBczx(String line, String date,String clzbh) { 77 public List<ScheduleRealInfo> queryListBczx(String line, String date,String clzbh) {
71 // TODO Auto-generated method stub 78 // TODO Auto-generated method stub
@@ -1895,7 +1902,7 @@ public class ReportServiceImpl implements ReportService{ @@ -1895,7 +1902,7 @@ public class ReportServiceImpl implements ReportService{
1895 if(cts != null && cts.size() > 0){ 1902 if(cts != null && cts.size() > 0){
1896 lists.add(s); 1903 lists.add(s);
1897 }else{ 1904 }else{
1898 - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ 1905 + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null && s.getZdsjActual().length() > 0 && s.getFcsjActual().length() > 0){
1899 lists.add(s); 1906 lists.add(s);
1900 } 1907 }
1901 } 1908 }
@@ -2633,7 +2640,7 @@ public class ReportServiceImpl implements ReportService{ @@ -2633,7 +2640,7 @@ public class ReportServiceImpl implements ReportService{
2633 if(cts != null && cts.size() > 0){ 2640 if(cts != null && cts.size() > 0){
2634 lists.add(s); 2641 lists.add(s);
2635 }else{ 2642 }else{
2636 - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ 2643 + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null && s.getZdsjActual().length() > 0 && s.getFcsjActual().length() > 0){
2637 lists.add(s); 2644 lists.add(s);
2638 } 2645 }
2639 } 2646 }
@@ -3243,7 +3250,7 @@ public class ReportServiceImpl implements ReportService{ @@ -3243,7 +3250,7 @@ public class ReportServiceImpl implements ReportService{
3243 if(cts != null && cts.size() > 0){ 3250 if(cts != null && cts.size() > 0){
3244 type_=true; 3251 type_=true;
3245 }else{ 3252 }else{
3246 - if(sinfo.getZdsjActual()!=null && sinfo.getFcsjActual()!=null){ 3253 + if(sinfo.getZdsjActual()!=null && sinfo.getFcsjActual()!=null && sinfo.getZdsjActual().length() > 0 && sinfo.getFcsjActual().length() > 0){
3247 type_=true; 3254 type_=true;
3248 } 3255 }
3249 } 3256 }
@@ -3549,6 +3556,393 @@ public class ReportServiceImpl implements ReportService{ @@ -3549,6 +3556,393 @@ public class ReportServiceImpl implements ReportService{
3549 } 3556 }
3550 return list; 3557 return list;
3551 } 3558 }
  3559 + @Override
  3560 + public List<Singledata> singledatatj(Map<String, Object> map) {
  3561 + String sfyy="";
  3562 + if(map.get("sfyy")!=null){
  3563 + sfyy=map.get("sfyy").toString();
  3564 + }
  3565 + String gsdm="";
  3566 + if(map.get("gsdmSing")!=null){
  3567 + gsdm=map.get("gsdmSing").toString();
  3568 + }
  3569 + String fgsdm="";
  3570 + if(map.get("fgsdmSing")!=null){
  3571 + fgsdm=map.get("fgsdmSing").toString();
  3572 + }
  3573 + String type="";
  3574 + if(map.get("type")!=null){
  3575 + type=map.get("type").toString();
  3576 + }
  3577 + String tjtype=map.get("tjtype").toString();
  3578 + String xlbm=map.get("line").toString().trim();
  3579 + String startDate = map.get("startDate").toString();
  3580 + String endDate = map.get("endDate").toString();
  3581 +
  3582 + List<ScheduleRealInfo> listReal=new ArrayList<ScheduleRealInfo>();
  3583 + if(xlbm.equals("")){
  3584 + listReal=scheduleRealInfoRepository.scheduleByDateAndLineTj(xlbm, startDate, endDate, gsdm, fgsdm);
  3585 + }else{
  3586 + listReal=scheduleRealInfoRepository.scheduleByDateAndLineTj2(xlbm, startDate, endDate);
  3587 + }
  3588 + List<Singledata> list=new ArrayList<Singledata>();
  3589 + List<Singledata> list_=new ArrayList<Singledata>();
  3590 + if(tjtype.equals("jsy")){
  3591 + //油统计
  3592 + String sql="select r.j_gh, r.xl_bm,r.cl_zbh,r.fgs_bm"
  3593 + + " from bsth_c_s_sp_info_real r where "
  3594 + + " r.schedule_date_str >= '"+startDate+"'"
  3595 + + " and r.schedule_date_str<='"+endDate+"'";
  3596 + if(xlbm.length() != 0){
  3597 + sql += " and r.xl_bm = '"+xlbm+"'";
  3598 + }
  3599 + if(gsdm.length() != 0){
  3600 + sql += " and r.gs_bm ='"+gsdm+"'";
  3601 + }
  3602 + if(fgsdm.length() != 0){
  3603 + sql += " and r.fgs_bm ='"+fgsdm+"'";
  3604 + }
  3605 + sql += " group by r.j_gh,r.xl_bm,r.cl_zbh order by r.xl_bm,r.cl_zbh";
  3606 +
  3607 + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
  3608 + @Override
  3609 + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
  3610 + Singledata sin = new Singledata();
  3611 + sin.setxL(arg0.getString("xl_bm"));
  3612 + sin.setJsy(arg0.getString("j_gh"));
  3613 + sin.setClzbh(arg0.getString("cl_zbh"));
  3614 + sin.setgS(arg0.getString("fgs_bm"));
  3615 + return sin;
  3616 + }
  3617 + });
  3618 +
  3619 +
  3620 + String linesql="";
  3621 + if(!xlbm.equals("")){
  3622 + linesql +=" and xlbm ='"+xlbm+"' ";
  3623 + }
  3624 + if(!gsdm.equals("")){
  3625 + linesql +=" and ssgsdm ='"+gsdm+"' ";
  3626 + }
  3627 + if(!fgsdm.equals("")){
  3628 + linesql +=" and fgsdm ='"+fgsdm+"' ";
  3629 + }
  3630 + /*String nysql="SELECT id,xlbm,nbbm,jsy,jzl as jzl,yh as yh,sh as sh,fgsdm FROM bsth_c_ylb"
  3631 + + " WHERE rq >= '"+startDate+"' and rq <='"+endDate+"'"
  3632 + + linesql
  3633 + + " union"
  3634 + + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh,fgsdm FROM bsth_c_dlb"
  3635 + + " WHERE rq = '"+startDate+"' and rq <='"+endDate+"'"
  3636 + + linesql;*/
  3637 +
  3638 + String nysql="SELECT 'yh' as type,xlbm,nbbm,jsy,sum(jzl*1000)/1000 as jzl,"
  3639 + + " sum(yh*1000)/1000 as yh,"
  3640 + + " sum(sh*1000)/1000 as sh FROM "
  3641 + + "bsth_c_ylb where rq>='"+startDate+"' "
  3642 + + " and rq <='"+endDate+"' " +linesql
  3643 + + " group by xlbm ,nbbm,jsy "
  3644 + + " union SELECT 'dh' as type,xlbm,nbbm,jsy, "
  3645 + + " sum(cdl*1000)/1000 as jzl,sum(hd*1000)/1000 as yh,"
  3646 + + " sum(sh * 1000) / 1000 AS sh"
  3647 + + " FROM bsth_c_dlb where rq>='"+startDate+"' "
  3648 + + " and rq <='"+endDate+"'" +linesql
  3649 + + " group by xlbm ,nbbm,jsy" ;
  3650 +
  3651 + List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() {
  3652 + @Override
  3653 + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
  3654 + Singledata sin = new Singledata();
  3655 + sin.setxL(arg0.getString("xlbm"));
  3656 + sin.setJsy(arg0.getString("jsy"));
  3657 + sin.setClzbh(arg0.getString("nbbm"));
  3658 + sin.setJzl(arg0.getString("jzl"));
  3659 + sin.setHyl(arg0.getString("yh"));
  3660 + sin.setUnyyyl(arg0.getString("sh"));
  3661 + return sin;
  3662 + }
  3663 + });
  3664 + //统计油,电表中手动添加的或者有加注没里程的数据
  3665 + for (int i = 0; i < listNy.size(); i++) {
  3666 + Singledata sin_=listNy.get(i);
  3667 + String jsy=sin_.getJsy();
  3668 + String line=sin_.getxL();
  3669 + String clzbh=sin_.getClzbh();
  3670 + boolean fages=true;
  3671 + for (int j = 0; j < list.size(); j++) {
  3672 + Singledata sin=list.get(j);
  3673 + String jsy_=sin.getJsy();
  3674 + String line_=sin.getxL();
  3675 + String clzbh_=sin.getClzbh();
  3676 + if(jsy.equals(jsy_)
  3677 + &&line.equals(line_)
  3678 + &&clzbh.equals(clzbh_)){
  3679 + fages=false;
  3680 + }
  3681 + }
  3682 + if(fages){
  3683 + Singledata s=new Singledata();
  3684 + s.setJsy(jsy);
  3685 + s.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  3686 + s.setClzbh(clzbh);
  3687 + s.setSgh("");
  3688 + s.setsName("");
  3689 + s.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  3690 + s.setxL(line);
  3691 + s.setXlmc(BasicData.lineCodeAllNameMap.get(line));
  3692 + s.setJzl(sin_.getJzl());
  3693 + s.setHyl(sin_.getHyl());
  3694 + s.setUnyyyl(sin_.getUnyyyl());
  3695 + s.setJhlc("0.0");
  3696 + s.setEmptMileage("0.0");
  3697 + s.setJhjl("0.0");
  3698 + if(startDate.equals(endDate))
  3699 + s.setrQ(startDate);
  3700 + else
  3701 + s.setrQ(startDate+"-"+endDate);
  3702 +
  3703 + list_.add(s);
  3704 + }
  3705 + }
  3706 + for (int i= 0; i < list.size(); i++) {
  3707 + Singledata sin=list.get(i);
  3708 + String jsy=sin.getJsy();
  3709 + String line=sin.getxL();
  3710 + String clzbh=sin.getClzbh();
  3711 + double jzl=0.0;
  3712 + double yh=0.0;
  3713 + double sh=0.0;
  3714 + for (int j = 0; j < listNy.size(); j++) {
  3715 + Singledata y=listNy.get(j);
  3716 + if(y.getJsy().equals(jsy)
  3717 + &&y.getClzbh().equals(clzbh)
  3718 + &&y.getxL().equals(line)){
  3719 + jzl=Arith.add(jzl, y.getJzl());
  3720 + yh=Arith.add(yh, y.getHyl());
  3721 + sh=Arith.add(sh, y.getUnyyyl());
  3722 + }
  3723 + }
  3724 + sin.setHyl(String.valueOf(yh));
  3725 + sin.setJzl(String.valueOf(jzl));
  3726 + sin.setUnyyyl(String.valueOf(sh));
  3727 +
  3728 + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  3729 + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>();
  3730 + for (int j = 0; j < listReal.size(); j++) {
  3731 + ScheduleRealInfo s=listReal.get(j);
  3732 + if(s.getjGh().equals(jsy)
  3733 + && s.getClZbh().equals(clzbh)
  3734 + &&s.getXlBm().equals(line)){
  3735 + newList.add(s);
  3736 + Set<ChildTaskPlan> cts = s.getcTasks();
  3737 + if(cts != null && cts.size() > 0){
  3738 + newList_.add(s);
  3739 + }else{
  3740 + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
  3741 + newList_.add(s);
  3742 + }
  3743 + }
  3744 + }
  3745 + }
  3746 + double jhgl=culateMileageService.culateJhgl(newList);
  3747 + double jhjcc=culateMileageService.culateJhJccgl(newList);
  3748 + double yygl=culateMileageService.culateSjgl(newList_);
  3749 + double ljgl=culateMileageService.culateLjgl(newList_);
  3750 + double ksgl=culateMileageService.culateKsgl(newList_);
  3751 + double jcgl=culateMileageService.culateJccgl(newList_);
  3752 +
  3753 + double zyygl=Arith.add(yygl, ljgl);
  3754 + double zksgl=Arith.add(ksgl, jcgl);
  3755 + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl)));
  3756 + sin.setEmptMileage(String.valueOf(zksgl));
  3757 + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
  3758 + if(newList.size()>0){
  3759 + sin.setXlmc(newList.get(0).getXlName());
  3760 + sin.setjName(newList.get(0).getjName());
  3761 + }else{
  3762 + sin.setXlmc(BasicData.lineCodeAllNameMap.get(line));
  3763 + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  3764 +
  3765 + }
  3766 + if(startDate.equals(endDate))
  3767 + sin.setrQ(startDate);
  3768 + else
  3769 + sin.setrQ(startDate+"-"+endDate);
  3770 +// sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  3771 + sin.setSgh("");
  3772 + sin.setsName("");
  3773 + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  3774 + list_.add(sin);
  3775 +
  3776 + }
  3777 + }else{
  3778 + String sql="select r.s_gh,r.s_name, "
  3779 + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm"
  3780 + + " from bsth_c_s_sp_info_real r where "
  3781 + + " r.schedule_date_str >= '"+startDate+"'"
  3782 + + " schedule_date_str <='"+endDate+"'"
  3783 + + " and r.s_gh !='' and r.s_gh is not null ";
  3784 + if(!xlbm.equals("")){
  3785 + sql += " and r.xl_bm = '"+xlbm+"'";
  3786 + }
  3787 + if(!gsdm.equals("")){
  3788 + sql += " and r.gs_bm = '"+gsdm+"'";
  3789 + }
  3790 + if(!fgsdm.equals("")){
  3791 + sql += " and r.fgs_bm = '"+fgsdm+"'";
  3792 + }
  3793 + sql += " group by r.s_gh,r.s_name,"
  3794 + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh";
  3795 +
  3796 + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
  3797 + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  3798 + @Override
  3799 + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
  3800 + Singledata sin = new Singledata();
  3801 +// sin.setrQ(startDate);
  3802 + sin.setxL(arg0.getString("xl_bm"));
  3803 + sin.setClzbh(arg0.getString("cl_zbh"));
  3804 + sin.setSgh(arg0.getString("s_gh"));
  3805 + sin.setsName(arg0.getString("s_name"));
  3806 + sin.setgS(arg0.getString("fgs_bm"));
  3807 + return sin;
  3808 + }
  3809 + });
  3810 +
  3811 + String spy="";
  3812 + if(map.get("map")!=null){
  3813 + spy=map.get("spy").toString();
  3814 + }
  3815 + for (int i = 0; i < list.size(); i++) {
  3816 + Singledata sin=list.get(i);
  3817 + sin.setrQ(startDate+"-"+endDate);
  3818 + String jsy=sin.getSgh();
  3819 + String line=sin.getxL();
  3820 + String clzbh=sin.getClzbh();
  3821 + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  3822 + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>();
  3823 +
  3824 + for (int j = 0; j < listReal.size(); j++) {
  3825 + ScheduleRealInfo s=listReal.get(j);
  3826 + if(s.getsGh().equals(jsy) && s.getClZbh().equals(clzbh)
  3827 + &&s.getXlBm().equals(line)){
  3828 + newList.add(s);
  3829 + Set<ChildTaskPlan> cts = s.getcTasks();
  3830 + if(cts != null && cts.size() > 0){
  3831 + newList_.add(s);
  3832 + }else{
  3833 + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
  3834 + newList_.add(s);
  3835 + }
  3836 + }
  3837 + }
  3838 + }
  3839 + double jhgl=culateMileageService.culateJhgl(newList);;
  3840 + double jhjcc=culateMileageService.culateJhJccgl(newList);
  3841 + double yygl=0.0;
  3842 + double ljgl=0.0;
  3843 + double zksgl=0.0;
  3844 + if(spy.equals("zrw")){
  3845 + yygl=culateMileageService.culateSjgl_spy(newList_);
  3846 + ljgl=culateMileageService.culateLjgl_spy(newList_);
  3847 + zksgl=culateMileageService.culateSjfyylc_spy(newList_);
  3848 + }else{
  3849 + yygl=culateMileageService.culateSjgl(newList_);
  3850 + ljgl=culateMileageService.culateLjgl(newList_);
  3851 + double ksgl=culateMileageService.culateKsgl(newList_);
  3852 + double jcgl=culateMileageService.culateJccgl(newList_);
  3853 + zksgl=Arith.add(ksgl, jcgl);
  3854 + }
  3855 + double zyygl=Arith.add(yygl, ljgl);
  3856 + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl)));
  3857 + sin.setEmptMileage(String.valueOf(zksgl));
  3858 + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
  3859 + if(newList.size()>0)
  3860 + sin.setXlmc(newList.get(0).getXlName());
  3861 + else
  3862 + sin.setXlmc(BasicData.lineCodeAllNameMap.get(line));
  3863 + sin.setClzbh(clzbh);
  3864 + sin.setJsy("");
  3865 + sin.setjName("");
  3866 + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  3867 + sin.setHyl("");
  3868 + sin.setJzl("");
  3869 + sin.setUnyyyl("");
  3870 + list_.add(sin);
  3871 + }
  3872 + }
  3873 +
  3874 + /*Map<String, Boolean> lineNature = lineService.lineNature();
  3875 + List<Singledata> resList = new ArrayList<Singledata>();
  3876 + for(Singledata s : list_){
  3877 + String xlBm = s.getxL();
  3878 + if(sfyy.length() != 0){
  3879 + if(sfyy.equals("0")){
  3880 + resList.add(s);
  3881 + } else if(sfyy.equals("1")){
  3882 + if(lineNature.containsKey(xlBm) && lineNature.get(xlBm)){
  3883 + resList.add(s);
  3884 + }
  3885 + } else {
  3886 + if(lineNature.containsKey(xlBm) && !lineNature.get(xlBm)){
  3887 + resList.add(s);
  3888 + }
  3889 + }
  3890 + } else {
  3891 + resList.add(s);
  3892 + }
  3893 + }*/
  3894 +
  3895 +
  3896 + if (type.equals("export")) {
  3897 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  3898 + ReportUtils ee = new ReportUtils();
  3899 +
  3900 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  3901 + int i = 1;
  3902 + for (Singledata l : list_) {
  3903 + Map<String, Object> m = new HashMap<String, Object>();
  3904 + m.put("i", i);
  3905 + m.put("rQ", l.getrQ());
  3906 + m.put("gS", l.getgS());
  3907 + m.put("xL", l.getXlmc());
  3908 + m.put("clzbh", l.getClzbh());
  3909 + m.put("jsy", l.getJsy());
  3910 + m.put("jName", l.getjName());
  3911 + m.put("sgh", l.getSgh());
  3912 + m.put("sName", l.getsName());
  3913 + m.put("jhlc", l.getJhlc());
  3914 + m.put("emptMileage", l.getEmptMileage());
  3915 + m.put("hyl", l.getHyl());
  3916 + m.put("jzl", l.getJzl());
  3917 + m.put("unyyyl", l.getUnyyyl());
  3918 + m.put("jhjl", l.getJhjl());
  3919 + resList.add(m);
  3920 +
  3921 + i++;
  3922 + }
  3923 +
  3924 + listI.add(resList.iterator());
  3925 + try {
  3926 + String exportDate="";
  3927 + if(startDate.equals(endDate)){
  3928 + exportDate =sdfSimple.format(sdfMonth.parse(startDate)) ;
  3929 + }else{
  3930 + exportDate =sdfSimple.format(sdfMonth.parse(startDate))+"-"+sdfSimple.format(sdfMonth.parse(endDate)) ;
  3931 + }
  3932 + String lineName = "";
  3933 + if(map.containsKey("lineName"))
  3934 + lineName = map.get("lineName").toString();
  3935 +
  3936 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  3937 + ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls",
  3938 + path + "export/" +exportDate
  3939 + + "-" + lineName + "-路单统计.xls");
  3940 + } catch (ParseException e) {
  3941 + e.printStackTrace();
  3942 + }
  3943 + }
  3944 + return list_;
  3945 + }
3552 3946
3553 3947
3554 } 3948 }
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
@@ -385,9 +385,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -385,9 +385,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
385 // zgfEnd = sdf.parse(date + "08:30").getTime(); 385 // zgfEnd = sdf.parse(date + "08:30").getTime();
386 // wgfBegin = sdf.parse(date + "16:00").getTime(); 386 // wgfBegin = sdf.parse(date + "16:00").getTime();
387 // wgfEnd = sdf.parse(date + "18:00").getTime(); 387 // wgfEnd = sdf.parse(date + "18:00").getTime();
388 - zgfBegin = 6l * 60l + 30l; 388 + zgfBegin = 6l * 60l + 31l;
389 zgfEnd = 8l * 60l + 30l; 389 zgfEnd = 8l * 60l + 30l;
390 - wgfBegin = 16l * 60l + 0l; 390 + wgfBegin = 16l * 60l + 1l;
391 wgfEnd = 18l * 60l + 0l; 391 wgfEnd = 18l * 60l + 0l;
392 } catch (Exception e) { 392 } catch (Exception e) {
393 // TODO Auto-generated catch block 393 // TODO Auto-generated catch block
@@ -414,15 +414,23 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -414,15 +414,23 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
414 subCompanyName = schedule.getFgsName(); 414 subCompanyName = schedule.getFgsName();
415 415
416 //早晚高峰时段执行率 416 //早晚高峰时段执行率
417 - if(schedule.getFcsjT() >= zgfBegin && schedule.getFcsjT() <= zgfEnd){  
418 - jhzgf++;  
419 - if(schedule.getFcsjActual() != null) 417 + if(!schedule.getBcType().equals("in") && !schedule.getBcType().equals("out") && !schedule.getBcType().equals("ldks")){
  418 + if(schedule.getFcsjT() >= zgfBegin && schedule.getFcsjT() <= zgfEnd){
  419 + jhzgf++;
  420 + }
  421 + if(schedule.getFcsjActual() != null && !schedule.isDestroy()
  422 + && schedule.getFcsjActualTime() >= zgfBegin
  423 + && schedule.getFcsjActualTime() <= zgfEnd){
420 sjzgf++; 424 sjzgf++;
421 - }  
422 - if(schedule.getFcsjT() >= wgfBegin && schedule.getFcsjT() <= wgfEnd){  
423 - jhwgf++;  
424 - if(schedule.getFcsjActual() != null) 425 + }
  426 + if(schedule.getFcsjT() >= wgfBegin && schedule.getFcsjT() <= wgfEnd){
  427 + jhwgf++;
  428 + }
  429 + if(schedule.getFcsjActual() != null && !schedule.isDestroy()
  430 + && schedule.getFcsjActualTime() >= wgfBegin
  431 + && schedule.getFcsjActualTime() <= wgfEnd){
425 sjwgf++; 432 sjwgf++;
  433 + }
426 } 434 }
427 435
428 //班次数和出场数 436 //班次数和出场数
@@ -1262,8 +1270,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1262,8 +1270,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1262 1270
1263 try { 1271 try {
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," 1272 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,"
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"  
1266 - + " where schedule_date_str = '"+date+"'" 1273 + + " a.xl_bm, a.fgs_bm, a.cc_service, (select start_opt from bsth_c_line_config where id ="
  1274 + + " (select max(id) from bsth_c_line_config where line = (select id from bsth_c_line where line_code = a.xl_bm))) start_opt"
  1275 + + " from bsth_c_s_sp_info_real a where schedule_date_str = '"+date+"'"
1267 + " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'"; 1276 + " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'";
1268 if(line.trim().length() != 0) 1277 if(line.trim().length() != 0)
1269 sql += " and xl_bm = '"+line+"'"; 1278 sql += " and xl_bm = '"+line+"'";
@@ -1294,7 +1303,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1294,7 +1303,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1294 schedule.setFgsBm(rs.getString("fgs_bm")); 1303 schedule.setFgsBm(rs.getString("fgs_bm"));
1295 schedule.setCcService(rs.getBoolean("cc_service")); 1304 schedule.setCcService(rs.getBoolean("cc_service"));
1296 1305
1297 - int startOpt = 0; 1306 + int startOpt = 120;
1298 if(rs.getString("start_opt") != null && rs.getString("start_opt").trim().length() != 0){ 1307 if(rs.getString("start_opt") != null && rs.getString("start_opt").trim().length() != 0){
1299 String[] split = rs.getString("start_opt").split(":"); 1308 String[] split = rs.getString("start_opt").split(":");
1300 startOpt = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); 1309 startOpt = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
@@ -1533,9 +1542,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1533,9 +1542,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1533 1542
1534 try { 1543 try {
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," 1544 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,"
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"  
1538 - + " where schedule_date_str >= '"+startDate+"' and schedule_date_str <= '"+endDate+"'" 1545 + + " a.fgs_bm, a.cc_service, a.remarks, a.adjust_exps, (select start_opt from bsth_c_line_config where id = "
  1546 + + " (select max(id) from bsth_c_line_config where line = (select id from bsth_c_line where line_code = a.xl_bm))) start_opt"
  1547 + + " from bsth_c_s_sp_info_real a where schedule_date_str >= '"+startDate+"' and schedule_date_str <= '"+endDate+"'"
1539 + " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'"; 1548 + " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'";
1540 if(line.length() != 0) 1549 if(line.length() != 0)
1541 sql += " and xl_bm = '"+line+"'"; 1550 sql += " and xl_bm = '"+line+"'";
@@ -1567,8 +1576,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1567,8 +1576,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1567 schedule.setCcService(rs.getBoolean("cc_service")); 1576 schedule.setCcService(rs.getBoolean("cc_service"));
1568 schedule.setRemarks(rs.getString("remarks")!=null?rs.getString("remarks"):""); 1577 schedule.setRemarks(rs.getString("remarks")!=null?rs.getString("remarks"):"");
1569 schedule.setAdjustExps(rs.getString("adjust_exps")!=null?rs.getString("adjust_exps"):""); 1578 schedule.setAdjustExps(rs.getString("adjust_exps")!=null?rs.getString("adjust_exps"):"");
1570 -  
1571 - int startOpt = 0; 1579 +
  1580 + int startOpt = 120;
1572 if(rs.getString("start_opt") != null && rs.getString("start_opt").trim().length() != 0){ 1581 if(rs.getString("start_opt") != null && rs.getString("start_opt").trim().length() != 0){
1573 String[] split = rs.getString("start_opt").split(":"); 1582 String[] split = rs.getString("start_opt").split(":");
1574 startOpt = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); 1583 startOpt = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
src/main/resources/static/index.html
@@ -632,6 +632,7 @@ @@ -632,6 +632,7 @@
632 data-exclude=1></script> 632 data-exclude=1></script>
633 <!-- echarts4 误删 --> 633 <!-- echarts4 误删 -->
634 <script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script> 634 <script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script>
  635 +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script>
635 636
636 </body> 637 </body>
637 </html> 638 </html>
638 \ No newline at end of file 639 \ No newline at end of file
src/main/resources/static/pages/electricity/list/list.html
@@ -183,7 +183,11 @@ @@ -183,7 +183,11 @@
183 {{obj.gsname}} 183 {{obj.gsname}}
184 </td> 184 </td>
185 <td> 185 <td>
186 - {{obj.xlname}} 186 + {{if obj.linename=='' || obj.linename==null}}
  187 + {{obj.xlname}}
  188 + {{else}}
  189 + {{obj.linename}}
  190 + {{/if}}
187 </td> 191 </td>
188 <td> 192 <td>
189 <lable data-id="{{obj.id}}" class="in_carpark_nbbm">{{obj.nbbm}}</lable> 193 <lable data-id="{{obj.id}}" class="in_carpark_nbbm">{{obj.nbbm}}</lable>
@@ -194,7 +198,11 @@ @@ -194,7 +198,11 @@
194 <input data-id="{{obj.id}}" style=" width:100%" type="text" class="in_carpark_jsy" ></input> 198 <input data-id="{{obj.id}}" style=" width:100%" type="text" class="in_carpark_jsy" ></input>
195 <button class="btn btn-sm blue btn-jsyUpdate" style=" width:100%" data-id="{{obj.id}}">填写工号</button> 199 <button class="btn btn-sm blue btn-jsyUpdate" style=" width:100%" data-id="{{obj.id}}">填写工号</button>
196 {{else}} 200 {{else}}
197 - {{obj.jsy}}/{{obj.name}} 201 + {{if obj.jname=='' || obj.jname==null}}
  202 + {{obj.jsy}}/{{obj.name}}
  203 + {{else}}
  204 + {{obj.jsy}}/{{obj.jname}}
  205 + {{/if}}
198 {{/if}} 206 {{/if}}
199 </td> 207 </td>
200 <td> 208 <td>
src/main/resources/static/pages/forms/calc/calcjsyspy.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid;
  11 + text-align: center; }
  12 + .table-bordered > thead > tr > th,
  13 + .table-bordered > thead > tr > td {
  14 + border-bottom-width: 2px;
  15 + text-align: center; }
  16 +
  17 + .table > tbody + tbody {
  18 + border-top: 1px solid; }
  19 +</style>
  20 +
  21 +<div class="page-head">
  22 + <div class="page-title">
  23 + <h1>人车班次公里统计</h1>
  24 + </div>
  25 +</div>
  26 +
  27 +<div class="row">
  28 + <div class="col-md-12">
  29 + <div class="portlet light porttlet-fit bordered">
  30 + <div class="portlet-title">
  31 + <form class="form-inline" action="">
  32 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_manth">
  33 + <span class="item-label" style="width: 80px;">公司: </span>
  34 + <select class="form-control" name="company" id="gsdmManth" style="width: 140px;"></select>
  35 + </div>
  36 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_manth">
  37 + <span class="item-label" style="width: 80px;">分公司: </span>
  38 + <select class="form-control" name="subCompany" id="fgsdmManth" style="width: 140px;"></select>
  39 + </div>
  40 + <div style="display: inline-block;margin-left: 10px">
  41 + <span class="item-label" style="width: 150px;">线路: </span>
  42 + <select class="form-control" name="line" id="line" style="width: 136px;"></select>
  43 + </div>
  44 + <div style="margin-top: 10px">
  45 +
  46 + </div>
  47 + <div style="display: inline-block;margin-left: 5px;">
  48 + <span class="item-label" style="width: 80px;">开始时间: </span>
  49 + <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
  50 + </div>
  51 + <div style="display: inline-block;margin-left: 10px;">
  52 + <span class="item-label" style="width: 80px;">结束时间: </span>
  53 + <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
  54 + </div>
  55 + <div style="display: inline-block;margin-left: 10px">
  56 + <span class="item-label" style="width: 80px;">统计: </span>
  57 + <select class="form-control" style="width: 136px;" id='empnames'>
  58 + <option value="驾驶员">驾驶员</option>
  59 + <option value="售票员">售票员</option>
  60 + <option value="车辆自编号">车辆自编号</option>
  61 + </select>
  62 + </div>
  63 + <div style="display: inline-block;margin-left: 0px">
  64 + <span class="item-label" style="width: 150px;">:</span>
  65 + <input class="form-control" name="cont" id="cont" style="width: 136px;"></input>
  66 + </div>
  67 + <div class="form-group">
  68 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  69 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  70 + </div>
  71 + </form>
  72 + </div>
  73 + <div class="portlet-body">
  74 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  75 + <table class="table table-bordered table-hover table-checkable" id="forms">
  76 + <thead>
  77 + <tr>
  78 + <th>序号</th>
  79 + <th id='empname'>驾驶员</th>
  80 + <th>计划营运班次</th>
  81 + <th>实际营运班次</th>
  82 + <th>烂班班次</th>
  83 + <th>临加班次</th>
  84 + <th>计划总里程</th>
  85 + <th>计划营运里程</th>
  86 + <th>计划空驶里程</th>
  87 + <th>实际总里程</th>
  88 + <th>实际营运里程</th>
  89 + <th>实际空驶里程</th>
  90 + <th>烂班里程</th>
  91 + <th>临加营运里程</th>
  92 + <th>临加空驶里程</th>
  93 + </tr>
  94 + </thead>
  95 + <tbody>
  96 +
  97 + </tbody>
  98 + </table>
  99 + </div>
  100 + </div>
  101 + </div>
  102 + </div>
  103 +</div>
  104 +
  105 +<script>
  106 + $(function(){
  107 + // 关闭左侧栏
  108 + if (!$('body').hasClass('page-sidebar-closed'))
  109 + $('.menu-toggler.sidebar-toggler').click();
  110 +
  111 + var d = new Date();
  112 + d.setTime(d.getTime() - 1*1000*60*60*24);
  113 + var year = d.getFullYear();
  114 + var month = d.getMonth() + 1;
  115 + var day = d.getDate();
  116 + if(month < 10)
  117 + month = "0" + month;
  118 + if(day < 10)
  119 + day = "0" + day;
  120 + var dateTime = year + "-" + month + "-" + day;
  121 + $("#startDate,#endDate").datetimepicker({
  122 + format : 'YYYY-MM-DD',
  123 + locale : 'zh-cn',
  124 + maxDate : dateTime
  125 + });
  126 + $("#startDate,#endDate").val(year + "-" + month + "-" + day);
  127 +
  128 + var fage=false;
  129 + var obj = [];
  130 + var xlList;
  131 + $.get('/report/lineList',function(result){
  132 + xlList=result;
  133 + $.get('/user/companyData', function(result){
  134 + obj = result;
  135 + var options = '';
  136 + for(var i = 0; i < obj.length; i++){
  137 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  138 + }
  139 +
  140 + if(obj.length ==0){
  141 + $("#gsdmDiv_manth").css('display','none');
  142 + $('#fgsdmDiv_manth').css('display','none');
  143 + }else if(obj.length ==1){
  144 + $("#gsdmDiv_manth").css('display','none');
  145 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  146 + $('#fgsdmDiv_manth').css('display','none');
  147 + }
  148 + $('#gsdmManth').html(options);
  149 + updateCompany();
  150 + });
  151 + })
  152 + $("#gsdmManth").on("change",updateCompany);
  153 + function updateCompany(){
  154 + var company = $('#gsdmManth').val();
  155 + var options = '<option value="">全部分公司</option>';
  156 + for(var i = 0; i < obj.length; i++){
  157 + if(obj[i].companyCode == company){
  158 + var children = obj[i].children;
  159 + for(var j = 0; j < children.length; j++){
  160 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  161 + }
  162 + }
  163 + }
  164 + $('#fgsdmManth').html(options);
  165 + }
  166 +
  167 +
  168 + var tempData = {};
  169 + $.get('/report/lineList',function(xlList){
  170 + var data = [];
  171 + data.push({id: " ", text: "全部线路"});
  172 + $.get('/user/companyData', function(result){
  173 + for(var i = 0; i < result.length; i++){
  174 + var companyCode = result[i].companyCode;
  175 + var children = result[i].children;
  176 + for(var j = 0; j < children.length; j++){
  177 + var code = children[j].code;
  178 + for(var k=0;k < xlList.length;k++ ){
  179 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  180 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  181 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  182 + }
  183 + }
  184 + }
  185 + }
  186 + initPinYinSelect2('#line',data,'');
  187 +
  188 + });
  189 + });
  190 +
  191 + $("#line").on("change", function(){
  192 + if($("#line").val() == " "){
  193 + $("#gsdmManth").attr("disabled", false);
  194 + $("#fgsdmManth").attr("disabled", false);
  195 + } else {
  196 + var temp = tempData[$("#line").val()].split(":");
  197 + $("#gsdmManth").val(temp[0]);
  198 + updateCompany();
  199 + $("#fgsdmManth").val(temp[1]);
  200 + $("#gsdmManth").attr("disabled", true);
  201 +// $("#fgsdmManth").attr("disabled", true);
  202 + }
  203 + });
  204 +
  205 + var cont = "驾驶员", cont1 = "", cont2 = "", cont3 = "";
  206 + $("#empnames").on("change",function(){
  207 + if(cont == "驾驶员"){
  208 + cont1 = $("#cont").val();
  209 + } else if(cont == "售票员"){
  210 + cont2 = $("#cont").val();
  211 + } else if(cont == "车辆自编号"){
  212 + cont3 = $("#cont").val();
  213 + }
  214 + cont = $("#empnames").val();
  215 + if($("#empnames").val() == "驾驶员"){
  216 + $("#cont").val(cont1);
  217 + } else if($("#empnames").val() == "售票员"){
  218 + $("#cont").val(cont2);
  219 + } else if($("#empnames").val() == "车辆自编号"){
  220 + $("#cont").val(cont3);
  221 + }
  222 + });
  223 +
  224 + $("#query").on("click",function(){
  225 + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
  226 + layer.msg("请选择时间范围!");
  227 + return;
  228 + }
  229 + if($("#endDate").val() == null || $("#endDate").val().trim().length == 0){
  230 + layer.msg("请选择时间范围!");
  231 + return;
  232 + }
  233 + $("#empname").html($("#empnames").val())
  234 + var params={};
  235 + params.empnames=$("#empnames").val();
  236 + params.cont = $("#cont").val();
  237 + params.line = $("#line").val();
  238 + params.startDate = $("#startDate").val();
  239 + params.endDate = $("#endDate").val();
  240 + params.lpName = $("#lpName").val();
  241 + params.gsdmManth= $("#gsdmManth").val();
  242 + params.fgsdmManth= $("#fgsdmManth").val();
  243 + var i = layer.load(2);
  244 + $get("/calc_mix/calcjsyspy",params,function(result){
  245 +
  246 + var list_calcjsyspy = template('list_calcjsyspy',{list:result});
  247 + // 把渲染好的模版html文本追加到表格中
  248 + $('#forms tbody').html(list_calcjsyspy);
  249 + layer.close(i);
  250 +
  251 + });
  252 + });
  253 +
  254 + $("#export").on("click",function(){
  255 + var lineName = $('#line option:selected').text();
  256 + var startDate = $("#startDate").val();
  257 + var endDate = $("#endDate").val();
  258 + var params={};
  259 + params.empnames=$("#empnames").val();
  260 + params.cont = $("#cont").val();
  261 + params.line = $("#line").val();
  262 + params.startDate = $("#startDate").val();
  263 + params.endDate = $("#endDate").val();
  264 + params.lpName = $("#lpName").val();
  265 + params.gsdmManth= $("#gsdmManth").val();
  266 + params.fgsdmManth= $("#fgsdmManth").val();
  267 + params.lineName = lineName;
  268 + params.type='export';
  269 + var i = layer.load(2);
  270 + $get('/calc_export/waybilldayExport',params,function(result){
  271 + var dateTime = "";
  272 + if(startDate == endDate){
  273 + dateTime = moment(startDate).format("YYYYMMDD");
  274 + } else {
  275 + dateTime = moment(startDate).format("YYYYMMDD")
  276 + +"-"+moment(endDate).format("YYYYMMDD");
  277 + }
  278 + window.open("/downloadFile/download?fileName="
  279 + +dateTime+"-"+lineName+"-人车班次公里统计");
  280 + layer.close(i);
  281 + });
  282 + });
  283 +
  284 + });
  285 +
  286 +
  287 +</script>
  288 +<script type="text/html" id="list_calcjsyspy">
  289 + {{each list as obj i}}
  290 + <tr>
  291 + <td>{{i+1}}</td>
  292 + <td>{{obj.jName}}</td>
  293 + <td>{{obj.jhyybc}}</td>
  294 + <td>{{obj.sjyybc}}</td>
  295 + <td>{{obj.lbbc}}</td>
  296 + <td>{{obj.ljbc}}</td>
  297 + <td>{{obj.jhzlc}}</td>
  298 + <td>{{obj.jhyylc}}</td>
  299 + <td>{{obj.jhfyylc}}</td>
  300 + <td>{{obj.sjzlc}}</td>
  301 + <td>{{obj.sjyylc}}</td>
  302 + <td>{{obj.sjfyylc}}</td>
  303 + <td>{{obj.lblc}}</td>
  304 + <td>{{obj.ljyylc}}</td>
  305 + <td>{{obj.ljfyylc}}</td>
  306 + </tr>
  307 + {{/each}}
  308 + {{if list.length == 0}}
  309 + <tr>
  310 + <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td>
  311 + </tr>
  312 + {{/if}}
  313 +</script>
0 \ No newline at end of file 314 \ No newline at end of file
src/main/resources/static/pages/forms/calc/calcsingledata.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 +</style>
  19 +
  20 +<div class="page-head">
  21 + <div class="page-title">
  22 + <h1>路单数据(统计)</h1>
  23 + </div>
  24 +</div>
  25 +
  26 +<div class="row">
  27 + <div class="col-md-12">
  28 + <div class="portlet light porttlet-fit bordered">
  29 + <div class="portlet-title">
  30 + <form class="form-inline" action="">
  31 + <div style="display: inline-block; margin-left: 31px;" id="gsdmDiv_sing">
  32 + <span class="item-label" style="width: 80px;">公司: </span>
  33 + <select class="form-control" name="company" id="gsdmSing" style="width: 140px;"></select>
  34 + </div>
  35 + <div style="display: inline-block; margin-left: 22px;" id="fgsdmDiv_sing">
  36 + <span class="item-label" style="width: 80px;">分公司: </span>
  37 + <select class="form-control" name="subCompany" id="fgsdmSing" style="width: 140px;"></select>
  38 + </div>
  39 + <div style="display: inline-block; margin-left: 31px;">
  40 + <span class="item-label" style="width: 80px;">线路: </span>
  41 + <select class="form-control" name="line" id="line" style="width: 140px;"></select>
  42 + </div>
  43 + <div style="margin-top: 10px"></div>
  44 + <div style="display: inline-block;margin-left: 3px;">
  45 + <span class="item-label" style="width: 140px;">开始时间: </span>
  46 + <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
  47 + </div>
  48 + <div style="display: inline-block;margin-left: 8px;">
  49 + <span class="item-label" style="width: 140px;">结束时间: </span>
  50 + <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
  51 + </div>
  52 + <div style="display: inline-block;margin-left: 31px">
  53 + <span class="item-label" style="width: 150px;">统计: </span>
  54 + <select class="form-control" name="tjtype" id="tjtype" style="width: 140px;">
  55 + <option value="驾驶员">驾驶员</option>
  56 + <option value="售票员">售票员</option>
  57 + <option value="车辆自编号">车辆自编号</option>
  58 + </select>
  59 + <div style="display: inline-block;margin-left: 0px">
  60 + <span class="item-label" style="width: 150px;">:</span>
  61 + <input class="form-control" name="cont" id="cont" style="width: 136px;"></input>
  62 + </div>
  63 + </div>
  64 + <div class="form-group">
  65 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  66 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  67 + </div>
  68 + </form>
  69 + </div>
  70 + <div class="portlet-body">
  71 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  72 + <table class="table table-bordered table-hover table-checkable" id="forms">
  73 + <thead>
  74 + <tr>
  75 + <th>序号</th>
  76 + <th>所属公司</th>
  77 + <th>线路</th>
  78 + <th id='empname'>驾驶员</th>
  79 + <th>行驶里程(包括空放)</th>
  80 + <th>空驶里程</th>
  81 + <th>耗油量</th>
  82 + <th>加注量</th>
  83 + <th>非营业用油</th>
  84 + <th>计划公里</th>
  85 + </tr>
  86 + </thead>
  87 + <tbody>
  88 +
  89 + </tbody>
  90 + </table>
  91 + </div>
  92 + </div>
  93 + </div>
  94 + </div>
  95 +</div>
  96 +
  97 +<script>
  98 + $(function(){
  99 + // 关闭左侧栏
  100 + if (!$('body').hasClass('page-sidebar-closed'))
  101 + $('.menu-toggler.sidebar-toggler').click();
  102 +
  103 + $("#startDate,#endDate").datetimepicker({
  104 + format : 'YYYY-MM-DD',
  105 + locale : 'zh-cn'
  106 + });
  107 +
  108 + var d = new Date();
  109 + var year = d.getFullYear();
  110 + var month = d.getMonth() + 1;
  111 + var day = d.getDate();
  112 + if(month < 10)
  113 + month = "0" + month;
  114 + if(day < 10)
  115 + day = "0" + day;
  116 + $("#startDate,#endDate").val(year + "-" + month + "-" + day);
  117 +
  118 + var fage=false;
  119 + var xlList;
  120 + var obj = [];
  121 +
  122 + $.get('/report/lineList',function(result){
  123 + xlList=result;
  124 + $.get('/user/companyData', function(result){
  125 + obj = result;
  126 + var options = '';
  127 + for(var i = 0; i < obj.length; i++){
  128 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  129 + }
  130 +
  131 + if(obj.length ==0){
  132 + $("#gsdmDiv_sing").css('display','none');
  133 + }else if(obj.length ==1){
  134 + $("#gsdmDiv_sing").css('display','none');
  135 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  136 + $('#fgsdmDiv_sing').css('display','none');
  137 + }
  138 + $('#gsdmSing').html(options);
  139 + updateCompany();
  140 + });
  141 + })
  142 + $("#gsdmSing").on("change",updateCompany);
  143 + function updateCompany(){
  144 + var company = $('#gsdmSing').val();
  145 +// var options = '<option value="">全部分公司</option>';
  146 + var options ='';
  147 + for(var i = 0; i < obj.length; i++){
  148 + if(obj[i].companyCode == company){
  149 + var children = obj[i].children;
  150 + for(var j = 0; j < children.length; j++){
  151 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  152 + }
  153 + }
  154 + }
  155 + $('#fgsdmSing').html(options);
  156 + }
  157 +
  158 + var tempData = {};
  159 + $.get('/report/lineList',function(xlList){
  160 + var data = [];
  161 + data.push({id: " ", text: "全部线路"});
  162 + $.get('/user/companyData', function(result){
  163 + for(var i = 0; i < result.length; i++){
  164 + var companyCode = result[i].companyCode;
  165 + var children = result[i].children;
  166 + for(var j = 0; j < children.length; j++){
  167 + var code = children[j].code;
  168 + for(var k=0;k < xlList.length;k++ ){
  169 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  170 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  171 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  172 + }
  173 + }
  174 + }
  175 + }
  176 + initPinYinSelect2('#line',data,'');
  177 +
  178 + });
  179 + });
  180 +
  181 + $("#line").on("change", function(){
  182 + if($("#line").val() == " "){
  183 + $("#gsdmSing").attr("disabled", false);
  184 + $("#fgsdmSing").attr("disabled", false);
  185 + } else {
  186 + var temp = tempData[$("#line").val()].split(":");
  187 + $("#gsdmSing").val(temp[0]);
  188 + updateCompany();
  189 +// $("#fgsdmSing").val(temp[1]);
  190 + $("#fgsdmSing").val("");
  191 + $("#gsdmSing").attr("disabled", true);
  192 +// $("#fgsdmSing").attr("disabled", true);
  193 + }
  194 + });
  195 +
  196 + var cont = "驾驶员", cont1 = "", cont2 = "", cont3 = "";
  197 + $("#tjtype").on("change",function(){
  198 + if(cont == "驾驶员"){
  199 + cont1 = $("#cont").val();
  200 + } else if(cont == "售票员"){
  201 + cont2 = $("#cont").val();
  202 + } else if(cont == "车辆自编号"){
  203 + cont3 = $("#cont").val();
  204 + }
  205 + cont = $("#tjtype").val();
  206 + if($("#tjtype").val() == "驾驶员"){
  207 + $("#cont").val(cont1);
  208 + } else if($("#tjtype").val() == "售票员"){
  209 + $("#cont").val(cont2);
  210 + } else if($("#tjtype").val() == "车辆自编号"){
  211 + $("#cont").val(cont3);
  212 + }
  213 + });
  214 +
  215 + $("#query").on("click",function(){
  216 + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
  217 + layer.msg("请选择时间!");
  218 + return;
  219 + }
  220 + if($("#endDate").val() == null || $("#endDate").val().trim().length == 0){
  221 + layer.msg("请选择时间!");
  222 + return;
  223 + }
  224 + $("#empname").html($("#tjtype").val());
  225 + var line = $("#line").val();
  226 + var startDate = $("#startDate").val();
  227 + var endDate = $("#endDate").val();
  228 + var gsdmSing = $("#gsdmSing").val();
  229 + var fgsdmSing = $("#fgsdmSing").val();
  230 + var tjtype=$("#tjtype").val();
  231 + var cont=$("#cont").val();
  232 + var params = {};
  233 + var i = layer.load(2);
  234 + $get("/calc_mix/singledatatj",{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,cont:cont},function(result){
  235 + layer.close(i);
  236 + var singledata = template('singledata',{list:result});
  237 + // 把渲染好的模版html文本追加到表格中
  238 + $('#forms tbody').html(singledata);
  239 + });
  240 + });
  241 +
  242 + $("#export").on("click",function(){
  243 + var line = $("#line").val();
  244 + var startDate = $("#startDate").val();
  245 + var endDate = $("#endDate").val();
  246 + var gsdmSing = $("#gsdmSing").val();
  247 + var fgsdmSing = $("#fgsdmSing").val();
  248 + var tjtype=$("#tjtype").val();
  249 + var cont=$("#cont").val();
  250 + var lineName = $('#line option:selected').text();
  251 + if(lineName == "全部线路")
  252 + lineName = $('#fgsdmSing option:selected').text();
  253 + var i = layer.load(2);
  254 + $get('/calc_export/singledataExportTj',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,cont:cont,type:'export',lineName:lineName},function(result){
  255 + var dateTime = "";
  256 + if(startDate == endDate){
  257 + dateTime = moment(startDate).format("YYYYMMDD");
  258 + } else {
  259 + dateTime = moment(startDate).format("YYYYMMDD")
  260 + +"-"+moment(endDate).format("YYYYMMDD");
  261 + }
  262 + window.open("/downloadFile/download?fileName="
  263 + +dateTime+"-"+lineName+"-路单数据(统计)");
  264 + layer.close(i);
  265 + });
  266 + });
  267 + });
  268 +
  269 +</script>
  270 +<script type="text/html" id="singledata">
  271 + {{each list as obj i}}
  272 + <tr>
  273 + <td>{{i+1}}</td>
  274 + <td>{{obj.gS}}</td>
  275 + <td>{{obj.xlName}}</td>
  276 + <td>{{obj.jName}}</td>
  277 + <td>{{obj.sjzlc}}</td>
  278 + <td>{{obj.sjfyylc}}</td>
  279 + <td>{{obj.hyl}}</td>
  280 + <td>{{obj.jzl}}</td>
  281 + <td>{{obj.sh}}</td>
  282 + <td>{{obj.jhzlc}}</td>
  283 + </tr>
  284 + {{/each}}
  285 + {{if list.length == 0}}
  286 + <tr>
  287 + <td colspan="16"><h6 class="muted">没有找到相关数据</h6></td>
  288 + </tr>
  289 + {{/if}}
  290 +</script>
src/main/resources/static/pages/forms/mould/calcjsyspy.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/calcsingledata.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/waybillQp.html
@@ -318,7 +318,14 @@ @@ -318,7 +318,14 @@
318 <script type="text/html" id="ludan_2"> 318 <script type="text/html" id="ludan_2">
319 {{each list as obj i}} 319 {{each list as obj i}}
320 <tr> 320 <tr>
321 - <td>{{i+1}}</td> 321 + <td>
  322 + {{if obj.adjustExps == "子"}}
  323 + {{obj.adjustExps}}
  324 + {{/if}}
  325 + {{if obj.adjustExps != "子"}}
  326 + {{i+1}}
  327 + {{/if}}
  328 + </td>
322 <td>{{obj.lpName}}</td> 329 <td>{{obj.lpName}}</td>
323 <td>{{obj.jGh}}{{obj.jName}}</td> 330 <td>{{obj.jGh}}{{obj.jName}}</td>
324 <td> 331 <td>
src/main/resources/static/pages/mforms/singledatas/singledata_date.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 +</style>
  19 +
  20 +<div class="page-head">
  21 + <div class="page-title">
  22 + <h1>路单统计</h1>
  23 + </div>
  24 +</div>
  25 +
  26 +<div class="row">
  27 + <div class="col-md-12">
  28 + <div class="portlet light porttlet-fit bordered">
  29 + <div class="portlet-title">
  30 + <form class="form-inline" action="">
  31 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_sing">
  32 + <span class="item-label" style="width: 140px;">&nbsp;&nbsp;&nbsp;&nbsp;
  33 + &nbsp;
  34 + 公司: </span>
  35 + <select class="form-control" name="company" id="gsdmSing" style="width: 140px;"></select>
  36 + </div>
  37 + <div style="display: inline-block; margin-left: 10px;" id="fgsdmDiv_sing">
  38 + <span class="item-label" style="width: 140px;">&nbsp;&nbsp;&nbsp;&nbsp;分公司: </span>
  39 + <select class="form-control" name="subCompany" id="fgsdmSing" style="width: 140px;"></select>
  40 + </div>
  41 + <div style="display: inline-block; margin-left: 15px;">
  42 + <span class="item-label" style="width: 80px;">线路: </span>
  43 + <select class="form-control" name="line" id="line" style="width: 140px;"></select>
  44 + </div>
  45 + <div style="margin-top: 10px"></div>
  46 +
  47 + <div style="display: inline-block;margin-left: 33px;">
  48 + <span class="item-label" style="width: 140px;">开始时间: </span>
  49 + <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
  50 + </div>
  51 + <div style="display: inline-block;margin-left: 15px;">
  52 + <span class="item-label" style="width: 140px;">结束时间: </span>
  53 + <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
  54 + </div>
  55 +
  56 + <div style="display: inline-block;margin-left: 15px">
  57 + <span class="item-label" style="width: 150px;">统计: </span>
  58 + <select class="form-control" name="tjtype" id="tjtype" style="width: 140px;">
  59 + <option value="jsy">驾驶员</option>
  60 + <option value="spy">售票员</option>
  61 + </select>
  62 +
  63 + </div>
  64 + <div class="form-group">
  65 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  66 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  67 + </div>
  68 + </form>
  69 + </div>
  70 + <div class="portlet-body">
  71 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  72 + <table class="table table-bordered table-hover table-checkable" id="forms">
  73 + <thead>
  74 + <tr>
  75 + <th>序号</th>
  76 + <th>日期</th>
  77 + <th>所属公司</th>
  78 + <th>线路</th>
  79 + <th>车号</th>
  80 + <th>司机职号</th>
  81 + <th>司机姓名</th>
  82 + <th>售票员职号</th>
  83 + <th>售票员姓名</th>
  84 + <th>行驶里程(包括空放)</th>
  85 + <th>空驶里程</th>
  86 + <th>耗油量</th>
  87 + <th>加注量</th>
  88 + <th>非营业用油</th>
  89 + <th>计划公里</th>
  90 + </tr>
  91 + </thead>
  92 + <tbody>
  93 +
  94 + </tbody>
  95 + </table>
  96 + </div>
  97 + </div>
  98 + </div>
  99 + </div>
  100 +</div>
  101 +
  102 +<script>
  103 + $(function(){
  104 + // 关闭左侧栏
  105 + if (!$('body').hasClass('page-sidebar-closed'))
  106 + $('.menu-toggler.sidebar-toggler').click();
  107 +
  108 + $("#startDate,#endDate").datetimepicker({
  109 + format : 'YYYY-MM-DD',
  110 + locale : 'zh-cn'
  111 + });
  112 + var d = new Date();
  113 + var year = d.getFullYear();
  114 + var month = d.getMonth() + 1;
  115 + var day = d.getDate();
  116 + if(month < 10)
  117 + month = "0" + month;
  118 + if(day < 10)
  119 + day = "0" + day;
  120 + $("#startDate").val(year + "-" + month + "-" + day);
  121 + $("#endDate").val(year + "-" + month + "-" + day);
  122 +
  123 +
  124 + var fage=false;
  125 + var xlList;
  126 + var obj = [];
  127 +
  128 + $.get('/report/lineList',function(result){
  129 + xlList=result;
  130 + $.get('/user/companyData', function(result){
  131 + obj = result;
  132 + var options = '';
  133 + for(var i = 0; i < obj.length; i++){
  134 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  135 + }
  136 +
  137 + if(obj.length ==0){
  138 + $("#gsdmDiv_sing").css('display','none');
  139 + }else if(obj.length ==1){
  140 + $("#gsdmDiv_sing").css('display','none');
  141 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  142 + $('#fgsdmDiv_sing').css('display','none');
  143 + }
  144 + $('#gsdmSing').html(options);
  145 + updateCompany();
  146 + });
  147 + })
  148 + $("#gsdmSing").on("change",updateCompany);
  149 + function updateCompany(){
  150 + var company = $('#gsdmSing').val();
  151 + var options ='';
  152 +// var options = '<option value="">全部分公司</option>';
  153 + for(var i = 0; i < obj.length; i++){
  154 + if(obj[i].companyCode == company){
  155 + var children = obj[i].children;
  156 + for(var j = 0; j < children.length; j++){
  157 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  158 + }
  159 + }
  160 + }
  161 + $('#fgsdmSing').html(options);
  162 + }
  163 +
  164 + var tempData = {};
  165 + $.get('/report/lineList',function(xlList){
  166 + var data = [];
  167 + data.push({id: " ", text: "全部线路"});
  168 + $.get('/user/companyData', function(result){
  169 + for(var i = 0; i < result.length; i++){
  170 + var companyCode = result[i].companyCode;
  171 + var children = result[i].children;
  172 + for(var j = 0; j < children.length; j++){
  173 + var code = children[j].code;
  174 + for(var k=0;k < xlList.length;k++ ){
  175 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  176 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  177 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  178 + }
  179 + }
  180 + }
  181 + }
  182 + initPinYinSelect2('#line',data,'');
  183 +
  184 + });
  185 + });
  186 +
  187 + $("#line").on("change", function(){
  188 + if($("#line").val() == " "){
  189 + $("#gsdmSing").attr("disabled", false);
  190 + $("#fgsdmSing").attr("disabled", false);
  191 + } else {
  192 + var temp = tempData[$("#line").val()].split(":");
  193 + $("#gsdmSing").val(temp[0]);
  194 + updateCompany();
  195 + $("#fgsdmSing").val(temp[1]);
  196 +// $("#fgsdmSing").val("");
  197 + $("#gsdmSing").attr("disabled", true);
  198 + $("#fgsdmSing").attr("disabled", true);
  199 + }
  200 + });
  201 +
  202 +
  203 + $("#query").on("click",function(){
  204 + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
  205 + layer.msg("请选择时间!");
  206 + return;
  207 + }
  208 + var i = layer.load(2);
  209 + var params = {};
  210 + params['sfyy'] = $("#sfyy").val();
  211 + params['gsdmSing'] = $("#gsdmSing").val();
  212 + params['fgsdmSing'] = $("#fgsdmSing").val();
  213 + params['line'] = $("#line").val();
  214 + params['startDate'] = $("#startDate").val();
  215 + params['endDate'] = $("#endDate").val();
  216 + params['lpName'] = $("#lpName").val();
  217 + params['tjtype'] = $("#tjtype").val();
  218 + params['spy'] = "zrw";
  219 +
  220 + $get("/report/singledatatj",params,function(result){
  221 + layer.close(i);
  222 + var singledata = template('singledata',{list:result});
  223 + // 把渲染好的模版html文本追加到表格中
  224 + $('#forms tbody').html(singledata);
  225 +
  226 + });
  227 +
  228 + });
  229 +
  230 + $("#export").on("click",function(){
  231 + var params = {};
  232 + params['sfyy'] = $("#sfyy").val();
  233 + params['gsdmSing'] = $("#gsdmSing").val();
  234 + params['fgsdmSing'] = $("#fgsdmSing").val();
  235 + params['line'] = $("#line").val();
  236 + params['startDate'] = $("#startDate").val();
  237 + params['endDate'] = $("#endDate").val();
  238 + params['lpName'] = $("#lpName").val();
  239 + params['tjtype'] = $("#tjtype").val();
  240 + params['spy'] = "zrw";
  241 + var lineName = $('#line option:selected').text();
  242 + if(lineName == "全部线路")
  243 + lineName = $('#fgsdmSing option:selected').text();
  244 +
  245 + params['lineName'] =lineName;
  246 + params['type'] ='export';
  247 + var i = layer.load(2);
  248 + $get('/report/singledatatj',params,function(result){
  249 + var exportDate="";
  250 + if( $("#startDate").val()==$("#endDate").val()){
  251 + exportDate=moment($("#startDate").val()).format("YYYYMMDD");
  252 + }else{
  253 + exportDate=moment($("#startDate").val()).format("YYYYMMDD")
  254 + +"-"+moment($("#endDate").val()).format("YYYYMMDD");
  255 +
  256 + }
  257 + console.log("exportDate:"+exportDate);
  258 + window.open("/downloadFile/download?fileName="
  259 + +exportDate
  260 + +"-"+lineName+"-路单统计");
  261 + layer.close(i);
  262 + });
  263 +
  264 + });
  265 + });
  266 +</script>
  267 +<script type="text/html" id="singledata">
  268 + {{each list as obj i}}
  269 + <tr>
  270 + <td>{{i+1}}</td>
  271 + <td>{{obj.rQ}}</td>
  272 + <td>{{obj.gS}}</td>
  273 + <td>{{obj.xlmc}}</td>
  274 + <td>{{obj.clzbh}}</td>
  275 + <td>{{obj.jsy}}</td>
  276 + <td>{{obj.jName}}</td>
  277 + <td>{{obj.sgh}}</td>
  278 + <td>{{obj.sName}}</td>
  279 + <td>{{obj.jhlc}}</td>
  280 + <td>{{obj.emptMileage}}</td>
  281 + <td>{{obj.hyl}}</td>
  282 + <td>{{obj.jzl}}</td>
  283 + <td>{{obj.unyyyl}}</td>
  284 + <td>{{obj.jhjl}}</td>
  285 + </tr>
  286 + {{/each}}
  287 + {{if list.length == 0}}
  288 + <tr>
  289 + <td colspan="16"><h6 class="muted">没有找到相关数据</h6></td>
  290 + </tr>
  291 + {{/if}}
  292 +</script>
  293 +<script type="text/html" id="singledata2">
  294 + {{each list as obj i}}
  295 + <tr>
  296 + <td>{{i+1}}</td>
  297 + <td>{{obj.rQ}}</td>
  298 + <td>{{obj.gS}}</td>
  299 + <td>{{obj.xlmc}}</td>
  300 + <td>{{obj.clzbh}}</td>
  301 + <td></td>
  302 + <td></td>
  303 + <td>{{obj.sgh}}</td>
  304 + <td>{{obj.sName}}</td>
  305 + <td>{{obj.jhlc}}</td>
  306 + <td>{{obj.emptMileage}}</td>
  307 + <td></td>
  308 + <td></td>
  309 + <td></td>
  310 + <td>{{obj.jhjl}}</td>
  311 + </tr>
  312 + {{/each}}
  313 + {{if list.length == 0}}
  314 + <tr>
  315 + <td colspan="16"><h6 class="muted">没有找到相关数据</h6></td>
  316 + </tr>
  317 + {{/if}}
  318 +</script>
src/main/resources/static/pages/oil/list_ph.html
@@ -242,7 +242,12 @@ @@ -242,7 +242,12 @@
242 {{obj.fgsname}} 242 {{obj.fgsname}}
243 </td> 243 </td>
244 <td width="8%"> 244 <td width="8%">
245 - {{obj.xlname}} 245 + {{if obj.linename=='' || obj.linename==null}}
  246 + {{obj.xlname}}
  247 + {{else}}
  248 + {{obj.linename}}
  249 + {{/if}}
  250 +
246 </td> 251 </td>
247 <td width="5%"> 252 <td width="5%">
248 <lable data-id="{{obj.id}}" class="in_carpark_nbbm">{{obj.nbbm}}</lable> 253 <lable data-id="{{obj.id}}" class="in_carpark_nbbm">{{obj.nbbm}}</lable>
@@ -253,7 +258,11 @@ @@ -253,7 +258,11 @@
253 <input data-id="{{obj.id}}" style=" width:100%" type="text" class="in_carpark_jsy" ></input> 258 <input data-id="{{obj.id}}" style=" width:100%" type="text" class="in_carpark_jsy" ></input>
254 <button class="btn btn-sm blue btn-jsyUpdate" style=" width:100%" data-id="{{obj.id}}">填写工号</button> 259 <button class="btn btn-sm blue btn-jsyUpdate" style=" width:100%" data-id="{{obj.id}}">填写工号</button>
255 {{else}} 260 {{else}}
256 - {{obj.jsy}}/{{obj.name}} 261 + {{if obj.jname=='' || obj.jname==null}}
  262 + {{obj.jsy}}/{{obj.name}}
  263 + {{else}}
  264 + {{obj.jsy}}/{{obj.jname}}
  265 + {{/if}}
257 {{/if}} 266 {{/if}}
258 267
259 </td> 268 </td>
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch/editor.html
@@ -374,7 +374,7 @@ @@ -374,7 +374,7 @@
374 $('[name=bcType]', f).trigger('change'); 374 $('[name=bcType]', f).trigger('change');
375 } 375 }
376 376
377 - 377 +
378 function initScheduleTypeChange(f, cb) { 378 function initScheduleTypeChange(f, cb) {
379 (function (f, cb) { 379 (function (f, cb) {
380 $('[name=bcType]', f).on('change', function () { 380 $('[name=bcType]', f).on('change', function () {
@@ -396,7 +396,8 @@ @@ -396,7 +396,8 @@
396 var time, mileage; 396 var time, mileage;
397 switch (bcType_e.val()) { 397 switch (bcType_e.val()) {
398 case 'out': 398 case 'out':
399 - qdz.html(park_opts).val(information.carPark); 399 + if (gb_sch && gb_sch.qdzCode) qdz.html(park_opts).val(gb_sch.qdzCode);
  400 + else qdz.html(park_opts).val(information.carPark);
400 zdz.html(opts); 401 zdz.html(opts);
401 //出场结束时间 402 //出场结束时间
402 time = updown == 0 ? information.upOutTimer : information.downOutTimer; 403 time = updown == 0 ? information.upOutTimer : information.downOutTimer;
@@ -404,7 +405,8 @@ @@ -404,7 +405,8 @@
404 break; 405 break;
405 case 'in': 406 case 'in':
406 qdz.html(opts); 407 qdz.html(opts);
407 - zdz.html(park_opts).val(information.carPark); 408 + if (gb_sch && gb_sch.zdzCode) zdz.html(park_opts).val(gb_sch.zdzCode);
  409 + else zdz.html(park_opts).val(information.carPark);
408 //进场结束时间 410 //进场结束时间
409 time = updown == 0 ? information.upInTimer : information.downInTimer; 411 time = updown == 0 ? information.upInTimer : information.downInTimer;
410 mileage = updown == 0 ? information.upInMileage : information.downInMileage; 412 mileage = updown == 0 ? information.upInMileage : information.downInMileage;