Commit 9de2dc2f656fa5a3c5dd880976423d26566b9296

Authored by 徐烜
2 parents 749d6e3b df52ddfd

Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang

Showing 28 changed files with 1989 additions and 383 deletions
src/main/java/com/bsth/controller/oil/DlbController.java
@@ -84,8 +84,14 @@ public class DlbController extends BaseController<Dlb, Integer>{ @@ -84,8 +84,14 @@ public class DlbController extends BaseController<Dlb, Integer>{
84 84
85 85
86 @RequestMapping(value = "/obtain",method = RequestMethod.GET) 86 @RequestMapping(value = "/obtain",method = RequestMethod.GET)
87 - public Map<String, Object> obtain(@RequestParam Map<String, Object> map){  
88 - Map<String, Object> list=service.obtain(map); 87 + public Map<String, Object> obtain(@RequestParam Map<String, Object> map) throws Exception{
  88 + Map<String, Object> list=new HashMap<String, Object>();
  89 + try {
  90 + list = service.obtain(map);
  91 + } catch (Exception e) {
  92 + // TODO Auto-generated catch block
  93 + throw e;
  94 + }
89 return list; 95 return list;
90 } 96 }
91 97
src/main/java/com/bsth/controller/sys/IntervalController.java
@@ -9,12 +9,13 @@ import org.springframework.web.bind.annotation.RequestParam; @@ -9,12 +9,13 @@ import org.springframework.web.bind.annotation.RequestParam;
9 import org.springframework.web.bind.annotation.RestController; 9 import org.springframework.web.bind.annotation.RestController;
10 10
11 import com.alibaba.fastjson.JSON; 11 import com.alibaba.fastjson.JSON;
  12 +import com.bsth.controller.BaseController;
12 import com.bsth.entity.sys.Interval; 13 import com.bsth.entity.sys.Interval;
13 import com.bsth.service.sys.IntervalService; 14 import com.bsth.service.sys.IntervalService;
14 15
15 @RestController 16 @RestController
16 @RequestMapping("interval") 17 @RequestMapping("interval")
17 -public class IntervalController { 18 +public class IntervalController extends BaseController<Interval, Integer> {
18 19
19 @Autowired 20 @Autowired
20 IntervalService intervalService; 21 IntervalService intervalService;
src/main/java/com/bsth/data/gpsdata/thread/GpsDataLoaderThread.java
@@ -154,7 +154,7 @@ public class GpsDataLoaderThread extends Thread { @@ -154,7 +154,7 @@ public class GpsDataLoaderThread extends Thread {
154 CloseableHttpResponse response = null; 154 CloseableHttpResponse response = null;
155 155
156 try { 156 try {
157 - logger.error("load start..."); 157 + logger.info("load start...");
158 httpClient = HttpClients.createDefault(); 158 httpClient = HttpClients.createDefault();
159 HttpGet get = new HttpGet(clientUrl); 159 HttpGet get = new HttpGet(clientUrl);
160 //超时时间 160 //超时时间
@@ -175,7 +175,7 @@ public class GpsDataLoaderThread extends Thread { @@ -175,7 +175,7 @@ public class GpsDataLoaderThread extends Thread {
175 175
176 list = JSON.parseArray(stringBuffer.toString(), GpsEntity.class); 176 list = JSON.parseArray(stringBuffer.toString(), GpsEntity.class);
177 String nbbm; 177 String nbbm;
178 - logger.error("load end!"); 178 + logger.info("load end!");
179 for (GpsEntity gps : list) { 179 for (GpsEntity gps : list) {
180 180
181 //没有设备号 181 //没有设备号
src/main/java/com/bsth/entity/oil/Dlb.java
@@ -54,6 +54,7 @@ public class Dlb { @@ -54,6 +54,7 @@ public class Dlb {
54 private String edituser; 54 private String edituser;
55 private Date edittime; 55 private Date edittime;
56 private Date createtime; 56 private Date createtime;
  57 + private Date updatetime;
57 private int nylx; 58 private int nylx;
58 //进场顺序(根据最先出场和最后进场来关联车辆的存电量) 59 //进场顺序(根据最先出场和最后进场来关联车辆的存电量)
59 private int jcsx; 60 private int jcsx;
@@ -374,4 +375,14 @@ public class Dlb { @@ -374,4 +375,14 @@ public class Dlb {
374 public void setFgsname(String fgsname) { 375 public void setFgsname(String fgsname) {
375 this.fgsname = fgsname; 376 this.fgsname = fgsname;
376 } 377 }
  378 +
  379 + public Date getUpdatetime() {
  380 + return updatetime;
  381 + }
  382 +
  383 + public void setUpdatetime(Date updatetime) {
  384 + this.updatetime = updatetime;
  385 + }
  386 +
  387 +
377 } 388 }
src/main/java/com/bsth/entity/sys/Interval.java
@@ -39,11 +39,11 @@ public class Interval { @@ -39,11 +39,11 @@ public class Interval {
39 } 39 }
40 40
41 41
42 - public Integer getCreateBy() { 42 + public String getCreateBy() {
43 return createBy; 43 return createBy;
44 } 44 }
45 45
46 - public void setCreateBy(Integer createBy) { 46 + public void setCreateBy(String createBy) {
47 this.createBy = createBy; 47 this.createBy = createBy;
48 } 48 }
49 49
@@ -55,11 +55,11 @@ public class Interval { @@ -55,11 +55,11 @@ public class Interval {
55 this.createDate = createDate; 55 this.createDate = createDate;
56 } 56 }
57 57
58 - public Integer getUpdateBy() { 58 + public String getUpdateBy() {
59 return updateBy; 59 return updateBy;
60 } 60 }
61 61
62 - public void setUpdateBy(Integer updateBy) { 62 + public void setUpdateBy(String updateBy) {
63 this.updateBy = updateBy; 63 this.updateBy = updateBy;
64 } 64 }
65 65
@@ -75,13 +75,13 @@ public class Interval { @@ -75,13 +75,13 @@ public class Interval {
75 private Integer trough; 75 private Integer trough;
76 76
77 @Column(name = "create_by") 77 @Column(name = "create_by")
78 - private Integer createBy; 78 + private String createBy;
79 79
80 @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") 80 @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
81 private Date createDate; 81 private Date createDate;
82 82
83 @Column(name = "update_by") 83 @Column(name = "update_by")
84 - private Integer updateBy; 84 + private String updateBy;
85 85
86 @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") 86 @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
87 private Date updateDate; 87 private Date updateDate;
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
@@ -20,10 +20,10 @@ import com.bsth.service.traffic.YgcBasicDataService; @@ -20,10 +20,10 @@ import com.bsth.service.traffic.YgcBasicDataService;
20 import com.bsth.util.TimeUtils; 20 import com.bsth.util.TimeUtils;
21 import com.bsth.util.db.DBUtils_MS; 21 import com.bsth.util.db.DBUtils_MS;
22 import com.bsth.webService.trafficManage.geotool.services.InternalPortType; 22 import com.bsth.webService.trafficManage.geotool.services.InternalPortType;
23 -import com.bsth.webService.trafficManage.geotool.services.Internal;  
24 import com.bsth.webService.trafficManage.org.tempuri.Results; 23 import com.bsth.webService.trafficManage.org.tempuri.Results;
25 import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; 24 import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator;
26 import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; 25 import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap;
  26 +import org.apache.commons.lang.StringEscapeUtils;
27 import org.apache.commons.lang.StringUtils; 27 import org.apache.commons.lang.StringUtils;
28 import org.apache.commons.lang.time.DateUtils; 28 import org.apache.commons.lang.time.DateUtils;
29 import org.slf4j.Logger; 29 import org.slf4j.Logger;
@@ -373,7 +373,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -373,7 +373,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
373 counter = 0; 373 counter = 0;
374 sf.append("</DLDS>"); 374 sf.append("</DLDS>");
375 str = sf.toString().replace("'","");// 去掉'号 375 str = sf.toString().replace("'","");// 去掉'号
376 - Results results = ssop.setLD(userNameOther, passwordOther, str); 376 + Results results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str));
377 if(results.isSuccess()){ 377 if(results.isSuccess()){
378 result = "success"; 378 result = "success";
379 }else{ 379 }else{
@@ -387,7 +387,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -387,7 +387,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
387 if(counter > 0){ 387 if(counter > 0){
388 sf.append("</DLDS>"); 388 sf.append("</DLDS>");
389 str = sf.toString().replace("'","");// 去掉'号 389 str = sf.toString().replace("'","");// 去掉'号
390 - Results results = ssop.setLD(userNameOther, passwordOther, str); 390 + Results results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str));
391 if(results.isSuccess()){ 391 if(results.isSuccess()){
392 result = "success"; 392 result = "success";
393 }else{ 393 }else{
@@ -413,7 +413,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -413,7 +413,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
413 String result = "failure"; 413 String result = "failure";
414 try { 414 try {
415 String tmp = readXmlFromFile("E:/ld.txt"); 415 String tmp = readXmlFromFile("E:/ld.txt");
416 - Results rss = ssop.setLD(userNameOther, passwordOther, tmp); 416 + Results rss = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(tmp));
417 if(rss.isSuccess()){ 417 if(rss.isSuccess()){
418 result = "success"; 418 result = "success";
419 } 419 }
@@ -435,7 +435,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -435,7 +435,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
435 private String readXmlFromFile(String fileName) throws Exception { 435 private String readXmlFromFile(String fileName) throws Exception {
436 StringBuffer sf = new StringBuffer(""); 436 StringBuffer sf = new StringBuffer("");
437 File file = new File(fileName); 437 File file = new File(fileName);
438 - InputStreamReader reader = new InputStreamReader(new FileInputStream(file),"utf-8"); 438 + InputStreamReader reader = new InputStreamReader(new FileInputStream(file),"GBK");
439 BufferedReader bufferedReader = new BufferedReader(reader); 439 BufferedReader bufferedReader = new BufferedReader(reader);
440 String lineTxt = ""; 440 String lineTxt = "";
441 while((lineTxt = bufferedReader.readLine()) != null){ 441 while((lineTxt = bufferedReader.readLine()) != null){
@@ -964,47 +964,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -964,47 +964,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
964 * 下载全量的公交基础数据 964 * 下载全量的公交基础数据
965 */ 965 */
966 public String getDownLoadAllDataFile() { 966 public String getDownLoadAllDataFile() {
967 - String result = "success"; 967 + String result = "failure";
968 try { 968 try {
969 - Runtime currRuntime = Runtime.getRuntime ();  
970 -  
971 - int nFreeMemory = ( int ) (currRuntime.freeMemory() / 1024 / 1024);  
972 -  
973 - int nTotalMemory = ( int ) (currRuntime.totalMemory() / 1024 / 1024);  
974 -  
975 - System.out.println("zzz:"+nFreeMemory + "M/" + nTotalMemory +"M(free/total)");  
976 - portType = new Internal().getInternalHttpSoap11Endpoint();  
977 - byte[] res = portType.downloadAllDataFile("down_pdgj", "down_pdgj123");  
978 - String filePath = "E:\\ygc";  
979 - BufferedOutputStream bos = null;  
980 - FileOutputStream fos = null;  
981 - File file = null;  
982 try { 969 try {
983 - File dir = new File(filePath);  
984 - if(!dir.exists()&&dir.isDirectory()){//判断文件目录是否存在  
985 - dir.mkdirs(); 970 + if(ygcBasicDataService.download("admin","000000","abc.zip")){
  971 + result = "success";
986 } 972 }
987 - file = new File(filePath+"\\abc.rar");  
988 - fos = new FileOutputStream(file);  
989 - bos = new BufferedOutputStream(fos);  
990 - bos.write(res);  
991 } catch (Exception e) { 973 } catch (Exception e) {
992 e.printStackTrace(); 974 e.printStackTrace();
993 - } finally {  
994 - if (bos != null) {  
995 - try {  
996 - bos.close();  
997 - } catch (IOException e1) {  
998 - e1.printStackTrace();  
999 - }  
1000 - }  
1001 - if (fos != null) {  
1002 - try {  
1003 - fos.close();  
1004 - } catch (IOException e1) {  
1005 - e1.printStackTrace();  
1006 - }  
1007 - }  
1008 } 975 }
1009 } catch (Exception e) { 976 } catch (Exception e) {
1010 e.printStackTrace(); 977 e.printStackTrace();
src/main/java/com/bsth/service/oil/DlbService.java
@@ -7,7 +7,7 @@ import com.bsth.entity.oil.Dlb; @@ -7,7 +7,7 @@ import com.bsth.entity.oil.Dlb;
7 import com.bsth.service.BaseService; 7 import com.bsth.service.BaseService;
8 8
9 public interface DlbService extends BaseService<Dlb, Integer>{ 9 public interface DlbService extends BaseService<Dlb, Integer>{
10 - Map<String, Object> obtain(Map<String, Object> map); 10 + Map<String, Object> obtain(Map<String, Object> map) throws Exception;
11 11
12 Map<String, Object> sort(Map<String, Object> map); 12 Map<String, Object> sort(Map<String, Object> map);
13 13
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
@@ -2,6 +2,8 @@ package com.bsth.service.oil.impl; @@ -2,6 +2,8 @@ package com.bsth.service.oil.impl;
2 2
3 3
4 4
  5 +import java.sql.ResultSet;
  6 +import java.sql.SQLException;
5 import java.text.DecimalFormat; 7 import java.text.DecimalFormat;
6 import java.text.ParseException; 8 import java.text.ParseException;
7 import java.text.SimpleDateFormat; 9 import java.text.SimpleDateFormat;
@@ -22,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -22,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
22 import org.springframework.data.domain.Sort; 24 import org.springframework.data.domain.Sort;
23 import org.springframework.data.domain.Sort.Direction; 25 import org.springframework.data.domain.Sort.Direction;
24 import org.springframework.jdbc.core.JdbcTemplate; 26 import org.springframework.jdbc.core.JdbcTemplate;
  27 +import org.springframework.jdbc.core.RowMapper;
25 import org.springframework.stereotype.Service; 28 import org.springframework.stereotype.Service;
26 29
27 import com.alibaba.fastjson.JSONArray; 30 import com.alibaba.fastjson.JSONArray;
@@ -48,6 +51,7 @@ import com.bsth.service.impl.BaseServiceImpl; @@ -48,6 +51,7 @@ import com.bsth.service.impl.BaseServiceImpl;
48 import com.bsth.service.oil.DlbService; 51 import com.bsth.service.oil.DlbService;
49 import com.bsth.service.realcontrol.ScheduleRealInfoService; 52 import com.bsth.service.realcontrol.ScheduleRealInfoService;
50 import com.bsth.util.Arith; 53 import com.bsth.util.Arith;
  54 +import com.bsth.util.BatchSaveUtils;
51 55
52 @Service 56 @Service
53 public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbService{ 57 public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbService{
@@ -210,7 +214,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -210,7 +214,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
210 * 获取进存电信息 214 * 获取进存电信息
211 * @Transactional 回滚事物 215 * @Transactional 回滚事物
212 */ 216 */
213 - @Transactional 217 + /*@Transactional
214 @Override 218 @Override
215 public Map<String, Object> obtain(Map<String, Object> map2) { 219 public Map<String, Object> obtain(Map<String, Object> map2) {
216 List<Cars> carsList=carsRepository.findCars(); 220 List<Cars> carsList=carsRepository.findCars();
@@ -223,6 +227,16 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -223,6 +227,16 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
223 if(map2.get("ssgsdm_like")!=null){ 227 if(map2.get("ssgsdm_like")!=null){
224 gsbm=map2.get("ssgsdm_like").toString(); 228 gsbm=map2.get("ssgsdm_like").toString();
225 } 229 }
  230 +
  231 + String nbbm="";
  232 + if(map2.get("nbbm_eq")!=null){
  233 + nbbm=map2.get("nbbm_eq").toString();
  234 + }
  235 + String fgsbm="";
  236 + if(map2.get("fgsdm_like")!=null){
  237 + fgsbm=map2.get("fgsdm_like").toString();
  238 + }
  239 +
226 String rq=map2.get("rq").toString(); 240 String rq=map2.get("rq").toString();
227 String line=""; 241 String line="";
228 if(map2.get("xlbm_eq")!=null){ 242 if(map2.get("xlbm_eq")!=null){
@@ -235,18 +249,18 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -235,18 +249,18 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
235 // TODO Auto-generated method stub 249 // TODO Auto-generated method stub
236 Map<String, Object> newMap=new HashMap<String,Object>(); 250 Map<String, Object> newMap=new HashMap<String,Object>();
237 //当天DLB信息 251 //当天DLB信息
238 - List<Dlb> dlList=repository.obtainDl(rq, gsbm, "", line, "", "nbbm"); 252 + List<Dlb> dlList=repository.obtainDl(rq, gsbm, fgsbm, line, nbbm, "nbbm");
239 //当天YLXXB信息 253 //当天YLXXB信息
240 List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq,1,gsbm); 254 List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq,1,gsbm);
241 //当天加电信息表 255 //当天加电信息表
242 List<Jdl> jdlList=jdlRepository.JdlList(rq); 256 List<Jdl> jdlList=jdlRepository.JdlList(rq);
243 //前一天所有车辆最后进场班次信息 257 //前一天所有车辆最后进场班次信息
244 - List<Dlb> dlListBe=repository.obtainYlbefore(rq, "", "", "", ""); 258 + List<Dlb> dlListBe=repository.obtainYlbefore(rq, gsbm, fgsbm, line, nbbm);
245 List<Cdl> cdyList=cdlRepository.obtainCdl(); 259 List<Cdl> cdyList=cdlRepository.obtainCdl();
246 //从排班表中计算出行驶的总里程 260 //从排班表中计算出行驶的总里程
247 - List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq,"","","","");  
248 - List<Ylb> addList=new ArrayList<Ylb>();  
249 - List<Ylb> updateList=new ArrayList<Ylb>(); 261 + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line, rq, gsbm, fgsbm, "", nbbm);
  262 + List<Dlb> addList=new ArrayList<Dlb>();
  263 + List<Dlb> updateList=new ArrayList<Dlb>();
250 for(int x=0;x<listpb.size();x++){ 264 for(int x=0;x<listpb.size();x++){
251 String type="add"; 265 String type="add";
252 boolean sfdc=false; 266 boolean sfdc=false;
@@ -332,12 +346,11 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -332,12 +346,11 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
332 t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); 346 t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString());
333 t.setRq(sdf.parse(rq)); 347 t.setRq(sdf.parse(rq));
334 t.setCreatetime(new Date()); 348 t.setCreatetime(new Date());
335 - /*if(type.equals("add")){ 349 + if(type.equals("add")){
336 addList.add(t); 350 addList.add(t);
337 }else{ 351 }else{
338 updateList.add(t); 352 updateList.add(t);
339 - }*/  
340 - repository.save(t); 353 + }
341 newMap.put("status", ResponseCode.SUCCESS); 354 newMap.put("status", ResponseCode.SUCCESS);
342 } catch (ParseException e) { 355 } catch (ParseException e) {
343 // TODO Auto-generated catch block 356 // TODO Auto-generated catch block
@@ -346,20 +359,264 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -346,20 +359,264 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
346 } 359 }
347 } 360 }
348 } 361 }
349 - /* try { 362 + try {
350 if(addList.size()>0){ 363 if(addList.size()>0){
351 - new BatchSaveUtils<Ylb>().saveList(addList, Ylb.class); 364 + try{
  365 + new BatchSaveUtils<Dlb>().saveList(addList, Dlb.class);
  366 + } catch (Exception e) {
  367 + // TODO: handle exception
  368 + if(e.getMessage().indexOf("PK_DLB_UK")>0){
  369 + newMap.put("fage", "存在相同数据,数据已经过滤");
  370 + logger.info("获取:存在相同数据,数据已经过滤");
  371 + }
  372 + }
352 } 373 }
353 374
354 if(updateList.size()>0){ 375 if(updateList.size()>0){
355 - 376 + for (int i = 0; i < updateList.size(); i++) {
  377 + repository.save(updateList.get(i));
  378 + }
356 } 379 }
357 newMap.put("status", ResponseCode.SUCCESS); 380 newMap.put("status", ResponseCode.SUCCESS);
358 } 381 }
359 catch (Exception e) { 382 catch (Exception e) {
360 // TODO: handle exception 383 // TODO: handle exception
361 newMap.put("status", ResponseCode.ERROR); 384 newMap.put("status", ResponseCode.ERROR);
362 - }*/ 385 + }
  386 + return newMap;
  387 + }*/
  388 +
  389 + /**
  390 + * 获取进存油信息
  391 + * @Transactional 回滚事物
  392 + */
  393 + @Transactional
  394 + @Override
  395 + public Map<String, Object> obtain(Map<String, Object> map2) throws Exception{
  396 + Map<String, Object> newMap = new HashMap<String, Object>();
  397 + try {
  398 + Date date=new Date();
  399 + List<Cars> carsList = carsRepository.findCars();
  400 + Map<String, Boolean> carsMap = new HashMap<String, Boolean>();
  401 + for (int i = 0; i < carsList.size(); i++) {
  402 + Cars c = carsList.get(i);
  403 + carsMap.put(c.getInsideCode(), c.getSfdc());
  404 + }
  405 + String rq = map2.get("rq").toString();
  406 + String line = "";
  407 + if (map2.get("xlbm_like") != null) {
  408 + line = map2.get("xlbm_like").toString().trim();
  409 + }
  410 + String gsbm="";
  411 + if(map2.get("ssgsdm_like")!=null){
  412 + gsbm=map2.get("ssgsdm_like").toString();
  413 + }
  414 + String fgsbm="";
  415 + if(map2.get("fgsdm_like")!=null){
  416 + fgsbm=map2.get("fgsdm_like").toString();
  417 + }
  418 + String nbbm="";
  419 + if(map2.get("nbbm_eq")!=null){
  420 + nbbm=map2.get("nbbm_eq").toString();
  421 + }
  422 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  423 + // 保留两位小数
  424 + DecimalFormat df = new DecimalFormat("#.00");
  425 + // TODO Auto-generated method stub
  426 + // 当天YLB信息
  427 + List<Dlb> dlList = this.listOrderBy(rq,gsbm,fgsbm,line,nbbm,"nbbm");
  428 +// repository.obtainYl(rq,gsbm,fgsbm,line,nbbm,"nbbm");
  429 + // 当天YLXXB信息
  430 + List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0,gsbm);
  431 + // 前一天所有车辆最后进场班次信息
  432 +// List<Ylb> ylListBe = repository.obtainYlbefore(rq, gsbm, fgsbm, line, nbbm);
  433 +// List<Dlb> ylListBe =repository.listMaxRqJcsx(rq, gsbm, fgsbm, line, nbbm);
  434 +// List<Cyl> clyList = cylRepository.obtainCyl(nbbm,gsbm);
  435 + // 从排班表中计算出行驶的总里程
  436 + List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>();
  437 + List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList(line, rq, gsbm, fgsbm, "", nbbm);
  438 + List<Jdl> jdlList=jdlRepository.JdlList(rq);
  439 + String sxtj=map2.get("sxtj").toString();
  440 + if(sxtj.equals("0")){
  441 + listpb=listpbs;
  442 + }else{
  443 + List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, line,nbbm);
  444 + List<String> stringList=new ArrayList<String>();
  445 + for (int i = 0; i < objectLists.size(); i++) {
  446 + String clbm=objectLists.get(i)[0].toString();
  447 + int cs=Integer.parseInt(objectLists.get(i)[1].toString());
  448 + //一车一单
  449 + if(sxtj.equals("1")){
  450 + if(cs==1){
  451 + stringList.add(clbm);
  452 + }
  453 + }
  454 + //一车多单
  455 + if(sxtj.equals("2")){
  456 + if(cs>1){
  457 + stringList.add(clbm);
  458 + }
  459 + }
  460 + }
  461 +
  462 + for (int i = 0; i < stringList.size(); i++) {
  463 + String strNbbm=stringList.get(i);
  464 + for (int j = 0; j < listpbs.size(); j++) {
  465 + Map<String, Object> map = listpbs.get(j);
  466 + String mapNbbm=map.get("clZbh").toString();
  467 + if(strNbbm.equals(mapNbbm)){
  468 + listpb.add(map);
  469 + }
  470 + }
  471 + }
  472 + }
  473 +
  474 + List<Dlb> addList = new ArrayList<Dlb>();
  475 + List<Dlb> updateList = new ArrayList<Dlb>();
  476 + String ins="";
  477 + Map<String, Object> ylMap=new HashMap<String, Object>();
  478 + for (int x = 0; x < listpb.size(); x++) {
  479 + String type = "add";
  480 + boolean sfdc = false;
  481 + Map<String, Object> map = listpb.get(x);
  482 + if (carsMap.get(map.get("clZbh").toString()) != null) {
  483 + sfdc = carsMap.get(map.get("clZbh").toString());
  484 + } else {
  485 + sfdc = false;
  486 + }
  487 + if (sfdc) {
  488 + // 判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断)
  489 + Dlb t = new Dlb();
  490 + for (int k = 0; k < dlList.size(); k++) {
  491 + Dlb t1 = dlList.get(k);
  492 + if (t1.getNbbm().equals(map.get("clZbh").toString())
  493 + && t1.getJsy().equals(map.get("jGh").toString())
  494 + && t1.getXlbm().equals(map.get("xlBm").toString())) {
  495 + t = t1;
  496 + type = "update";
  497 + }
  498 + }
  499 +
  500 + // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量
  501 + /* if (map.get("seqNumber").toString().equals("1")) {
  502 + boolean fage = true;
  503 + for (int i = 0; i < ylListBe.size(); i++) {
  504 + Ylb ylb = ylListBe.get(i);
  505 + if (map.get("clZbh").toString().equals(ylb.getNbbm())) {
  506 + if(ylb.getJzyl()>0){
  507 + t.setCzyl(ylb.getJzyl());
  508 + fage = false;
  509 + break;
  510 + }
  511 +
  512 + }
  513 + }
  514 + if (fage) {
  515 + for (int y = 0; y < clyList.size(); y++) {
  516 + Cyl cyl = clyList.get(y);
  517 + if (map.get("clZbh").toString().equals(cyl.getNbbm())) {
  518 + if(cyl!=null){
  519 + if(cyl.getCyl()>=0){
  520 + t.setCzyl(cyl.getCyl());
  521 + fage = false;
  522 + break;
  523 + }else {
  524 + if(cyl.getCxrl()!=null){
  525 + if(cyl.getCxrl()>0){
  526 + t.setCzyl(cyl.getCxrl());
  527 + fage = false;
  528 + break;
  529 + }
  530 + }
  531 + }
  532 + }
  533 + }
  534 + }
  535 + }
  536 + if (fage) {
  537 + t.setCzyl(0.0);
  538 + }
  539 + }
  540 + */
  541 + Double jzl = 0.0;
  542 + //一人一车加注量只匹配一次
  543 + if(ylMap.get(map.get("clZbh").toString()+"_"+ map.get("jGh").toString())!=null){
  544 +
  545 + }else{
  546 + // 把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断)
  547 + for (int j = 0; j < ylxxList.size(); j++) {
  548 + Ylxxb ylxxb = ylxxList.get(j);
  549 + if (map.get("clZbh").toString().equals(ylxxb.getNbbm())
  550 + && map.get("jGh").toString().equals(ylxxb.getJsy())) {
  551 + jzl +=Arith.add(jzl, ylxxb.getJzl());
  552 + }
  553 + }
  554 + ylMap.put(map.get("clZbh").toString()+"_"+ map.get("jGh").toString(),map.get("xlBm") == null ? "" : map.get("xlBm").toString());
  555 + }
  556 + for (int i = 0; i < jdlList.size(); i++) {
  557 + Jdl jdl=jdlList.get(i);
  558 + if(map.get("clZbh").toString().equals(jdl.getNbbm())
  559 + &&map.get("jGh").toString().equals(jdl.getJsy())
  560 + &&map.get("bCompany").toString().equals(jdl.getFgsBm())){
  561 + jzl+=jdl.getJdl();
  562 + }
  563 + }
  564 +
  565 + t.setCdl(jzl);
  566 + t.setCzcd(100.0);
  567 + t.setJzcd(100.0);
  568 + t.setHd(jzl);
  569 + t.setNbbm(map.get("clZbh").toString());
  570 + t.setJsy(map.get("jGh") == null ? "" : map.get("jGh").toString());
  571 + t.setZlc(map.get("totalKilometers") == null ? 0.0
  572 + : Double.parseDouble(map.get("totalKilometers").toString()));
  573 + t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString());
  574 + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
  575 + t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString());
  576 + t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString());
  577 + t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString());
  578 + t.setRq(sdf.parse(rq));
  579 +
  580 + if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){
  581 + if(type.equals("add")){
  582 + t.setCreatetime(date);
  583 + addList.add(t);
  584 + }else{
  585 + t.setUpdatetime(date);
  586 + updateList.add(t);
  587 + ins += t.getId().toString()+",";
  588 + }
  589 + }
  590 +// repository.save(t);
  591 + newMap.put("status", ResponseCode.SUCCESS);
  592 +
  593 + }
  594 + }
  595 + if(addList.size()>0){
  596 + try {
  597 + new BatchSaveUtils<Dlb>().saveList2(addList, Dlb.class);
  598 + } catch (Exception e) {
  599 + // TODO: handle exception
  600 + if(e.getMessage().indexOf("PK_YLB_UK")>0){
  601 + newMap.put("fage", "存在相同数据,数据已经过滤");
  602 + logger.info("获取:存在相同数据,数据已经过滤");
  603 + }
  604 + }
  605 +
  606 + }
  607 +
  608 + if(updateList.size()>0){
  609 + for (int i = 0; i < updateList.size(); i++) {
  610 + repository.save(updateList.get(i));
  611 + }
  612 + }
  613 + newMap.put("status", ResponseCode.SUCCESS);
  614 + } catch (Exception e) {
  615 + // TODO Auto-generated catch block
  616 + newMap.put("status", ResponseCode.ERROR);
  617 + throw e;
  618 + }
  619 +
363 return newMap; 620 return newMap;
364 } 621 }
365 622
@@ -717,4 +974,43 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS @@ -717,4 +974,43 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
717 } 974 }
718 return newMap; 975 return newMap;
719 } 976 }
  977 +
  978 + public List<Dlb> listOrderBy(String rq,String gsdm,
  979 + String fgsdm,String xlbm,String nbbm,
  980 + String px) {
  981 + // TODO Auto-generated method stub
  982 + String sql="SELECT * FROM bsth_c_dlb "
  983 + + " where to_days('"+rq+"')=to_days(rq) and ssgsdm like '%"+gsdm+"%' "
  984 + + " and fgsdm like '%"+fgsdm+"%'";
  985 + if(xlbm.equals("")){
  986 + sql+= " and xlbm like '%"+xlbm+"%' ";
  987 + }else{
  988 + sql+= " and xlbm = '"+xlbm+"' ";
  989 + }
  990 +
  991 + sql += "and nbbm like '%"+nbbm+"%' order by "+px+" asc ";
  992 +
  993 + List<Dlb> list = jdbcTemplate.query(sql, new RowMapper<Dlb>() {
  994 + @Override
  995 + public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException {
  996 + Dlb y = new Dlb();
  997 + y.setId(arg0.getInt("id"));
  998 + return y;
  999 + }
  1000 + });
  1001 + List<Dlb> lists=new ArrayList<Dlb>();
  1002 + List<Dlb> dlbLists=repository.obtainDl(rq,gsdm,fgsdm,xlbm,nbbm,"jcsx");
  1003 + for (int i = 0; i < list.size(); i++) {
  1004 + Dlb t=list.get(i);
  1005 + for (int j = 0; j < dlbLists.size(); j++) {
  1006 + Dlb t2=dlbLists.get(j);
  1007 + if(t.getId().intValue()==t2.getId().intValue()){
  1008 + lists.add(t2);
  1009 + break;
  1010 + }
  1011 + }
  1012 + }
  1013 +
  1014 + return lists;
  1015 + }
720 } 1016 }
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -868,30 +868,127 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -868,30 +868,127 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
868 Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId()); 868 Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());
869 869
870 map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos))); 870 map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos)));
871 - map.put("remMileage",culateMieageService.culateLbgl(lists)); 871 + map.put("remMileage",culateMieageService.culateLbgl(scheduleRealInfos));
872 map.put("addMileage", culateMieageService.culateLjgl(lists)); 872 map.put("addMileage", culateMieageService.culateLjgl(lists));
873 double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists)); 873 double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists));
874 map.put("yygl", yygl); 874 map.put("yygl", yygl);
875 - double ksgl=Arith.add(culateMieageService.culateKsgl(lists),culateMieageService.culateJccgl(lists)); 875 + double ksgl=Arith.add(culateMieageService.culateKsgl(scheduleRealInfos),culateMieageService.culateJccgl(lists));
876 map.put("ksgl",ksgl); 876 map.put("ksgl",ksgl);
877 map.put("realMileage", Arith.add(yygl ,ksgl)); 877 map.put("realMileage", Arith.add(yygl ,ksgl));
878 - map.put("jhbc", culateMieageService.culateJhgl(scheduleRealInfos));  
879 - map.put("cjbc", culateMieageService.culateLbbc(lists)); 878 + map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos,""));
  879 + map.put("cjbc", culateMieageService.culateLbbc(scheduleRealInfos));
880 map.put("ljbc", culateMieageService.culateLjbc(lists, "")); 880 map.put("ljbc", culateMieageService.culateLjbc(lists, ""));
881 int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, ""); 881 int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, "");
882 map.put("sjbc", sjbc); 882 map.put("sjbc", sjbc);
883 // map=new HashMap<String,Object>(); 883 // map=new HashMap<String,Object>();
  884 +
  885 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
  886 + String sqlMinYysj="select start_opt from bsth_c_line_config where "
  887 + + " id = ("
  888 + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'"
  889 + + ")";
  890 + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  891 + String[] minSjs = minfcsj.split(":");
  892 + Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
  893 +
  894 +
  895 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  896 + ScheduleRealInfo s=scheduleRealInfos.get(i);
  897 + String[] fcsj= s.getFcsj().split(":");
  898 + Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);
  899 +
  900 + Long fscjT=0L;
  901 + if(fcsjL<minSj){
  902 + Calendar calendar = new GregorianCalendar();
  903 + calendar.setTime(s.getScheduleDate());
  904 + calendar.add(calendar.DATE,1);
  905 + s.setScheduleDate(calendar.getTime());
  906 + try {
  907 + fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime();
  908 + } catch (ParseException e) {
  909 + // TODO Auto-generated catch block
  910 + e.printStackTrace();
  911 + }
  912 +
  913 + }else{
  914 + try {
  915 + fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime();
  916 + } catch (ParseException e) {
  917 + // TODO Auto-generated catch block
  918 + e.printStackTrace();
  919 + };
  920 + }
  921 + s.setFcsjT(fscjT);
  922 + }
  923 + List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>();
  924 + Collections.sort(scheduleRealInfos, new ComparableReal());
  925 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  926 + ScheduleRealInfo s = scheduleRealInfos.get(i);
  927 + s.setAdjustExps(i + 1 + "");
  928 + String remarks = "";
  929 + if (s.getRemarks() != null) {
  930 + remarks += s.getRemarks();
  931 + }
  932 +
  933 + Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
  934 + if (!childTaskPlans.isEmpty()) {
  935 + s.setFcsjActual("");
  936 + s.setZdsjActual("");
  937 + s.setJhlc(0.0);
  938 + }
  939 +
  940 + if (s.isDestroy()) {
  941 + s.setFcsjActual("");
  942 + s.setZdsjActual("");
  943 + s.setJhlc(0.0);
  944 + remarks += "(烂班)";
  945 + s.setRemarks(remarks);
  946 + }
  947 +
  948 + listSchedule.add(s);
  949 + //计算营运里程,空驶里程
  950 + if (!childTaskPlans.isEmpty()) {
  951 +// Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  952 + List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
  953 + Collections.sort(listit, new ComparableChild());
  954 + for (int j = 0; j < listit.size(); j++) {
  955 + ScheduleRealInfo t = new ScheduleRealInfo();
  956 + ChildTaskPlan childTaskPlan = listit.get(j);
  957 + if (childTaskPlan.isDestroy()) {
  958 + t.setFcsjActual("");
  959 + t.setZdsjActual("");
  960 + t.setJhlc(0.0);
  961 + } else {
  962 + t.setFcsjActual(childTaskPlan.getStartDate());
  963 + t.setZdsjActual(childTaskPlan.getEndDate());
  964 + t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
  965 + }
  966 + t.setQdzName(childTaskPlan.getStartStationName());
  967 + t.setZdzName(childTaskPlan.getEndStationName());
  968 + t.setRemarks(childTaskPlan.getRemarks());
  969 + t.setAdjustExps("子");
  970 + t.setjGh("");
  971 + t.setjName("");
  972 + t.setsGh("");
  973 + t.setsName("");
  974 + listSchedule.add(t);
  975 + }
  976 + }
  977 + }
884 Map<String, Object> maps; 978 Map<String, Object> maps;
885 - for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { 979 + for (ScheduleRealInfo scheduleRealInfo : listSchedule) {
886 maps = new HashMap<String, Object>(); 980 maps = new HashMap<String, Object>();
887 try { 981 try {
888 scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName()); 982 scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());
889 scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName()); 983 scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());
890 maps = rru.getMapValue(scheduleRealInfo); 984 maps = rru.getMapValue(scheduleRealInfo);
  985 + maps.put("bcs", scheduleRealInfo.getAdjustExps());
891 String zdsj = scheduleRealInfo.getZdsj(); 986 String zdsj = scheduleRealInfo.getZdsj();
892 String zdsjActual = scheduleRealInfo.getZdsjActual(); 987 String zdsjActual = scheduleRealInfo.getZdsjActual();
893 if (zdsj != null && zdsjActual != null && 988 if (zdsj != null && zdsjActual != null &&
894 - !zdsj.equals(zdsjActual)) { 989 + !zdsj.equals(zdsjActual) &&
  990 + !zdsj.equals("")&&
  991 + !zdsjActual.equals("")) {
895 if (zdsj.compareTo(zdsjActual) > 0) { 992 if (zdsj.compareTo(zdsjActual) > 0) {
896 maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual)); 993 maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
897 maps.put("slow", ""); 994 maps.put("slow", "");
@@ -908,6 +1005,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -908,6 +1005,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
908 e.printStackTrace(); 1005 e.printStackTrace();
909 } 1006 }
910 } 1007 }
  1008 +
911 String xls=""; 1009 String xls="";
912 if(map.get("type").toString().equals("0")){ 1010 if(map.get("type").toString().equals("0")){
913 xls="waybill_minhang.xls"; 1011 xls="waybill_minhang.xls";
@@ -2674,8 +2772,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2674,8 +2772,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2674 } 2772 }
2675 for (int i = 0; i < newList.size(); i++) { 2773 for (int i = 0; i < newList.size(); i++) {
2676 ScheduleRealInfo t1 = newList.get(i); 2774 ScheduleRealInfo t1 = newList.get(i);
  2775 + String reamrks1=t1.getRemarks()==null?"":t1.getRemarks();
  2776 + if(reamrks1.length()>5){
  2777 + t1.setRemarks(reamrks1.substring(0, 5));
  2778 + t1.setRemark(reamrks1);
  2779 + }
2677 for (int j = 0; j < list.size(); j++) { 2780 for (int j = 0; j < list.size(); j++) {
2678 ScheduleRealInfo t2 = list.get(j); 2781 ScheduleRealInfo t2 = list.get(j);
  2782 + String reamrks2=t2.getRemarks()==null?"":t2.getRemarks();
  2783 + if(reamrks2.length()>5){
  2784 + t2.setRemarks(reamrks2.substring(0, 5));
  2785 + t2.setRemark(reamrks2);
  2786 + }
2679 if (t1.getId() == t2.getId()) { 2787 if (t1.getId() == t2.getId()) {
2680 t1 = t2; 2788 t1 = t2;
2681 } 2789 }
@@ -3989,7 +4097,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3989,7 +4097,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3989 } 4097 }
3990 tempMap.put("fcsjk" + x, fcsjk); 4098 tempMap.put("fcsjk" + x, fcsjk);
3991 tempMap.put("fcsjm" + x, fcsjm); 4099 tempMap.put("fcsjm" + x, fcsjm);
3992 - tempMap.put("remarks" + x, schedule.getRemarks() != null ? schedule.getRemarks() : ""); 4100 + tempMap.put("remarks" + x, schedule.getRemark() != null ? schedule.getRemark() : "");
3993 4101
3994 size++; 4102 size++;
3995 } 4103 }
@@ -4058,65 +4166,163 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4058,65 +4166,163 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4058 List<Iterator<?>> list = new ArrayList<Iterator<?>>(); 4166 List<Iterator<?>> list = new ArrayList<Iterator<?>>();
4059 List<ScheduleRealInfo> scheduleRealInfos = listpl; 4167 List<ScheduleRealInfo> scheduleRealInfos = listpl;
4060 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); 4168 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
4061 -// List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line);  
4062 - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();  
4063 - for (int i = 0; i < scheduleRealInfos.size(); i++) {  
4064 - ScheduleRealInfo s=scheduleRealInfos.get(i);  
4065 - Set<ChildTaskPlan> cts = s.getcTasks();  
4066 - if(cts != null && cts.size() > 0){  
4067 - lists.add(s);  
4068 - }else{ 4169 +// List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line);
  4170 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  4171 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  4172 + ScheduleRealInfo s=scheduleRealInfos.get(i);
  4173 + Set<ChildTaskPlan> cts = s.getcTasks();
  4174 + if(cts != null && cts.size() > 0){
  4175 + lists.add(s);
  4176 + }else{
4069 if(s.getZdsjActual()!=null){ 4177 if(s.getZdsjActual()!=null){
4070 lists.add(s); 4178 lists.add(s);
4071 } 4179 }
4072 - }  
4073 - }  
4074 - DecimalFormat format = new DecimalFormat("0.00"); 4180 + }
  4181 + }
  4182 + DecimalFormat format = new DecimalFormat("0.00");
4075 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); 4183 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
4076 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); 4184 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
4077 - Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());  
4078 - //计算里程和班次数,并放入Map里  
4079 - map.put("jhlc", Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos)));  
4080 - map.put("remMileage",culateMieageService.culateLbgl(lists));  
4081 - map.put("addMileage", culateMieageService.culateLjgl(lists));  
4082 - double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists));  
4083 - map.put("yygl", yygl);  
4084 - double ksgl=Arith.add(culateMieageService.culateKsgl(lists),culateMieageService.culateJccgl(lists));  
4085 - map.put("ksgl",ksgl);  
4086 - map.put("realMileage", Arith.add(yygl ,ksgl));  
4087 - map.put("jhbc", culateMieageService.culateJhgl(scheduleRealInfos));  
4088 - map.put("cjbc", culateMieageService.culateLbbc(lists));  
4089 - map.put("ljbc", culateMieageService.culateLjbc(lists, ""));  
4090 - int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, "");  
4091 - map.put("sjbc", sjbc);  
4092 -  
4093 - Map<String, Object> maps;  
4094 - for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) {  
4095 - maps = new HashMap<String, Object>();  
4096 - try {  
4097 - scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());  
4098 - scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());  
4099 - maps = rru.getMapValue(scheduleRealInfo);  
4100 - String zdsj = scheduleRealInfo.getZdsj();  
4101 - String zdsjActual = scheduleRealInfo.getZdsjActual();  
4102 - if (zdsj != null && zdsjActual != null &&  
4103 - !zdsj.equals(zdsjActual)) {  
4104 - if (zdsj.compareTo(zdsjActual) > 0) {  
4105 - maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));  
4106 - maps.put("slow", "");  
4107 - } else {  
4108 - maps.put("fast", "");  
4109 - maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));  
4110 - }  
4111 - } else {  
4112 - maps.put("fast", "");  
4113 - maps.put("slow", "");  
4114 - }  
4115 - listMap.add(maps);  
4116 - } catch (Exception e) {  
4117 - e.printStackTrace();  
4118 - }  
4119 - } 4185 + //计算里程和班次数,并放入Map里
  4186 + Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());
  4187 +
  4188 + map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos)));
  4189 + map.put("remMileage",culateMieageService.culateLbgl(scheduleRealInfos));
  4190 + map.put("addMileage", culateMieageService.culateLjgl(lists));
  4191 + double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists));
  4192 + map.put("yygl", yygl);
  4193 + double ksgl=Arith.add(culateMieageService.culateKsgl(scheduleRealInfos),culateMieageService.culateJccgl(lists));
  4194 + map.put("ksgl",ksgl);
  4195 + map.put("realMileage", Arith.add(yygl ,ksgl));
  4196 + map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos,""));
  4197 + map.put("cjbc", culateMieageService.culateLbbc(scheduleRealInfos));
  4198 + map.put("ljbc", culateMieageService.culateLjbc(lists, ""));
  4199 + int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, "");
  4200 + map.put("sjbc", sjbc);
  4201 +// map=new HashMap<String,Object>();
  4202 +
  4203 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
  4204 + String sqlMinYysj="select start_opt from bsth_c_line_config where "
  4205 + + " id = ("
  4206 + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(listpl.get(0).getXlBm()) +"'"
  4207 + + ")";
  4208 + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  4209 + String[] minSjs = minfcsj.split(":");
  4210 + Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
  4211 +
  4212 +
  4213 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  4214 + ScheduleRealInfo s=scheduleRealInfos.get(i);
  4215 + String[] fcsj= s.getFcsj().split(":");
  4216 + Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);
  4217 +
  4218 + Long fscjT=0L;
  4219 + if(fcsjL<minSj){
  4220 + Calendar calendar = new GregorianCalendar();
  4221 + calendar.setTime(s.getScheduleDate());
  4222 + calendar.add(calendar.DATE,1);
  4223 + s.setScheduleDate(calendar.getTime());
  4224 + try {
  4225 + fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime();
  4226 + } catch (ParseException e) {
  4227 + // TODO Auto-generated catch block
  4228 + e.printStackTrace();
  4229 + }
  4230 +
  4231 + }else{
  4232 + try {
  4233 + fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime();
  4234 + } catch (ParseException e) {
  4235 + // TODO Auto-generated catch block
  4236 + e.printStackTrace();
  4237 + };
  4238 + }
  4239 + s.setFcsjT(fscjT);
  4240 + }
  4241 + List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>();
  4242 + Collections.sort(scheduleRealInfos, new ComparableReal());
  4243 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  4244 + ScheduleRealInfo s = scheduleRealInfos.get(i);
  4245 + s.setAdjustExps(i + 1 + "");
  4246 + String remarks = "";
  4247 + if (s.getRemarks() != null) {
  4248 + remarks += s.getRemarks();
  4249 + }
  4250 +
  4251 + Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
  4252 + if (!childTaskPlans.isEmpty()) {
  4253 + s.setFcsjActual("");
  4254 + s.setZdsjActual("");
  4255 + s.setJhlc(0.0);
  4256 + }
  4257 +
  4258 + if (s.isDestroy()) {
  4259 + s.setFcsjActual("");
  4260 + s.setZdsjActual("");
  4261 + s.setJhlc(0.0);
  4262 + remarks += "(烂班)";
  4263 + s.setRemarks(remarks);
  4264 + }
  4265 +
  4266 + listSchedule.add(s);
  4267 + //计算营运里程,空驶里程
  4268 + if (!childTaskPlans.isEmpty()) {
  4269 +// Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  4270 + List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
  4271 + Collections.sort(listit, new ComparableChild());
  4272 + for (int j = 0; j < listit.size(); j++) {
  4273 + ScheduleRealInfo t = new ScheduleRealInfo();
  4274 + ChildTaskPlan childTaskPlan = listit.get(j);
  4275 + if (childTaskPlan.isDestroy()) {
  4276 + t.setFcsjActual("");
  4277 + t.setZdsjActual("");
  4278 + t.setJhlc(0.0);
  4279 + } else {
  4280 + t.setFcsjActual(childTaskPlan.getStartDate());
  4281 + t.setZdsjActual(childTaskPlan.getEndDate());
  4282 + t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
  4283 + }
  4284 + t.setQdzName(childTaskPlan.getStartStationName());
  4285 + t.setZdzName(childTaskPlan.getEndStationName());
  4286 + t.setRemarks(childTaskPlan.getRemarks());
  4287 + t.setAdjustExps("子");
  4288 + t.setjGh("");
  4289 + t.setjName("");
  4290 + t.setsGh("");
  4291 + t.setsName("");
  4292 + listSchedule.add(t);
  4293 + }
  4294 + }
  4295 + }
  4296 + Map<String, Object> maps;
  4297 + for (ScheduleRealInfo scheduleRealInfo : listSchedule) {
  4298 + maps = new HashMap<String, Object>();
  4299 + try {
  4300 + scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());
  4301 + scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());
  4302 + maps = rru.getMapValue(scheduleRealInfo);
  4303 + maps.put("bcs", scheduleRealInfo.getAdjustExps());
  4304 + String zdsj = scheduleRealInfo.getZdsj();
  4305 + String zdsjActual = scheduleRealInfo.getZdsjActual();
  4306 + if (zdsj != null && zdsjActual != null &&
  4307 + !zdsj.equals(zdsjActual) &&
  4308 + !zdsj.equals("")&&
  4309 + !zdsjActual.equals("")) {
  4310 + if (zdsj.compareTo(zdsjActual) > 0) {
  4311 + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  4312 + maps.put("slow", "");
  4313 + } else {
  4314 + maps.put("fast", "");
  4315 + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  4316 + }
  4317 + } else {
  4318 + maps.put("fast", "");
  4319 + maps.put("slow", "");
  4320 + }
  4321 + listMap.add(maps);
  4322 + } catch (Exception e) {
  4323 + e.printStackTrace();
  4324 + }
  4325 + }
4120 4326
4121 4327
4122 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; 4328 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -39,6 +39,8 @@ import java.text.ParseException; @@ -39,6 +39,8 @@ import java.text.ParseException;
39 import java.text.SimpleDateFormat; 39 import java.text.SimpleDateFormat;
40 import java.util.*; 40 import java.util.*;
41 41
  42 +import javax.persistence.criteria.CriteriaBuilder.In;
  43 +
42 @Service 44 @Service
43 public class ReportServiceImpl implements ReportService{ 45 public class ReportServiceImpl implements ReportService{
44 46
@@ -864,12 +866,14 @@ public class ReportServiceImpl implements ReportService{ @@ -864,12 +866,14 @@ public class ReportServiceImpl implements ReportService{
864 //查询时间里程 866 //查询时间里程
865 String sqlPc=" (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,2 as xh FROM " 867 String sqlPc=" (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,2 as xh FROM "
866 + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and " 868 + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and "
867 - + " fcsj <='"+minfcsj+"' and bc_type!='in' and bc_type!='out' and bc_type!='ldks') " 869 + + " fcsj <='"+minfcsj+"' and bc_type!='ldks'"
  870 + + " and bc_type !='region') "
868 + " union " 871 + " union "
869 + " (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,1 as xh FROM " 872 + " (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,1 as xh FROM "
870 + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and " 873 + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and "
871 - + " fcsj > '"+minfcsj+"' and bc_type!='in' and bc_type!='out' and bc_type!='ldks') "  
872 - + " order by xl_dir, xh, fcsj"; 874 + + " fcsj > '"+minfcsj+"' and bc_type!='ldks' "
  875 + + " and bc_type !='region') "
  876 + + " order by xl_dir, xh, lp,fcsj";
873 Map<String, Object> map=new HashMap<String,Object>(); 877 Map<String, Object> map=new HashMap<String,Object>();
874 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc, 878 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc,
875 new RowMapper<Map<String, Object>>(){ 879 new RowMapper<Map<String, Object>>(){
@@ -883,17 +887,399 @@ public class ReportServiceImpl implements ReportService{ @@ -883,17 +887,399 @@ public class ReportServiceImpl implements ReportService{
883 m.put("lp", rs.getString("lp")); 887 m.put("lp", rs.getString("lp"));
884 m.put("dir", rs.getString("xl_dir")); 888 m.put("dir", rs.getString("xl_dir"));
885 m.put("ists", rs.getString("ists")!=null?rs.getString("ists"):""); 889 m.put("ists", rs.getString("ists")!=null?rs.getString("ists"):"");
886 - 890 + String[] split = m.get("fcsj").toString().split(":");
887 if(rs.getString("xh").equals("2")){ 891 if(rs.getString("xh").equals("2")){
888 - String[] split = m.get("fcsj").toString().split(":");  
889 - m.put("fcsj", Integer.valueOf(split[0]) + 24 + ":"+split[1]); 892 + m.put("fcsj", (Integer.valueOf(split[0]) + 24) + ":"+split[1]);
890 } 893 }
891 894
892 return m; 895 return m;
893 } 896 }
894 }); 897 });
895 -  
896 - List<Map<String, Object>> newList=new ArrayList<Map<String,Object>>(); 898 + List<Map<String, Object>> newList=new ArrayList<Map<String,Object>>();
  899 + int yysxZq=0,yyxxZq=0,tzsxZq=0,tzxxZq=0,minZqcj=0,maxZqcj=0,sxcountZqbc=0,xxcountZqbc=0; //早前
  900 + int yysxZgf=0,yyxxZgf=0,tzsxZgf=0,tzxxZgf=0,minZgfcj=0,maxZgfcj=0,sxcountZgfbc=0,xxcountZgfbc=0;//早高峰
  901 + int yysxZw=0,yyxxZw=0,tzsxZw=0,tzxxZw=0,minZwcj=0,maxZwcj=0,sxcountZwbc=0,xxcountZwbc=0;//中午
  902 + int yysxWgf=0,yyxxWgf=0,tzsxWgf=0,tzxxWgf=0,minWgfcj=0,maxWgfcj=0,sxcountWgfbc=0,xxcountWgfbc=0;//晚高峰
  903 + int yysxWh=0,yyxxWh=0,tzsxWh=0,tzxxWh=0,minWhcj=0,maxWhcj=0,sxcountWhbc=0,xxcountWhbc=0;//晚后
  904 + List<Integer> zqFcsj0=new ArrayList<Integer>();
  905 + List<Integer> zgfFcsj0=new ArrayList<Integer>();
  906 + List<Integer> zwFcsj0=new ArrayList<Integer>();
  907 + List<Integer> wgfFcsj0=new ArrayList<Integer>();
  908 + List<Integer> whFcsj0=new ArrayList<Integer>();
  909 +
  910 + List<Integer> zqFcsj1=new ArrayList<Integer>();
  911 + List<Integer> zgfFcsj1=new ArrayList<Integer>();
  912 + List<Integer> zwFcsj1=new ArrayList<Integer>();
  913 + List<Integer> wgfFcsj1=new ArrayList<Integer>();
  914 + List<Integer> whFcsj1=new ArrayList<Integer>();
  915 + int temp = 48*60+1, zcj = 0;
  916 + boolean ists = true;
  917 + String lpname="";
  918 + for (int i = 0; i < list.size(); i++) {
  919 + Map<String, Object> m=list.get(i);
  920 + int xlDir = Integer.valueOf(m.get("dir").toString());
  921 + String[] split = m.get("fcsj").toString().split(":");
  922 + int fcsjT = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  923 + String bcType=m.get("bcType").toString();
  924 + int bcsj = Integer.valueOf(m.get("bcsj").toString());
  925 + if(i==0){
  926 + lpname=m.get("lp").toString();
  927 + if(temp>fcsjT){
  928 + temp=fcsjT+bcsj;
  929 + }
  930 + }else{
  931 + if(temp>fcsjT){
  932 + temp=fcsjT+bcsj;
  933 + }
  934 + if(bcType.equals("in") || bcType.equals("out")){
  935 + temp = fcsjT+bcsj;
  936 + lpname=m.get("lp").toString();
  937 + ists=false;
  938 + }else{
  939 +// if(ists){
  940 +// temp = fcsjT+bcsj;
  941 +// lpname=m.get("lp").toString();
  942 +// }else{
  943 + if(xlDir==0){
  944 + //上行数据
  945 + if(fcsjT>= minSj && fcsjT <= 6*60+30){
  946 + //早高峰前
  947 + yysxZq +=bcsj;
  948 + sxcountZqbc ++;
  949 + zqFcsj0.add(fcsjT);
  950 + if(ists){
  951 + if(lpname.equals(m.get("lp").toString())){
  952 + tzsxZq +=fcsjT-temp;
  953 + }
  954 + }
  955 + temp = fcsjT+bcsj;
  956 +
  957 + }else if(fcsjT > 6*60+30 && fcsjT <= 8*60+30){
  958 + //早高峰
  959 + yysxZgf +=bcsj;
  960 + sxcountZgfbc ++;
  961 + zgfFcsj0.add(fcsjT);
  962 + if(ists){
  963 + if(lpname.equals(m.get("lp").toString())){
  964 + tzsxZgf +=fcsjT-temp;
  965 + }
  966 + }
  967 + temp =fcsjT+bcsj;
  968 +
  969 + }else if(fcsjT > 8*60+30 && fcsjT <= 16*60){
  970 + //中午
  971 + yysxZw +=bcsj;
  972 + sxcountZwbc ++;
  973 + zwFcsj0.add(fcsjT);
  974 + if(ists){
  975 + if(lpname.equals(m.get("lp").toString())){
  976 + tzsxZw +=fcsjT-temp;
  977 + }
  978 + }
  979 + temp =fcsjT+bcsj;
  980 + }else if(fcsjT > 16*60 && fcsjT <= 18*60){
  981 + //晚高峰
  982 + yysxWgf +=bcsj;
  983 + sxcountWgfbc ++;
  984 + wgfFcsj0.add(fcsjT);
  985 + if(ists){
  986 + if(lpname.equals(m.get("lp").toString())){
  987 + tzsxWgf +=fcsjT-temp;
  988 + }
  989 + }
  990 + temp =fcsjT+bcsj;
  991 + }else{
  992 + //晚高峰后
  993 + yysxWh +=bcsj;
  994 + sxcountWhbc ++;
  995 + whFcsj0.add(fcsjT);
  996 + if(ists){
  997 + if(lpname.equals(m.get("lp").toString())){
  998 + tzsxWh +=fcsjT-temp;
  999 + }
  1000 + }
  1001 + temp =fcsjT+bcsj;
  1002 + }
  1003 + lpname=m.get("lp").toString();
  1004 + }else{
  1005 + //下行数据
  1006 + if(fcsjT>= minSj && fcsjT <= 6*60+30){
  1007 + //早高峰前
  1008 + yyxxZq +=bcsj;
  1009 + xxcountZqbc ++;
  1010 + zqFcsj1.add(fcsjT);
  1011 + if(ists){
  1012 + if(lpname.equals(m.get("lp").toString())){
  1013 + tzxxZq +=fcsjT-temp;
  1014 + }
  1015 + }
  1016 + temp =fcsjT+bcsj;
  1017 + }else if(fcsjT > 6*60+30 && fcsjT <= 8*60+30){
  1018 + //早高峰
  1019 + yyxxZgf +=bcsj;
  1020 + xxcountZgfbc ++;
  1021 + zgfFcsj1.add(fcsjT);
  1022 + if(ists){
  1023 + if(lpname.equals(m.get("lp").toString())){
  1024 + tzxxZgf +=fcsjT-temp;
  1025 + }
  1026 + }
  1027 + temp =fcsjT+bcsj;
  1028 + }else if(fcsjT > 8*60+30 && fcsjT <= 16*60){
  1029 + //中午
  1030 + yyxxZw +=bcsj;
  1031 + xxcountZwbc ++;
  1032 + zwFcsj1.add(fcsjT);
  1033 + if(ists){
  1034 + if(lpname.equals(m.get("lp").toString())){
  1035 + tzxxZw +=fcsjT-temp;
  1036 + }
  1037 + }
  1038 + temp =fcsjT+bcsj;
  1039 + }else if(fcsjT > 16*60 && fcsjT <= 18*60){
  1040 + //晚高峰
  1041 + yyxxWgf +=bcsj;
  1042 + xxcountWgfbc ++;
  1043 + wgfFcsj1.add(fcsjT);
  1044 + if(ists){
  1045 + if(lpname.equals(m.get("lp").toString())){
  1046 + tzxxWgf +=fcsjT-temp;
  1047 + }
  1048 + }
  1049 + temp =fcsjT+bcsj;
  1050 + }else{
  1051 + //晚高峰后
  1052 + yyxxWh +=bcsj;
  1053 + xxcountWhbc ++;
  1054 + whFcsj1.add(fcsjT);
  1055 + if(ists){
  1056 + if(lpname.equals(m.get("lp").toString())){
  1057 + tzxxWh +=fcsjT-temp;
  1058 + }
  1059 + }
  1060 + temp =fcsjT+bcsj;
  1061 + }
  1062 +// }
  1063 + }
  1064 + }
  1065 + }
  1066 + if(m.get("ists").toString().trim().equals("1")){
  1067 + ists=false;
  1068 + }else{
  1069 + ists = true;
  1070 + }
  1071 + }
  1072 +
  1073 + //---------------------------------------早前
  1074 + List<Integer> cjs = new ArrayList<Integer>();
  1075 + Collections.sort(zqFcsj0);
  1076 + int fcsjs=0;
  1077 + for (int i = 0; i < zqFcsj0.size(); i++) {
  1078 + if(i==0){
  1079 + fcsjs =zqFcsj0.get(i);
  1080 + }else{
  1081 + cjs.add(zqFcsj0.get(i)-fcsjs);
  1082 + fcsjs=zqFcsj0.get(i);
  1083 + }
  1084 +
  1085 + }
  1086 + Collections.sort(zqFcsj1);
  1087 + int fcsjx=0;
  1088 + for (int i = 0; i < zqFcsj1.size(); i++) {
  1089 + if(i==0){
  1090 + fcsjx =zqFcsj1.get(i);
  1091 + }else{
  1092 + cjs.add(zqFcsj1.get(i)-fcsjx);
  1093 + fcsjx =zqFcsj1.get(i);
  1094 + }
  1095 +
  1096 + }
  1097 + Collections.sort(cjs);
  1098 + for(int i : cjs){
  1099 + zcj += i;
  1100 + }
  1101 + Map<String, Object> tempMap = new HashMap<String, Object>();
  1102 + tempMap.put("sjd", "(首)——6:30");
  1103 + tempMap.put("sxsj", sxcountZqbc != 0 ? yysxZq / sxcountZqbc : "0");
  1104 + tempMap.put("xxsj", xxcountZqbc != 0 ? yyxxZq / xxcountZqbc : "0");
  1105 + tempMap.put("sxtssj", sxcountZqbc!= 0 ? tzsxZq / sxcountZqbc : "0");
  1106 + tempMap.put("xxtssj", xxcountZqbc != 0 ? tzxxZq / xxcountZqbc : "0");
  1107 + tempMap.put("fqsj", Integer.valueOf(tempMap.get("sxsj").toString()) + Integer.valueOf(tempMap.get("xxsj").toString())
  1108 + + Integer.valueOf(tempMap.get("sxtssj").toString()) + Integer.valueOf(tempMap.get("xxtssj").toString()));
  1109 + tempMap.put("cjqj", cjs.size()>0?cjs.get(0)+"——"+cjs.get(cjs.size()-1):"——");
  1110 + tempMap.put("pjcj", cjs.size()>0?zcj/cjs.size():"/");
  1111 + newList.add(tempMap);
  1112 +
  1113 + //----------------------------------早高峰
  1114 + cjs = new ArrayList<Integer>();
  1115 + zcj =0;
  1116 +
  1117 + Collections.sort(zgfFcsj0);
  1118 + fcsjs=0;
  1119 + for (int i = 0; i < zgfFcsj0.size(); i++) {
  1120 + if(i==0){
  1121 + fcsjs =zgfFcsj0.get(i);
  1122 + }else{
  1123 + cjs.add(zgfFcsj0.get(i)-fcsjs);
  1124 + fcsjs=zgfFcsj0.get(i);
  1125 + }
  1126 +
  1127 + }
  1128 + Collections.sort(zgfFcsj1);
  1129 + fcsjx=0;
  1130 + for (int i = 0; i < zgfFcsj1.size(); i++) {
  1131 + if(i==0){
  1132 + fcsjx =zgfFcsj1.get(i);
  1133 + }else{
  1134 + cjs.add(zgfFcsj1.get(i)-fcsjx);
  1135 + fcsjx =zgfFcsj1.get(i);
  1136 + }
  1137 +
  1138 + }
  1139 + Collections.sort(cjs);
  1140 + for(int i : cjs){
  1141 + zcj += i;
  1142 + }
  1143 +
  1144 + tempMap = new HashMap<String, Object>();
  1145 + tempMap.put("sjd", "6:31——8:30");
  1146 + tempMap.put("sxsj", sxcountZgfbc != 0 ? yysxZgf / sxcountZgfbc : "0");
  1147 + tempMap.put("xxsj", xxcountZgfbc != 0 ? yyxxZgf / xxcountZgfbc : "0");
  1148 + tempMap.put("sxtssj", sxcountZgfbc!= 0 ? tzsxZgf / sxcountZgfbc : "0");
  1149 + tempMap.put("xxtssj", xxcountZgfbc != 0 ? tzxxZgf / xxcountZgfbc : "0");
  1150 + tempMap.put("fqsj", Integer.valueOf(tempMap.get("sxsj").toString()) + Integer.valueOf(tempMap.get("xxsj").toString())
  1151 + + Integer.valueOf(tempMap.get("sxtssj").toString()) + Integer.valueOf(tempMap.get("xxtssj").toString()));
  1152 + tempMap.put("cjqj", cjs.size()>0?cjs.get(0)+"——"+cjs.get(cjs.size()-1):"——");
  1153 + tempMap.put("pjcj", cjs.size()>0?zcj/cjs.size():"/");
  1154 + newList.add(tempMap);
  1155 + //----------------------------------------------中午
  1156 + cjs = new ArrayList<Integer>();
  1157 + zcj =0;
  1158 +
  1159 + Collections.sort(zwFcsj0);
  1160 + fcsjs=0;
  1161 + for (int i = 0; i < zwFcsj0.size(); i++) {
  1162 + if(i==0){
  1163 + fcsjs =zwFcsj0.get(i);
  1164 + }else{
  1165 + cjs.add(zwFcsj0.get(i)-fcsjs);
  1166 + fcsjs=zwFcsj0.get(i);
  1167 + }
  1168 +
  1169 + }
  1170 + Collections.sort(zwFcsj1);
  1171 + fcsjx=0;
  1172 + for (int i = 0; i < zwFcsj1.size(); i++) {
  1173 + if(i==0){
  1174 + fcsjx =zwFcsj1.get(i);
  1175 + }else{
  1176 + cjs.add(zwFcsj1.get(i)-fcsjx);
  1177 + fcsjx =zwFcsj1.get(i);
  1178 + }
  1179 +
  1180 + }
  1181 + Collections.sort(cjs);
  1182 + for(int i : cjs){
  1183 + zcj += i;
  1184 + }
  1185 +
  1186 + tempMap = new HashMap<String, Object>();
  1187 + tempMap.put("sjd", "8:31——16:00");
  1188 + tempMap.put("sxsj", sxcountZwbc != 0 ? yysxZw / sxcountZwbc : "0");
  1189 + tempMap.put("xxsj", xxcountZwbc != 0 ? yyxxZw / xxcountZwbc : "0");
  1190 + tempMap.put("sxtssj", sxcountZwbc!= 0 ? tzsxZw / sxcountZwbc : "0");
  1191 + tempMap.put("xxtssj", xxcountZwbc != 0 ? tzxxZw / xxcountZwbc : "0");
  1192 + tempMap.put("fqsj", Integer.valueOf(tempMap.get("sxsj").toString()) + Integer.valueOf(tempMap.get("xxsj").toString())
  1193 + + Integer.valueOf(tempMap.get("sxtssj").toString()) + Integer.valueOf(tempMap.get("xxtssj").toString()));
  1194 + tempMap.put("cjqj", cjs.size()>0?cjs.get(0)+"——"+cjs.get(cjs.size()-1):"——");
  1195 + tempMap.put("pjcj", cjs.size()>0?zcj/cjs.size():"/");
  1196 + newList.add(tempMap);
  1197 + //-------------------------------------------------晚高峰
  1198 + cjs = new ArrayList<Integer>();
  1199 + zcj =0;
  1200 +
  1201 + Collections.sort(wgfFcsj0);
  1202 + fcsjs=0;
  1203 + for (int i = 0; i < wgfFcsj0.size(); i++) {
  1204 + if(i==0){
  1205 + fcsjs =wgfFcsj0.get(i);
  1206 + }else{
  1207 + cjs.add(wgfFcsj0.get(i)-fcsjs);
  1208 + fcsjs=wgfFcsj0.get(i);
  1209 + }
  1210 +
  1211 + }
  1212 + Collections.sort(wgfFcsj1);
  1213 + fcsjx=0;
  1214 + for (int i = 0; i < wgfFcsj1.size(); i++) {
  1215 + if(i==0){
  1216 + fcsjx =wgfFcsj1.get(i);
  1217 + }else{
  1218 + cjs.add(wgfFcsj1.get(i)-fcsjx);
  1219 + fcsjx =wgfFcsj1.get(i);
  1220 + }
  1221 +
  1222 + }
  1223 + Collections.sort(cjs);
  1224 + for(int i : cjs){
  1225 + zcj += i;
  1226 + }
  1227 +
  1228 + tempMap = new HashMap<String, Object>();
  1229 + tempMap.put("sjd", "16:01——18:00");
  1230 + tempMap.put("sxsj", sxcountWgfbc != 0 ? yysxWgf / sxcountWgfbc : "0");
  1231 + tempMap.put("xxsj", xxcountWgfbc != 0 ? yyxxWgf / xxcountWgfbc : "0");
  1232 + tempMap.put("sxtssj", sxcountWgfbc!= 0 ? tzsxWgf / sxcountWgfbc : "0");
  1233 + tempMap.put("xxtssj", xxcountWgfbc != 0 ? tzxxWgf / xxcountWgfbc : "0");
  1234 + tempMap.put("fqsj", Integer.valueOf(tempMap.get("sxsj").toString()) + Integer.valueOf(tempMap.get("xxsj").toString())
  1235 + + Integer.valueOf(tempMap.get("sxtssj").toString()) + Integer.valueOf(tempMap.get("xxtssj").toString()));
  1236 + tempMap.put("cjqj", cjs.size()>0?cjs.get(0)+"——"+cjs.get(cjs.size()-1):"——");
  1237 + tempMap.put("pjcj", cjs.size()>0?zcj/cjs.size():"/");
  1238 + newList.add(tempMap);
  1239 +
  1240 + //----------------------------------晚后
  1241 + cjs = new ArrayList<Integer>();
  1242 + zcj =0;
  1243 +
  1244 + Collections.sort(whFcsj0);
  1245 + fcsjs=0;
  1246 + for (int i = 0; i < whFcsj0.size(); i++) {
  1247 + if(i==0){
  1248 + fcsjs =whFcsj0.get(i);
  1249 + }else{
  1250 + cjs.add(whFcsj0.get(i)-fcsjs);
  1251 + fcsjs=whFcsj0.get(i);
  1252 + }
  1253 +
  1254 + }
  1255 + Collections.sort(whFcsj1);
  1256 + fcsjx=0;
  1257 + for (int i = 0; i < whFcsj1.size(); i++) {
  1258 + if(i==0){
  1259 + fcsjx =whFcsj1.get(i);
  1260 + }else{
  1261 + cjs.add(whFcsj1.get(i)-fcsjx);
  1262 + fcsjx =whFcsj1.get(i);
  1263 + }
  1264 +
  1265 + }
  1266 + Collections.sort(cjs);
  1267 + for(int i : cjs){
  1268 + zcj += i;
  1269 + }
  1270 +
  1271 + tempMap = new HashMap<String, Object>();
  1272 + tempMap.put("sjd", "18:01——(末)");
  1273 + tempMap.put("sxsj", sxcountWhbc != 0 ? yysxWh / sxcountWhbc : "0");
  1274 + tempMap.put("xxsj", xxcountWhbc != 0 ? yyxxWh / xxcountWhbc : "0");
  1275 + tempMap.put("sxtssj", sxcountWhbc!= 0 ? tzsxWh / sxcountWhbc : "0");
  1276 + tempMap.put("xxtssj", xxcountWhbc != 0 ? tzxxWh / xxcountWhbc : "0");
  1277 + tempMap.put("fqsj", Integer.valueOf(tempMap.get("sxsj").toString()) + Integer.valueOf(tempMap.get("xxsj").toString())
  1278 + + Integer.valueOf(tempMap.get("sxtssj").toString()) + Integer.valueOf(tempMap.get("xxtssj").toString()));
  1279 + tempMap.put("cjqj", cjs.size()>0?cjs.get(0)+"——"+cjs.get(cjs.size()-1):"——");
  1280 + tempMap.put("pjcj", cjs.size()>0?zcj/cjs.size():"/");
  1281 + newList.add(tempMap);
  1282 + /*
897 Map<String, List<Map<String, Object>>> keyMap = new HashMap<String, List<Map<String, Object>>>(); 1283 Map<String, List<Map<String, Object>>> keyMap = new HashMap<String, List<Map<String, Object>>>();
898 Map<String, Map<String, Object>> maps = new HashMap<String, Map<String, Object>>(); 1284 Map<String, Map<String, Object>> maps = new HashMap<String, Map<String, Object>>();
899 keyMap.put("(首)——6:30", new ArrayList<Map<String, Object>>()); 1285 keyMap.put("(首)——6:30", new ArrayList<Map<String, Object>>());
@@ -923,41 +1309,99 @@ public class ReportServiceImpl implements ReportService{ @@ -923,41 +1309,99 @@ public class ReportServiceImpl implements ReportService{
923 Map<String, Object> tempMap = new HashMap<String, Object>(); 1309 Map<String, Object> tempMap = new HashMap<String, Object>();
924 List<Map<String, Object>> list2 = keyMap.get(key); 1310 List<Map<String, Object>> list2 = keyMap.get(key);
925 List<Integer> cjs = new ArrayList<Integer>(); 1311 List<Integer> cjs = new ArrayList<Integer>();
  1312 + List<Integer> fcsj_s = new ArrayList<Integer>();
  1313 + List<Integer> fcsj_x = new ArrayList<Integer>();
926 int sxsj = 0, xxsj = 0, sxtssj = 0, xxtssj = 0; 1314 int sxsj = 0, xxsj = 0, sxtssj = 0, xxtssj = 0;
927 int sxbc = 0, xxbc = 0, sxtsbc = 0, xxtsbc = 0; 1315 int sxbc = 0, xxbc = 0, sxtsbc = 0, xxtsbc = 0;
928 - int temp = 24*60+1, zcj = 0; 1316 + int temp = 48*60+1, zcj = 0;
929 boolean ists = false; 1317 boolean ists = false;
  1318 + String lpname="";
930 for(Map<String, Object> m : list2){ 1319 for(Map<String, Object> m : list2){
931 - String[] split = m.get("fcsj").toString().split(":");  
932 - int fcsj = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);  
933 - int xlDir = Integer.valueOf(m.get("dir").toString());  
934 - int bcsj = Integer.valueOf(m.get("bcsj").toString());  
935 - if(temp >= fcsj){  
936 - temp = fcsj;  
937 - ists = false;  
938 - }  
939 - if(xlDir == 0){  
940 - sxsj += bcsj;  
941 - sxbc ++;  
942 - if(ists){  
943 - sxtssj += fcsj - temp;  
944 - sxtsbc++; 1320 + String bcType=m.get("bcType").toString();
  1321 + if(bcType.equals("in") || bcType.equals("out")){
  1322 + temp=24*60+1;
  1323 + }else{
  1324 + String[] split = m.get("fcsj").toString().split(":");
  1325 + int fcsj = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1326 +
  1327 + int xlDir = Integer.valueOf(m.get("dir").toString());
  1328 + int bcsj = Integer.valueOf(m.get("bcsj").toString());
  1329 + if(temp >= fcsj){
  1330 + temp = fcsj+bcsj;
  1331 + ists = false;
945 } 1332 }
946 - } else {  
947 - xxsj += bcsj;  
948 - xxbc ++;  
949 - if(ists){  
950 - xxtssj += fcsj - temp;  
951 - xxtsbc++; 1333 + if(xlDir == 0){
  1334 + fcsj_s.add(fcsj);
  1335 + sxsj += bcsj;
  1336 + sxbc ++;
  1337 + if(!ists){
  1338 + if(lpname.equals("")){
  1339 + lpname=m.get("lp").toString();
  1340 + }else{
  1341 + if(lpname.equals(m.get("lp").toString())){
  1342 + if(fcsj-temp<90){
  1343 + sxtssj += fcsj - temp;
  1344 + }
  1345 + }
  1346 + lpname=m.get("lp").toString();
  1347 +
  1348 + }
  1349 + sxtsbc++;
  1350 + }
  1351 +
  1352 + } else {
  1353 +
  1354 + fcsj_x.add(fcsj);
  1355 + xxsj += bcsj;
  1356 + xxbc ++;
  1357 +
  1358 + if(!ists){
  1359 + if(lpname.equals("")){
  1360 + lpname=m.get("lp").toString();
  1361 + }else{
  1362 + if(lpname.equals(m.get("lp").toString())){
  1363 + if(fcsj-temp<90){
  1364 + xxtssj += fcsj- temp;
  1365 + }
  1366 + }
  1367 + lpname=m.get("lp").toString();
  1368 + }
  1369 + xxtsbc++;
  1370 + }
  1371 +
  1372 + }
  1373 + if(temp < fcsj){
  1374 + cjs.add(fcsj - temp);
  1375 + temp = fcsj;
  1376 + }
  1377 + if(m.get("ists").toString().trim().equals("1")){
  1378 + ists = true;
  1379 + }else{
  1380 + ists=false;
952 } 1381 }
953 } 1382 }
954 - if(temp < fcsj){  
955 - cjs.add(fcsj - temp);  
956 - temp = fcsj; 1383 + }
  1384 + Collections.sort(fcsj_s);
  1385 + int fcsjs=0;
  1386 + for (int i = 0; i < fcsj_s.size(); i++) {
  1387 + if(i==0){
  1388 + fcsjs =fcsj_s.get(i);
  1389 + }else{
  1390 + cjs.add(fcsj_s.get(i)-fcsjs);
  1391 + fcsjs=fcsj_s.get(i);
957 } 1392 }
958 - if(m.get("ists").toString().trim().equals("1")){  
959 - ists = true; 1393 +
  1394 + }
  1395 + Collections.sort(fcsj_x);
  1396 + int fcsjx=0;
  1397 + for (int i = 0; i < fcsj_x.size(); i++) {
  1398 + if(i==0){
  1399 + fcsjx =fcsj_x.get(i);
  1400 + }else{
  1401 + cjs.add(fcsj_x.get(i)-fcsjx);
  1402 + fcsjx =fcsj_x.get(i);
960 } 1403 }
  1404 +
961 } 1405 }
962 Collections.sort(cjs); 1406 Collections.sort(cjs);
963 for(int i : cjs){ 1407 for(int i : cjs){
@@ -978,7 +1422,7 @@ public class ReportServiceImpl implements ReportService{ @@ -978,7 +1422,7 @@ public class ReportServiceImpl implements ReportService{
978 newList.add(maps.get("6:31——8:30")); 1422 newList.add(maps.get("6:31——8:30"));
979 newList.add(maps.get("8:31——16:00")); 1423 newList.add(maps.get("8:31——16:00"));
980 newList.add(maps.get("16:01——18:00")); 1424 newList.add(maps.get("16:01——18:00"));
981 - newList.add(maps.get("18:01——(末)")); 1425 + newList.add(maps.get("18:01——(末)"));*/
982 1426
983 return newList; 1427 return newList;
984 } 1428 }
src/main/java/com/bsth/service/schedule/rules/shiftloop/GidFbFcnoFunction.java
1 -package com.bsth.service.schedule.rules.shiftloop;  
2 -  
3 -import com.bsth.entity.schedule.TTInfoDetail;  
4 -import org.kie.api.runtime.rule.AccumulateFunction;  
5 -  
6 -import java.io.*;  
7 -  
8 -/**  
9 - * 时刻表路牌下的分班班次发车顺序号。  
10 - */  
11 -public class GidFbFcnoFunction implements AccumulateFunction {  
12 - @Override  
13 - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {  
14 - }  
15 -  
16 - @Override  
17 - public void writeExternal(ObjectOutput out) throws IOException {  
18 - }  
19 -  
20 - protected static class GidFbInfoData implements Externalizable {  
21 - public Integer fbfcno;  
22 - public TTInfoDetail ttInfoDetail;  
23 -  
24 - public GidFbInfoData() {}  
25 -  
26 - @Override  
27 - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {  
28 - fbfcno = (Integer) in.readObject();  
29 - ttInfoDetail = (TTInfoDetail) in.readObject();  
30 - }  
31 -  
32 - @Override  
33 - public void writeExternal(ObjectOutput out) throws IOException {  
34 - out.writeObject(fbfcno);  
35 - out.writeObject(ttInfoDetail);  
36 - }  
37 - }  
38 -  
39 - @Override  
40 - public Serializable createContext() {  
41 - return new GidFbInfoData();  
42 - }  
43 -  
44 - @Override  
45 - public void init(Serializable context) throws Exception {  
46 - GidFbInfoData gidFbInfoData = (GidFbInfoData) context;  
47 - gidFbInfoData.fbfcno = 999;  
48 - }  
49 -  
50 - @Override  
51 - public void accumulate(Serializable context, Object value) {  
52 - GidFbInfoData gidFbInfoData = (GidFbInfoData) context;  
53 - TTInfoDetail ttInfoDetail = (TTInfoDetail) value;  
54 -  
55 - // 1块路牌有多个分班班次,取最早的时间作为起始分班班次发车顺序号  
56 - if (ttInfoDetail.getIsFB()) {  
57 - if (ttInfoDetail.getFcno() <= gidFbInfoData.fbfcno) {  
58 - gidFbInfoData.fbfcno = ttInfoDetail.getFcno();  
59 - }  
60 - }  
61 - }  
62 -  
63 - @Override  
64 - public void reverse(Serializable serializable, Object o) throws Exception {  
65 -  
66 - }  
67 -  
68 - @Override  
69 - public boolean supportsReverse() {  
70 - return false;  
71 - }  
72 -  
73 - @Override  
74 - public Class<?> getResultType() {  
75 - return Integer.class;  
76 - }  
77 -  
78 - @Override  
79 - public Object getResult(Serializable context) throws Exception {  
80 - GidFbInfoData gidFbInfoData = (GidFbInfoData) context;  
81 -  
82 - return gidFbInfoData.fbfcno;  
83 - }  
84 -  
85 -} 1 +package com.bsth.service.schedule.rules.shiftloop;
  2 +
  3 +import com.bsth.entity.schedule.TTInfoDetail;
  4 +import org.kie.api.runtime.rule.AccumulateFunction;
  5 +
  6 +import java.io.*;
  7 +
  8 +/**
  9 + * 时刻表路牌下的分班班次发车顺序号。
  10 + */
  11 +public class GidFbFcnoFunction implements AccumulateFunction {
  12 + @Override
  13 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  14 + }
  15 +
  16 + @Override
  17 + public void writeExternal(ObjectOutput out) throws IOException {
  18 + }
  19 +
  20 + protected static class GidFbInfoData implements Externalizable {
  21 + public Integer fbfcno;
  22 + public TTInfoDetail ttInfoDetail;
  23 +
  24 + public GidFbInfoData() {}
  25 +
  26 + @Override
  27 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  28 + fbfcno = (Integer) in.readObject();
  29 + ttInfoDetail = (TTInfoDetail) in.readObject();
  30 + }
  31 +
  32 + @Override
  33 + public void writeExternal(ObjectOutput out) throws IOException {
  34 + out.writeObject(fbfcno);
  35 + out.writeObject(ttInfoDetail);
  36 + }
  37 + }
  38 +
  39 + @Override
  40 + public Serializable createContext() {
  41 + return new GidFbInfoData();
  42 + }
  43 +
  44 + @Override
  45 + public void init(Serializable context) throws Exception {
  46 + GidFbInfoData gidFbInfoData = (GidFbInfoData) context;
  47 + gidFbInfoData.fbfcno = 999;
  48 + }
  49 +
  50 + @Override
  51 + public void accumulate(Serializable context, Object value) {
  52 + GidFbInfoData gidFbInfoData = (GidFbInfoData) context;
  53 + TTInfoDetail ttInfoDetail = (TTInfoDetail) value;
  54 +
  55 + // 1块路牌有多个分班班次,取最早的时间作为起始分班班次发车顺序号
  56 + if (ttInfoDetail.getIsFB()) {
  57 + if (ttInfoDetail.getFcno() <= gidFbInfoData.fbfcno) {
  58 + gidFbInfoData.fbfcno = ttInfoDetail.getFcno();
  59 + }
  60 + }
  61 + }
  62 +
  63 + @Override
  64 + public void reverse(Serializable serializable, Object o) throws Exception {
  65 +
  66 + }
  67 +
  68 + @Override
  69 + public boolean supportsReverse() {
  70 + return false;
  71 + }
  72 +
  73 + @Override
  74 + public Class<?> getResultType() {
  75 + return Integer.class;
  76 + }
  77 +
  78 + @Override
  79 + public Object getResult(Serializable context) throws Exception {
  80 + GidFbInfoData gidFbInfoData = (GidFbInfoData) context;
  81 +
  82 + return gidFbInfoData.fbfcno;
  83 + }
  84 +
  85 +}
src/main/java/com/bsth/service/traffic/YgcBasicDataService.java
@@ -17,5 +17,14 @@ public interface YgcBasicDataService { @@ -17,5 +17,14 @@ public interface YgcBasicDataService {
17 * @return 17 * @return
18 */ 18 */
19 String invokeMethod(String methodName,String param); 19 String invokeMethod(String methodName,String param);
  20 +
  21 + /**
  22 + * 下载基础数据,并生成rar文件
  23 + * @param userName
  24 + * @param password
  25 + * @param saveFile
  26 + * @return
  27 + */
  28 + boolean download(String userName, String password, String saveFile);
20 } 29 }
21 30
src/main/java/com/bsth/service/traffic/impl/YgcBasicDataServiceImpl.java
@@ -68,7 +68,7 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{ @@ -68,7 +68,7 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
68 String flag = "failure"; 68 String flag = "failure";
69 try { 69 try {
70 // 调用接口下载基础数据 70 // 调用接口下载基础数据
71 - if(download(userName, DigestUtils.md5Hex(passWord), saveFile)){ 71 + if(download(userName, passWord, saveFile)){
72 // 读取基础数据zip 72 // 读取基础数据zip
73 StringBuffer sb = readZipFile(saveFile); 73 StringBuffer sb = readZipFile(saveFile);
74 // 解析xml 74 // 解析xml
@@ -99,10 +99,11 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{ @@ -99,10 +99,11 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
99 * @param saveFile 99 * @param saveFile
100 * @return 100 * @return
101 */ 101 */
102 - private boolean download(String userName, String password, String saveFile) 102 + public boolean download(String userName, String password, String saveFile)
103 { 103 {
104 try 104 try
105 { 105 {
  106 + password = DigestUtils.md5Hex(password);
106 OMElement data = buildDownloadEnvelope(userName, password); 107 OMElement data = buildDownloadEnvelope(userName, password);
107 ServiceClient sender = new ServiceClient(); 108 ServiceClient sender = new ServiceClient();
108 Options options = sender.getOptions(); 109 Options options = sender.getOptions();
@@ -123,6 +124,12 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{ @@ -123,6 +124,12 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
123 while ((read = is.read(buffer)) != -1) { 124 while ((read = is.read(buffer)) != -1) {
124 imageOutStream.write(buffer, 0, read); 125 imageOutStream.write(buffer, 0, read);
125 } 126 }
  127 + if(is != null){
  128 + is.close();
  129 + }
  130 + if(imageOutStream != null){
  131 + imageOutStream.close();
  132 + }
126 return true; 133 return true;
127 } catch (Exception e) { 134 } catch (Exception e) {
128 e.printStackTrace(); 135 e.printStackTrace();
src/main/resources/static/pages/base/interval/add.html 0 → 100644
  1 +<!-- 片段标题 START -->
  2 +<div class="page-head">
  3 + <div class="page-title">
  4 + <h1>新增间隔信息</h1>
  5 + </div>
  6 +</div>
  7 +<!-- 片段标题 END -->
  8 +
  9 +<!-- 线路信息导航栏组件 START -->
  10 +<ul class="page-breadcrumb breadcrumb">
  11 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  12 + <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li>
  13 + <li><a href="/pages/base/interval/list.html" data-pjax>间隔信息</a> <i class="fa fa-circle"></i></li>
  14 + <li><span class="active">新增间隔信息</span></li>
  15 +</ul>
  16 +<!-- 线路信息导航栏组件 END -->
  17 +
  18 +<!-- 信息容器组件 START -->
  19 +<div class="portlet light bordered">
  20 +
  21 + <!-- 信息容器组件标题 START -->
  22 + <div class="portlet-title">
  23 + <div class="caption">
  24 + <i class="icon-equalizer font-red-sunglo"></i>
  25 + <span class="caption-subject font-red-sunglo bold uppercase">新增间隔信息</span>
  26 + </div>
  27 + </div>
  28 + <!-- 信息容器组件标题 END -->
  29 +
  30 + <!-- 表单容器组件 START -->
  31 + <div class="portlet-body form" id="intervalAddForm">
  32 +
  33 + <!-- START FORM -->
  34 + <form action="/" class="form-horizontal" id="interval_add_form" >
  35 +
  36 + <!-- 错误提示信息组件 START -->
  37 + <div class="alert alert-danger display-hide">
  38 + <button class="close" data-close="alert"></button>
  39 + 您的输入有误,请检查下面的输入项
  40 + </div>
  41 + <!-- 错误提示信息组件 END -->
  42 +
  43 + <!-- 表单内容 START -->
  44 + <div class="form-body">
  45 +
  46 + <!-- 表单分组组件 form-group START -->
  47 + <div class="form-group">
  48 + <div class="col-md-12" style="margin-top:10px">
  49 + <label class="control-label col-md-5"> 间隔等级&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  50 + <div class="col-md-4">
  51 + <input type="text" class="form-control" name="level" id="level" placeholder="间隔等级">
  52 + </div>
  53 + </div>
  54 +
  55 + <div class="col-md-12" style="margin-top:10px">
  56 + <label class="control-label col-md-5"> 高峰间隔时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  57 + <div class="col-md-4">
  58 + <input type="text" class="form-control" name="peak" id="peak" placeholder="高峰间隔时间">
  59 + </div>
  60 + </div>
  61 +
  62 + <div class="col-md-12" style="margin-top:10px">
  63 + <label class="control-label col-md-5"> 低谷间隔时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  64 + <div class="col-md-4">
  65 + <input type="text" class="form-control" name="trough" id="trough" placeholder="低谷间隔时间">
  66 + </div>
  67 + </div>
  68 +
  69 + <div class="col-md-12" style="margin-top:10px" hidden>
  70 + <label class="control-label col-md-5"> 创建人&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  71 + <div class="col-md-4">
  72 + <input type="text" class="form-control" name="createBy" id="createBy" placeholder="创建人">
  73 + </div>
  74 + </div>
  75 +
  76 + </div>
  77 + <!-- 表单分组组件 form-group END -->
  78 +
  79 + <!-- 表单按钮组件 START -->
  80 + <div class="form-actions">
  81 + <div class="row">
  82 + <div class="col-md-offset-5 col-md-7">
  83 + <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button>
  84 + <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a>
  85 + </div>
  86 + </div>
  87 + </div>
  88 + <!-- 表单按钮组件 END -->
  89 + </form>
  90 + <!-- END FORM-->
  91 + </div>
  92 + <!-- 表单组件 END -->
  93 +</div>
  94 +<!-- 信息容器组件 END -->
  95 +
  96 +<!-- 线路信息修改片段JS模块 -->
  97 +<script src="/pages/base/interval/js/interval-add-form.js"></script>
0 \ No newline at end of file 98 \ No newline at end of file
src/main/resources/static/pages/base/interval/edit.html 0 → 100644
  1 +<!-- 片段标题 START -->
  2 +<div class="page-head">
  3 + <div class="page-title">
  4 + <h1>修改间隔信息</h1>
  5 + </div>
  6 +</div>
  7 +<!-- 片段标题 END -->
  8 +
  9 +<!-- 线路信息导航栏组件 START -->
  10 +<ul class="page-breadcrumb breadcrumb">
  11 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  12 + <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li>
  13 + <li><a href="/pages/base/interval/list.html" data-pjax>间隔信息</a> <i class="fa fa-circle"></i></li>
  14 + <li><span class="active">修改间隔信息</span></li>
  15 +</ul>
  16 +<!-- 线路信息导航栏组件 END -->
  17 +
  18 +<!-- 信息容器组件 START -->
  19 +<div class="portlet light bordered">
  20 +
  21 + <!-- 信息容器组件标题 START -->
  22 + <div class="portlet-title">
  23 + <div class="caption">
  24 + <i class="icon-equalizer font-red-sunglo"></i>
  25 + <span class="caption-subject font-red-sunglo bold uppercase">修改间隔信息</span>
  26 + </div>
  27 + </div>
  28 + <!-- 信息容器组件标题 END -->
  29 +
  30 + <!-- 表单容器组件 START -->
  31 + <div class="portlet-body form" id="intervalEditForm">
  32 +
  33 + <!-- START FORM -->
  34 + <form action="/" class="form-horizontal" id="interval_edit_form" >
  35 +
  36 + <!-- 错误提示信息组件 START -->
  37 + <div class="alert alert-danger display-hide">
  38 + <button class="close" data-close="alert"></button>
  39 + 您的输入有误,请检查下面的输入项
  40 + </div>
  41 + <!-- 错误提示信息组件 END -->
  42 +
  43 + <!-- 表单内容 START -->
  44 + <div class="form-body">
  45 + <input type="hidden" name="id" id="intervalId">
  46 +
  47 + <!-- 表单分组组件 form-group START -->
  48 + <div class="form-group">
  49 + <div class="col-md-12" style="margin-top:10px">
  50 + <label class="control-label col-md-5"> 间隔等级&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  51 + <div class="col-md-4">
  52 + <input type="text" class="form-control" name="level" id="levelInput" placeholder="间隔等级">
  53 + </div>
  54 + </div>
  55 +
  56 + <div class="col-md-12" style="margin-top:10px">
  57 + <label class="control-label col-md-5"> 高峰间隔时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  58 + <div class="col-md-4">
  59 + <input type="text" class="form-control" name="peak" id="peakInput" placeholder="高峰间隔时间">
  60 + </div>
  61 + </div>
  62 +
  63 + <div class="col-md-12" style="margin-top:10px">
  64 + <label class="control-label col-md-5"> 低谷间隔时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  65 + <div class="col-md-4">
  66 + <input type="text" class="form-control" name="trough" id="troughInput" placeholder="低谷间隔时间">
  67 + </div>
  68 + </div>
  69 +
  70 + <div class="col-md-12" style="margin-top:10px">
  71 + <label class="control-label col-md-5"> 创建人&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  72 + <div class="col-md-4">
  73 + <input type="text" class="form-control" name="createBy" id="createByInput" readonly>
  74 + </div>
  75 + </div>
  76 +
  77 + <div class="col-md-12" style="margin-top:10px">
  78 + <label class="control-label col-md-5"> 创建时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  79 + <div class="col-md-4">
  80 + <input type="text" class="form-control" name="createDate" id="createDateInput" disabled>
  81 + </div>
  82 + </div>
  83 +
  84 + <div class="col-md-12" style="margin-top:10px">
  85 + <label class="control-label col-md-5"> 修改人&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  86 + <div class="col-md-4">
  87 + <input type="text" class="form-control" name="updateBy" id="updateByInput" readonly>
  88 + </div>
  89 + </div>
  90 +
  91 + <div class="col-md-12" style="margin-top:10px">
  92 + <label class="control-label col-md-5"> 修改时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  93 + <div class="col-md-4">
  94 + <input type="text" class="form-control" name="updateDate" id="updateDateInput" disabled>
  95 + </div>
  96 + </div>
  97 +
  98 + </div>
  99 + <!-- 表单分组组件 form-group END -->
  100 +
  101 + <!-- 表单按钮组件 START -->
  102 + <div class="form-actions">
  103 + <div class="row">
  104 + <div class="col-md-offset-5 col-md-7">
  105 + <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button>
  106 + <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a>
  107 + </div>
  108 + </div>
  109 + </div>
  110 + <!-- 表单按钮组件 END -->
  111 + </form>
  112 + <!-- END FORM-->
  113 + </div>
  114 + <!-- 表单组件 END -->
  115 +</div>
  116 +<!-- 信息容器组件 END -->
  117 +
  118 +<!-- 线路信息修改片段JS模块 -->
  119 +<script src="/pages/base/interval/js/interval-edit-form.js"></script>
0 \ No newline at end of file 120 \ No newline at end of file
src/main/resources/static/pages/base/interval/js/interval-add-form.js 0 → 100644
  1 +/**
  2 + * @description TODO(公司信息添加片段JS模块)
  3 + *
  4 + * @author bsth@lq
  5 + *
  6 + * @date 二〇一六年十月十八日 13:31:58
  7 + *
  8 + */
  9 +
  10 +$(function(){
  11 + // 定义表单
  12 + var form = $('#interval_add_form');
  13 + // 定义表单异常
  14 + var error = $('.alert-danger',form);
  15 + $.ajax({
  16 + type: "get",
  17 + async:false,
  18 + url: '/user/currentUser',
  19 + success: function (user) {
  20 + $("#createBy").val(user.userName);
  21 + }
  22 + })
  23 + // 表单验证
  24 + form.validate({
  25 + // 错误提示元素span对象
  26 + errorElement : 'span',
  27 + // 错误提示元素class名称
  28 + errorClass : 'help-block help-block-error',
  29 + // 验证错误获取焦点
  30 + focusInvalid : true,
  31 + // 需要验证的表单元素
  32 + rules : {
  33 + // 公司名称编码
  34 + 'level' : {
  35 + // 必填项
  36 + required : true,
  37 + // 最大长度
  38 + maxlength: 10
  39 + },
  40 + // 公司名称
  41 + 'peak' : {
  42 + // 必填项
  43 + required : true,
  44 + // 最大长度
  45 + maxlength: 10
  46 + },
  47 + // 公司名称
  48 + 'trough' : {
  49 + // 必填项
  50 + required : true,
  51 + // 最大长度
  52 + maxlength: 10
  53 + },
  54 + },
  55 + /**
  56 + * 类型:Callback。当未通过验证的表单提交时,可以在该回调函数中处理一些事情。
  57 + *
  58 + * 参数:该回调函数有两个参数:第一个为一个事件对象,第二个为验证器(validator)
  59 + */
  60 + invalidHandler : function(event, validator) {
  61 + // 显示表单未通过提示信息
  62 + error.show();
  63 + // 把提示信息放到指定的位置。
  64 + App.scrollTo(error, -200);
  65 + },
  66 + /**
  67 + * 类型:Callback。
  68 + *
  69 + * 默认:添加errorClass("has-error")到表单元素。将未通过验证的表单元素设置高亮。
  70 + */
  71 + highlight : function(element) {
  72 + // 添加errorClass("has-error")到表单元素
  73 + $(element).closest('.form-group').addClass('has-error');
  74 +
  75 + },
  76 + /**
  77 + * 类型:Callback。
  78 + *
  79 + * 默认:移除errorClass("has-error")。与highlight操作相反
  80 + */
  81 + unhighlight : function(element) {
  82 + // 移除errorClass("has-error")
  83 + $(element).closest('.form-group').removeClass('has-error');
  84 +
  85 + },
  86 + /**
  87 + * 类型:String,Callback。
  88 + *
  89 + * 如果指定它,当验证通过时显示一个消息。
  90 + *
  91 + * 如果是String类型的,则添加该样式到标签中;
  92 + *
  93 + * 如果是一个回调函数,则将标签作为其唯一的参数。
  94 + */
  95 + success : function(label) {
  96 + // 当验证通过时,移除errorClass("has-error")
  97 + label.closest('.form-group').removeClass('has-error');
  98 + },
  99 +
  100 + /**
  101 + * 类型:Callback。
  102 + *
  103 + * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form
  104 + */
  105 + submitHandler : function(f) {
  106 + // 隐藏错误提示
  107 + error.hide();
  108 + // 表单序列化
  109 + var params = form.serializeJSON();
  110 + console.log(params);
  111 + submit();
  112 + // 提交
  113 + function submit() {
  114 + // 添加数据
  115 + $post('/interval', params, function(result) {
  116 + // 如果返回结果不为空
  117 + if(result){
  118 + // 返回状态码为"SUCCESS" ,则添加成功;返回状态码为"ERROR" ,则添加失败
  119 + if(result.status=='SUCCESS') {
  120 + // 弹出添加成功提示消息
  121 + layer.msg('添加成功...');
  122 + } else if(result.status=='ERROR') {
  123 + // 弹出添加失败提示消息
  124 + layer.msg('添加失败...');
  125 + }
  126 + }
  127 + // 返回list.html页面
  128 + //loadPage('list.html');
  129 + window.location.href = 'list.html';
  130 + });
  131 + }
  132 + }
  133 + });
  134 +});
0 \ No newline at end of file 135 \ No newline at end of file
src/main/resources/static/pages/base/interval/js/interval-edit-form.js 0 → 100644
  1 +/**
  2 + * @description TODO(间隔信息修改片段JS模块)
  3 + *
  4 + * @author bsth@zb
  5 + *
  6 + * @date 2017.08.01
  7 + *
  8 + */
  9 +
  10 +!function(){
  11 + // 获取参数ID
  12 + var intervalId = $.url().param('no');
  13 + // 如果参数ID不为空
  14 + if(intervalId) {
  15 + // 获取线路Id元素并设值
  16 + $('#intervalId').val(intervalId);
  17 + /** 根据ID查询详细信息 */
  18 + $get('/interval/' + intervalId ,null, function(result){
  19 + if(result) {
  20 + /** 填充修改线路表单元素值 @param:<result:数据结果集;interval_edit_form:表单元素> */
  21 + // 定义日期格式
  22 + var fs = 'YYYY-MM-DD'
  23 + // 设置日期
  24 + result.createDate = moment(result.createDate).format(fs);
  25 + result.updateDate = moment(result.updateDate).format(fs);
  26 + putFormData(result, '#interval_edit_form');
  27 + }
  28 + });
  29 + } else {
  30 + // 缺少ID
  31 + layer.confirm('【ID缺失,请点击返回,重新进行修改操作】', {btn : [ '返回' ],icon: 3, title:'提示'}, function(index){
  32 + // 关闭弹出层
  33 + layer.close(index);
  34 + // 跳转到list页面
  35 + loadPage('list.html');
  36 + });
  37 + }
  38 + // 定义表单
  39 + var form = $('#interval_edit_form');
  40 +
  41 + // 定义表单异常
  42 + var error = $('.alert-danger',form);
  43 + // 表单验证
  44 + form.validate({
  45 + // 错误提示元素span对象
  46 + errorElement : 'span',
  47 + // 错误提示元素class名称
  48 + errorClass : 'help-block help-block-error',
  49 + // 验证错误获取焦点
  50 + focusInvalid : true,
  51 + // 需要验证的表单元素
  52 + rules : {
  53 + // 公司名称编码
  54 + 'level' : {
  55 + // 必填项
  56 + required : true,
  57 + // 最大长度
  58 + maxlength: 10
  59 + },
  60 + // 公司名称
  61 + 'peak' : {
  62 + // 必填项
  63 + required : true,
  64 + // 最大长度
  65 + maxlength: 10
  66 + },
  67 + // 公司名称
  68 + 'trough' : {
  69 + // 必填项
  70 + required : true,
  71 + // 最大长度
  72 + maxlength: 10
  73 + },
  74 + },
  75 +
  76 + /**
  77 + * 类型:Callback。当未通过验证的表单提交时,可以在该回调函数中处理一些事情。
  78 + *
  79 + * 参数:该回调函数有两个参数:第一个为一个事件对象,第二个为验证器(validator)
  80 + */
  81 + invalidHandler : function(event, validator) {
  82 +
  83 + // 显示表单未通过提示信息
  84 + error.show();
  85 +
  86 + // 把提示信息放到指定的位置。
  87 + App.scrollTo(error, -200);
  88 + },
  89 +
  90 + /**
  91 + * 类型:Callback。
  92 + *
  93 + * 默认:添加errorClass("has-error")到表单元素。将未通过验证的表单元素设置高亮。
  94 + */
  95 + highlight : function(element) {
  96 +
  97 + // 添加errorClass("has-error")到表单元素
  98 + $(element).closest('.form-group').addClass('has-error');
  99 +
  100 + },
  101 +
  102 + /**
  103 + * 类型:Callback。
  104 + *
  105 + * 默认:移除errorClass("has-error")。与highlight操作相反
  106 + */
  107 + unhighlight : function(element) {
  108 +
  109 + // 移除errorClass("has-error")
  110 + $(element).closest('.form-group').removeClass('has-error');
  111 +
  112 + },
  113 +
  114 + /**
  115 + * 类型:String,Callback。
  116 + *
  117 + * 如果指定它,当验证通过时显示一个消息。
  118 + *
  119 + * 如果是String类型的,则添加该样式到标签中;
  120 + *
  121 + * 如果是一个回调函数,则将标签作为其唯一的参数。
  122 + */
  123 + success : function(label) {
  124 +
  125 + // 当验证通过时,移除errorClass("has-error")
  126 + label.closest('.form-group').removeClass('has-error');
  127 +
  128 + },
  129 + /**
  130 + * 类型:Callback。
  131 + *
  132 + * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form
  133 + */
  134 + submitHandler : function(f) {
  135 + // 隐藏错误提示
  136 + error.hide();
  137 + // 表单序列化
  138 + $.ajax({
  139 + type: "get",
  140 + async:false,
  141 + url: '/user/currentUser',
  142 + success: function (user) {
  143 + $("#updateByInput").val(user.userName);
  144 + }
  145 + });
  146 + var params = form.serializeJSON();
  147 + console.log(params);
  148 + submit();
  149 + // 提交
  150 + function submit() {
  151 + // 修改数据
  152 + $post('/interval', params, function(result) {
  153 + // 如果返回结果不为空
  154 + if(result){
  155 + // 返回状态码为"SUCCESS" ,则添加成功;返回状态码为"ERROR" ,则添加失败
  156 + if(result.status=='SUCCESS') {
  157 + // 弹出添加成功提示消息
  158 + layer.msg('添加成功...');
  159 + } else if(result.status=='ERROR') {
  160 + // 弹出添加失败提示消息
  161 + layer.msg('添加失败...');
  162 + }
  163 + }
  164 + // 返回list.html页面
  165 + //loadPage('list.html');
  166 + window.location.href = 'list.html';
  167 + });
  168 + }
  169 + }
  170 + });
  171 +}();
0 \ No newline at end of file 172 \ No newline at end of file
src/main/resources/static/pages/base/interval/js/interval-list-table.js 0 → 100644
  1 +/**
  2 + *
  3 + * @JSName : list.js(站点信息list.html页面js)
  4 + *
  5 + * @Author : bsth@zb
  6 + *
  7 + * @Description : TODO(站点信息list.html页面js)
  8 + *
  9 + * @Data : 2017年8月1日 上午9:21:17
  10 + *
  11 + * @Version 公交调度系统BS版 0.1
  12 + *
  13 + */
  14 +
  15 +(function(){
  16 + // 关闭左侧栏
  17 + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();}
  18 + /** page : 当前页 initPag : */
  19 + var page = 0,initPag,storage = window.localStorage;
  20 + if(storage.xlName_AgursData!=null && storage.xlName_AgursData !='') {
  21 + $('.tipso-animation').children().remove();
  22 + // 延迟加载
  23 + setTimeout(function(){
  24 + $('.tipso-animation').tipso({
  25 + speed : 400,
  26 + background : '#0ed0e8',
  27 + color : '#ffffff',
  28 + position :'bottom',
  29 + width : 400,
  30 + delay : 100,
  31 + animationIn : 'fadeInDownBig',
  32 + animationOut : 'fadeOut',
  33 + offsetX : -50,
  34 + offsetY : -195,
  35 + content :'您可以通过点击重置按钮来清除对线路名称的记忆哦!',
  36 +
  37 + });
  38 + $('.tipso-animation').tipso('show');
  39 + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
  40 + },200);
  41 + }
  42 +
  43 + /** 表格数据分页加载 */
  44 + loadTableDate(null,true);
  45 +
  46 + /** 重置按钮事件 */
  47 + $('tr.filter .filter-cancel').on('click',function(){
  48 + // 清空搜索框值
  49 + $('tr.filter input,select').val('').change();
  50 + $('.tipso-animation').tipso('hide');
  51 + storage.setItem('xlName_AgursData','');
  52 + // 重新加载表格数据
  53 + loadTableDate(null,true);
  54 + });
  55 +
  56 + /** 搜索按钮事件 */
  57 + $('tr.filter .filter-submit').on('click',function(){
  58 + var params = getParams();
  59 + page = 0;
  60 + /** 表格数据分页加载 @param:<params:搜索参数;true:是否重新分页> */
  61 + loadTableDate(params,true);
  62 + });
  63 +
  64 + function getParams() {
  65 + // cells 集合返回表格中所有(列)单元格的一个数组
  66 + var cells = $('tr.filter')[0].cells;
  67 + // 搜索参数集合
  68 + var params = {};
  69 + // 搜索字段名称
  70 + var name;
  71 + // 遍历cells数组
  72 + $.each(cells, function(i, cell){
  73 + // 获取第i列的input或者select集合
  74 + var items = $('input,select', cell);
  75 + // 遍历items集合
  76 + for(var j = 0, item; item = items[j++];){
  77 + // 获取字段名称
  78 + name = $(item).attr('name');
  79 + if(name){
  80 + // 赋取相对应的值
  81 + params[name] = $(item).val();
  82 + }
  83 + }
  84 + });
  85 + return params;
  86 + }
  87 +
  88 + /**
  89 + * 表格数据分页加载事件
  90 + *
  91 + * ------@param : 查询参数
  92 + *
  93 + * ------@isPon : 是否重新分页
  94 + *
  95 + */
  96 + function loadTableDate(param,isPon){
  97 + // 搜索参数
  98 + var params = {};
  99 + if(param) {
  100 + params = param;
  101 + }
  102 + // 排序(按id)
  103 + params['order'] = 'id';
  104 + //排序方向
  105 + params['direction'] = 'ASC';
  106 + // 记录当前页数
  107 + params['page'] = page;
  108 + // 弹出正在加载层
  109 + var i = layer.load(2);
  110 + // 异步请求获取表格数据
  111 + $.get('/interval',params,function(result){
  112 + // 添加序号
  113 + result.content.page = page;
  114 + // 把数据填充到模版中
  115 + var tbodyHtml = template('interval_list_temp',{list:result.content});
  116 + $('#datatable_interval tbody').html(tbodyHtml);
  117 + // 是重新分页且返回数据长度大于0
  118 + if(isPon && result.content.length > 0){
  119 + // 重新分页
  120 + initPag = true;
  121 + // 分页栏
  122 + showPagination(result);
  123 + }
  124 + // 关闭弹出加载层
  125 + layer.close(i);
  126 + });
  127 + }
  128 + /** 分页栏组件 */
  129 + function showPagination(data){
  130 + // 分页组件
  131 + $('#pagination').jqPaginator({
  132 + // 总页数
  133 + totalPages: data.totalPages,
  134 + // 中间显示页数
  135 + visiblePages: 6,
  136 + // 当前页
  137 + currentPage: page + 1,
  138 + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
  139 + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
  140 + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
  141 + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
  142 + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
  143 + onPageChange: function (num, type) {
  144 + if(initPag){
  145 + initPag = false;
  146 + return;
  147 + }
  148 + var pData = getParams();
  149 + if(pData.stationName_like!='' && pData.stationName_like != null) {
  150 + pData.stationName_like = pData.stationName_like.split('_')[0];
  151 + }
  152 + page = num - 1;
  153 + loadTableDate(pData, false);
  154 + }
  155 + });
  156 + }
  157 +})();
0 \ No newline at end of file 158 \ No newline at end of file
src/main/resources/static/pages/base/interval/list.html
1 -<!-- <link href="/pages/base/line/css/animate.css" rel="stylesheet" type="text/css" />  
2 -<link href="/pages/base/line/css/tipso.css" rel="stylesheet" type="text/css" /> -->  
3 <!-- 片段标题 START --> 1 <!-- 片段标题 START -->
4 <div class="page-head"> 2 <div class="page-head">
5 <div class="page-title"> 3 <div class="page-title">
6 - <h1>间隔信息</h1> 4 + <h1>间隔信息</h1>
7 </div> 5 </div>
8 </div> 6 </div>
9 <!-- 片段标题 END --> 7 <!-- 片段标题 END -->
@@ -12,7 +10,7 @@ @@ -12,7 +10,7 @@
12 <ul class="page-breadcrumb breadcrumb"> 10 <ul class="page-breadcrumb breadcrumb">
13 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> 11 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
14 <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li> 12 <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li>
15 - <li><span class="active">间隔信息</span></li> 13 + <li><span class="active">间隔信息</span></li>
16 </ul> 14 </ul>
17 <!-- 线路信息导航栏组件 END --> 15 <!-- 线路信息导航栏组件 END -->
18 16
@@ -24,29 +22,27 @@ @@ -24,29 +22,27 @@
24 </div> 22 </div>
25 <div class="caption"> 23 <div class="caption">
26 <i class="fa fa-info-circle font-dark"></i> 24 <i class="fa fa-info-circle font-dark"></i>
27 - <span class="caption-subject font-dark sbold uppercase">线路信息</span> 25 + <span class="caption-subject font-dark sbold uppercase">间隔信息</span>
28 </div> 26 </div>
29 <div class="actions"> 27 <div class="actions">
30 <div class="btn-group btn-group-devided" data-toggle="buttons"> 28 <div class="btn-group btn-group-devided" data-toggle="buttons">
31 - <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加线路</a> 29 + <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加间隔信息</a>
32 </div> 30 </div>
33 </div> 31 </div>
34 </div> 32 </div>
35 <div class="portlet-body"> 33 <div class="portlet-body">
36 <div class="table-container" style="margin-top: 10px"> 34 <div class="table-container" style="margin-top: 10px">
37 - <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_line"> 35 + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_interval">
38 <thead> 36 <thead>
39 <tr role="row" class="heading"> 37 <tr role="row" class="heading">
40 - <th >#</th>  
41 <th >序号</th> 38 <th >序号</th>
42 - <th >大间隔ID</th>  
43 - <th >大间隔等级</th> 39 + <th >间隔ID</th>
  40 + <th >间隔等级</th>
44 <th >高峰间隔时间</th> 41 <th >高峰间隔时间</th>
45 <th >低谷间隔时间</th> 42 <th >低谷间隔时间</th>
46 <th >操作</th> 43 <th >操作</th>
47 </tr> 44 </tr>
48 <tr role="row" class="filter"> 45 <tr role="row" class="filter">
49 - <td>#</td>  
50 <td></td> 46 <td></td>
51 <td></td> 47 <td></td>
52 <td></td> 48 <td></td>
@@ -73,72 +69,27 @@ @@ -73,72 +69,27 @@
73 </div> 69 </div>
74 </div> 70 </div>
75 </div> 71 </div>
76 -<script type="text/html" id="line_list_temp"> 72 +<script type="text/html" id="interval_list_temp">
77 {{each list as obj i }} 73 {{each list as obj i }}
78 <tr> 74 <tr>
79 - <td style="vertical-align: middle;">  
80 - <input type="checkbox" class="group-checkable icheck" value="{{obj.name}}" id="{{obj.id}}" data-id="{{obj.id}}" data-lineName="{{obj.name}}">  
81 - </td>  
82 - <td style="vertical-align: middle;">  
83 - {{(list.page*10)+(i+1)}}  
84 - </td>  
85 - <td>  
86 - {{obj.lineCode}}  
87 - </td>  
88 <td> 75 <td>
89 - {{obj.name}}  
90 - </td>  
91 - <td>  
92 - {{if obj.nature == 'lj'}}  
93 - 路救  
94 - {{else if obj.nature == 'bc'}}  
95 - 备车  
96 - {{else if obj.nature == 'dbc'}}  
97 - 定班车  
98 - {{else if obj.nature == 'yxl'}}  
99 - 夜宵路  
100 - {{else if obj.nature == 'cgxl'}}  
101 - 常规线路  
102 - {{else if obj.nature == 'gjxl'}}  
103 - 过江线路  
104 - {{else if obj.nature == 'csbs'}}  
105 - 穿梭巴士  
106 - {{else if obj.nature == 'tyxl'}}  
107 - 特约线路  
108 - {{else if obj.nature == 'qt'}}  
109 - 其他  
110 - {{else if obj.nature == 'cctxl'}}  
111 - 村村通线路  
112 - {{/if}}  
113 - </td>  
114 - <td>  
115 - {{if obj.level == '1'}}  
116 - 一级线路  
117 - {{else if obj.level == '2'}}  
118 - 二级线路  
119 - {{else if obj.level == '0'}}  
120 - 未知等级  
121 - {{/if}} 76 + {{(list.page*10)+(i+1)}}
122 </td> 77 </td>
123 <td> 78 <td>
124 - {{obj.shanghaiLinecode}} 79 + {{obj.id}}
125 </td> 80 </td>
126 <td> 81 <td>
127 - {{if obj.destroy == 1}}  
128 - <span style="font-weight: bold; color: red; padding: 5px; background-color: #FFE4E1; margin: 5px; font-size: 9px;border-radius: 4px;">撤销</span>  
129 - {{else if obj.destroy == 0}}  
130 - <span style="font-weight: bold; color: #07824e; padding: 5px; background-color: #FFE4E1; margin: 5px; font-size: 9px;border-radius: 4px;">运营</span>  
131 - {{/if}} 82 + {{obj.level}}
132 </td> 83 </td>
133 <td> 84 <td>
134 - <a href="/pages/base/lineinformation/list.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a> 85 + {{obj.peak}}
135 </td> 86 </td>
136 <td> 87 <td>
137 - <a href="/pages/base/stationroute/list.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a> 88 + {{obj.trough}}
138 </td> 89 </td>
139 <td> 90 <td>
140 - <a href="details.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 详细 </a>  
141 - <a href="edit.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a> 91 + <a href="edit.html?no={{obj.id}}" class="btn btn-info btn-sm" data-pjax> 修改 </a>
  92 + <a class="btn btn-danger btn-sm" onclick="del({{obj.id}})"> 删除</a>
142 </td> 93 </td>
143 </tr> 94 </tr>
144 {{/each}} 95 {{/each}}
@@ -150,4 +101,20 @@ @@ -150,4 +101,20 @@
150 </script> 101 </script>
151 <!-- <script src="/pages/base/line/js/tipso.js"></script> --> 102 <!-- <script src="/pages/base/line/js/tipso.js"></script> -->
152 <!-- 线路信息片段JS模块 --> 103 <!-- 线路信息片段JS模块 -->
153 -<script src="/pages/base/line/js/line-list-table.js"></script>  
154 \ No newline at end of file 104 \ No newline at end of file
  105 +<script src="/pages/base/interval/js/interval-list-table.js"></script>
  106 +<script>
  107 + function del(intervalId){
  108 + layer.confirm('确定要删除间隔信息吗?', {
  109 + btn: ['确定','取消'] //按钮
  110 + }, function(){
  111 + $.ajax({
  112 + url: '/interval/' + intervalId,
  113 + type: 'DELETE',
  114 + success: function(result) {
  115 + window.location.href = 'list.html';
  116 + }
  117 + });
  118 + }, function(){
  119 + });
  120 + }
  121 +</script>
155 \ No newline at end of file 122 \ No newline at end of file
src/main/resources/static/pages/base/line/editRoute.html
@@ -149,9 +149,9 @@ $(&#39;#edit_route_mobal&#39;).on(&#39;editRouteMobal.show&#39;, function(e,transGPS,editRoute,m @@ -149,9 +149,9 @@ $(&#39;#edit_route_mobal&#39;).on(&#39;editRouteMobal.show&#39;, function(e,transGPS,editRoute,m
149 var stationList = arrayFormat.stationList; 149 var stationList = arrayFormat.stationList;
150 var sectionListTemp = arrayFormat.sectionList; 150 var sectionListTemp = arrayFormat.sectionList;
151 var sectionList = []; 151 var sectionList = [];
152 - // 隔50个取一个点(相当于50s)  
153 - for(var i = 0; i*40 < sectionListTemp.length; i++) {  
154 - sectionList[i] = sectionListTemp[i*40]; 152 + // 隔30个取一个点(相当于30s)
  153 + for(var i = 0; i*30 < sectionListTemp.length; i++) {
  154 + sectionList[i] = sectionListTemp[i*30];
155 } 155 }
156 156
157 var sectionListFinal = []; 157 var sectionListFinal = [];
@@ -273,7 +273,7 @@ $(&#39;#edit_route_mobal&#39;).on(&#39;editRouteMobal.show&#39;, function(e,transGPS,editRoute,m @@ -273,7 +273,7 @@ $(&#39;#edit_route_mobal&#39;).on(&#39;editRouteMobal.show&#39;, function(e,transGPS,editRoute,m
273 //$('#uploadRoute').addClass('hidden'); 273 //$('#uploadRoute').addClass('hidden');
274 $('#upload').addClass('hidden'); 274 $('#upload').addClass('hidden');
275 layer.msg('请先编辑路段,并保存!!!'); 275 layer.msg('请先编辑路段,并保存!!!');
276 - }else { 276 + }else {
277 layer.msg('生成路线失败!'); 277 layer.msg('生成路线失败!');
278 } 278 }
279 }); 279 });
src/main/resources/static/pages/base/line/js/line-list-map.js
@@ -30,7 +30,7 @@ var WorldsBMapLine = function () { @@ -30,7 +30,7 @@ var WorldsBMapLine = function () {
30 mapBValue = new BMap.Map("bmap_basic"); 30 mapBValue = new BMap.Map("bmap_basic");
31 31
32 //中心点和缩放级别 32 //中心点和缩放级别
33 - mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); 33 + mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 20);
34 34
35 //启用地图拖拽事件,默认启用(可不写) 35 //启用地图拖拽事件,默认启用(可不写)
36 mapBValue.enableDragging(); 36 mapBValue.enableDragging();
src/main/resources/static/pages/base/line/map.html
@@ -109,11 +109,11 @@ $(function(){ @@ -109,11 +109,11 @@ $(function(){
109 }); 109 });
110 110
111 // 提交截取事件 111 // 提交截取事件
112 - $('#cutSection').on('click', function() {  
113 - layer.confirm('提交会把原有的站点和路段覆盖,您确定要提交吗?', {  
114 - btn: ['提交','取消'] //按钮  
115 - }, function(){  
116 - if(WorldsBMapLine.getPointIndex() > 0) { 112 + $('#cutSection').on('click', function() {
  113 + if(WorldsBMapLine.getPointIndex() > 0) {
  114 + layer.confirm('提交会把原有的站点和路段覆盖,您确定要提交吗?', {
  115 + btn: ['提交','取消'] //按钮
  116 + }, function(){
117 var sectionList = WorldsBMapLine.getSectionList(); 117 var sectionList = WorldsBMapLine.getSectionList();
118 var data = {}; 118 var data = {};
119 var section = EditSectionObj.getEitdSection(); 119 var section = EditSectionObj.getEitdSection();
@@ -131,10 +131,11 @@ $(function(){ @@ -131,10 +131,11 @@ $(function(){
131 layer.msg('提交失败...'); 131 layer.msg('提交失败...');
132 } 132 }
133 }); 133 });
134 - } else {  
135 - layer.msg("请先截取路段!!!");  
136 - }  
137 - }); 134 + });
  135 + } else {
  136 + layer.msg("请先截取路段!!!");
  137 + }
  138 + //});
138 }); 139 });
139 140
140 // 删除最后一个路段 141 // 删除最后一个路段
src/main/resources/static/pages/excep/mhspeedingList.html
@@ -32,9 +32,10 @@ @@ -32,9 +32,10 @@
32 <th width="3%">#</th> 32 <th width="3%">#</th>
33 <th width="4%">线路</th> 33 <th width="4%">线路</th>
34 <th width="6%">车辆自编号</th> 34 <th width="6%">车辆自编号</th>
35 - <th width="8%">上下行</th>  
36 - <th width="10%">开始时间</th>  
37 - <th width="10%">结束时间</th> 35 + <th width="6%">上下行</th>
  36 + <th width="8%">超速位置</th>
  37 + <th width="8%">开始时间</th>
  38 + <th width="8%">结束时间</th>
38 <th width="8%">持续时间</th> 39 <th width="8%">持续时间</th>
39 <th width="8%">查看轨迹</th> 40 <th width="8%">查看轨迹</th>
40 <th width="6%">操作</th> 41 <th width="6%">操作</th>
@@ -47,11 +48,6 @@ @@ -47,11 +48,6 @@
47 <td> 48 <td>
48 <select class="form-control" name="nbbm" id="nbbm" style="width: 100px;"></select> 49 <select class="form-control" name="nbbm" id="nbbm" style="width: 100px;"></select>
49 </td> 50 </td>
50 - <!-- <td>  
51 -  
52 - </td>  
53 - <td>  
54 - </td> -->  
55 <td> 51 <td>
56 <select class="form-control form-filter " name="updown" style="width: 90px;"> 52 <select class="form-control form-filter " name="updown" style="width: 90px;">
57 <option value="">请选择...</option> 53 <option value="">请选择...</option>
@@ -60,7 +56,9 @@ @@ -60,7 +56,9 @@
60 <option value="-1">无效</option> 56 <option value="-1">无效</option>
61 </select> 57 </select>
62 </td> 58 </td>
63 - <td> 59 + <td>
  60 + </td>
  61 + <td>
64 <input class="form-control" type="date" name="startDate" /> 62 <input class="form-control" type="date" name="startDate" />
65 </td> 63 </td>
66 <td> 64 <td>
@@ -114,6 +112,9 @@ @@ -114,6 +112,9 @@
114 {{/if}} 112 {{/if}}
115 </td> 113 </td>
116 <td> 114 <td>
  115 + {{obj.address}}
  116 + </td>
  117 + <td>
117 {{obj.timestampDate}} 118 {{obj.timestampDate}}
118 </td> 119 </td>
119 <td> 120 <td>
@@ -142,10 +143,9 @@ @@ -142,10 +143,9 @@
142 {{/if}} 143 {{/if}}
143 </script> 144 </script>
144 145
145 -<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>  
146 -  
147 <script> 146 <script>
148 $(function(){ 147 $(function(){
  148 + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();}
149 var page = 0, initPagination; 149 var page = 0, initPagination;
150 var icheckOptions = { 150 var icheckOptions = {
151 checkboxClass: 'icheckbox_flat-blue', 151 checkboxClass: 'icheckbox_flat-blue',
@@ -222,41 +222,55 @@ $(function(){ @@ -222,41 +222,55 @@ $(function(){
222 params['page'] = page; 222 params['page'] = page;
223 var i = layer.load(2); 223 var i = layer.load(2);
224 $get('/nowspeeding/pagequery' ,params, function(data){ 224 $get('/nowspeeding/pagequery' ,params, function(data){
225 - var bodyHtm = template('speeding_list_temp', {list: data.dataList});  
226 - $('#datatable_speeding tbody').html(bodyHtm)  
227 - .find('.icheck').iCheck(icheckOptions)  
228 - .on('ifChanged', iCheckChange);  
229 - if(pagination && data.dataList.length > 0){  
230 - //重新分页  
231 - initPagination = true;  
232 - showPagination(data);  
233 - }  
234 - layer.close(i);  
235 - $(".lookTrajectory").click(function(){  
236 - var vehicle = $(this).data('vehicle');  
237 - var startDate = $(this).data('startdate');  
238 - var endDate = $(this).data('enddate');  
239 - var lon = $(this).data('lon');  
240 - var lat = $(this).data('lat');  
241 - var endLon = $(this).data('endlon');  
242 - var endLat = $(this).data('endlat');  
243 - var lineid = $(this).data('lineid');  
244 - var upDown = $(this).data('updown');  
245 - var storage = window.localStorage;  
246 - storage.setItem("zbhAndDate",vehicle+","+startDate+","+endDate+","+lon+","+lat+","+endLon+","+endLat+","+lineid+","+upDown);  
247 - $.get('/pages/excep/speedingMap.html?',function (result) {  
248 - layer.open({  
249 - type: 1,  
250 - title:'<i class="uk-icon-play-circle"></i>轨迹回放',  
251 - shadeClose: true,  
252 - shade: true,  
253 - scrollbar: false,  
254 - maxmin: false, //开启最大化最小化按钮  
255 - area: ['100%', '100%'],  
256 - content:result,//内容  
257 - });  
258 - });  
259 - }) 225 + var listResult = data.dataList;
  226 + var index=0;
  227 + (function(){
  228 + var f = arguments.callee;
  229 + if(index >= listResult.length){
  230 + var bodyHtm = template('speeding_list_temp', {list:listResult});
  231 + $('#datatable_speeding tbody').html(bodyHtm).find('.icheck').iCheck(icheckOptions).on('ifChanged', iCheckChange);
  232 + if(pagination && data.dataList.length > 0){
  233 + //重新分页
  234 + initPagination = true;
  235 + showPagination(data);
  236 + }
  237 + layer.close(i);
  238 + $(".lookTrajectory").click(function(){
  239 + var vehicle = $(this).data('vehicle');
  240 + var startDate = $(this).data('startdate');
  241 + var endDate = $(this).data('enddate');
  242 + var lon = $(this).data('lon');
  243 + var lat = $(this).data('lat');
  244 + var endLon = $(this).data('endlon');
  245 + var endLat = $(this).data('endlat');
  246 + var lineid = $(this).data('lineid');
  247 + var upDown = $(this).data('updown');
  248 + var storage = window.localStorage;
  249 + storage.setItem("zbhAndDate",vehicle+","+startDate+","+endDate+","+lon+","+lat+","+endLon+","+endLat+","+lineid+","+upDown);
  250 + $.get('/pages/excep/speedingMap.html?',function (result) {
  251 + layer.open({
  252 + type: 1,
  253 + title:'<i class="uk-icon-play-circle"></i>轨迹回放',
  254 + shadeClose: true,
  255 + shade: true,
  256 + scrollbar: false,
  257 + maxmin: false, //开启最大化最小化按钮
  258 + area: ['100%', '100%'],
  259 + content:result,//内容
  260 + });
  261 + });
  262 + })
  263 + return;
  264 + }
  265 + var result = listResult[index];
  266 + new BMap.Geocoder().getLocation(new BMap.Point(result.lon,result.lat), function(rs){
  267 + var addComp = rs.addressComponents;
  268 + result.address = addComp.district+addComp.street+addComp.streetNumber;
  269 + f();
  270 + index++;
  271 + });
  272 + })();
  273 + console.log(listResult);
260 }); 274 });
261 } 275 }
262 276
src/main/resources/static/pages/excep/pdspeedingList.html
@@ -142,8 +142,6 @@ @@ -142,8 +142,6 @@
142 {{/if}} 142 {{/if}}
143 </script> 143 </script>
144 144
145 -<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>  
146 -  
147 <script> 145 <script>
148 $(function(){ 146 $(function(){
149 var page = 0, initPagination; 147 var page = 0, initPagination;
src/main/resources/static/pages/forms/statement/scheduleDaily.html
@@ -594,7 +594,7 @@ @@ -594,7 +594,7 @@
594 <td>{{obj.slow0}} 594 <td>{{obj.slow0}}
595 595
596 </td> 596 </td>
597 - <td colspan="2"></td> 597 + <td colspan="2" title="{{obj.remark}}">{{obj.remarks}}</td>
598 {{if (i+1)%3 == 0}} 598 {{if (i+1)%3 == 0}}
599 <td>&nbsp;</td> 599 <td>&nbsp;</td>
600 </tr> 600 </tr>
src/main/resources/static/pages/forms/statement/waybill.html
@@ -333,7 +333,8 @@ @@ -333,7 +333,8 @@
333 return; 333 return;
334 } 334 }
335 $get('/realSchedule/exportWaybill',{jName:jName,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){ 335 $get('/realSchedule/exportWaybill',{jName:jName,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){
336 - window.open("/downloadFile/download?fileName="+date+"-"+jName+"-"+params[1]+"-"+params[2]+"-行车路单"); 336 + var fileName=date+"-"+jName+"-"+params[1]+"-"+params[2]+"-行车路单";
  337 + window.open("/downloadFile/download?fileName="+encodeURIComponent(fileName));
337 }); 338 });
338 }); 339 });
339 340
src/main/resources/static/pages/mapmonitor/real/js/playBack.js
@@ -269,9 +269,9 @@ var playBack = (function() { @@ -269,9 +269,9 @@ var playBack = (function() {
269 269
270 if(defaultLine){ 270 if(defaultLine){
271 layer.msg('加载线路图层数据...', {icon: 16, time: 0,shade:0.3}); 271 layer.msg('加载线路图层数据...', {icon: 16, time: 0,shade:0.3});
272 - $.get('/realMap/findRouteByLine', {lineCode: defaultLine}  
273 - ,function(route){  
274 - lineRoute = route; 272 + $.get('/realMap/findRouteByLine', {idx: defaultLine}
  273 + ,function(rs){
  274 + lineRoute = rs[defaultLine];
275 iMap.call('drawLine', {route: lineRoute}); 275 iMap.call('drawLine', {route: lineRoute});
276 276
277 cTime = sTime; 277 cTime = sTime;
src/main/resources/static/pages/summary/work_hours/list.html
@@ -263,8 +263,8 @@ @@ -263,8 +263,8 @@
263 } 263 }
264 264
265 //日期选择器 265 //日期选择器
266 - $('[name=rq_eq]', f).val('2017-07-27');  
267 - flatpickr('.ct_search_form_wrap [name=rq_eq]', {"locale": "zh", maxDate: '2017-07-27', minDate: '2017-07-01'}); 266 + $('[name=rq_eq]', f).val('2017-07-31');
  267 + flatpickr('.ct_search_form_wrap [name=rq_eq]', {"locale": "zh", maxDate: '2017-07-31', minDate: '2017-07-01'});
268 268
269 var comps; 269 var comps;
270 //构建公司级联下拉框 270 //构建公司级联下拉框