Commit af2009fed2ad889f54df1f86b65837f185bea80a
Merge branch 'minhang' into pudong
Showing
46 changed files
with
3610 additions
and
200 deletions
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| @@ -2,12 +2,12 @@ package com.bsth.controller.realcontrol; | @@ -2,12 +2,12 @@ package com.bsth.controller.realcontrol; | ||
| 2 | 2 | ||
| 3 | import java.io.UnsupportedEncodingException; | 3 | import java.io.UnsupportedEncodingException; |
| 4 | import java.net.URLDecoder; | 4 | import java.net.URLDecoder; |
| 5 | -import java.util.Collection; | ||
| 6 | -import java.util.List; | ||
| 7 | -import java.util.Map; | 5 | +import java.util.*; |
| 8 | 6 | ||
| 9 | import org.apache.commons.lang3.StringEscapeUtils; | 7 | import org.apache.commons.lang3.StringEscapeUtils; |
| 10 | import org.drools.core.runtime.help.impl.XStreamJSon.JSonAbortWorkItemConverter; | 8 | import org.drools.core.runtime.help.impl.XStreamJSon.JSonAbortWorkItemConverter; |
| 9 | +import org.joda.time.format.DateTimeFormat; | ||
| 10 | +import org.joda.time.format.DateTimeFormatter; | ||
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | import org.springframework.web.bind.annotation.PathVariable; | 12 | import org.springframework.web.bind.annotation.PathVariable; |
| 13 | import org.springframework.web.bind.annotation.RequestMapping; | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
| @@ -400,4 +400,33 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -400,4 +400,33 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 400 | List<DfsjChange> dfsjcs = JSONArray.parseArray(dcsJson, DfsjChange.class); | 400 | List<DfsjChange> dfsjcs = JSONArray.parseArray(dcsJson, DfsjChange.class); |
| 401 | return scheduleRealInfoService.multi_dftz(dfsjcs); | 401 | return scheduleRealInfoService.multi_dftz(dfsjcs); |
| 402 | } | 402 | } |
| 403 | + | ||
| 404 | + @RequestMapping(value="/changeBcType/{id}", method=RequestMethod.POST) | ||
| 405 | + public Map<String, Object> changeBcType(@PathVariable("id") Long id, String bcType, String remarks){ | ||
| 406 | + return scheduleRealInfoService.changeBcType(id, bcType, remarks); | ||
| 407 | + } | ||
| 408 | + | ||
| 409 | + @RequestMapping(value="/history", method=RequestMethod.POST) | ||
| 410 | + public Map<String,Object> historySave(ScheduleRealInfo sch){ | ||
| 411 | + return scheduleRealInfoService.historySave(sch); | ||
| 412 | + } | ||
| 413 | + | ||
| 414 | + | ||
| 415 | + private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"); | ||
| 416 | + private final static long ONE_DAY = 1000 * 60 * 60 * 24; | ||
| 417 | + /** | ||
| 418 | + * 获取可编辑的历史班次日期 | ||
| 419 | + * @return | ||
| 420 | + */ | ||
| 421 | + @RequestMapping("dateArray") | ||
| 422 | + public List<String> dateArray(){ | ||
| 423 | + List<String> rs = new ArrayList<>(); | ||
| 424 | + | ||
| 425 | + long t = new Date().getTime() - ONE_DAY; | ||
| 426 | + for(int i = 0; i < 5; i ++){ | ||
| 427 | + rs.add(fmtyyyyMMdd.print(t)); | ||
| 428 | + t -= ONE_DAY; | ||
| 429 | + } | ||
| 430 | + return rs; | ||
| 431 | + } | ||
| 403 | } | 432 | } |
src/main/java/com/bsth/controller/schedule/PeopleCarPlanController.java
0 → 100644
| 1 | +package com.bsth.controller.schedule; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import java.util.Map; | ||
| 5 | + | ||
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 8 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 9 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 10 | +import org.springframework.web.bind.annotation.RestController; | ||
| 11 | + | ||
| 12 | +import com.bsth.service.realcontrol.ScheduleRealInfoService; | ||
| 13 | +import com.bsth.service.schedule.PeopleCarPlanService; | ||
| 14 | + | ||
| 15 | +@RestController | ||
| 16 | +@RequestMapping("pcpc") | ||
| 17 | +public class PeopleCarPlanController { | ||
| 18 | + | ||
| 19 | + @Autowired | ||
| 20 | + private PeopleCarPlanService peopleCarPlanService; | ||
| 21 | + | ||
| 22 | + @RequestMapping(value = "/queryPeopleCar", method = RequestMethod.GET) | ||
| 23 | + public List<Map<String,Object>> queryPeopleCar(@RequestParam String line, @RequestParam String date, @RequestParam String type){ | ||
| 24 | + return peopleCarPlanService.queryPeopleCar(line, date, type); | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + @RequestMapping(value="/workDaily", method = RequestMethod.GET) | ||
| 28 | + public List<Map<String,Object>> workDaily(@RequestParam String line, @RequestParam String date, @RequestParam String type){ | ||
| 29 | + return peopleCarPlanService.workDaily(line, date, type); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + @RequestMapping(value="/scheduleAnaly", method = RequestMethod.GET) | ||
| 33 | + public Map<String, Object> scheduleAnaly(@RequestParam String page, @RequestParam String line, @RequestParam String startDate, @RequestParam String endDate, @RequestParam String model, @RequestParam String type){ | ||
| 34 | + return peopleCarPlanService.scheduleAnaly(page, line, startDate, endDate, model, type); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + @RequestMapping(value="/getModel", method = RequestMethod.GET) | ||
| 38 | + public List<Map<String,Object>> getModel(@RequestParam String line, @RequestParam String startDate, @RequestParam String endDate){ | ||
| 39 | + return peopleCarPlanService.getModel(line, startDate, endDate); | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + @RequestMapping(value="/firstAndLastBus", method = RequestMethod.GET) | ||
| 43 | + public List<Map<String,Object>> firstAndLastBus(@RequestParam String line, @RequestParam String date, @RequestParam String type){ | ||
| 44 | + return peopleCarPlanService.firstAndLastBus(line, date, type); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + @RequestMapping(value="/commandState", method = RequestMethod.GET) | ||
| 48 | + public List<Map<String,Object>> commandState(@RequestParam String line, @RequestParam String date, @RequestParam String code){ | ||
| 49 | + return peopleCarPlanService.commandState(line, date, code); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | +} |
src/main/java/com/bsth/data/arrival/ArrivalData_GPS.java
| @@ -50,8 +50,8 @@ public class ArrivalData_GPS implements CommandLineRunner{ | @@ -50,8 +50,8 @@ public class ArrivalData_GPS implements CommandLineRunner{ | ||
| 50 | 50 | ||
| 51 | @Override | 51 | @Override |
| 52 | public void run(String... arg0) throws Exception { | 52 | public void run(String... arg0) throws Exception { |
| 53 | - logger.info("ArrivalData_GPS,100,10 @11-11"); | ||
| 54 | - //Application.mainServices.scheduleWithFixedDelay(dataLoaderThread, 100, 10, TimeUnit.SECONDS); | 53 | + logger.info("ArrivalData_GPS,50,10 @11-11"); |
| 54 | + //Application.mainServices.scheduleWithFixedDelay(dataLoaderThread, 50, 10, TimeUnit.SECONDS); | ||
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | @Component | 57 | @Component |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| @@ -343,6 +343,7 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -343,6 +343,7 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 343 | //发车时间仍然校验不过的,直接写成00:00 | 343 | //发车时间仍然校验不过的,直接写成00:00 |
| 344 | sch.setFcsj("00:00"); | 344 | sch.setFcsj("00:00"); |
| 345 | } | 345 | } |
| 346 | + sch.setDfsj(sch.getFcsj()); | ||
| 346 | 347 | ||
| 347 | // 计划终点时间 | 348 | // 计划终点时间 |
| 348 | if (sch.getBcsj() != null) { | 349 | if (sch.getBcsj() != null) { |
| @@ -494,6 +495,9 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -494,6 +495,9 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 494 | 495 | ||
| 495 | //主键索引 | 496 | //主键索引 |
| 496 | id2SchedulMap.put(sch.getId(), sch); | 497 | id2SchedulMap.put(sch.getId(), sch); |
| 498 | + //跨24点的,再save一次 | ||
| 499 | + if(!sch.getRealExecDate().equals(sch.getScheduleDateStr())) | ||
| 500 | + save(sch); | ||
| 497 | } | 501 | } |
| 498 | 502 | ||
| 499 | public void delete(ScheduleRealInfo sch) { | 503 | public void delete(ScheduleRealInfo sch) { |
src/main/java/com/bsth/data/schedule/thread/SubmitToTrafficManage.java
| 1 | package com.bsth.data.schedule.thread; | 1 | package com.bsth.data.schedule.thread; |
| 2 | 2 | ||
| 3 | import com.bsth.service.TrafficManageService; | 3 | import com.bsth.service.TrafficManageService; |
| 4 | +import com.bsth.service.oil.YlbService; | ||
| 5 | + | ||
| 4 | import org.slf4j.Logger; | 6 | import org.slf4j.Logger; |
| 5 | import org.slf4j.LoggerFactory; | 7 | import org.slf4j.LoggerFactory; |
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -17,10 +19,19 @@ public class SubmitToTrafficManage extends Thread{ | @@ -17,10 +19,19 @@ public class SubmitToTrafficManage extends Thread{ | ||
| 17 | 19 | ||
| 18 | @Autowired | 20 | @Autowired |
| 19 | TrafficManageService trafficManageService; | 21 | TrafficManageService trafficManageService; |
| 22 | + | ||
| 23 | + @Autowired | ||
| 24 | + YlbService YlbService; | ||
| 20 | 25 | ||
| 21 | @Override | 26 | @Override |
| 22 | public void run() { | 27 | public void run() { |
| 23 | logger.info("开始提交数据到运管处..."); | 28 | logger.info("开始提交数据到运管处..."); |
| 29 | + try{ | ||
| 30 | + YlbService.obtainDsq(); | ||
| 31 | + } catch(Exception e){ | ||
| 32 | + logger.error("计算路单里程加注量失败",e); | ||
| 33 | + } | ||
| 34 | + | ||
| 24 | try { | 35 | try { |
| 25 | //路单 | 36 | //路单 |
| 26 | trafficManageService.setLD(); | 37 | trafficManageService.setLD(); |
src/main/java/com/bsth/service/oil/YlbService.java
| @@ -8,7 +8,7 @@ import com.bsth.service.BaseService; | @@ -8,7 +8,7 @@ import com.bsth.service.BaseService; | ||
| 8 | 8 | ||
| 9 | public interface YlbService extends BaseService<Ylb, Integer>{ | 9 | public interface YlbService extends BaseService<Ylb, Integer>{ |
| 10 | Map<String, Object> obtain(String rq); | 10 | Map<String, Object> obtain(String rq); |
| 11 | - | 11 | + String obtainDsq(); |
| 12 | Map<String, Object> sort(Map<String, Object> map); | 12 | Map<String, Object> sort(Map<String, Object> map); |
| 13 | 13 | ||
| 14 | Map<String, Object> outAndIn(Map<String, Object> map); | 14 | Map<String, Object> outAndIn(Map<String, Object> map); |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| 1 | package com.bsth.service.oil.impl; | 1 | package com.bsth.service.oil.impl; |
| 2 | 2 | ||
| 3 | +import java.sql.ResultSet; | ||
| 4 | +import java.sql.SQLException; | ||
| 3 | import java.text.DecimalFormat; | 5 | import java.text.DecimalFormat; |
| 4 | import java.text.ParseException; | 6 | import java.text.ParseException; |
| 5 | import java.text.SimpleDateFormat; | 7 | import java.text.SimpleDateFormat; |
| 6 | import java.util.ArrayList; | 8 | import java.util.ArrayList; |
| 9 | +import java.util.Calendar; | ||
| 7 | import java.util.Date; | 10 | import java.util.Date; |
| 8 | import java.util.HashMap; | 11 | import java.util.HashMap; |
| 9 | import java.util.Iterator; | 12 | import java.util.Iterator; |
| @@ -17,6 +20,8 @@ import org.slf4j.LoggerFactory; | @@ -17,6 +20,8 @@ import org.slf4j.LoggerFactory; | ||
| 17 | import org.springframework.beans.factory.annotation.Autowired; | 20 | import org.springframework.beans.factory.annotation.Autowired; |
| 18 | import org.springframework.data.domain.Sort; | 21 | import org.springframework.data.domain.Sort; |
| 19 | import org.springframework.data.domain.Sort.Direction; | 22 | import org.springframework.data.domain.Sort.Direction; |
| 23 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 24 | +import org.springframework.jdbc.core.RowMapper; | ||
| 20 | import org.springframework.stereotype.Service; | 25 | import org.springframework.stereotype.Service; |
| 21 | 26 | ||
| 22 | import com.bsth.common.ResponseCode; | 27 | import com.bsth.common.ResponseCode; |
| @@ -46,9 +51,100 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -46,9 +51,100 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 46 | @Autowired | 51 | @Autowired |
| 47 | ScheduleRealInfoService scheduleRealInfoService; | 52 | ScheduleRealInfoService scheduleRealInfoService; |
| 48 | 53 | ||
| 54 | + @Autowired | ||
| 55 | + JdbcTemplate jdbcTemplate; | ||
| 56 | + | ||
| 49 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 57 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 50 | 58 | ||
| 51 | 59 | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * 获取进存油信息 | ||
| 63 | + * @Transactional 回滚事物 | ||
| 64 | + */ | ||
| 65 | + @Transactional | ||
| 66 | + @Override | ||
| 67 | + public String obtainDsq() { | ||
| 68 | + String result = "failure"; | ||
| 69 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | ||
| 70 | + Date dNow = new Date(); //当前时间 | ||
| 71 | + Date dBefore = new Date(); | ||
| 72 | + Calendar calendar = Calendar.getInstance(); //得到日历 | ||
| 73 | + calendar.setTime(dNow);//把当前时间赋给日历 | ||
| 74 | + calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天 | ||
| 75 | + dBefore = calendar.getTime(); //得到前一天的时间 | ||
| 76 | + String rq=sdf.format(dBefore); | ||
| 77 | + //保留两位小数 | ||
| 78 | + DecimalFormat df = new DecimalFormat("#.00"); | ||
| 79 | + // TODO Auto-generated method stub | ||
| 80 | + Map<String, Object> newMap=new HashMap<String,Object>(); | ||
| 81 | + //当天YLB信息 | ||
| 82 | + List<Ylb> ylList=repository.obtainYl(rq); | ||
| 83 | + //当天YLXXB信息 | ||
| 84 | +// List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq); | ||
| 85 | + //前一天所有车辆最后进场班次信息 | ||
| 86 | + List<Ylb> ylListBe=repository.obtainYlbefore(rq); | ||
| 87 | + //从排班表中计算出行驶的总里程 | ||
| 88 | + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("1024",rq); | ||
| 89 | + | ||
| 90 | + for(int x=0;x<listpb.size();x++){ | ||
| 91 | + | ||
| 92 | + Map<String, Object> map=listpb.get(x); | ||
| 93 | + | ||
| 94 | + //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | ||
| 95 | + Ylb t=new Ylb(); | ||
| 96 | + for(int k=0;k<ylList.size();k++){ | ||
| 97 | + Ylb t1=ylList.get(k); | ||
| 98 | + if(t1.getNbbm().equals(map.get("clZbh").toString()) | ||
| 99 | + &&t1.getJsy().equals(map.get("jGh").toString()) | ||
| 100 | + &&t1.getXlbm().equals(map.get("xlBm").toString())) | ||
| 101 | + { | ||
| 102 | + t=t1; | ||
| 103 | + } | ||
| 104 | + } | ||
| 105 | + try { | ||
| 106 | + //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | ||
| 107 | + if(map.get("seqNumber").toString().equals("1")){ | ||
| 108 | + for (int y = 0; y < ylListBe.size(); y++) { | ||
| 109 | + Ylb ylb=ylListBe.get(y); | ||
| 110 | + if(map.get("clZbh").toString().equals(ylb.getNbbm())){ | ||
| 111 | + t.setCzyl(ylb.getJzyl()); | ||
| 112 | + break; | ||
| 113 | + }else{ | ||
| 114 | + t.setCzyl(0.0); | ||
| 115 | + } | ||
| 116 | + } | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + /*Double jzl=0.0; | ||
| 120 | + //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | ||
| 121 | + for(int j=0;j<ylxxList.size();j++){ | ||
| 122 | + Ylxxb ylxxb= ylxxList.get(j); | ||
| 123 | + if(map.get("clZbh").toString().equals(ylxxb.getNbbm()) &&map.get("jGh").toString().equals(ylxxb.getJsy())){ | ||
| 124 | + jzl+=ylxxb.getJzl(); | ||
| 125 | + } | ||
| 126 | + } | ||
| 127 | + t.setJzl(jzl);*/ | ||
| 128 | + t.setNbbm(map.get("clZbh").toString()); | ||
| 129 | + t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); | ||
| 130 | + t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString())))); | ||
| 131 | + t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); | ||
| 132 | + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | ||
| 133 | + t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); | ||
| 134 | + t.setRq(dBefore); | ||
| 135 | + repository.save(t); | ||
| 136 | + result = "success"; | ||
| 137 | + } catch (Exception e) { | ||
| 138 | + // TODO Auto-generated catch block | ||
| 139 | + e.printStackTrace(); | ||
| 140 | + }finally{ | ||
| 141 | + logger.info("setDDRB:"+result); | ||
| 142 | + } | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + return result; | ||
| 146 | + } | ||
| 147 | + | ||
| 52 | /** | 148 | /** |
| 53 | * 获取进存油信息 | 149 | * 获取进存油信息 |
| 54 | * @Transactional 回滚事物 | 150 | * @Transactional 回滚事物 |
| @@ -394,8 +490,36 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -394,8 +490,36 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 394 | 490 | ||
| 395 | @Override | 491 | @Override |
| 396 | public List<Ylb> oilListMonth(String line, String date) { | 492 | public List<Ylb> oilListMonth(String line, String date) { |
| 493 | + String date2=date.substring(0, 8)+"01"; | ||
| 494 | + String lineStr=""; | ||
| 495 | + if(line !=null && !line.equals("")){ | ||
| 496 | + lineStr =" and xlbm= '"+ line +"'"; | ||
| 497 | + } | ||
| 498 | + String sql="select a.nbbm,a.rq,a.jzyl from (" + | ||
| 499 | + " select x.nbbm,max(x.rq) as rq,max(x.jcsx) as jcsx from " | ||
| 500 | + + "(select nbbm,rq,max(jcsx) as jcsx from bsth_c_ylb where rq between '" | ||
| 501 | + + date2 +"' and '" + date+"' "+lineStr | ||
| 502 | + + "group by nbbm,rq) x group by x.nbbm ) b" | ||
| 503 | + + " left join (select nbbm,rq,jzyl,jcsx FROM bsth_c_ylb " | ||
| 504 | + + " where rq between '" | ||
| 505 | + + date2 +"' and '" + date+"' "+lineStr | ||
| 506 | + + ") a " | ||
| 507 | + + " on a.nbbm =b.nbbm and a.jcsx=b.jcsx and a.rq=b.rq " | ||
| 508 | + + " where a.nbbm is not null order by a.nbbm"; | ||
| 509 | + | ||
| 397 | // TODO Auto-generated method stub | 510 | // TODO Auto-generated method stub |
| 398 | - return null; | 511 | + List<Ylb> list =jdbcTemplate.query(sql, |
| 512 | + new RowMapper<Ylb>(){ | ||
| 513 | + @Override | ||
| 514 | + public Ylb mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 515 | + Ylb s = new Ylb(); | ||
| 516 | + s.setNbbm(rs.getString("nbbm")); | ||
| 517 | + s.setRq(rs.getDate("rq")); | ||
| 518 | + s.setJzyl(rs.getDouble("jzyl")); | ||
| 519 | + return s; | ||
| 520 | + } | ||
| 521 | + }); | ||
| 522 | + return list; | ||
| 399 | } | 523 | } |
| 400 | 524 | ||
| 401 | 525 |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| @@ -121,4 +121,8 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | @@ -121,4 +121,8 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | ||
| 121 | Map<String, Object> multi_tzrc(List<ChangePersonCar> cpcs); | 121 | Map<String, Object> multi_tzrc(List<ChangePersonCar> cpcs); |
| 122 | 122 | ||
| 123 | Map<String, Object> multi_dftz(List<DfsjChange> dfsjcs); | 123 | Map<String, Object> multi_dftz(List<DfsjChange> dfsjcs); |
| 124 | + | ||
| 125 | + Map<String,Object> changeBcType(Long id, String bcType, String remarks); | ||
| 126 | + | ||
| 127 | + Map<String,Object> historySave(ScheduleRealInfo sch); | ||
| 124 | } | 128 | } |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -14,9 +14,10 @@ import java.util.List; | @@ -14,9 +14,10 @@ import java.util.List; | ||
| 14 | import java.util.Map; | 14 | import java.util.Map; |
| 15 | import java.util.Set; | 15 | import java.util.Set; |
| 16 | 16 | ||
| 17 | -import javax.transaction.Transactional; | ||
| 18 | - | 17 | +import com.bsth.entity.realcontrol.LineConfig; |
| 19 | import org.apache.commons.lang3.StringUtils; | 18 | import org.apache.commons.lang3.StringUtils; |
| 19 | +import org.joda.time.format.DateTimeFormat; | ||
| 20 | +import org.joda.time.format.DateTimeFormatter; | ||
| 20 | import org.slf4j.Logger; | 21 | import org.slf4j.Logger; |
| 21 | import org.slf4j.LoggerFactory; | 22 | import org.slf4j.LoggerFactory; |
| 22 | import org.springframework.beans.factory.annotation.Autowired; | 23 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -123,27 +124,27 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -123,27 +124,27 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 123 | return mMap.asMap(); | 124 | return mMap.asMap(); |
| 124 | } | 125 | } |
| 125 | 126 | ||
| 127 | + private final static long DAY_TIME = 1000 * 60 * 60 * 24L; | ||
| 128 | + private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"); | ||
| 126 | @Override | 129 | @Override |
| 127 | public Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj/*, String nbbm,String jsy,String spy*/) { | 130 | public Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj/*, String nbbm,String jsy,String spy*/) { |
| 128 | Map<String, Object> map = new HashMap<>(); | 131 | Map<String, Object> map = new HashMap<>(); |
| 129 | try { | 132 | try { |
| 130 | 133 | ||
| 131 | ScheduleRealInfo schedule = dayOfSchedule.get(id); | 134 | ScheduleRealInfo schedule = dayOfSchedule.get(id); |
| 132 | - schedule.setDfsjT(sdfMinute.parse(schedule.getRealExecDate() + " " + dfsj).getTime()); | ||
| 133 | - schedule.setDfsj(dfsj); | 135 | + |
| 136 | + | ||
| 137 | + LineConfig config = lineConfigData.get(schedule.getXlBm()); | ||
| 138 | + //小于线路开始运营时间,则默认跨过24点 | ||
| 139 | + if(dfsj.compareTo(config.getStartOpt()) < 0){ | ||
| 140 | + schedule.setRealExecDate(fmtyyyyMMdd.print(schedule.getScheduleDate().getTime() + DAY_TIME)); | ||
| 141 | + } | ||
| 142 | + else { | ||
| 143 | + schedule.setRealExecDate(schedule.getScheduleDateStr()); | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + schedule.setDfsjAll(dfsj); | ||
| 134 | schedule.addRemarks(remarks); | 147 | schedule.addRemarks(remarks); |
| 135 | -// schedule.setClZbh(nbbm); | ||
| 136 | -// if(jsy != null && jsy.indexOf("/") != -1){ | ||
| 137 | -// String[] jsyArray = jsy.split("/"); | ||
| 138 | -// schedule.setjGh(jsyArray[0]); | ||
| 139 | -// schedule.setjName(jsyArray[1]); | ||
| 140 | -// } | ||
| 141 | -// | ||
| 142 | -// if(spy != null && spy.indexOf("/") != -1){ | ||
| 143 | -// String[] spyArray = spy.split("/"); | ||
| 144 | -// schedule.setsGh(spyArray[0]); | ||
| 145 | -// schedule.setsName(spyArray[1]); | ||
| 146 | -// } | ||
| 147 | 148 | ||
| 148 | List<ScheduleRealInfo> ts = new ArrayList<>(); | 149 | List<ScheduleRealInfo> ts = new ArrayList<>(); |
| 149 | ts.add(schedule); | 150 | ts.add(schedule); |
| @@ -192,50 +193,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -192,50 +193,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 192 | rsList.add(schedule); | 193 | rsList.add(schedule); |
| 193 | } | 194 | } |
| 194 | 195 | ||
| 195 | - // 调整间隔 | ||
| 196 | -// if (spaceAdjust == 1) { | ||
| 197 | -// | ||
| 198 | -// ScheduleRealInfo first = dayOfSchedule.get(Long.parseLong(idList.get(0))); | ||
| 199 | -// String lineCode = first.getXlBm() + ""; | ||
| 200 | -// String upDown = first.getXlDir(); | ||
| 201 | -// | ||
| 202 | -// List<ScheduleRealInfo> schList = dayOfSchedule.findByLineCode(lineCode), | ||
| 203 | -// dirList = new ArrayList<>(); | ||
| 204 | -// // 筛选走向 | ||
| 205 | -// for (ScheduleRealInfo s : schList) { | ||
| 206 | -// if (s.getXlDir().equals(upDown)) { | ||
| 207 | -// dirList.add(s); | ||
| 208 | -// } | ||
| 209 | -// } | ||
| 210 | -// | ||
| 211 | -// int size = dirList.size(); | ||
| 212 | -// Long st = null; | ||
| 213 | -// int diff = spaceNum * 60 * 1000; | ||
| 214 | -// for (int i = 0; i < size; i++) { | ||
| 215 | -// schedule = dirList.get(i); | ||
| 216 | -// | ||
| 217 | -// if (schedule.getId() == first.getId()) { | ||
| 218 | -// if (i == 0) | ||
| 219 | -// st = schedule.getDfsjT() - diff; | ||
| 220 | -// else | ||
| 221 | -// st = dirList.get(i - 1).getDfsjT(); | ||
| 222 | -// continue; | ||
| 223 | -// } | ||
| 224 | -// if (null == st || schedule.getStatus() == -1) | ||
| 225 | -// continue; | ||
| 226 | -// | ||
| 227 | -// st = st + diff; | ||
| 228 | -// schedule.setDfsjT(st); | ||
| 229 | -// schedule.setDfsj(sdfShort.format(new Date(st))); | ||
| 230 | -// | ||
| 231 | -// dayOfSchedule.save(schedule); | ||
| 232 | -// //scheduleRealInfoRepository.save(schedule); | ||
| 233 | -// //ScheduleBuffer.persistentList.add(schedule); | ||
| 234 | -// // 将调整的班次返回给页面 | ||
| 235 | -// rsList.add(schedule); | ||
| 236 | -// } | ||
| 237 | -// } | ||
| 238 | - | ||
| 239 | map.put("status", ResponseCode.SUCCESS); | 196 | map.put("status", ResponseCode.SUCCESS); |
| 240 | } catch (Exception e) { | 197 | } catch (Exception e) { |
| 241 | logger.error("", e); | 198 | logger.error("", e); |
| @@ -695,27 +652,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -695,27 +652,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 695 | try { | 652 | try { |
| 696 | ScheduleRealInfo sch = dayOfSchedule.get(id); | 653 | ScheduleRealInfo sch = dayOfSchedule.get(id); |
| 697 | 654 | ||
| 698 | - Long t = sdfMinute.parse(sch.getRealExecDate() + " " + fcsjActual).getTime(); | ||
| 699 | - /*sch.setFcsjActualTime(sdfMinute.parse(sch.getRealExecDate() + " " + fcsjActual).getTime()); | ||
| 700 | - sch.setFcsjActual(fcsjActual);*/ | ||
| 701 | -// if(null != sch.getSjfcModel()) | ||
| 702 | -// sch.getSjfcModel().setPersonTime(t); | ||
| 703 | - | ||
| 704 | - sch.setFcsjActualAll(t); | 655 | + LineConfig config = lineConfigData.get(sch.getXlBm()); |
| 656 | + //小于线路开始运营时间,则默认跨过24点 | ||
| 657 | + if(fcsjActual.compareTo(config.getStartOpt()) < 0){ | ||
| 658 | + sch.setRealExecDate(fmtyyyyMMdd.print(sch.getScheduleDate().getTime() + DAY_TIME)); | ||
| 659 | + } | ||
| 660 | + else { | ||
| 661 | + sch.setRealExecDate(sch.getScheduleDateStr()); | ||
| 662 | + } | ||
| 663 | + | ||
| 664 | + sch.setFcsjActualAll(fcsjActual); | ||
| 705 | sch.addRemarks(remarks); | 665 | sch.addRemarks(remarks); |
| 706 | sch.calcStatus(); | 666 | sch.calcStatus(); |
| 707 | - /*//改变状态 | ||
| 708 | - if(sch.getZdsjActual() == null) | ||
| 709 | - sch.setStatus(1);*/ | ||
| 710 | - | 667 | + |
| 711 | scheduleRealInfoRepository.save(sch); | 668 | scheduleRealInfoRepository.save(sch); |
| 712 | - //ScheduleBuffer.persistentList.add(sch); | ||
| 713 | - | 669 | + |
| 714 | ts.add(sch); | 670 | ts.add(sch); |
| 715 | - /*//关联班次 | ||
| 716 | - if(sch.existDependent()) | ||
| 717 | - ts.add(sch.getTwins());*/ | ||
| 718 | - | 671 | + |
| 719 | rs.put("status", ResponseCode.SUCCESS); | 672 | rs.put("status", ResponseCode.SUCCESS); |
| 720 | rs.put("ts", ts); | 673 | rs.put("ts", ts); |
| 721 | 674 | ||
| @@ -790,10 +743,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -790,10 +743,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 790 | @Override | 743 | @Override |
| 791 | public Map<String, Object> spaceAdjust(Long[] ids, Integer space) { | 744 | public Map<String, Object> spaceAdjust(Long[] ids, Integer space) { |
| 792 | 745 | ||
| 793 | - List<ScheduleRealInfo> list = new ArrayList<>(); | 746 | + List<ScheduleRealInfo> list = new ArrayList<>() |
| 747 | + ,updateList = new ArrayList<>(); | ||
| 794 | Map<String, Object> rs = new HashMap<>(); | 748 | Map<String, Object> rs = new HashMap<>(); |
| 795 | try { | 749 | try { |
| 796 | - ScheduleRealInfo sch; | 750 | + ScheduleRealInfo sch, next; |
| 797 | for (Long id : ids) { | 751 | for (Long id : ids) { |
| 798 | sch = dayOfSchedule.get(id); | 752 | sch = dayOfSchedule.get(id); |
| 799 | if (null != sch) | 753 | if (null != sch) |
| @@ -817,12 +771,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -817,12 +771,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 817 | st += plus; | 771 | st += plus; |
| 818 | sch = list.get(i); | 772 | sch = list.get(i); |
| 819 | sch.setDfsjAll(st); | 773 | sch.setDfsjAll(st); |
| 820 | - | ||
| 821 | - scheduleRealInfoRepository.save(sch); | 774 | + //重新计算终点时间 |
| 775 | + sch.calcEndTime(); | ||
| 776 | + | ||
| 777 | + dayOfSchedule.save(sch); | ||
| 778 | + | ||
| 779 | + updateList.add(sch); | ||
| 780 | + next=dayOfSchedule.next(sch); | ||
| 781 | + if(next.getQdzName().equals(sch.getZdzName())){ | ||
| 782 | + next.setQdzArrDateJH(sch.getZdsj()); | ||
| 783 | + updateList.add(next); | ||
| 784 | + } | ||
| 822 | } | 785 | } |
| 823 | - | 786 | + |
| 787 | + | ||
| 824 | rs.put("status", ResponseCode.SUCCESS); | 788 | rs.put("status", ResponseCode.SUCCESS); |
| 825 | - rs.put("list", list); | 789 | + rs.put("ts", updateList); |
| 826 | } | 790 | } |
| 827 | 791 | ||
| 828 | } catch (Exception e) { | 792 | } catch (Exception e) { |
| @@ -832,6 +796,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -832,6 +796,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 832 | return rs; | 796 | return rs; |
| 833 | } | 797 | } |
| 834 | 798 | ||
| 799 | + private static DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm"); | ||
| 800 | + | ||
| 835 | @Override | 801 | @Override |
| 836 | public Map<String, Object> schInfoFineTune(Map<String, String> map) { | 802 | public Map<String, Object> schInfoFineTune(Map<String, String> map) { |
| 837 | Map<String, Object> rs = new HashMap<>(); | 803 | Map<String, Object> rs = new HashMap<>(); |
| @@ -871,11 +837,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -871,11 +837,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 871 | //sch.setBcType(bcType); | 837 | //sch.setBcType(bcType); |
| 872 | //sch.setClZbh(clZbh); | 838 | //sch.setClZbh(clZbh); |
| 873 | //sch.setFcsjAll(fcsj); | 839 | //sch.setFcsjAll(fcsj); |
| 874 | - | 840 | + |
| 875 | if(StringUtils.isNotBlank(fcsjActual)){ | 841 | if(StringUtils.isNotBlank(fcsjActual)){ |
| 842 | + LineConfig config = lineConfigData.get(sch.getXlBm()); | ||
| 843 | + long t=0L; | ||
| 844 | + //小于线路开始运营时间,则默认跨过24点 | ||
| 845 | + if(fcsjActual.compareTo(config.getStartOpt()) < 0) | ||
| 846 | + t=fmtyyyyMMddHHmm.parseMillis(fmtyyyyMMdd.print(sch.getScheduleDate().getTime() + DAY_TIME)+fcsjActual); | ||
| 847 | + else | ||
| 848 | + t=fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+fcsjActual); | ||
| 849 | + | ||
| 876 | //调整实发 | 850 | //调整实发 |
| 877 | if(!fcsjActual.equals(sch.getFcsjActual())) | 851 | if(!fcsjActual.equals(sch.getFcsjActual())) |
| 878 | - sch.setFcsjActualAll(fcsjActual); | 852 | + sch.setFcsjActualAll(t); |
| 879 | } | 853 | } |
| 880 | else{ | 854 | else{ |
| 881 | //撤销实发 | 855 | //撤销实发 |
| @@ -1593,7 +1567,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1593,7 +1567,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1593 | Map<String, Object> rs = new HashMap<>(); | 1567 | Map<String, Object> rs = new HashMap<>(); |
| 1594 | List<ScheduleRealInfo> list = new ArrayList<>(); | 1568 | List<ScheduleRealInfo> list = new ArrayList<>(); |
| 1595 | 1569 | ||
| 1596 | - ScheduleRealInfo sch; | 1570 | + ScheduleRealInfo sch,next; |
| 1597 | for(DfsjChange dc : dfsjcs){ | 1571 | for(DfsjChange dc : dfsjcs){ |
| 1598 | if(StringUtils.isEmpty(dc.getOld_dfsj()) || StringUtils.isEmpty(dc.getNew_dfsj())) | 1572 | if(StringUtils.isEmpty(dc.getOld_dfsj()) || StringUtils.isEmpty(dc.getNew_dfsj())) |
| 1599 | continue; | 1573 | continue; |
| @@ -1603,8 +1577,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1603,8 +1577,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1603 | continue; | 1577 | continue; |
| 1604 | 1578 | ||
| 1605 | sch.setDfsjAll(dc.getNew_dfsj()); | 1579 | sch.setDfsjAll(dc.getNew_dfsj()); |
| 1606 | - | 1580 | + //重新计算终点时间 |
| 1581 | + sch.calcEndTime(); | ||
| 1607 | list.add(sch); | 1582 | list.add(sch); |
| 1583 | + | ||
| 1584 | + next=dayOfSchedule.next(sch); | ||
| 1585 | + if(next.getQdzName().equals(sch.getZdzName())){ | ||
| 1586 | + next.setQdzArrDateJH(sch.getZdsj()); | ||
| 1587 | + list.add(next); | ||
| 1588 | + } | ||
| 1608 | } | 1589 | } |
| 1609 | 1590 | ||
| 1610 | rs.put("status", ResponseCode.SUCCESS); | 1591 | rs.put("status", ResponseCode.SUCCESS); |
| @@ -1612,6 +1593,92 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1612,6 +1593,92 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1612 | return rs; | 1593 | return rs; |
| 1613 | } | 1594 | } |
| 1614 | 1595 | ||
| 1596 | + /** | ||
| 1597 | + * 调整班次类型 | ||
| 1598 | + * @param id | ||
| 1599 | + * @param bcType | ||
| 1600 | + * @param remarks | ||
| 1601 | + * @return | ||
| 1602 | + */ | ||
| 1603 | + @Override | ||
| 1604 | + public Map<String, Object> changeBcType(Long id, String bcType, String remarks) { | ||
| 1605 | + Map<String, Object> rs = new HashMap<>(); | ||
| 1606 | + | ||
| 1607 | + try { | ||
| 1608 | + ScheduleRealInfo sch = dayOfSchedule.get(id); | ||
| 1609 | + if(sch != null){ | ||
| 1610 | + sch.setBcType(bcType); | ||
| 1611 | + sch.addRemarks(remarks); | ||
| 1612 | + //有时间记录一下相关变更数据 | ||
| 1613 | + rs.put("status", ResponseCode.SUCCESS); | ||
| 1614 | + rs.put("t", sch); | ||
| 1615 | + } | ||
| 1616 | + } catch (Exception e) { | ||
| 1617 | + logger.error("", e); | ||
| 1618 | + rs.put("status", ResponseCode.ERROR); | ||
| 1619 | + } | ||
| 1620 | + | ||
| 1621 | + return rs; | ||
| 1622 | + } | ||
| 1623 | + | ||
| 1624 | + @Override | ||
| 1625 | + public Map<String, Object> historySave(ScheduleRealInfo sch) { | ||
| 1626 | + Map<String, Object> rs = new HashMap<>(); | ||
| 1627 | + rs.put("status", ResponseCode.ERROR); | ||
| 1628 | + | ||
| 1629 | + ScheduleRealInfo oldSch = super.findById(sch.getId()); | ||
| 1630 | + //修改车辆 | ||
| 1631 | + if(!oldSch.getClZbh().equals(sch.getClZbh())){ | ||
| 1632 | + Set<String> allCar=BasicData.deviceId2NbbmMap.values(); | ||
| 1633 | + if(!allCar.contains(sch.getClZbh())){ | ||
| 1634 | + rs.put("msg", "无效的车辆自编号"); | ||
| 1635 | + return rs; | ||
| 1636 | + } | ||
| 1637 | + else | ||
| 1638 | + oldSch.setClZbh(sch.getClZbh()); | ||
| 1639 | + } | ||
| 1640 | + | ||
| 1641 | + //修改驾驶员 | ||
| 1642 | + if(!oldSch.getjGh().equals(sch.getjGh())){ | ||
| 1643 | + Map<String, String> allPer = BasicData.allPerson; | ||
| 1644 | + if(!allPer.containsKey(sch.getjGh())){ | ||
| 1645 | + rs.put("msg", "无效的驾驶员"); | ||
| 1646 | + return rs; | ||
| 1647 | + } | ||
| 1648 | + else{ | ||
| 1649 | + oldSch.setjGh(sch.getjGh()); | ||
| 1650 | + oldSch.setjName(allPer.get(oldSch.getjGh())); | ||
| 1651 | + } | ||
| 1652 | + } | ||
| 1653 | + | ||
| 1654 | + //修改售票员 | ||
| 1655 | +/* if(!oldSch.getsGh().equals(sch.getsGh())){ | ||
| 1656 | + Map<String, String> allPer = BasicData.allPerson; | ||
| 1657 | + | ||
| 1658 | + if(StringUtils.isNotEmpty(sch.getsGh())){ | ||
| 1659 | + if(!allPer.containsKey(sch.getsGh())){ | ||
| 1660 | + rs.put("msg", "无效的售票员"); | ||
| 1661 | + return rs; | ||
| 1662 | + } | ||
| 1663 | + } | ||
| 1664 | + oldSch.setsGh(sch.getsGh()); | ||
| 1665 | + oldSch.setsName(allPer.get(oldSch.getsGh())); | ||
| 1666 | + }*/ | ||
| 1667 | + | ||
| 1668 | + //待发时间 | ||
| 1669 | + oldSch.setDfsj(sch.getDfsj()); | ||
| 1670 | + //实发时间 | ||
| 1671 | + oldSch.setFcsjActual(sch.getFcsjActual()); | ||
| 1672 | + //实际终点 | ||
| 1673 | + oldSch.setZdsjActual(sch.getZdsjActual()); | ||
| 1674 | + //备注 | ||
| 1675 | + oldSch.setRemarks(sch.getRemarks()); | ||
| 1676 | + | ||
| 1677 | + scheduleRealInfoRepository.save(oldSch); | ||
| 1678 | + rs.put("status", ResponseCode.SUCCESS); | ||
| 1679 | + return rs; | ||
| 1680 | + } | ||
| 1681 | + | ||
| 1615 | @Override | 1682 | @Override |
| 1616 | public List<Map<String, Object>> yesterdayDataList(String line) { | 1683 | public List<Map<String, Object>> yesterdayDataList(String line) { |
| 1617 | // TODO Auto-generated method stub | 1684 | // TODO Auto-generated method stub |
src/main/java/com/bsth/service/schedule/PeopleCarPlanService.java
0 → 100644
| 1 | +package com.bsth.service.schedule; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import java.util.Map; | ||
| 5 | + | ||
| 6 | +public interface PeopleCarPlanService { | ||
| 7 | + | ||
| 8 | + List<Map<String, Object>> queryPeopleCar(String line, String date, String type); | ||
| 9 | + | ||
| 10 | + List<Map<String, Object>> workDaily(String line, String date, String type); | ||
| 11 | + | ||
| 12 | + Map<String, Object> scheduleAnaly(String page, String line, String startDate, String endDate, String model, String type); | ||
| 13 | + | ||
| 14 | + List<Map<String, Object>> getModel(String line, String startDate, String endDate); | ||
| 15 | + | ||
| 16 | + List<Map<String, Object>> firstAndLastBus(String line, String date, String type); | ||
| 17 | + | ||
| 18 | + List<Map<String, Object>> commandState(String line, String date, String code); | ||
| 19 | +} |
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule; | ||
| 2 | + | ||
| 3 | +import java.math.BigDecimal; | ||
| 4 | +import java.sql.ResultSet; | ||
| 5 | +import java.sql.SQLException; | ||
| 6 | +import java.text.DecimalFormat; | ||
| 7 | +import java.text.ParseException; | ||
| 8 | +import java.text.SimpleDateFormat; | ||
| 9 | +import java.util.ArrayList; | ||
| 10 | +import java.util.Collections; | ||
| 11 | +import java.util.Date; | ||
| 12 | +import java.util.HashMap; | ||
| 13 | +import java.util.HashSet; | ||
| 14 | +import java.util.Iterator; | ||
| 15 | +import java.util.List; | ||
| 16 | +import java.util.Map; | ||
| 17 | +import java.util.Set; | ||
| 18 | + | ||
| 19 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 20 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 21 | +import org.springframework.jdbc.core.RowMapper; | ||
| 22 | +import org.springframework.stereotype.Service; | ||
| 23 | + | ||
| 24 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 25 | +import com.bsth.entity.schedule.SchedulePlanInfo; | ||
| 26 | +import com.bsth.entity.schedule.TTInfoDetail; | ||
| 27 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | ||
| 28 | +import com.bsth.util.ReportUtils; | ||
| 29 | + | ||
| 30 | +@Service | ||
| 31 | +public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 32 | + | ||
| 33 | + @Autowired | ||
| 34 | + private ScheduleRealInfoRepository scheduleRealInfoRepository; | ||
| 35 | + | ||
| 36 | + @Autowired | ||
| 37 | + private JdbcTemplate jdbcTemplate; | ||
| 38 | + | ||
| 39 | + @Override | ||
| 40 | + public List<Map<String, Object>> queryPeopleCar(String line, String date, String type) { | ||
| 41 | + Map<String, List<SchedulePlanInfo>> keyMap = new HashMap<String, List<SchedulePlanInfo>>(); | ||
| 42 | + Map<String, List<Map<String, Object>>> temp = new HashMap<String, List<Map<String, Object>>>(); | ||
| 43 | + List<SchedulePlanInfo> list = new ArrayList<SchedulePlanInfo>(); | ||
| 44 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 45 | + List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>(); | ||
| 46 | + | ||
| 47 | + if(date.length() == 0){ | ||
| 48 | + date = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + try { | ||
| 52 | + | ||
| 53 | + String sql = "select * from bsth_c_s_sp_info where DATE_FORMAT(schedule_date,'%Y-%m-%d') = '"+date+"'"; | ||
| 54 | + if(line.length() != 0){ | ||
| 55 | + sql += " and xl_bm = '"+line+"'"; | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + list =jdbcTemplate.query(sql, | ||
| 59 | + new RowMapper<SchedulePlanInfo>(){ | ||
| 60 | + @Override | ||
| 61 | + public SchedulePlanInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 62 | + | ||
| 63 | + SchedulePlanInfo schedule = new SchedulePlanInfo(); | ||
| 64 | + | ||
| 65 | + schedule.setXlName(rs.getString("xl_name")); | ||
| 66 | + schedule.setLpName(rs.getString("lp_name")); | ||
| 67 | + schedule.setClZbh(rs.getString("cl_zbh")); | ||
| 68 | + schedule.setjName(rs.getString("j_name")); | ||
| 69 | + schedule.setsName(rs.getString("s_name")); | ||
| 70 | + schedule.setJhlc(rs.getDouble("jhlc")); | ||
| 71 | + return schedule; | ||
| 72 | + } | ||
| 73 | + }); | ||
| 74 | + | ||
| 75 | + | ||
| 76 | + } catch (Exception e) { | ||
| 77 | + // TODO Auto-generated catch block | ||
| 78 | + e.printStackTrace(); | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + //分组计算路程公里 | ||
| 82 | + for(SchedulePlanInfo schedule : list){ | ||
| 83 | + String key = schedule.getXlName() + "/" + schedule.getLpName() + "/" + | ||
| 84 | + schedule.getClZbh() + "/" + schedule.getjName() + "/" + schedule.getsName(); | ||
| 85 | + if(!keyMap.containsKey(key)) | ||
| 86 | + keyMap.put(key, new ArrayList<SchedulePlanInfo>()); | ||
| 87 | + keyMap.get(key).add(schedule); | ||
| 88 | + } | ||
| 89 | + for(String key : keyMap.keySet()){ | ||
| 90 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 91 | + BigDecimal jhlc = new BigDecimal(0); | ||
| 92 | + for(SchedulePlanInfo schedule : keyMap.get(key)){ | ||
| 93 | + if(schedule.getJhlc() != null) | ||
| 94 | + jhlc = jhlc.add(new BigDecimal(schedule.getJhlc())); | ||
| 95 | + } | ||
| 96 | + String[] split = key.split("/"); | ||
| 97 | + tempMap.put("date", date); | ||
| 98 | + tempMap.put("line", split[0]); | ||
| 99 | + tempMap.put("lp", split[1]); | ||
| 100 | + tempMap.put("clzbh", split[2]); | ||
| 101 | + tempMap.put("jName", split[3]); | ||
| 102 | + tempMap.put("sName", split[4]); | ||
| 103 | + if(split[4].equals("null")) | ||
| 104 | + tempMap.put("sName", "/"); | ||
| 105 | + tempMap.put("jhlc", jhlc.setScale(2, BigDecimal.ROUND_UP)); | ||
| 106 | + mapList.add(tempMap); | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + for(Map<String, Object> m : mapList){ | ||
| 110 | + String key = m.get("line").toString(); | ||
| 111 | + if(!temp.containsKey(key)) | ||
| 112 | + temp.put(key, new ArrayList<Map<String, Object>>()); | ||
| 113 | + temp.get(key).add(m); | ||
| 114 | + } | ||
| 115 | + for(String key : temp.keySet()){ | ||
| 116 | + Map<Integer, List<Map<String, Object>>> tempList = new HashMap<Integer, List<Map<String,Object>>>(); | ||
| 117 | + List<Integer> keyList = new ArrayList<Integer>(); | ||
| 118 | + for(Map<String, Object> m : temp.get(key)){ | ||
| 119 | + int i = Integer.valueOf(m.get("lp").toString()); | ||
| 120 | + if(!tempList.containsKey(i)) | ||
| 121 | + tempList.put(i, new ArrayList<Map<String, Object>>()); | ||
| 122 | + tempList.get(i).add(m); | ||
| 123 | + keyList.add(i); | ||
| 124 | + } | ||
| 125 | + Collections.sort(keyList); | ||
| 126 | + for(Integer i : keyList){ | ||
| 127 | + for(Map<String, Object> m : tempList.get(i)){ | ||
| 128 | + resList.add(m); | ||
| 129 | + } | ||
| 130 | + } | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + if(type.equals("export")){ | ||
| 134 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 135 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 136 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 137 | + Map<String,Object> map = new HashMap<String, Object>(); | ||
| 138 | + ReportUtils ee = new ReportUtils(); | ||
| 139 | + try { | ||
| 140 | + listI.add(resList.iterator()); | ||
| 141 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | ||
| 142 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\peoCarPlan.xls", | ||
| 143 | + path+"export\\计划车辆班次人员" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | ||
| 144 | + } catch (Exception e) { | ||
| 145 | + // TODO: handle exception | ||
| 146 | + e.printStackTrace(); | ||
| 147 | + } | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + return resList; | ||
| 151 | + } | ||
| 152 | + | ||
| 153 | + @Override | ||
| 154 | + public List<Map<String, Object>> workDaily(String line, String date, String type) { | ||
| 155 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 156 | + DecimalFormat df = new DecimalFormat("###0.##"); | ||
| 157 | + if(date.length() == 0){ | ||
| 158 | + date = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 159 | + } | ||
| 160 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | ||
| 161 | + if(line.length() != 0) | ||
| 162 | + list = scheduleRealInfoRepository.scheduleDaily(line, date); | ||
| 163 | + else | ||
| 164 | + list = scheduleRealInfoRepository.findByDate(date); | ||
| 165 | + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | ||
| 166 | + for(ScheduleRealInfo schedule : list){ | ||
| 167 | + String key = schedule.getXlName(); | ||
| 168 | + if(!keyMap.containsKey(key)){ | ||
| 169 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 170 | + } | ||
| 171 | + keyMap.get(key).add(schedule); | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-ddHH:mm"); | ||
| 175 | + Long zgfBegin = 0l; | ||
| 176 | + Long zgfEnd = 0l; | ||
| 177 | + Long wgfBegin = 0l; | ||
| 178 | + Long wgfEnd = 0l; | ||
| 179 | + try { | ||
| 180 | + //早晚高峰时段 | ||
| 181 | + zgfBegin = sdf.parse(date + "07:30").getTime(); | ||
| 182 | + zgfEnd = sdf.parse(date + "09:30").getTime(); | ||
| 183 | + wgfBegin = sdf.parse(date + "16:30").getTime(); | ||
| 184 | + wgfEnd = sdf.parse(date + "18:30").getTime(); | ||
| 185 | + } catch (ParseException e) { | ||
| 186 | + // TODO Auto-generated catch block | ||
| 187 | + e.printStackTrace(); | ||
| 188 | + } | ||
| 189 | + for(String key : keyMap.keySet()){ | ||
| 190 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 191 | + Map<String, List <ScheduleRealInfo>> listMap = new HashMap<String, List <ScheduleRealInfo>>(); | ||
| 192 | + int jhbc = 0; | ||
| 193 | + int dftz = 0; | ||
| 194 | + int jhcc = 0; | ||
| 195 | + int sjcc = 0; | ||
| 196 | + int upfk = 0; | ||
| 197 | + int updk = 0; | ||
| 198 | + int dnfk = 0; | ||
| 199 | + int dndk = 0; | ||
| 200 | + int upfm = 0; | ||
| 201 | + int updm = 0; | ||
| 202 | + int dnfm = 0; | ||
| 203 | + int dndm = 0; | ||
| 204 | + int jhsb = 0; | ||
| 205 | + int sjsb = 0; | ||
| 206 | + int jhmb = 0; | ||
| 207 | + int sjmb = 0; | ||
| 208 | + int jhzgf = 0; | ||
| 209 | + int sjzgf = 0; | ||
| 210 | + int jhwgf = 0; | ||
| 211 | + int sjwgf = 0; | ||
| 212 | + for(ScheduleRealInfo schedule : keyMap.get(key)){ | ||
| 213 | + schedule.setFcsjAll(schedule.getFcsj()); | ||
| 214 | + | ||
| 215 | + //早晚高峰时段执行率 | ||
| 216 | + if(schedule.getFcsjT() >= zgfBegin && schedule.getFcsjT() <= zgfEnd){ | ||
| 217 | + jhzgf++; | ||
| 218 | + if(schedule.getFcsjActual() != null) | ||
| 219 | + sjzgf++; | ||
| 220 | + } | ||
| 221 | + if(schedule.getFcsjT() >= wgfBegin && schedule.getFcsjT() <= wgfEnd){ | ||
| 222 | + jhwgf++; | ||
| 223 | + if(schedule.getFcsjActual() != null) | ||
| 224 | + sjwgf++; | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + //班次数和出场数 | ||
| 228 | + jhbc++; | ||
| 229 | + if(schedule.getBcType().equals("out")) | ||
| 230 | + jhcc++; | ||
| 231 | + | ||
| 232 | + //发出时间快慢 | ||
| 233 | + if(schedule.getFcsjActual() != null){ | ||
| 234 | + if(schedule.getBcType().equals("out")) | ||
| 235 | + sjcc++; | ||
| 236 | + schedule.setFcsjActualAll(schedule.getFcsjActual()); | ||
| 237 | + if(schedule.getFcsjActualTime() - schedule.getFcsjT() < -60000){ | ||
| 238 | + if(schedule.getXlDir().equals("0")) | ||
| 239 | + upfk++; | ||
| 240 | + else if (schedule.getXlDir().equals("1")) | ||
| 241 | + dnfk++; | ||
| 242 | + } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 180000){ | ||
| 243 | + if(schedule.getXlDir().equals("0")) | ||
| 244 | + upfm++; | ||
| 245 | + else if (schedule.getXlDir().equals("1")) | ||
| 246 | + dnfm++; | ||
| 247 | + } | ||
| 248 | + } | ||
| 249 | + //到站时间快慢 | ||
| 250 | + if(schedule.getZdsjActual() != null && schedule.getBcsj() != null){ | ||
| 251 | + schedule.setZdsjActualAll(schedule.getZdsjActual()); | ||
| 252 | + schedule.setDfsjAll(schedule.getDfsj()); | ||
| 253 | + schedule.calcEndTime(); | ||
| 254 | + if(schedule.getZdsjActualTime() - schedule.getZdsjT() < -60000){ | ||
| 255 | + if(schedule.getXlDir().equals("0")) | ||
| 256 | + updk++; | ||
| 257 | + else if (schedule.getXlDir().equals("1")) | ||
| 258 | + dndk++; | ||
| 259 | + } else if(schedule.getZdsjActualTime() - schedule.getZdsjT() > 180000){ | ||
| 260 | + if(schedule.getXlDir().equals("0")) | ||
| 261 | + updm++; | ||
| 262 | + else if (schedule.getXlDir().equals("1")) | ||
| 263 | + dndm++; | ||
| 264 | + } | ||
| 265 | + } | ||
| 266 | + | ||
| 267 | + //待发调整 | ||
| 268 | + if(schedule.getDfsj() != null){ | ||
| 269 | + if(!schedule.getDfsj().equals(schedule.getFcsj())){ | ||
| 270 | + dftz++; | ||
| 271 | + } | ||
| 272 | + } | ||
| 273 | + | ||
| 274 | + if(schedule.getBcType().equals("normal")){ | ||
| 275 | + String clZbh = schedule.getClZbh(); | ||
| 276 | + if(!listMap.containsKey(clZbh)) | ||
| 277 | + listMap.put(clZbh, new ArrayList<ScheduleRealInfo>()); | ||
| 278 | + listMap.get(clZbh).add(schedule); | ||
| 279 | + } | ||
| 280 | + } | ||
| 281 | + | ||
| 282 | + //求首末班准点率 | ||
| 283 | + for(String clZbh : listMap.keySet()){ | ||
| 284 | + Map<Integer, ScheduleRealInfo> temp = new HashMap<Integer, ScheduleRealInfo>(); | ||
| 285 | + List <ScheduleRealInfo> tempList = new ArrayList<ScheduleRealInfo>(); | ||
| 286 | + List<Integer> sort = new ArrayList<Integer>(); | ||
| 287 | + for(ScheduleRealInfo schedule : listMap.get(clZbh)){ | ||
| 288 | + String[] split = schedule.getFcsj().split(":"); | ||
| 289 | + int min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | ||
| 290 | + temp.put(min, schedule); | ||
| 291 | + sort.add(min); | ||
| 292 | + } | ||
| 293 | + Collections.sort(sort); | ||
| 294 | + for(Integer i : sort){ | ||
| 295 | + tempList.add(temp.get(i)); | ||
| 296 | + } | ||
| 297 | + ScheduleRealInfo shouban = tempList.get(0); | ||
| 298 | + ScheduleRealInfo moban = tempList.get(tempList.size() - 1); | ||
| 299 | + if(shouban.getFcsjActual() != null){ | ||
| 300 | + jhsb++; | ||
| 301 | + if(shouban.getFcsjActualTime() - shouban.getFcsjT() >= -60000 && shouban.getFcsjActualTime() - shouban.getFcsjT() <= 180000) | ||
| 302 | + sjsb++; | ||
| 303 | + } | ||
| 304 | + if(moban.getFcsjActual() != null){ | ||
| 305 | + jhmb++; | ||
| 306 | + if(moban.getFcsjActualTime() - moban.getFcsjT() >= -60000 && moban.getFcsjActualTime() - moban.getFcsjT() <= 180000) | ||
| 307 | + sjmb++; | ||
| 308 | + } | ||
| 309 | + | ||
| 310 | + } | ||
| 311 | + | ||
| 312 | + tempMap.put("date", date); | ||
| 313 | + tempMap.put("line", key); | ||
| 314 | + tempMap.put("jhbc", jhbc); | ||
| 315 | + tempMap.put("dftz", dftz); | ||
| 316 | + tempMap.put("dftzl", df.format(((float)dftz/jhbc)*100) + "%"); | ||
| 317 | + tempMap.put("ccl", df.format(((float)sjcc/jhcc)*100) + "%"); | ||
| 318 | + tempMap.put("upfk", upfk); | ||
| 319 | + tempMap.put("updk", updk); | ||
| 320 | + tempMap.put("dnfk", dnfk); | ||
| 321 | + tempMap.put("dndk", dndk); | ||
| 322 | + tempMap.put("upfm", upfm); | ||
| 323 | + tempMap.put("updm", updm); | ||
| 324 | + tempMap.put("dnfm", dnfm); | ||
| 325 | + tempMap.put("dndm", dndm); | ||
| 326 | + tempMap.put("wdzs", (upfk + updk + dnfk + dndk) + "/" + (upfm + updm + dnfm + dndm)); | ||
| 327 | + tempMap.put("smbzdl", (jhsb==0?"100%":df.format(((float)sjsb/jhsb)*100)+"%")+"/"+(jhmb==0?"100%":df.format(((float)sjmb/jhmb)*100)+"%")); | ||
| 328 | + tempMap.put("gfbczxl", (jhzgf==0?"0%":df.format(((float)sjzgf/jhzgf)*100)+"%")+"/"+(jhwgf==0?"0%":df.format(((float)sjwgf/jhwgf)*100)+"%")); | ||
| 329 | + resList.add(tempMap); | ||
| 330 | + } | ||
| 331 | + | ||
| 332 | + if(type.equals("export")){ | ||
| 333 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 334 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 335 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 336 | + Map<String,Object> map = new HashMap<String, Object>(); | ||
| 337 | + ReportUtils ee = new ReportUtils(); | ||
| 338 | + try { | ||
| 339 | + listI.add(resList.iterator()); | ||
| 340 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | ||
| 341 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\workDaily.xls", | ||
| 342 | + path+"export\\营运服务日报表" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | ||
| 343 | + } catch (Exception e) { | ||
| 344 | + // TODO: handle exception | ||
| 345 | + e.printStackTrace(); | ||
| 346 | + } | ||
| 347 | + } | ||
| 348 | + | ||
| 349 | + return resList; | ||
| 350 | + } | ||
| 351 | + | ||
| 352 | + @Override | ||
| 353 | + public Map<String, Object> scheduleAnaly(String page, String line, String startDate, String endDate, String model, String type) { | ||
| 354 | + DecimalFormat df = new DecimalFormat("00"); | ||
| 355 | + List<TTInfoDetail> ttList = new ArrayList<TTInfoDetail>(); | ||
| 356 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | ||
| 357 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 358 | + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); | ||
| 359 | + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | ||
| 360 | + Map<String, Object> modelMap = new HashMap<String, Object>(); | ||
| 361 | + | ||
| 362 | + if(startDate.length() == 0){ | ||
| 363 | + startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 364 | + } | ||
| 365 | + if(endDate.length() == 0){ | ||
| 366 | + endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 367 | + } | ||
| 368 | + try { | ||
| 369 | + | ||
| 370 | + String sql = "select * from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"' and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"'"; | ||
| 371 | + if(line.length() != 0){ | ||
| 372 | + sql += " and xl_bm = '"+line+"'"; | ||
| 373 | + } | ||
| 374 | + sql += " and bc_type = 'normal'"; | ||
| 375 | + | ||
| 376 | + list =jdbcTemplate.query(sql, | ||
| 377 | + new RowMapper<ScheduleRealInfo>(){ | ||
| 378 | + @Override | ||
| 379 | + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 380 | + ScheduleRealInfo schedule = new ScheduleRealInfo(); | ||
| 381 | + schedule.setXlName(rs.getString("xl_name")); | ||
| 382 | + schedule.setBcType(rs.getString("bc_type")); | ||
| 383 | + schedule.setBcs(rs.getInt("bcs")); | ||
| 384 | + schedule.setFcsj(rs.getString("fcsj")); | ||
| 385 | + schedule.setFcsjActual(rs.getString("fcsj_actual")); | ||
| 386 | + schedule.setZdsj(rs.getString("zdsj")); | ||
| 387 | + schedule.setZdsjActual(rs.getString("zdsj_actual")); | ||
| 388 | + schedule.setBcsj(rs.getInt("bcsj")); | ||
| 389 | + schedule.setQdzName(rs.getString("qdz_name")); | ||
| 390 | + return schedule; | ||
| 391 | + } | ||
| 392 | + }); | ||
| 393 | + | ||
| 394 | + if(model.length() != 0){ | ||
| 395 | + sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type = 'normal'"; | ||
| 396 | + } | ||
| 397 | + | ||
| 398 | + ttList =jdbcTemplate.query(sql, | ||
| 399 | + new RowMapper<TTInfoDetail>(){ | ||
| 400 | + @Override | ||
| 401 | + public TTInfoDetail mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 402 | + TTInfoDetail ttInfo = new TTInfoDetail(); | ||
| 403 | + ttInfo.setBcType(rs.getString("bc_type")); | ||
| 404 | + ttInfo.setBcs(rs.getInt("bcs")); | ||
| 405 | + ttInfo.setFcsj(rs.getString("fcsj")); | ||
| 406 | + ttInfo.setBcsj(rs.getInt("bcsj")); | ||
| 407 | + return ttInfo; | ||
| 408 | + } | ||
| 409 | + }); | ||
| 410 | + | ||
| 411 | + } catch (Exception e) { | ||
| 412 | + // TODO Auto-generated catch block | ||
| 413 | + e.printStackTrace(); | ||
| 414 | + } | ||
| 415 | + | ||
| 416 | + //分组计算 同时判断是否所选时刻信息 | ||
| 417 | + for(ScheduleRealInfo schedule : list){ | ||
| 418 | + if(model.length() != 0){ | ||
| 419 | + for(TTInfoDetail tt : ttList){ | ||
| 420 | + if(tt.getBcs() == schedule.getBcs() && tt.getFcsj().equals(schedule.getFcsj()) | ||
| 421 | + && tt.getBcsj() == schedule.getBcsj()){ | ||
| 422 | + String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj(); | ||
| 423 | + if(!keyMap.containsKey(key)) | ||
| 424 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 425 | + keyMap.get(key).add(schedule); | ||
| 426 | + continue; | ||
| 427 | + } | ||
| 428 | + } | ||
| 429 | + } else { | ||
| 430 | + String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj(); | ||
| 431 | + if(!keyMap.containsKey(key)) | ||
| 432 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 433 | + keyMap.get(key).add(schedule); | ||
| 434 | + } | ||
| 435 | + } | ||
| 436 | + for(String key : keyMap.keySet()){ | ||
| 437 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 438 | + List<Integer> fcsj = new ArrayList<Integer>(); | ||
| 439 | + List<Integer> yssj = new ArrayList<Integer>(); | ||
| 440 | + int jhbc = 0; | ||
| 441 | + int sjbc = 0; | ||
| 442 | + for(ScheduleRealInfo schedule : keyMap.get(key)){ | ||
| 443 | + tempMap.put("bcsj", schedule.getBcsj()); | ||
| 444 | + jhbc++; | ||
| 445 | + if(schedule.getZdsjActual() != null && schedule.getFcsjActual() != null){ | ||
| 446 | + sjbc++; | ||
| 447 | + String[] fcsj_ = schedule.getFcsjActual().split(":"); | ||
| 448 | + String[] zdsj_ = schedule.getZdsjActual().split(":"); | ||
| 449 | + int fcsj_m = (Integer.valueOf(fcsj_[0]) * 60) + Integer.valueOf(fcsj_[1]); | ||
| 450 | + int zdsj_m = (Integer.valueOf(zdsj_[0]) * 60) + Integer.valueOf(zdsj_[1]); | ||
| 451 | + fcsj.add(fcsj_m); | ||
| 452 | + yssj.add(zdsj_m - fcsj_m); | ||
| 453 | + } | ||
| 454 | + } | ||
| 455 | + int zzfc = 0; | ||
| 456 | + int zwfc = 0; | ||
| 457 | + int pjfc = 0; | ||
| 458 | + int fcSum = 0; | ||
| 459 | + int zkys = 0; | ||
| 460 | + int zmys = 0; | ||
| 461 | + int pjys = 0; | ||
| 462 | + int ysSum = 0; | ||
| 463 | + for(int i : fcsj){ | ||
| 464 | + fcSum += i; | ||
| 465 | + if(zzfc == 0 || zzfc > i) | ||
| 466 | + zzfc = i; | ||
| 467 | + if(zwfc == 0 || zwfc < i) | ||
| 468 | + zwfc = i; | ||
| 469 | + } | ||
| 470 | + for(int i : yssj){ | ||
| 471 | + ysSum += i; | ||
| 472 | + if(zkys == 0 || zkys > i) | ||
| 473 | + zkys = i; | ||
| 474 | + if(zmys == 0 || zmys < i) | ||
| 475 | + zmys = i; | ||
| 476 | + } | ||
| 477 | + if(fcsj.size() != 0){ | ||
| 478 | + pjfc = fcSum / fcsj.size(); | ||
| 479 | + tempMap.put("zzfc", df.format(zzfc/60)+":"+df.format(zzfc%60)); | ||
| 480 | + tempMap.put("zwfc", df.format(zwfc/60)+":"+df.format(zwfc%60)); | ||
| 481 | + tempMap.put("pjfc", df.format(pjfc/60)+":"+df.format(pjfc%60)); | ||
| 482 | + } else { | ||
| 483 | + tempMap.put("zzfc", "/"); | ||
| 484 | + tempMap.put("zwfc", "/"); | ||
| 485 | + tempMap.put("pjfc", "/"); | ||
| 486 | + } | ||
| 487 | + if(yssj.size() != 0){ | ||
| 488 | + pjys = ysSum / yssj.size(); | ||
| 489 | + tempMap.put("zkys", zkys); | ||
| 490 | + tempMap.put("zmys", zmys); | ||
| 491 | + tempMap.put("pjys", pjys); | ||
| 492 | + } else { | ||
| 493 | + tempMap.put("zkys", "/"); | ||
| 494 | + tempMap.put("zmys", "/"); | ||
| 495 | + tempMap.put("pjys", "/"); | ||
| 496 | + } | ||
| 497 | + String[] split = key.split("/"); | ||
| 498 | + tempMap.put("line", split[0]); | ||
| 499 | + tempMap.put("qdz", split[1]); | ||
| 500 | + tempMap.put("jhfc", split[2]); | ||
| 501 | + tempMap.put("jhbc", jhbc); | ||
| 502 | + tempMap.put("sjbc", sjbc); | ||
| 503 | + tempList.add(tempMap); | ||
| 504 | + } | ||
| 505 | + | ||
| 506 | + //排序 | ||
| 507 | + Map<String, List<Map<String, Object>>> listMap = new HashMap<String, List<Map<String, Object>>>(); | ||
| 508 | + Map<String, List<Map<String, Object>>> listMap2 = new HashMap<String, List<Map<String, Object>>>(); | ||
| 509 | + for(Map<String, Object> m : tempList){ | ||
| 510 | + String key = m.get("line").toString() + m.get("qdz"); | ||
| 511 | + if(!listMap.containsKey(key)) | ||
| 512 | + listMap.put(key, new ArrayList<Map<String, Object>>()); | ||
| 513 | + listMap.get(key).add(m); | ||
| 514 | + } | ||
| 515 | + for(String key : listMap.keySet()){ | ||
| 516 | + Map<Integer, Map<String, Object>> tempMap = new HashMap<Integer, Map<String,Object>>(); | ||
| 517 | + List<Integer> keyList = new ArrayList<Integer>(); | ||
| 518 | + for(Map<String, Object> m : listMap.get(key)){ | ||
| 519 | + String[] split = m.get("jhfc").toString().split(":"); | ||
| 520 | + int jhfc = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | ||
| 521 | + tempMap.put(jhfc, m); | ||
| 522 | + keyList.add(jhfc); | ||
| 523 | + } | ||
| 524 | + Collections.sort(keyList); | ||
| 525 | + for(Integer Int : keyList){ | ||
| 526 | + Map<String, Object> map = tempMap.get(Int); | ||
| 527 | + String str = map.get("line").toString(); | ||
| 528 | + if(!listMap2.containsKey(str)) | ||
| 529 | + listMap2.put(str, new ArrayList<Map<String, Object>>()); | ||
| 530 | + listMap2.get(str).add(map); | ||
| 531 | + } | ||
| 532 | + } | ||
| 533 | + for(String str : listMap2.keySet()){ | ||
| 534 | + for(Map<String, Object> map : listMap2.get(str)){ | ||
| 535 | + resList.add(map); | ||
| 536 | + } | ||
| 537 | + } | ||
| 538 | + | ||
| 539 | + //分页 | ||
| 540 | + if(page.length() != 0 && type.equals("query")){ | ||
| 541 | + int currPage = Integer.valueOf(page); | ||
| 542 | + modelMap.put("totalPage", resList.size()%10>0?(resList.size()/10 + 1):resList.size()/10); | ||
| 543 | + modelMap.put("dataList", resList.subList(currPage*10,((currPage+1)*10)>=resList.size()?resList.size():(currPage+1)*10)); | ||
| 544 | + } | ||
| 545 | + | ||
| 546 | + //导出 | ||
| 547 | + if(type.equals("export")){ | ||
| 548 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 549 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 550 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 551 | + Map<String,Object> map = new HashMap<String, Object>(); | ||
| 552 | + ReportUtils ee = new ReportUtils(); | ||
| 553 | + try { | ||
| 554 | + listI.add(resList.iterator()); | ||
| 555 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | ||
| 556 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\scheduleAnaly.xls", | ||
| 557 | + path+"export\\时刻表分析" + sdfSimple.format(sdfMonth.parse(startDate)) + "-" + sdfSimple.format(sdfMonth.parse(endDate)) + ".xls"); | ||
| 558 | + } catch (Exception e) { | ||
| 559 | + // TODO: handle exception | ||
| 560 | + e.printStackTrace(); | ||
| 561 | + } | ||
| 562 | + } | ||
| 563 | + | ||
| 564 | + return modelMap; | ||
| 565 | + } | ||
| 566 | + | ||
| 567 | + @Override | ||
| 568 | + public List<Map<String, Object>> getModel(String line, String startDate, String endDate) { | ||
| 569 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 570 | + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); | ||
| 571 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 572 | + SimpleDateFormat sdfEE = new SimpleDateFormat("EEEE"); | ||
| 573 | + | ||
| 574 | + if(startDate.length() == 0){ | ||
| 575 | + startDate = sdf.format(new Date()); | ||
| 576 | + } | ||
| 577 | + if(endDate.length() == 0){ | ||
| 578 | + endDate = sdf.format(new Date()); | ||
| 579 | + } | ||
| 580 | + try { | ||
| 581 | + | ||
| 582 | + String sql = "select tt.id, tt.name, qyrq, tt.rule_days, tt.special_days from bsth_c_s_ttinfo tt left join bsth_c_line cl on cl.id = tt.xl where tt.is_cancel = 0 and tt.is_enable_dis_template = 1"; | ||
| 583 | + if(line.length() != 0){ | ||
| 584 | + sql += " and cl.line_code = '"+line+"'"; | ||
| 585 | + } | ||
| 586 | + sql += " order by tt.create_date desc"; | ||
| 587 | + | ||
| 588 | + list = jdbcTemplate.query(sql, | ||
| 589 | + new RowMapper<Map<String, Object>>(){ | ||
| 590 | + @Override | ||
| 591 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 592 | + Map<String, Object> map = new HashMap<String, Object>(); | ||
| 593 | + map.put("id", rs.getString("id")); | ||
| 594 | + map.put("name", rs.getString("name")); | ||
| 595 | + map.put("qyrq", rs.getString("qyrq")); | ||
| 596 | + map.put("ruleDays", rs.getString("rule_days")); | ||
| 597 | + map.put("specialDays", rs.getString("special_days")); | ||
| 598 | + return map; | ||
| 599 | + } | ||
| 600 | + }); | ||
| 601 | + | ||
| 602 | + } catch (Exception e) { | ||
| 603 | + // TODO Auto-generated catch block | ||
| 604 | + e.printStackTrace(); | ||
| 605 | + } | ||
| 606 | + | ||
| 607 | + Date date1 = null; | ||
| 608 | + Date date2 = null; | ||
| 609 | + try { | ||
| 610 | + date1 = sdf.parse(startDate); | ||
| 611 | + date2 = sdf.parse(endDate); | ||
| 612 | + } catch (ParseException e) { | ||
| 613 | + // TODO Auto-generated catch block | ||
| 614 | + e.printStackTrace(); | ||
| 615 | + } | ||
| 616 | + | ||
| 617 | + Set<Integer> ruleDays1 = new HashSet<Integer>(); | ||
| 618 | + List<String> specialDays1 = new ArrayList<String>(); | ||
| 619 | + for(int i = 0; ; i++){ | ||
| 620 | + Date tempDate = new Date(date1.getTime() + i*1000*60*60*24); | ||
| 621 | + if(tempDate.getTime() > date2.getTime()) | ||
| 622 | + break; | ||
| 623 | + String week = sdfEE.format(tempDate); | ||
| 624 | + if(week.equals("星期一")) | ||
| 625 | + ruleDays1.add(0); | ||
| 626 | + else if(week.equals("星期二")) | ||
| 627 | + ruleDays1.add(1); | ||
| 628 | + else if(week.equals("星期三")) | ||
| 629 | + ruleDays1.add(2); | ||
| 630 | + else if(week.equals("星期四")) | ||
| 631 | + ruleDays1.add(3); | ||
| 632 | + else if(week.equals("星期五")) | ||
| 633 | + ruleDays1.add(4); | ||
| 634 | + else if(week.equals("星期六")) | ||
| 635 | + ruleDays1.add(5); | ||
| 636 | + else if(week.equals("星期日")) | ||
| 637 | + ruleDays1.add(6); | ||
| 638 | + specialDays1.add(sdf.format(tempDate)); | ||
| 639 | + } | ||
| 640 | + for(Map<String, Object> map : list){ | ||
| 641 | + String[] ruleDays = map.get("ruleDays").toString().split(","); | ||
| 642 | + String[] specialDays = map.get("specialDays").toString().split(","); | ||
| 643 | + boolean flag = false; | ||
| 644 | + DO:{ | ||
| 645 | + try { | ||
| 646 | + long qyrq = sdf.parse(map.get("qyrq").toString()).getTime(); | ||
| 647 | + if(qyrq > date2.getTime()) | ||
| 648 | + break; | ||
| 649 | + } catch (ParseException e) { | ||
| 650 | + // TODO Auto-generated catch block | ||
| 651 | + e.printStackTrace(); | ||
| 652 | + } | ||
| 653 | + for(int i = 0; i < ruleDays.length; i++){ | ||
| 654 | + if(ruleDays[i].equals("1")){ | ||
| 655 | + if(ruleDays1.contains(i)){ | ||
| 656 | + flag = true; | ||
| 657 | + break DO; | ||
| 658 | + } | ||
| 659 | + } | ||
| 660 | + } | ||
| 661 | + for(int i = 0; i < specialDays.length; i++){ | ||
| 662 | + for(int j = 0; j < specialDays1.size(); j++){ | ||
| 663 | + if(specialDays[i].equals(specialDays1.get(j))){ | ||
| 664 | + flag = true; | ||
| 665 | + break DO; | ||
| 666 | + } | ||
| 667 | + } | ||
| 668 | + } | ||
| 669 | + } | ||
| 670 | + if(flag) | ||
| 671 | + resList.add(map); | ||
| 672 | + } | ||
| 673 | + | ||
| 674 | + return resList; | ||
| 675 | + } | ||
| 676 | + | ||
| 677 | + @Override | ||
| 678 | + public List<Map<String, Object>> firstAndLastBus(String line, String date, String type) { | ||
| 679 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | ||
| 680 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 681 | + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | ||
| 682 | + | ||
| 683 | + if(date.length() == 0) | ||
| 684 | + date = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 685 | + if(line.length() != 0) | ||
| 686 | + list = scheduleRealInfoRepository.scheduleDaily(line, date); | ||
| 687 | + else | ||
| 688 | + list = scheduleRealInfoRepository.findByDate(date); | ||
| 689 | + | ||
| 690 | + for(ScheduleRealInfo schedule : list){ | ||
| 691 | + if(!schedule.getBcType().equals("normal")) | ||
| 692 | + continue; | ||
| 693 | + String key = schedule.getXlName(); | ||
| 694 | + if(!keyMap.containsKey(key)) | ||
| 695 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 696 | + keyMap.get(key).add(schedule); | ||
| 697 | + } | ||
| 698 | + for(String key : keyMap.keySet()){ | ||
| 699 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 700 | + Map<Long, ScheduleRealInfo> temp0 = new HashMap<Long, ScheduleRealInfo>(); | ||
| 701 | + List<Long> longList0 = new ArrayList<Long>(); | ||
| 702 | + Map<Long, ScheduleRealInfo> temp1 = new HashMap<Long, ScheduleRealInfo>(); | ||
| 703 | + List<Long> longList1 = new ArrayList<Long>(); | ||
| 704 | + for(ScheduleRealInfo schedule : keyMap.get(key)){ | ||
| 705 | + String[] split = schedule.getFcsj().split(":"); | ||
| 706 | + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | ||
| 707 | + schedule.setFcsjT(min); | ||
| 708 | + if(schedule.getXlDir().equals("0")){ | ||
| 709 | + temp0.put(min, schedule); | ||
| 710 | + longList0.add(min); | ||
| 711 | + } else { | ||
| 712 | + temp1.put(min, schedule); | ||
| 713 | + longList1.add(min); | ||
| 714 | + } | ||
| 715 | + } | ||
| 716 | + Collections.sort(longList0); | ||
| 717 | + Collections.sort(longList1); | ||
| 718 | + ScheduleRealInfo shouban0 = temp0.get(longList0.get(0)); | ||
| 719 | + ScheduleRealInfo moban0 = temp0.get(longList0.get(longList0.size() - 1)); | ||
| 720 | + ScheduleRealInfo shouban1 = temp1.get(longList1.get(0)); | ||
| 721 | + ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1)); | ||
| 722 | + tempMap.put("date", date); | ||
| 723 | + tempMap.put("line", key); | ||
| 724 | + tempMap.put("qdzFirst0", shouban0.getQdzName()); | ||
| 725 | + tempMap.put("jhfcFirst0", shouban0.getFcsj()); | ||
| 726 | + tempMap.put("qdzLast0", moban0.getQdzName()); | ||
| 727 | + tempMap.put("jhfcLast0", moban0.getFcsj()); | ||
| 728 | + tempMap.put("qdzFirst1", shouban1.getQdzName()); | ||
| 729 | + tempMap.put("jhfcFirst1", shouban1.getFcsj()); | ||
| 730 | + tempMap.put("qdzLast1", moban1.getQdzName()); | ||
| 731 | + tempMap.put("jhfcLast1", moban1.getFcsj()); | ||
| 732 | + if(shouban0.getFcsjActual() != null){ | ||
| 733 | + String[] split = shouban0.getFcsjActual().split(":"); | ||
| 734 | + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | ||
| 735 | + long delay = shouban0.getFcsjT() - min; | ||
| 736 | + tempMap.put("sjfcFirst0", shouban0.getFcsjActual()); | ||
| 737 | + if(delay > 0) | ||
| 738 | + tempMap.put("delayFirst0", "+" + delay); | ||
| 739 | + else | ||
| 740 | + tempMap.put("delayFirst0", delay); | ||
| 741 | + } else { | ||
| 742 | + tempMap.put("sjfcFirst0", "/"); | ||
| 743 | + tempMap.put("delayFirst0", "/"); | ||
| 744 | + } | ||
| 745 | + if(moban0.getZdsjActual() != null){ | ||
| 746 | + String[] split = moban0.getFcsjActual().split(":"); | ||
| 747 | + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | ||
| 748 | + long delay = moban0.getFcsjT() - min; | ||
| 749 | + tempMap.put("sjfcLast0", moban0.getFcsjActual()); | ||
| 750 | + if(delay > 0) | ||
| 751 | + tempMap.put("delayLast0", "+" + delay); | ||
| 752 | + else | ||
| 753 | + tempMap.put("delayLast0", delay); | ||
| 754 | + } else { | ||
| 755 | + tempMap.put("sjfcLast0", "/"); | ||
| 756 | + tempMap.put("delayLast0", "/"); | ||
| 757 | + } | ||
| 758 | + if(shouban1.getFcsjActual() != null){ | ||
| 759 | + String[] split = shouban1.getFcsjActual().split(":"); | ||
| 760 | + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | ||
| 761 | + long delay = shouban1.getFcsjT() - min; | ||
| 762 | + tempMap.put("sjfcFirst1", shouban1.getFcsjActual()); | ||
| 763 | + if(delay > 0) | ||
| 764 | + tempMap.put("delayFirst1", "+" + delay); | ||
| 765 | + else | ||
| 766 | + tempMap.put("delayFirst1", delay); | ||
| 767 | + } else { | ||
| 768 | + tempMap.put("sjfcFirst1", "/"); | ||
| 769 | + tempMap.put("delayFirst1", "/"); | ||
| 770 | + } | ||
| 771 | + if(moban1.getZdsjActual() != null){ | ||
| 772 | + String[] split = moban1.getFcsjActual().split(":"); | ||
| 773 | + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | ||
| 774 | + long delay = moban1.getFcsjT() - min; | ||
| 775 | + tempMap.put("sjfcLast1", moban1.getFcsjActual()); | ||
| 776 | + if(delay > 0) | ||
| 777 | + tempMap.put("delayLast1", "+" + delay); | ||
| 778 | + else | ||
| 779 | + tempMap.put("delayLast1", delay); | ||
| 780 | + } else { | ||
| 781 | + tempMap.put("sjfcLast1", "/"); | ||
| 782 | + tempMap.put("delayLast1", "/"); | ||
| 783 | + } | ||
| 784 | + resList.add(tempMap); | ||
| 785 | + } | ||
| 786 | + | ||
| 787 | + if(type.equals("export")){ | ||
| 788 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 789 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 790 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 791 | + Map<String,Object> map = new HashMap<String, Object>(); | ||
| 792 | + ReportUtils ee = new ReportUtils(); | ||
| 793 | + try { | ||
| 794 | + listI.add(resList.iterator()); | ||
| 795 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | ||
| 796 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\firstAndLastBus.xls", | ||
| 797 | + path+"export\\线路首末班" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | ||
| 798 | + } catch (Exception e) { | ||
| 799 | + // TODO: handle exception | ||
| 800 | + e.printStackTrace(); | ||
| 801 | + } | ||
| 802 | + } | ||
| 803 | + | ||
| 804 | + return resList; | ||
| 805 | + } | ||
| 806 | + | ||
| 807 | + @Override | ||
| 808 | + public List<Map<String, Object>> commandState(String line, String date, String code) { | ||
| 809 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 810 | + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); | ||
| 811 | + Map<String, List<Map<String, Object>>> keyMap = new HashMap<String, List<Map<String, Object>>>(); | ||
| 812 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss"); | ||
| 813 | + | ||
| 814 | + if(date.length() == 0) | ||
| 815 | + date = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 816 | + | ||
| 817 | + try { | ||
| 818 | + | ||
| 819 | + String sql = "select r.id, r.schedule_date_str, r.xl_name, r.cl_zbh, r.j_gh, r.j_name, r.fcsj, d.timestamp, d.reply46, d.reply47, d.reply46time, d.reply47time " + | ||
| 820 | + "FROM bsth_c_s_sp_info_real as r left join bsth_v_directive_60 as d on r.id = d.sch and d.is_dispatch = 1 where DATE_FORMAT(schedule_date,'%Y-%m-%d') = '"+date+"'"; | ||
| 821 | + if(line.length() != 0){ | ||
| 822 | + sql += " and xl_bm = '"+line+"'"; | ||
| 823 | + } | ||
| 824 | + if(code.length() != 0){ | ||
| 825 | + sql += " and cl_zbh = '"+code+"'"; | ||
| 826 | + } | ||
| 827 | + sql += " union " + | ||
| 828 | + "select r.id, r.schedule_date_str, r.xl_name, r.cl_zbh, r.j_gh, r.j_name, r.fcsj, d.timestamp, d.reply46, d.reply47, d.reply46time, d.reply47time " + | ||
| 829 | + "FROM bsth_c_s_sp_info_real as r right join bsth_v_directive_60 as d on r.id = d.sch where d.is_dispatch = 1 and DATE_FORMAT(schedule_date,'%Y-%m-%d') = '"+date+"'"; | ||
| 830 | + if(line.length() != 0){ | ||
| 831 | + sql += " and xl_bm = '"+line+"'"; | ||
| 832 | + } | ||
| 833 | + if(code.length() != 0){ | ||
| 834 | + sql += " and cl_zbh = '"+code+"'"; | ||
| 835 | + } | ||
| 836 | + sql += " order by fcsj"; | ||
| 837 | + | ||
| 838 | + list = jdbcTemplate.query(sql, | ||
| 839 | + new RowMapper<Map<String, Object>>(){ | ||
| 840 | + @Override | ||
| 841 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 842 | + Map<String, Object> map = new HashMap<String, Object>(); | ||
| 843 | + map.put("id", rs.getString("id")); | ||
| 844 | + map.put("date", rs.getString("schedule_date_str")); | ||
| 845 | + map.put("line", rs.getString("xl_name")); | ||
| 846 | + map.put("clZbh", rs.getString("cl_zbh")); | ||
| 847 | + map.put("jGh", rs.getString("j_gh")); | ||
| 848 | + map.put("jName", rs.getString("j_name")); | ||
| 849 | + map.put("fcsj", rs.getString("fcsj")); | ||
| 850 | + map.put("timestamp", rs.getString("timestamp")); | ||
| 851 | + map.put("reply46", rs.getString("reply46")); | ||
| 852 | + map.put("reply47", rs.getString("reply47")); | ||
| 853 | + map.put("reply46time", rs.getString("reply46time")); | ||
| 854 | + map.put("reply47time", rs.getString("reply47time")); | ||
| 855 | + return map; | ||
| 856 | + } | ||
| 857 | + }); | ||
| 858 | + | ||
| 859 | + } catch (Exception e) { | ||
| 860 | + // TODO Auto-generated catch block | ||
| 861 | + e.printStackTrace(); | ||
| 862 | + } | ||
| 863 | + | ||
| 864 | + for(Map<String, Object> map : list){ | ||
| 865 | + String key = map.get("line") + "/" + map.get("clZbh") + "/" + map.get("jGh") + "/" + map.get("jName"); | ||
| 866 | + if(!keyMap.containsKey(key)) | ||
| 867 | + keyMap.put(key, new ArrayList<Map<String, Object>>()); | ||
| 868 | + keyMap.get(key).add(map); | ||
| 869 | + } | ||
| 870 | + for(String key : keyMap.keySet()){ | ||
| 871 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 872 | + Set<String> tempSet = new HashSet<String>(); | ||
| 873 | + int sjf = 0; | ||
| 874 | + int wqr = 0; | ||
| 875 | + for(Map<String, Object> map : keyMap.get(key)){ | ||
| 876 | + tempSet.add(map.get("id").toString()); | ||
| 877 | + if(map.get("timestamp") != null){ | ||
| 878 | + sjf++; | ||
| 879 | + if(map.get("reply47").toString().equals("-1")) | ||
| 880 | + wqr++; | ||
| 881 | + map.put("time", sdf.format(new Date(Long.valueOf(map.get("timestamp").toString())))); | ||
| 882 | + } else | ||
| 883 | + map.put("time", "/"); | ||
| 884 | + | ||
| 885 | + if(map.get("reply46time") != null) | ||
| 886 | + map.put("time46", sdf.format(new Date(Long.valueOf(map.get("reply46time").toString())))); | ||
| 887 | + else | ||
| 888 | + map.put("time46", "/"); | ||
| 889 | + | ||
| 890 | + if(map.get("reply47time") != null) | ||
| 891 | + map.put("time47", sdf.format(new Date(Long.valueOf(map.get("reply47time").toString())))); | ||
| 892 | + else | ||
| 893 | + map.put("time47", "/"); | ||
| 894 | + | ||
| 895 | + } | ||
| 896 | + String[] split = key.split("/"); | ||
| 897 | + tempMap.put("date", date); | ||
| 898 | + tempMap.put("line", split[0]); | ||
| 899 | + tempMap.put("clZbh", split[1]); | ||
| 900 | + tempMap.put("jsy", split[2] + "/" + split[3]); | ||
| 901 | + tempMap.put("jhf", tempSet.size()); | ||
| 902 | + tempMap.put("sjf", sjf); | ||
| 903 | + tempMap.put("wqr", wqr); | ||
| 904 | + tempMap.put("workList", keyMap.get(key)); | ||
| 905 | + resList.add(tempMap); | ||
| 906 | + } | ||
| 907 | + | ||
| 908 | + return resList; | ||
| 909 | + } | ||
| 910 | + | ||
| 911 | +} |
src/main/resources/static/pages/forms/mould/firstAndLastBus.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/peoCarPlan.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/scheduleAnaly.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/workDaily.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/commandState.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + | ||
| 15 | + .table > tbody + tbody { | ||
| 16 | + border-top: 1px solid; } | ||
| 17 | +</style> | ||
| 18 | + | ||
| 19 | +<div class="page-head"> | ||
| 20 | + <div class="page-title"> | ||
| 21 | + <h1>指令状态分析</h1> | ||
| 22 | + </div> | ||
| 23 | +</div> | ||
| 24 | + | ||
| 25 | +<div class="row"> | ||
| 26 | + <div class="col-md-12"> | ||
| 27 | + <div class="portlet light porttlet-fit bordered"> | ||
| 28 | + <div class="portlet-title"> | ||
| 29 | + <form id="history" class="form-inline" action=""> | ||
| 30 | + <div style="display: inline-block;"> | ||
| 31 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 32 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 35 | + <span class="item-label" style="width: 80px;">时间: </span> | ||
| 36 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | ||
| 37 | + </div> | ||
| 38 | + <div style="display: inline-block;margin-left: 15px"> | ||
| 39 | + <span class="item-label" style="width: 140px;">内部编码: </span> | ||
| 40 | + <select class="form-control" name="code" id="code" style="width: 180px;"></select> | ||
| 41 | + </div> | ||
| 42 | + <div class="form-group"> | ||
| 43 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 44 | +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | ||
| 45 | + </div> | ||
| 46 | + </form> | ||
| 47 | + </div> | ||
| 48 | + <div class="portlet-body"> | ||
| 49 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 50 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 51 | + <thead> | ||
| 52 | + <tr class="hidden"> | ||
| 53 | + <th>日期</th> | ||
| 54 | + <th>线路</th> | ||
| 55 | + <th>车辆</th> | ||
| 56 | + <th>人员</th> | ||
| 57 | + <th>应发</th> | ||
| 58 | + <th>实发</th> | ||
| 59 | + <th>未确认</th> | ||
| 60 | + </tr> | ||
| 61 | + </thead> | ||
| 62 | + <tbody> | ||
| 63 | + | ||
| 64 | + </tbody> | ||
| 65 | + </table> | ||
| 66 | + <div id="works_hidden" class="hidden"> | ||
| 67 | + <span class="item-label" style="width: 80px;">明细: </span> | ||
| 68 | + <span class="item-label" style="width: 80px;margin-left: 60px;">日期 </span> | ||
| 69 | + <span class="item-label" style="width: 80px;" id="date1"></span> | ||
| 70 | + <span class="item-label" style="width: 80px;margin-left: 60px;">线路 </span> | ||
| 71 | + <span class="item-label" style="width: 80px;" id="line1"></span> | ||
| 72 | + <span class="item-label" style="width: 80px;margin-left: 60px;">车辆 </span> | ||
| 73 | + <span class="item-label" style="width: 80px;" id="clZbh1"></span> | ||
| 74 | + <span class="item-label" style="width: 80px;margin-left: 60px;">人员 </span> | ||
| 75 | + <span class="item-label" style="width: 80px;" id="jsy1"></span> | ||
| 76 | + </div> | ||
| 77 | + <table class="table table-bordered table-hover table-checkable" id="works"> | ||
| 78 | + <thead> | ||
| 79 | + <tr class="hidden"> | ||
| 80 | + <th>日期</th> | ||
| 81 | + <th>线路</th> | ||
| 82 | + <th>车辆</th> | ||
| 83 | + <th>计划发车时间</th> | ||
| 84 | + <th>发送时间</th> | ||
| 85 | + <th>收到时间</th> | ||
| 86 | + <th>确认时间</th> | ||
| 87 | + </tr> | ||
| 88 | + </thead> | ||
| 89 | + <tbody> | ||
| 90 | + | ||
| 91 | + </tbody> | ||
| 92 | + </table> | ||
| 93 | + <div style="text-align: right;"> | ||
| 94 | + <ul id="pagination" class="pagination"></ul> | ||
| 95 | + </div> | ||
| 96 | + </div> | ||
| 97 | + </div> | ||
| 98 | + </div> | ||
| 99 | + </div> | ||
| 100 | +</div> | ||
| 101 | + | ||
| 102 | +<script> | ||
| 103 | + $(function(){ | ||
| 104 | + var list; | ||
| 105 | + | ||
| 106 | + // 关闭左侧栏 | ||
| 107 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 108 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 109 | + | ||
| 110 | + $("#date").datetimepicker({ | ||
| 111 | + format : 'YYYY-MM-DD', | ||
| 112 | + locale : 'zh-cn' | ||
| 113 | + }); | ||
| 114 | + | ||
| 115 | + var d = new Date(); | ||
| 116 | + var year = d.getFullYear(); | ||
| 117 | + var month = d.getMonth() + 1; | ||
| 118 | + var day = d.getDate(); | ||
| 119 | + if(month > 9){ | ||
| 120 | + $("#date").val(year + "-" + month + "-" + day); | ||
| 121 | + } else { | ||
| 122 | + $("#date").val(year + "-0" + month + "-" + day); | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + $('#line').select2({ | ||
| 126 | + ajax: { | ||
| 127 | + url: '/realSchedule/findLine', | ||
| 128 | + type: 'post', | ||
| 129 | + dataType: 'json', | ||
| 130 | + delay: 150, | ||
| 131 | + data: function(params){ | ||
| 132 | + return{line: params.term}; | ||
| 133 | + }, | ||
| 134 | + processResults: function (data) { | ||
| 135 | + return { | ||
| 136 | + results: data | ||
| 137 | + }; | ||
| 138 | + }, | ||
| 139 | + cache: true | ||
| 140 | + }, | ||
| 141 | + templateResult: function(repo){ | ||
| 142 | + if (repo.loading) return repo.text; | ||
| 143 | + var h = '<span>'+repo.text+'</span>'; | ||
| 144 | + return h; | ||
| 145 | + }, | ||
| 146 | + escapeMarkup: function (markup) { return markup; }, | ||
| 147 | + minimumInputLength: 1, | ||
| 148 | + templateSelection: function(repo){ | ||
| 149 | + return repo.text; | ||
| 150 | + }, | ||
| 151 | + language: { | ||
| 152 | + noResults: function(){ | ||
| 153 | + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | ||
| 154 | + }, | ||
| 155 | + inputTooShort : function(e) { | ||
| 156 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | ||
| 157 | + }, | ||
| 158 | + searching : function() { | ||
| 159 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | ||
| 160 | + } | ||
| 161 | + } | ||
| 162 | + }); | ||
| 163 | + $('#code').select2({ | ||
| 164 | + ajax: { | ||
| 165 | + url: '/realSchedule/sreachVehic', | ||
| 166 | + dataType: 'json', | ||
| 167 | + delay: 150, | ||
| 168 | + data: function(params){ | ||
| 169 | + return{nbbm: params.term}; | ||
| 170 | + }, | ||
| 171 | + processResults: function (data) { | ||
| 172 | + return { | ||
| 173 | + results: data | ||
| 174 | + }; | ||
| 175 | + }, | ||
| 176 | + cache: true | ||
| 177 | + }, | ||
| 178 | + templateResult: function(repo){ | ||
| 179 | + if (repo.loading) return repo.text; | ||
| 180 | + var h = '<span>'+repo.text+'</span>'; | ||
| 181 | + h += (repo.lineName?' <span class="select2-desc">'+repo.lineName+'</span>':''); | ||
| 182 | + return h; | ||
| 183 | + }, | ||
| 184 | + escapeMarkup: function (markup) { return markup; }, | ||
| 185 | + minimumInputLength: 1, | ||
| 186 | + templateSelection: function(repo){ | ||
| 187 | + return repo.text; | ||
| 188 | + }, | ||
| 189 | + language: { | ||
| 190 | + noResults: function(){ | ||
| 191 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 192 | + }, | ||
| 193 | + inputTooShort : function(e) { | ||
| 194 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 195 | + }, | ||
| 196 | + searching : function() { | ||
| 197 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 198 | + } | ||
| 199 | + } | ||
| 200 | + }); | ||
| 201 | + | ||
| 202 | + | ||
| 203 | + $("#query").on("click",jsDoQuery); | ||
| 204 | + | ||
| 205 | + function jsDoQuery(pagination){ | ||
| 206 | + var params = {}; | ||
| 207 | + params['line'] = $("#line").val(); | ||
| 208 | + params['date'] = $("#date").val(); | ||
| 209 | + params['code'] = $("#code").val(); | ||
| 210 | + $("#forms .hidden").removeClass("hidden"); | ||
| 211 | + $get('/pcpc/commandState', params, function(result){ | ||
| 212 | + // 把数据填充到模版中 | ||
| 213 | + var tbodyHtml = template('list_commandState',{list:result}); | ||
| 214 | + list = result; | ||
| 215 | + // 把渲染好的模版html文本追加到表格中 | ||
| 216 | + $('#forms tbody').html(tbodyHtml); | ||
| 217 | + | ||
| 218 | + }); | ||
| 219 | + } | ||
| 220 | + | ||
| 221 | + $("#export").on("click",function(){ | ||
| 222 | + $('#forms').tableExport({ type: 'excel', escape: 'false',filename:'(2016-02-29_2016-03-06)'}); | ||
| 223 | + }); | ||
| 224 | + | ||
| 225 | + $("#forms tbody").on("click","a",function(){ | ||
| 226 | + var jsy = $(this).html(); | ||
| 227 | + $.each(list, function(i, g){ | ||
| 228 | + if(jsy == g.jsy){ | ||
| 229 | + $("#date1").html(g.date); | ||
| 230 | + $("#line1").html(g.line); | ||
| 231 | + $("#clZbh1").html(g.clZbh); | ||
| 232 | + $("#jsy1").html(g.jsy); | ||
| 233 | + $("#works_hidden").removeClass("hidden"); | ||
| 234 | + $("#works .hidden").removeClass("hidden"); | ||
| 235 | + // 把数据填充到模版中 | ||
| 236 | + var tbodyHtml = template('list_workList',{list:g.workList}); | ||
| 237 | + // 把渲染好的模版html文本追加到表格中 | ||
| 238 | + $('#works tbody').html(tbodyHtml); | ||
| 239 | + } | ||
| 240 | + }); | ||
| 241 | + }); | ||
| 242 | + | ||
| 243 | + | ||
| 244 | + }); | ||
| 245 | + | ||
| 246 | + | ||
| 247 | +</script> | ||
| 248 | +<script type="text/html" id="list_commandState"> | ||
| 249 | + {{each list as obj i}} | ||
| 250 | + <tr> | ||
| 251 | + <td>{{obj.date}}</td> | ||
| 252 | + <td>{{obj.line}}</td> | ||
| 253 | + <td>{{obj.clZbh}}</td> | ||
| 254 | + <td><a id="jsy">{{obj.jsy}}</a></td> | ||
| 255 | + <td>{{obj.jhf}}</td> | ||
| 256 | + <td>{{obj.sjf}}</td> | ||
| 257 | + <td>{{obj.wqr}}</td> | ||
| 258 | + </tr> | ||
| 259 | + {{/each}} | ||
| 260 | + {{if list.length == 0}} | ||
| 261 | + <tr> | ||
| 262 | + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 263 | + </tr> | ||
| 264 | + {{/if}} | ||
| 265 | +</script> | ||
| 266 | + | ||
| 267 | +<script type="text/html" id="list_workList"> | ||
| 268 | + {{each list as obj i}} | ||
| 269 | + <tr> | ||
| 270 | + <td>{{obj.date}}</td> | ||
| 271 | + <td>{{obj.line}}</td> | ||
| 272 | + <td>{{obj.clZbh}}</td> | ||
| 273 | + <td>{{obj.fcsj}}</td> | ||
| 274 | + <td>{{obj.time}}</td> | ||
| 275 | + <td>{{obj.time46}}</td> | ||
| 276 | + <td>{{obj.time47}}</td> | ||
| 277 | + </tr> | ||
| 278 | + {{/each}} | ||
| 279 | + {{if list.length == 0}} | ||
| 280 | + <tr> | ||
| 281 | + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 282 | + </tr> | ||
| 283 | + {{/if}} | ||
| 284 | +</script> | ||
| 0 | \ No newline at end of file | 285 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + | ||
| 15 | + .table > tbody + tbody { | ||
| 16 | + border-top: 1px solid; } | ||
| 17 | +</style> | ||
| 18 | + | ||
| 19 | +<div class="page-head"> | ||
| 20 | + <div class="page-title"> | ||
| 21 | + <h1>线路首末班查询</h1> | ||
| 22 | + </div> | ||
| 23 | +</div> | ||
| 24 | + | ||
| 25 | +<div class="row"> | ||
| 26 | + <div class="col-md-12"> | ||
| 27 | + <div class="portlet light porttlet-fit bordered"> | ||
| 28 | + <div class="portlet-title"> | ||
| 29 | + <form id="history" class="form-inline" action=""> | ||
| 30 | + <div style="display: inline-block;"> | ||
| 31 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 32 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 35 | + <span class="item-label" style="width: 80px;">时间: </span> | ||
| 36 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | ||
| 37 | + </div> | ||
| 38 | + <div class="form-group"> | ||
| 39 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 40 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 41 | + </div> | ||
| 42 | + </form> | ||
| 43 | + </div> | ||
| 44 | + <div class="portlet-body"> | ||
| 45 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 46 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 47 | + <thead> | ||
| 48 | + <tr class="hidden"> | ||
| 49 | + <th width="100px" rowspan="2">日期</th> | ||
| 50 | + <th width="100px" rowspan="2">线路</th> | ||
| 51 | + <th colspan="4">上行首发</th> | ||
| 52 | + <th colspan="4">上行末发</th> | ||
| 53 | + <th colspan="4">下行首发</th> | ||
| 54 | + <th colspan="4">下行末发</th> | ||
| 55 | + </tr> | ||
| 56 | + <tr class="hidden"> | ||
| 57 | + <th width="100px">站点</th> | ||
| 58 | + <th>计发</th> | ||
| 59 | + <th>实发</th> | ||
| 60 | + <th>快慢</th> | ||
| 61 | + <th width="100px">站点</th> | ||
| 62 | + <th>计发</th> | ||
| 63 | + <th>实发</th> | ||
| 64 | + <th>快慢</th> | ||
| 65 | + <th width="100px">站点</th> | ||
| 66 | + <th>计发</th> | ||
| 67 | + <th>实发</th> | ||
| 68 | + <th>快慢</th> | ||
| 69 | + <th width="100px">站点</th> | ||
| 70 | + <th>计发</th> | ||
| 71 | + <th>实发</th> | ||
| 72 | + <th>快慢</th> | ||
| 73 | + </tr> | ||
| 74 | + </thead> | ||
| 75 | + <tbody> | ||
| 76 | + | ||
| 77 | + </tbody> | ||
| 78 | + </table> | ||
| 79 | + <div style="text-align: right;"> | ||
| 80 | + <ul id="pagination" class="pagination"></ul> | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + </div> | ||
| 84 | + </div> | ||
| 85 | + </div> | ||
| 86 | +</div> | ||
| 87 | + | ||
| 88 | +<script> | ||
| 89 | + $(function(){ | ||
| 90 | + | ||
| 91 | + // 关闭左侧栏 | ||
| 92 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 93 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 94 | + | ||
| 95 | + $("#date").datetimepicker({ | ||
| 96 | + format : 'YYYY-MM-DD', | ||
| 97 | + locale : 'zh-cn' | ||
| 98 | + }); | ||
| 99 | + | ||
| 100 | + var d = new Date(); | ||
| 101 | + var year = d.getFullYear(); | ||
| 102 | + var month = d.getMonth() + 1; | ||
| 103 | + var day = d.getDate(); | ||
| 104 | + if(month > 9){ | ||
| 105 | + $("#date").val(year + "-" + month + "-" + day); | ||
| 106 | + } else { | ||
| 107 | + $("#date").val(year + "-0" + month + "-" + day); | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + $('#line').select2({ | ||
| 111 | + ajax: { | ||
| 112 | + url: '/realSchedule/findLine', | ||
| 113 | + type: 'post', | ||
| 114 | + dataType: 'json', | ||
| 115 | + delay: 150, | ||
| 116 | + data: function(params){ | ||
| 117 | + return{line: params.term}; | ||
| 118 | + }, | ||
| 119 | + processResults: function (data) { | ||
| 120 | + return { | ||
| 121 | + results: data | ||
| 122 | + }; | ||
| 123 | + }, | ||
| 124 | + cache: true | ||
| 125 | + }, | ||
| 126 | + templateResult: function(repo){ | ||
| 127 | + if (repo.loading) return repo.text; | ||
| 128 | + var h = '<span>'+repo.text+'</span>'; | ||
| 129 | + return h; | ||
| 130 | + }, | ||
| 131 | + escapeMarkup: function (markup) { return markup; }, | ||
| 132 | + minimumInputLength: 1, | ||
| 133 | + templateSelection: function(repo){ | ||
| 134 | + return repo.text; | ||
| 135 | + }, | ||
| 136 | + language: { | ||
| 137 | + noResults: function(){ | ||
| 138 | + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | ||
| 139 | + }, | ||
| 140 | + inputTooShort : function(e) { | ||
| 141 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | ||
| 142 | + }, | ||
| 143 | + searching : function() { | ||
| 144 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | ||
| 145 | + } | ||
| 146 | + } | ||
| 147 | + }); | ||
| 148 | + | ||
| 149 | + $("#query").on("click",jsDoQuery); | ||
| 150 | + | ||
| 151 | + var line = $("#line").val(); | ||
| 152 | + var date = $("#date").val(); | ||
| 153 | + function jsDoQuery(pagination){ | ||
| 154 | + var params = {}; | ||
| 155 | + line = $("#line").val(); | ||
| 156 | + date = $("#date").val(); | ||
| 157 | + params['line'] = line; | ||
| 158 | + params['date'] = date; | ||
| 159 | + params['type'] = "query"; | ||
| 160 | + $(".hidden").removeClass("hidden"); | ||
| 161 | + $get('/pcpc/firstAndLastBus', params, function(result){ | ||
| 162 | + // 把数据填充到模版中 | ||
| 163 | + var tbodyHtml = template('list_firstAndLastBus',{list:result}); | ||
| 164 | + // 把渲染好的模版html文本追加到表格中 | ||
| 165 | + $('#forms tbody').html(tbodyHtml); | ||
| 166 | + | ||
| 167 | + }); | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + $("#export").on("click",function(){ | ||
| 171 | + $get('/pcpc/firstAndLastBus',{line:line,date:date,type:'export'},function(result){ | ||
| 172 | + window.open("/downloadFile/download?fileName=线路首末班"+moment(date).format("YYYYMMDD")); | ||
| 173 | + }); | ||
| 174 | + }); | ||
| 175 | + | ||
| 176 | + | ||
| 177 | + }); | ||
| 178 | + | ||
| 179 | +</script> | ||
| 180 | +<script type="text/html" id="list_firstAndLastBus"> | ||
| 181 | + {{each list as obj i}} | ||
| 182 | + <tr> | ||
| 183 | + <td>{{obj.date}}</td> | ||
| 184 | + <td>{{obj.line}}</td> | ||
| 185 | + <td>{{obj.qdzFirst0}}</td> | ||
| 186 | + <td>{{obj.jhfcFirst0}}</td> | ||
| 187 | + <td>{{obj.sjfcFirst0}}</td> | ||
| 188 | + <td>{{obj.delayFirst0}}</td> | ||
| 189 | + <td>{{obj.qdzLast0}}</td> | ||
| 190 | + <td>{{obj.jhfcLast0}}</td> | ||
| 191 | + <td>{{obj.sjfcLast0}}</td> | ||
| 192 | + <td>{{obj.delayLast0}}</td> | ||
| 193 | + <td>{{obj.qdzFirst1}}</td> | ||
| 194 | + <td>{{obj.jhfcFirst1}}</td> | ||
| 195 | + <td>{{obj.sjfcFirst1}}</td> | ||
| 196 | + <td>{{obj.delayFirst1}}</td> | ||
| 197 | + <td>{{obj.qdzLast1}}</td> | ||
| 198 | + <td>{{obj.jhfcLast1}}</td> | ||
| 199 | + <td>{{obj.sjfcLast1}}</td> | ||
| 200 | + <td>{{obj.delayLast1}}</td> | ||
| 201 | + </tr> | ||
| 202 | + {{/each}} | ||
| 203 | + {{if list.length == 0}} | ||
| 204 | + <tr> | ||
| 205 | + <td colspan="18"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 206 | + </tr> | ||
| 207 | + {{/if}} | ||
| 208 | +</script> | ||
| 0 | \ No newline at end of file | 209 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + | ||
| 15 | + .table > tbody + tbody { | ||
| 16 | + border-top: 1px solid; } | ||
| 17 | +</style> | ||
| 18 | + | ||
| 19 | +<div class="page-head"> | ||
| 20 | + <div class="page-title"> | ||
| 21 | + <h1>计划车辆班次人员</h1> | ||
| 22 | + </div> | ||
| 23 | +</div> | ||
| 24 | + | ||
| 25 | +<div class="row"> | ||
| 26 | + <div class="col-md-12"> | ||
| 27 | + <div class="portlet light porttlet-fit bordered"> | ||
| 28 | + <div class="portlet-title"> | ||
| 29 | + <form id="history" class="form-inline" action=""> | ||
| 30 | + <div style="display: inline-block;"> | ||
| 31 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 32 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 35 | + <span class="item-label" style="width: 80px;">时间: </span> | ||
| 36 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | ||
| 37 | + </div> | ||
| 38 | + <div class="form-group"> | ||
| 39 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 40 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 41 | + </div> | ||
| 42 | + </form> | ||
| 43 | + </div> | ||
| 44 | + <div class="portlet-body"> | ||
| 45 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 46 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 47 | + <thead> | ||
| 48 | + <tr class="hidden"> | ||
| 49 | + <th>日期</th> | ||
| 50 | + <th>线路</th> | ||
| 51 | + <th>路牌</th> | ||
| 52 | + <th>车辆</th> | ||
| 53 | + <th>驾驶员</th> | ||
| 54 | + <th>售票员</th> | ||
| 55 | + <th>计划里程</th> | ||
| 56 | + </tr> | ||
| 57 | + </thead> | ||
| 58 | + <tbody> | ||
| 59 | + | ||
| 60 | + </tbody> | ||
| 61 | + </table> | ||
| 62 | + <div style="text-align: right;"> | ||
| 63 | + <ul id="pagination" class="pagination"></ul> | ||
| 64 | + </div> | ||
| 65 | + </div> | ||
| 66 | + </div> | ||
| 67 | + </div> | ||
| 68 | + </div> | ||
| 69 | +</div> | ||
| 70 | + | ||
| 71 | +<script> | ||
| 72 | + $(function(){ | ||
| 73 | + | ||
| 74 | + // 关闭左侧栏 | ||
| 75 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 76 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 77 | + | ||
| 78 | + $("#date").datetimepicker({ | ||
| 79 | + format : 'YYYY-MM-DD', | ||
| 80 | + locale : 'zh-cn' | ||
| 81 | + }); | ||
| 82 | + | ||
| 83 | + var d = new Date(); | ||
| 84 | + var year = d.getFullYear(); | ||
| 85 | + var month = d.getMonth() + 1; | ||
| 86 | + var day = d.getDate(); | ||
| 87 | + if(month > 9){ | ||
| 88 | + $("#date").val(year + "-" + month + "-" + day); | ||
| 89 | + } else { | ||
| 90 | + $("#date").val(year + "-0" + month + "-" + day); | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + $('#line').select2({ | ||
| 94 | + ajax: { | ||
| 95 | + url: '/realSchedule/findLine', | ||
| 96 | + type: 'post', | ||
| 97 | + dataType: 'json', | ||
| 98 | + delay: 150, | ||
| 99 | + data: function(params){ | ||
| 100 | + return{line: params.term}; | ||
| 101 | + }, | ||
| 102 | + processResults: function (data) { | ||
| 103 | + return { | ||
| 104 | + results: data | ||
| 105 | + }; | ||
| 106 | + }, | ||
| 107 | + cache: true | ||
| 108 | + }, | ||
| 109 | + templateResult: function(repo){ | ||
| 110 | + if (repo.loading) return repo.text; | ||
| 111 | + var h = '<span>'+repo.text+'</span>'; | ||
| 112 | + return h; | ||
| 113 | + }, | ||
| 114 | + escapeMarkup: function (markup) { return markup; }, | ||
| 115 | + minimumInputLength: 1, | ||
| 116 | + templateSelection: function(repo){ | ||
| 117 | + return repo.text; | ||
| 118 | + }, | ||
| 119 | + language: { | ||
| 120 | + noResults: function(){ | ||
| 121 | + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | ||
| 122 | + }, | ||
| 123 | + inputTooShort : function(e) { | ||
| 124 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | ||
| 125 | + }, | ||
| 126 | + searching : function() { | ||
| 127 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | ||
| 128 | + } | ||
| 129 | + } | ||
| 130 | + }); | ||
| 131 | + | ||
| 132 | + | ||
| 133 | + $("#query").on("click",jsDoQuery); | ||
| 134 | + | ||
| 135 | + var line = $("#line").val(); | ||
| 136 | + var date = $("#date").val(); | ||
| 137 | + function jsDoQuery(pagination){ | ||
| 138 | + var params = {}; | ||
| 139 | + line = $("#line").val(); | ||
| 140 | + date = $("#date").val(); | ||
| 141 | + params['line'] = line; | ||
| 142 | + params['date'] = date; | ||
| 143 | + params['type'] = "query"; | ||
| 144 | + $(".hidden").removeClass("hidden"); | ||
| 145 | + $get('/pcpc/queryPeopleCar', params, function(result){ | ||
| 146 | + // 把数据填充到模版中 | ||
| 147 | + var tbodyHtml = template('list_queryPeopleCar',{list:result}); | ||
| 148 | + // 把渲染好的模版html文本追加到表格中 | ||
| 149 | + $('#forms tbody').html(tbodyHtml); | ||
| 150 | + | ||
| 151 | + }); | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + $("#export").on("click",function(){ | ||
| 155 | + $get('/pcpc/queryPeopleCar',{line:line,date:date,type:'export'},function(result){ | ||
| 156 | + window.open("/downloadFile/download?fileName=计划车辆班次人员"+moment(date).format("YYYYMMDD")); | ||
| 157 | + }); | ||
| 158 | + }); | ||
| 159 | + | ||
| 160 | + | ||
| 161 | + }); | ||
| 162 | + | ||
| 163 | +</script> | ||
| 164 | +<script type="text/html" id="list_queryPeopleCar"> | ||
| 165 | + {{each list as obj i}} | ||
| 166 | + <tr> | ||
| 167 | + <td>{{obj.date}}</td> | ||
| 168 | + <td>{{obj.line}}</td> | ||
| 169 | + <td>{{obj.lp}}</td> | ||
| 170 | + <td>{{obj.clzbh}}</td> | ||
| 171 | + <td>{{obj.jName}}</td> | ||
| 172 | + <td>{{obj.sName}}</td> | ||
| 173 | + <td>{{obj.jhlc}}</td> | ||
| 174 | + </tr> | ||
| 175 | + {{/each}} | ||
| 176 | + {{if list.length == 0}} | ||
| 177 | + <tr> | ||
| 178 | + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 179 | + </tr> | ||
| 180 | + {{/if}} | ||
| 181 | +</script> | ||
| 0 | \ No newline at end of file | 182 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + | ||
| 15 | + .table > tbody + tbody { | ||
| 16 | + border-top: 1px solid; } | ||
| 17 | +</style> | ||
| 18 | + | ||
| 19 | +<div class="page-head"> | ||
| 20 | + <div class="page-title"> | ||
| 21 | + <h1>时刻表分析</h1> | ||
| 22 | + </div> | ||
| 23 | +</div> | ||
| 24 | + | ||
| 25 | +<div class="row"> | ||
| 26 | + <div class="col-md-12"> | ||
| 27 | + <div class="portlet light porttlet-fit bordered"> | ||
| 28 | + <div class="portlet-title"> | ||
| 29 | + <form id="history" class="form-inline" action=""> | ||
| 30 | + <div style="display: inline-block;"> | ||
| 31 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 32 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 35 | + <span class="item-label" style="width: 80px;">开始时间: </span> | ||
| 36 | + <input class="form-control" type="text" id="startDate" style="width: 180px;"/> | ||
| 37 | + </div> | ||
| 38 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 39 | + <span class="item-label" style="width: 80px;">结束时间: </span> | ||
| 40 | + <input class="form-control" type="text" id="endDate" style="width: 180px;"/> | ||
| 41 | + </div> | ||
| 42 | + <div style="display: inline-block;"> | ||
| 43 | + <span class="item-label" style="width: 80px;">模板类型: </span> | ||
| 44 | + <select class="form-control" name="model" id="model" style="width: 180px;"> | ||
| 45 | + <option value="">请选择...</option> | ||
| 46 | + </select> | ||
| 47 | + </div> | ||
| 48 | + <div class="form-group"> | ||
| 49 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 50 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 51 | + </div> | ||
| 52 | + </form> | ||
| 53 | + </div> | ||
| 54 | + <div class="portlet-body"> | ||
| 55 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 56 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 57 | + <thead> | ||
| 58 | + <tr class="hidden"> | ||
| 59 | + <th width="10%">线路</th> | ||
| 60 | + <th width="10%">起点站名</th> | ||
| 61 | + <th width="8%">计发时间</th> | ||
| 62 | + <th width="8%">计划运送时间(分)</th> | ||
| 63 | + <th width="8%">计划完成次数</th> | ||
| 64 | + <th width="8%">完成次数</th> | ||
| 65 | + <th width="8%">最早发车时间</th> | ||
| 66 | + <th width="8%">最晚发车时间</th> | ||
| 67 | + <th width="8%">平均发车时间</th> | ||
| 68 | + <th width="8%">最慢运送时间(分)</th> | ||
| 69 | + <th width="8%">最快运送时间(分)</th> | ||
| 70 | + <th width="8%">平均运送时间(分)</th> | ||
| 71 | + </tr> | ||
| 72 | + </thead> | ||
| 73 | + <tbody> | ||
| 74 | + | ||
| 75 | + </tbody> | ||
| 76 | + </table> | ||
| 77 | + <div style="text-align: right;"> | ||
| 78 | + <ul id="pagination" class="pagination"></ul> | ||
| 79 | + </div> | ||
| 80 | + </div> | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + </div> | ||
| 84 | +</div> | ||
| 85 | + | ||
| 86 | +<script> | ||
| 87 | + $(function(){ | ||
| 88 | + var page = 0, initPagination; | ||
| 89 | + | ||
| 90 | + // 关闭左侧栏 | ||
| 91 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 92 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 93 | + | ||
| 94 | + $("#startDate").datetimepicker({ | ||
| 95 | + format : 'YYYY-MM-DD', | ||
| 96 | + locale : 'zh-cn' | ||
| 97 | + }); | ||
| 98 | + | ||
| 99 | + $("#endDate").datetimepicker({ | ||
| 100 | + format : 'YYYY-MM-DD', | ||
| 101 | + locale : 'zh-cn' | ||
| 102 | + }); | ||
| 103 | + | ||
| 104 | + var d = new Date(); | ||
| 105 | + var year = d.getFullYear(); | ||
| 106 | + var month = d.getMonth() + 1; | ||
| 107 | + var day = d.getDate(); | ||
| 108 | + if(month > 9){ | ||
| 109 | + $("#startDate").val(year + "-" + month + "-" + day); | ||
| 110 | + $("#endDate").val(year + "-" + month + "-" + day); | ||
| 111 | + } else { | ||
| 112 | + $("#startDate").val(year + "-0" + month + "-" + day); | ||
| 113 | + $("#endDate").val(year + "-0" + month + "-" + day); | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + $('#line').select2({ | ||
| 117 | + ajax: { | ||
| 118 | + url: '/realSchedule/findLine', | ||
| 119 | + type: 'post', | ||
| 120 | + dataType: 'json', | ||
| 121 | + delay: 150, | ||
| 122 | + data: function(params){ | ||
| 123 | + return{line: params.term}; | ||
| 124 | + }, | ||
| 125 | + processResults: function (data) { | ||
| 126 | + return { | ||
| 127 | + results: data | ||
| 128 | + }; | ||
| 129 | + }, | ||
| 130 | + cache: true | ||
| 131 | + }, | ||
| 132 | + templateResult: function(repo){ | ||
| 133 | + if (repo.loading) return repo.text; | ||
| 134 | + var h = '<span>'+repo.text+'</span>'; | ||
| 135 | + return h; | ||
| 136 | + }, | ||
| 137 | + escapeMarkup: function (markup) { return markup; }, | ||
| 138 | + minimumInputLength: 1, | ||
| 139 | + templateSelection: function(repo){ | ||
| 140 | + return repo.text; | ||
| 141 | + }, | ||
| 142 | + language: { | ||
| 143 | + noResults: function(){ | ||
| 144 | + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | ||
| 145 | + }, | ||
| 146 | + inputTooShort : function(e) { | ||
| 147 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | ||
| 148 | + }, | ||
| 149 | + searching : function() { | ||
| 150 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | ||
| 151 | + } | ||
| 152 | + } | ||
| 153 | + }); | ||
| 154 | + | ||
| 155 | + $("#query").on("click", function(){ | ||
| 156 | + page = 0; | ||
| 157 | + jsDoQuery(true); | ||
| 158 | + }); | ||
| 159 | + | ||
| 160 | + var line = $("#line").val(); | ||
| 161 | + var startDate = $("#startDate").val(); | ||
| 162 | + var endDate = $("#endDate").val(); | ||
| 163 | + var model = $("#model").val(); | ||
| 164 | + function jsDoQuery(pagination){ | ||
| 165 | + var params = {}; | ||
| 166 | + line = $("#line").val(); | ||
| 167 | + startDate = $("#startDate").val(); | ||
| 168 | + endDate = $("#endDate").val(); | ||
| 169 | + model = $("#model").val(); | ||
| 170 | + params['page'] = page; | ||
| 171 | + params['line'] = line; | ||
| 172 | + params['startDate'] = startDate; | ||
| 173 | + params['endDate'] = endDate; | ||
| 174 | + params['model'] = model; | ||
| 175 | + params['type'] = "query"; | ||
| 176 | + $(".hidden").removeClass("hidden"); | ||
| 177 | + $get('/pcpc/scheduleAnaly', params, function(result){ | ||
| 178 | + // 把数据填充到模版中 | ||
| 179 | + var tbodyHtml = template('list_scheduleAnaly',{list:result.dataList}); | ||
| 180 | + // 把渲染好的模版html文本追加到表格中 | ||
| 181 | + $('#forms tbody').html(tbodyHtml); | ||
| 182 | + | ||
| 183 | + if(pagination && result.dataList.length > 0){ | ||
| 184 | + //重新分页 | ||
| 185 | + initPagination = true; | ||
| 186 | + showPagination(result); | ||
| 187 | + } | ||
| 188 | + }); | ||
| 189 | + } | ||
| 190 | + | ||
| 191 | + $("#export").on("click",function(){ | ||
| 192 | + $get('/pcpc/scheduleAnaly',{page:'',line:line,startDate:startDate,endDate:endDate,model:model,type:'export'},function(result){ | ||
| 193 | + window.open("/downloadFile/download?fileName=时刻表分析"+moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD")); | ||
| 194 | + }); | ||
| 195 | + }); | ||
| 196 | + | ||
| 197 | + | ||
| 198 | + $("#line").on("change", function(){ | ||
| 199 | + line = $("#line").val(); | ||
| 200 | + updateModel(); | ||
| 201 | + }); | ||
| 202 | + $('#startDate').on("blur", function(){ | ||
| 203 | + startDate = $("#startDate").val(); | ||
| 204 | + endDate = $("#endDate").val(); | ||
| 205 | + updateModel(); | ||
| 206 | + }); | ||
| 207 | + $('#endDate').on("blur", function(){ | ||
| 208 | + startDate = $("#startDate").val(); | ||
| 209 | + endDate = $("#endDate").val(); | ||
| 210 | + updateModel(); | ||
| 211 | + }); | ||
| 212 | + | ||
| 213 | + var flag = 0; | ||
| 214 | + function updateModel(){ | ||
| 215 | + if(flag == 1) | ||
| 216 | + return; | ||
| 217 | + flag = 1; | ||
| 218 | + var treeData = []; | ||
| 219 | + var params = {}; | ||
| 220 | + params['line'] = line; | ||
| 221 | + params['startDate'] = startDate; | ||
| 222 | + params['endDate'] = endDate; | ||
| 223 | + $get('/pcpc/getModel', params, function(result){ | ||
| 224 | + treeData = createTreeData(result); | ||
| 225 | + var options = '<option value="">请选择...</option>'; | ||
| 226 | + var size = 0; | ||
| 227 | + $.each(treeData, function(i, g){ | ||
| 228 | + options += '<option value="'+g.id+'">'+g.name+'</option>'; | ||
| 229 | + size++; | ||
| 230 | + }); | ||
| 231 | + $('#model').html(options)/* .select2() */; | ||
| 232 | + flag = 0; | ||
| 233 | + }); | ||
| 234 | + } | ||
| 235 | + updateModel(); | ||
| 236 | + | ||
| 237 | + | ||
| 238 | + function showPagination(data){ | ||
| 239 | + //分页 | ||
| 240 | + $('#pagination').jqPaginator({ | ||
| 241 | + totalPages: data.totalPage, | ||
| 242 | + visiblePages: 6, | ||
| 243 | + currentPage: page + 1, | ||
| 244 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | ||
| 245 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | ||
| 246 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | ||
| 247 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | ||
| 248 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | ||
| 249 | + onPageChange: function (num, type) { | ||
| 250 | + if(initPagination){ | ||
| 251 | + initPagination = false; | ||
| 252 | + return; | ||
| 253 | + } | ||
| 254 | + page = num - 1; | ||
| 255 | + jsDoQuery(false); | ||
| 256 | + } | ||
| 257 | + }); | ||
| 258 | + } | ||
| 259 | + | ||
| 260 | + | ||
| 261 | + }); | ||
| 262 | + | ||
| 263 | +</script> | ||
| 264 | +<script type="text/html" id="list_scheduleAnaly"> | ||
| 265 | + {{each list as obj i}} | ||
| 266 | + <tr> | ||
| 267 | + <td>{{obj.line}}</td> | ||
| 268 | + <td>{{obj.qdz}}</td> | ||
| 269 | + <td>{{obj.jhfc}}</td> | ||
| 270 | + <td>{{obj.bcsj}}</td> | ||
| 271 | + <td>{{obj.jhbc}}</td> | ||
| 272 | + <td>{{obj.sjbc}}</td> | ||
| 273 | + <td>{{obj.zzfc}}</td> | ||
| 274 | + <td>{{obj.zwfc}}</td> | ||
| 275 | + <td>{{obj.pjfc}}</td> | ||
| 276 | + <td>{{obj.zmys}}</td> | ||
| 277 | + <td>{{obj.zkys}}</td> | ||
| 278 | + <td>{{obj.pjys}}</td> | ||
| 279 | + </tr> | ||
| 280 | + {{/each}} | ||
| 281 | + {{if list.length == 0}} | ||
| 282 | + <tr> | ||
| 283 | + <td colspan="12"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 284 | + </tr> | ||
| 285 | + {{/if}} | ||
| 286 | +</script> | ||
| 0 | \ No newline at end of file | 287 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/workDaily.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + | ||
| 15 | + .table > tbody + tbody { | ||
| 16 | + border-top: 1px solid; } | ||
| 17 | +</style> | ||
| 18 | + | ||
| 19 | +<div class="page-head"> | ||
| 20 | + <div class="page-title"> | ||
| 21 | + <h1>营运服务日报表</h1> | ||
| 22 | + </div> | ||
| 23 | +</div> | ||
| 24 | + | ||
| 25 | +<div class="row"> | ||
| 26 | + <div class="col-md-12"> | ||
| 27 | + <div class="portlet light porttlet-fit bordered"> | ||
| 28 | + <div class="portlet-title"> | ||
| 29 | + <form id="history" class="form-inline" action=""> | ||
| 30 | + <div style="display: inline-block;"> | ||
| 31 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 32 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 35 | + <span class="item-label" style="width: 80px;">时间: </span> | ||
| 36 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | ||
| 37 | + </div> | ||
| 38 | + <div class="form-group"> | ||
| 39 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 40 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 41 | + </div> | ||
| 42 | + </form> | ||
| 43 | + </div> | ||
| 44 | + <div class="portlet-body"> | ||
| 45 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 46 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 47 | + <thead> | ||
| 48 | + <tr class="hidden"> | ||
| 49 | + <th width="80px">日期</th> | ||
| 50 | + <th width="100px">线路</th> | ||
| 51 | + <th>计划班次</th> | ||
| 52 | + <th>待发调整</th> | ||
| 53 | + <th>待发调整比率</th> | ||
| 54 | + <th>出场率</th> | ||
| 55 | + <th width="46px">上行发快</th> | ||
| 56 | + <th width="46px">上行到快</th> | ||
| 57 | + <th width="46px">下行发快</th> | ||
| 58 | + <th width="46px">下行到快</th> | ||
| 59 | + <th width="46px">上行发慢</th> | ||
| 60 | + <th width="46px">上行到慢</th> | ||
| 61 | + <th width="46px">下行发慢</th> | ||
| 62 | + <th width="46px">下行到慢</th> | ||
| 63 | + <th>误点总数(快/慢)</th> | ||
| 64 | + <th>首末班准点率</th> | ||
| 65 | + <th>高峰班次执行率(早/晚)</th> | ||
| 66 | + </tr> | ||
| 67 | + </thead> | ||
| 68 | + <tbody> | ||
| 69 | + | ||
| 70 | + </tbody> | ||
| 71 | + </table> | ||
| 72 | + <div style="text-align: right;"> | ||
| 73 | + <ul id="pagination" class="pagination"></ul> | ||
| 74 | + </div> | ||
| 75 | + </div> | ||
| 76 | + </div> | ||
| 77 | + </div> | ||
| 78 | + </div> | ||
| 79 | +</div> | ||
| 80 | + | ||
| 81 | +<script> | ||
| 82 | + $(function(){ | ||
| 83 | + | ||
| 84 | + // 关闭左侧栏 | ||
| 85 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 86 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 87 | + | ||
| 88 | + $("#date").datetimepicker({ | ||
| 89 | + format : 'YYYY-MM-DD', | ||
| 90 | + locale : 'zh-cn' | ||
| 91 | + }); | ||
| 92 | + | ||
| 93 | + var d = new Date(); | ||
| 94 | + var year = d.getFullYear(); | ||
| 95 | + var month = d.getMonth() + 1; | ||
| 96 | + var day = d.getDate(); | ||
| 97 | + if(month > 9){ | ||
| 98 | + $("#date").val(year + "-" + month + "-" + day); | ||
| 99 | + } else { | ||
| 100 | + $("#date").val(year + "-0" + month + "-" + day); | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + $('#line').select2({ | ||
| 104 | + ajax: { | ||
| 105 | + url: '/realSchedule/findLine', | ||
| 106 | + type: 'post', | ||
| 107 | + dataType: 'json', | ||
| 108 | + delay: 150, | ||
| 109 | + data: function(params){ | ||
| 110 | + return{line: params.term}; | ||
| 111 | + }, | ||
| 112 | + processResults: function (data) { | ||
| 113 | + return { | ||
| 114 | + results: data | ||
| 115 | + }; | ||
| 116 | + }, | ||
| 117 | + cache: true | ||
| 118 | + }, | ||
| 119 | + templateResult: function(repo){ | ||
| 120 | + if (repo.loading) return repo.text; | ||
| 121 | + var h = '<span>'+repo.text+'</span>'; | ||
| 122 | + return h; | ||
| 123 | + }, | ||
| 124 | + escapeMarkup: function (markup) { return markup; }, | ||
| 125 | + minimumInputLength: 1, | ||
| 126 | + templateSelection: function(repo){ | ||
| 127 | + return repo.text; | ||
| 128 | + }, | ||
| 129 | + language: { | ||
| 130 | + noResults: function(){ | ||
| 131 | + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | ||
| 132 | + }, | ||
| 133 | + inputTooShort : function(e) { | ||
| 134 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | ||
| 135 | + }, | ||
| 136 | + searching : function() { | ||
| 137 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | ||
| 138 | + } | ||
| 139 | + } | ||
| 140 | + }); | ||
| 141 | + | ||
| 142 | + $("#query").on("click",jsDoQuery); | ||
| 143 | + | ||
| 144 | + var line = $("#line").val(); | ||
| 145 | + var date = $("#date").val(); | ||
| 146 | + function jsDoQuery(pagination){ | ||
| 147 | + var params = {}; | ||
| 148 | + line = $("#line").val(); | ||
| 149 | + date = $("#date").val(); | ||
| 150 | + params['line'] = line; | ||
| 151 | + params['date'] = date; | ||
| 152 | + params['type'] = "query"; | ||
| 153 | + $(".hidden").removeClass("hidden"); | ||
| 154 | + $get('/pcpc/workDaily', params, function(result){ | ||
| 155 | + // 把数据填充到模版中 | ||
| 156 | + var tbodyHtml = template('list_workDaily',{list:result}); | ||
| 157 | + // 把渲染好的模版html文本追加到表格中 | ||
| 158 | + $('#forms tbody').html(tbodyHtml); | ||
| 159 | + | ||
| 160 | + }); | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + $("#export").on("click",function(){ | ||
| 164 | + $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ | ||
| 165 | + window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD")); | ||
| 166 | + }); | ||
| 167 | + }); | ||
| 168 | + | ||
| 169 | + | ||
| 170 | + }); | ||
| 171 | + | ||
| 172 | +</script> | ||
| 173 | +<script type="text/html" id="list_workDaily"> | ||
| 174 | + {{each list as obj i}} | ||
| 175 | + <tr> | ||
| 176 | + <td>{{obj.date}}</td> | ||
| 177 | + <td>{{obj.line}}</td> | ||
| 178 | + <td>{{obj.jhbc}}</td> | ||
| 179 | + <td>{{obj.dftz}}</td> | ||
| 180 | + <td>{{obj.dftzl}}</td> | ||
| 181 | + <td>{{obj.ccl}}</td> | ||
| 182 | + <td>{{obj.upfk}}</td> | ||
| 183 | + <td>{{obj.updk}}</td> | ||
| 184 | + <td>{{obj.dnfk}}</td> | ||
| 185 | + <td>{{obj.dndk}}</td> | ||
| 186 | + <td>{{obj.upfm}}</td> | ||
| 187 | + <td>{{obj.updm}}</td> | ||
| 188 | + <td>{{obj.dnfm}}</td> | ||
| 189 | + <td>{{obj.dndm}}</td> | ||
| 190 | + <td>{{obj.wdzs}}</td> | ||
| 191 | + <td>{{obj.smbzdl}}</td> | ||
| 192 | + <td>{{obj.gfbczxl}}</td> | ||
| 193 | + </tr> | ||
| 194 | + {{/each}} | ||
| 195 | + {{if list.length == 0}} | ||
| 196 | + <tr> | ||
| 197 | + <td colspan="17"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 198 | + </tr> | ||
| 199 | + {{/if}} | ||
| 200 | +</script> | ||
| 0 | \ No newline at end of file | 201 | \ No newline at end of file |
src/main/resources/static/pages/report/oil/oilListMonth.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + | ||
| 15 | + .table > tbody + tbody { | ||
| 16 | + border-top: 1px solid; } | ||
| 17 | +</style> | ||
| 18 | + | ||
| 19 | +<div class="page-head"> | ||
| 20 | + <div class="page-title"> | ||
| 21 | + <h1>月存油报表</h1> | ||
| 22 | + </div> | ||
| 23 | +</div> | ||
| 24 | + | ||
| 25 | +<div class="row"> | ||
| 26 | + <div class="col-md-12"> | ||
| 27 | + <div class="portlet light porttlet-fit bordered"> | ||
| 28 | + <div class="portlet-title"> | ||
| 29 | + <form class="form-inline" action=""> | ||
| 30 | + <div style="display: inline-block;"> | ||
| 31 | + <span class="item-label" style="width: 80px;">时间: </span> | ||
| 32 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 35 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 36 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 37 | + </div> | ||
| 38 | + <div class="form-group"> | ||
| 39 | + <input class="btn btn-default" type="button" id="query" value="查询"/> | ||
| 40 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 41 | + </div> | ||
| 42 | + </form> | ||
| 43 | + </div> | ||
| 44 | + <div class="portlet-body"> | ||
| 45 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 46 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 47 | + <thead> | ||
| 48 | + <tr> | ||
| 49 | + <td>序号</td> | ||
| 50 | + <td>车号</td> | ||
| 51 | + <td>日期</td> | ||
| 52 | + <td>存油</td> | ||
| 53 | + | ||
| 54 | + <td>序号</td> | ||
| 55 | + <td>车号</td> | ||
| 56 | + <td>日期</td> | ||
| 57 | + <td>存油</td> | ||
| 58 | + | ||
| 59 | + <td>序号</td> | ||
| 60 | + <td>车号</td> | ||
| 61 | + <td>日期</td> | ||
| 62 | + <td>存油</td> | ||
| 63 | + | ||
| 64 | + <td>序号</td> | ||
| 65 | + <td>车号</td> | ||
| 66 | + <td>日期</td> | ||
| 67 | + <td>存油</td> | ||
| 68 | + | ||
| 69 | + <td>序号</td> | ||
| 70 | + <td>车号</td> | ||
| 71 | + <td>日期</td> | ||
| 72 | + <td>存油</td> | ||
| 73 | + </tr> | ||
| 74 | + </thead> | ||
| 75 | + | ||
| 76 | + <tbody > | ||
| 77 | + | ||
| 78 | + </tbody> | ||
| 79 | + </table> | ||
| 80 | + </div> | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + </div> | ||
| 84 | +</div> | ||
| 85 | + | ||
| 86 | +<script> | ||
| 87 | + $(function(){ | ||
| 88 | + // 关闭左侧栏 | ||
| 89 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 90 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 91 | + | ||
| 92 | + $("#date").datetimepicker({ | ||
| 93 | + format : 'YYYY-MM-DD', | ||
| 94 | + locale : 'zh-cn' | ||
| 95 | + }); | ||
| 96 | + | ||
| 97 | + $('#line').select2({ | ||
| 98 | + ajax: { | ||
| 99 | + url: '/realSchedule/findLine', | ||
| 100 | + dataType: 'json', | ||
| 101 | + delay: 150, | ||
| 102 | + data: function(params){ | ||
| 103 | + return{line: params.term}; | ||
| 104 | + }, | ||
| 105 | + processResults: function (data) { | ||
| 106 | + return { | ||
| 107 | + results: data | ||
| 108 | + }; | ||
| 109 | + }, | ||
| 110 | + cache: true | ||
| 111 | + }, | ||
| 112 | + templateResult: function(repo){ | ||
| 113 | + if (repo.loading) return repo.text; | ||
| 114 | + var h = '<span>'+repo.text+'</span>'; | ||
| 115 | + return h; | ||
| 116 | + }, | ||
| 117 | + escapeMarkup: function (markup) { return markup; }, | ||
| 118 | + minimumInputLength: 1, | ||
| 119 | + templateSelection: function(repo){ | ||
| 120 | + return repo.text; | ||
| 121 | + }, | ||
| 122 | + language: { | ||
| 123 | + noResults: function(){ | ||
| 124 | + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | ||
| 125 | + }, | ||
| 126 | + inputTooShort : function(e) { | ||
| 127 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | ||
| 128 | + }, | ||
| 129 | + searching : function() { | ||
| 130 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | ||
| 131 | + } | ||
| 132 | + } | ||
| 133 | + }); | ||
| 134 | + | ||
| 135 | + //查询 | ||
| 136 | + $("#query").on('click',function(){ | ||
| 137 | + var line = $("#line").val(); | ||
| 138 | + var date = $("#date").val(); | ||
| 139 | + $get('/ylb/oilListMonth',{line:line,date:date},function(result){ | ||
| 140 | + $.each(result, function(i, obj) { | ||
| 141 | + obj.rq = moment(obj.rq).format("DD"); | ||
| 142 | + }); | ||
| 143 | + var oilListMonth = template('oilListMonth',{list:result}); | ||
| 144 | + $('#forms tbody').html(oilListMonth); | ||
| 145 | + }); | ||
| 146 | + }); | ||
| 147 | + }); | ||
| 148 | +</script> | ||
| 149 | +<script type="text/html" id="oilListMonth"> | ||
| 150 | + {{each list as obj i}} | ||
| 151 | + {{if i%5 == 0}} | ||
| 152 | + <tr> | ||
| 153 | + {{/if}} | ||
| 154 | + <td>{{i+1}}</td> | ||
| 155 | + <td>{{obj.nbbm}}</td> | ||
| 156 | + <td>{{obj.rq}}</td> | ||
| 157 | + <td>{{obj.jzyl}}</td> | ||
| 158 | + {{if (i+1)%5 == 0}} | ||
| 159 | + </tr> | ||
| 160 | + {{/if}} | ||
| 161 | + {{/each}} | ||
| 162 | + {{if list.length == 0}} | ||
| 163 | + <tr> | ||
| 164 | + <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 165 | + </tr> | ||
| 166 | + {{/if}} | ||
| 167 | +</script> | ||
| 0 | \ No newline at end of file | 168 | \ No newline at end of file |
src/main/resources/static/real_control_v2/assets/plugins/uikit-2.27.1/components/slider.gradient.min.css
0 → 100644
| 1 | +/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ | ||
| 2 | +[data-uk-slider]{direction:ltr}html[dir=rtl] .uk-slider>*{direction:rtl}.uk-slider{position:relative;z-index:0;touch-action:pan-y}.uk-slider:not(.uk-grid){margin:0;padding:0;list-style:none}.uk-slider>*{position:absolute;top:0;left:0}.uk-slider-container{overflow:hidden}.uk-slider:not(.uk-drag){-webkit-transition:-webkit-transform .2s linear;transition:transform .2s linear}.uk-slider.uk-drag{cursor:col-resize;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.uk-slider a,.uk-slider img{-webkit-user-drag:none;user-drag:none;-webkit-touch-callout:none}.uk-slider img{pointer-events:none}.uk-slider-fullscreen,.uk-slider-fullscreen>li{height:100vh} | ||
| 0 | \ No newline at end of file | 3 | \ No newline at end of file |
src/main/resources/static/real_control_v2/assets/plugins/uikit-2.27.1/components/slider.min.js
0 → 100644
| 1 | +/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ | ||
| 2 | +!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-slider",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";var e,i,s,n,a={};return t.component("slider",{defaults:{center:!1,threshold:10,infinite:!0,autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0,activecls:"uk-active"},boot:function(){t.ready(function(e){setTimeout(function(){t.$("[data-uk-slider]",e).each(function(){var e=t.$(this);e.data("slider")||t.slider(e,t.Utils.options(e.attr("data-uk-slider")))})},0)})},init:function(){var o=this;this.container=this.element.find(".uk-slider"),this.focus=0,t.$win.on("resize load",t.Utils.debounce(function(){o.update(!0)},100)),this.on("click.uk.slider","[data-uk-slider-item]",function(e){e.preventDefault();var i=t.$(this).attr("data-uk-slider-item");if(o.focus!=i)switch(o.stop(),i){case"next":case"previous":o["next"==i?"next":"previous"]();break;default:o.updateFocus(parseInt(i,10))}}),this.container.on({"touchstart mousedown":function(h){h.originalEvent&&h.originalEvent.touches&&(h=h.originalEvent.touches[0]),h.button&&2==h.button||!o.active||(o.stop(),s=t.$(h.target).is("a")?t.$(h.target):t.$(h.target).parents("a:first"),n=!1,s.length&&s.one("click",function(t){n&&t.preventDefault()}),i=function(t){n=!0,e=o,a={touchx:parseInt(t.pageX,10),dir:1,focus:o.focus,base:o.options.center?"center":"area"},t.originalEvent&&t.originalEvent.touches&&(t=t.originalEvent.touches[0]),e.element.data({"pointer-start":{x:parseInt(t.pageX,10),y:parseInt(t.pageY,10)},"pointer-pos-start":o.pos}),o.container.addClass("uk-drag"),i=!1},i.x=parseInt(h.pageX,10),i.threshold=o.options.threshold)},mouseenter:function(){o.options.pauseOnHover&&(o.hovering=!0)},mouseleave:function(){o.hovering=!1}}),this.update(!0),this.on("display.uk.check",function(){o.element.is(":visible")&&o.update(!0)}),this.element.find("a,img").attr("draggable","false"),this.options.autoplay&&this.start(),t.domObserve(this.element,function(){o.element.children(":not([data-slide])").length&&o.update(!0)})},update:function(e){var i,s,n,a,o=this,h=0,r=0;return this.items=this.container.children().filter(":visible"),this.vp=this.element[0].getBoundingClientRect().width,this.container.css({"min-width":"","min-height":""}),this.items.each(function(e){i=t.$(this).attr("data-slide",e),a=i.css({left:"",width:""})[0].getBoundingClientRect(),s=a.width,n=i.width(),r=Math.max(r,a.height),i.css({left:h,width:s}).data({idx:e,left:h,width:s,cwidth:n,area:h+s,center:h-(o.vp/2-n/2)}),h+=s}),this.container.css({"min-width":h,"min-height":r}),this.options.infinite&&(h<=2*this.vp||this.items.length<5)&&!this.itemsResized?(this.container.children().each(function(t){o.container.append(o.items.eq(t).clone(!0).attr("id",""))}).each(function(t){o.container.append(o.items.eq(t).clone(!0).attr("id",""))}),this.itemsResized=!0,this.update()):(this.cw=h,this.pos=0,this.active=h>=this.vp,this.container.css({"-ms-transform":"","-webkit-transform":"",transform:""}),e&&this.updateFocus(this.focus),void 0)},updatePos:function(t){this.pos=t,this.container.css({"-ms-transform":"translateX("+t+"px)","-webkit-transform":"translateX("+t+"px)",transform:"translateX("+t+"px)"})},updateFocus:function(e,i){if(this.active){i=i||(e>this.focus?1:-1);var s,n,a=this.items.eq(e);if(this.options.infinite&&this.infinite(e,i),this.options.center)this.updatePos(-1*a.data("center")),this.items.filter("."+this.options.activecls).removeClass(this.options.activecls),a.addClass(this.options.activecls);else if(this.options.infinite)this.updatePos(-1*a.data("left"));else{for(s=0,n=e;n<this.items.length;n++)s+=this.items.eq(n).data("width");if(s>this.vp)this.updatePos(-1*a.data("left"));else if(1==i){for(s=0,n=this.items.length-1;n>=0;n--){if(s+=this.items.eq(n).data("width"),s==this.vp){e=n;break}if(s>this.vp){e=n<this.items.length-1?n+1:n;break}}s>this.vp?this.updatePos(-1*(this.container.width()-this.vp)):this.updatePos(-1*this.items.eq(e).data("left"))}}var o=this.items.eq(e).data("left");this.items.removeClass("uk-slide-before uk-slide-after").each(function(i){i!==e&&t.$(this).addClass(t.$(this).data("left")<o?"uk-slide-before":"uk-slide-after")}),this.focus=e,this.trigger("focusitem.uk.slider",[e,this.items.eq(e),this])}},next:function(){var t=this.items[this.focus+1]?this.focus+1:this.options.infinite?0:this.focus;this.updateFocus(t,1)},previous:function(){var t=this.items[this.focus-1]?this.focus-1:this.options.infinite?this.items[this.focus-1]?this.items-1:this.items.length-1:this.focus;this.updateFocus(t,-1)},start:function(){this.stop();var t=this;this.interval=setInterval(function(){t.hovering||t.next()},this.options.autoplayInterval)},stop:function(){this.interval&&clearInterval(this.interval)},infinite:function(t,e){var i,s=this,n=this.items.eq(t),a=t,o=[],h=0;if(1==e){for(i=0;i<this.items.length&&(a!=t&&(h+=this.items.eq(a).data("width"),o.push(this.items.eq(a))),!(h>this.vp));i++)a=a+1==this.items.length?0:a+1;o.length&&o.forEach(function(t){var e=n.data("area");t.css({left:e}).data({left:e,area:e+t.data("width"),center:e-(s.vp/2-t.data("cwidth")/2)}),n=t})}else{for(i=this.items.length-1;i>-1&&(h+=this.items.eq(a).data("width"),a!=t&&o.push(this.items.eq(a)),!(h>this.vp));i--)a=a-1==-1?this.items.length-1:a-1;o.length&&o.forEach(function(t){var e=n.data("left")-t.data("width");t.css({left:e}).data({left:e,area:e+t.data("width"),center:e-(s.vp/2-t.data("cwidth")/2)}),n=t})}}}),t.$doc.on("mousemove.uk.slider touchmove.uk.slider",function(t){if(t.originalEvent&&t.originalEvent.touches&&(t=t.originalEvent.touches[0]),i&&Math.abs(t.pageX-i.x)>i.threshold&&(window.getSelection().toString()?e=i=!1:i(t)),e){var s,n,o,h,r,c,d,u,f,l;if(t.clientX||t.clientY?s=t.clientX:(t.pageX||t.pageY)&&(s=t.pageX-document.body.scrollLeft-document.documentElement.scrollLeft),r=a.focus,n=s-e.element.data("pointer-start").x,o=e.element.data("pointer-pos-start")+n,h=s>e.element.data("pointer-start").x?-1:1,c=e.items.eq(a.focus),1==h)for(d=c.data("left")+Math.abs(n),u=0,f=a.focus;u<e.items.length;u++){if(l=e.items.eq(f),f!=a.focus&&l.data("left")<d&&l.data("area")>d){r=f;break}f=f+1==e.items.length?0:f+1}else for(d=c.data("left")-Math.abs(n),u=0,f=a.focus;u<e.items.length;u++){if(l=e.items.eq(f),f!=a.focus&&l.data("area")<=c.data("left")&&l.data("center")<d){r=f;break}f=f-1==-1?e.items.length-1:f-1}e.options.infinite&&r!=a._focus&&e.infinite(r,h),e.updatePos(o),a.dir=h,a._focus=r,a.touchx=parseInt(t.pageX,10),a.diff=d}}),t.$doc.on("mouseup.uk.slider touchend.uk.slider",function(){if(e){e.container.removeClass("uk-drag"),e.items.eq(a.focus);var t,s,n,o=!1;if(1==a.dir){for(s=0,n=a.focus;s<e.items.length;s++){if(t=e.items.eq(n),n!=a.focus&&t.data("left")>a.diff){o=n;break}n=n+1==e.items.length?0:n+1}e.options.infinite||o||(o=e.items.length)}else{for(s=0,n=a.focus;s<e.items.length;s++){if(t=e.items.eq(n),n!=a.focus&&t.data("left")<a.diff){o=n;break}n=n-1==-1?e.items.length-1:n-1}e.options.infinite||o||(o=0)}e.updateFocus(o!==!1?o:a._focus)}e=i=!1}),t.slider}); | ||
| 0 | \ No newline at end of file | 3 | \ No newline at end of file |
src/main/resources/static/real_control_v2/css/line_schedule.css
| @@ -183,7 +183,7 @@ | @@ -183,7 +183,7 @@ | ||
| 183 | .schedule-body .ct_table dl.drag-active dd { | 183 | .schedule-body .ct_table dl.drag-active dd { |
| 184 | background: #cef9e3!important; | 184 | background: #cef9e3!important; |
| 185 | color: #484848; | 185 | color: #484848; |
| 186 | - border-top: 1px solid #e0d7d7; | 186 | + border-top: 1px solid #e0d7d7 !important; |
| 187 | } | 187 | } |
| 188 | 188 | ||
| 189 | .schedule-body .ct_table dl.drag-active dd a { | 189 | .schedule-body .ct_table dl.drag-active dd a { |
| @@ -527,6 +527,10 @@ dl.relevance-active.intimity dd:nth-child(n+2) { | @@ -527,6 +527,10 @@ dl.relevance-active.intimity dd:nth-child(n+2) { | ||
| 527 | color: white; | 527 | color: white; |
| 528 | } | 528 | } |
| 529 | 529 | ||
| 530 | +dl.relevance-active.intimity dd:nth-child(n+2) a { | ||
| 531 | + color: white !important; | ||
| 532 | +} | ||
| 533 | + | ||
| 530 | dl.relevance-active dd.tl-qrlb, | 534 | dl.relevance-active dd.tl-qrlb, |
| 531 | dl.relevance-active.intimity dd.tl-qrlb{ | 535 | dl.relevance-active.intimity dd.tl-qrlb{ |
| 532 | background: linear-gradient(to right, #7B6B24, #4992c3) !important; | 536 | background: linear-gradient(to right, #7B6B24, #4992c3) !important; |
| @@ -695,7 +699,14 @@ input.i-cbox[type=checkbox]{ | @@ -695,7 +699,14 @@ input.i-cbox[type=checkbox]{ | ||
| 695 | .sys-note-42{ | 699 | .sys-note-42{ |
| 696 | width: calc(100% - 10px) !important; | 700 | width: calc(100% - 10px) !important; |
| 697 | margin: 5px !important; | 701 | margin: 5px !important; |
| 702 | + cursor: default; | ||
| 698 | } | 703 | } |
| 704 | + | ||
| 705 | +.sys-note-80:hover, | ||
| 706 | +.sys-note-42:hover{ | ||
| 707 | + box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12); | ||
| 708 | +} | ||
| 709 | + | ||
| 699 | .sys-note-80 .uk-panel-box, | 710 | .sys-note-80 .uk-panel-box, |
| 700 | .sys-note-42 .uk-panel-box{ | 711 | .sys-note-42 .uk-panel-box{ |
| 701 | padding: 10px; | 712 | padding: 10px; |
src/main/resources/static/real_control_v2/css/north.css
| @@ -17,14 +17,14 @@ | @@ -17,14 +17,14 @@ | ||
| 17 | right: 10px; | 17 | right: 10px; |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | -.north-toolbar a.uk-navbar-brand>i { | 20 | +.north-toolbar a.uk-navbar-brand > i { |
| 21 | margin-top: 3px; | 21 | margin-top: 3px; |
| 22 | vertical-align: middle; | 22 | vertical-align: middle; |
| 23 | color: #bababa; | 23 | color: #bababa; |
| 24 | font-size: 16px; | 24 | font-size: 16px; |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | -.north-toolbar a.uk-navbar-brand>span { | 27 | +.north-toolbar a.uk-navbar-brand > span { |
| 28 | margin-top: 3px; | 28 | margin-top: 3px; |
| 29 | vertical-align: middle; | 29 | vertical-align: middle; |
| 30 | display: inline-block; | 30 | display: inline-block; |
| @@ -40,38 +40,38 @@ | @@ -40,38 +40,38 @@ | ||
| 40 | margin-left: -14px; | 40 | margin-left: -14px; |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | -.north .north-tabs .uk-tab{ | ||
| 44 | - border-bottom: none; | 43 | +.north .north-tabs .uk-tab { |
| 44 | + border-bottom: none; | ||
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | -.north .north-tabs .uk-tab>li>a{ | ||
| 48 | - color: #bde1ff; | ||
| 49 | - text-shadow: none; | 47 | +.north .north-tabs .uk-tab > li > a { |
| 48 | + color: #bde1ff; | ||
| 49 | + text-shadow: none; | ||
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | -.north .north-tabs .uk-tab>li.tab-line>a{ | ||
| 53 | - padding: 8px 0px 8px 12px; | 52 | +.north .north-tabs .uk-tab > li.tab-line > a { |
| 53 | + padding: 8px 0px 8px 12px; | ||
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | -.north .north-tabs .uk-tab>li>a:hover, | ||
| 57 | -.north .north-tabs .uk-tab>li>a:focus{ | ||
| 58 | - border-color: #19537d; | ||
| 59 | - background: #19537d; | ||
| 60 | - color: white; | ||
| 61 | - margin-bottom: 0; | 56 | +.north .north-tabs .uk-tab > li > a:hover, |
| 57 | +.north .north-tabs .uk-tab > li > a:focus { | ||
| 58 | + border-color: #19537d; | ||
| 59 | + background: #19537d; | ||
| 60 | + color: white; | ||
| 61 | + margin-bottom: 0; | ||
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | -.north .north-tabs .uk-tab>li.uk-active>a{ | 64 | +.north .north-tabs .uk-tab > li.uk-active > a { |
| 65 | color: #444; | 65 | color: #444; |
| 66 | border-color: #fff; | 66 | border-color: #fff; |
| 67 | background: #fff; | 67 | background: #fff; |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | -#north_toolbar_panel li.disabled a{ | ||
| 71 | - cursor: no-drop !important; | 70 | +#north_toolbar_panel li.disabled a { |
| 71 | + cursor: no-drop !important; | ||
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | -.load-panel{ | 74 | +.load-panel { |
| 75 | position: absolute; | 75 | position: absolute; |
| 76 | top: 50%; | 76 | top: 50%; |
| 77 | left: 50%; | 77 | left: 50%; |
| @@ -81,16 +81,118 @@ | @@ -81,16 +81,118 @@ | ||
| 81 | display: none; | 81 | display: none; |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | -.uk-dropdown.dropdown-column-2{ | 84 | +#history-sch-maintain-modal .load-panel{ |
| 85 | + background: #fff; | ||
| 86 | + color: #c92121; | ||
| 87 | +} | ||
| 88 | + | ||
| 89 | +.uk-dropdown.dropdown-column-2 { | ||
| 85 | width: 336px; | 90 | width: 336px; |
| 86 | } | 91 | } |
| 87 | 92 | ||
| 88 | -#north_toolbar_panel li.event a i{ | 93 | +#north_toolbar_panel li.event a i { |
| 89 | margin-right: 4px; | 94 | margin-right: 4px; |
| 90 | color: #b4b2b2; | 95 | color: #b4b2b2; |
| 91 | font-size: 12px; | 96 | font-size: 12px; |
| 92 | } | 97 | } |
| 93 | 98 | ||
| 94 | -#north_toolbar_panel li.event a:hover i{ | 99 | +#north_toolbar_panel li.event a:hover i { |
| 95 | color: #e9e4e4; | 100 | color: #e9e4e4; |
| 96 | -} | ||
| 97 | \ No newline at end of file | 101 | \ No newline at end of file |
| 102 | +} | ||
| 103 | + | ||
| 104 | +.history-sch-table dl dt:nth-of-type(1), .history-sch-table dl dd:nth-of-type(1) { | ||
| 105 | + width: 10%; | ||
| 106 | +} | ||
| 107 | + | ||
| 108 | +.history-sch-table dl dt:nth-of-type(2), .history-sch-table dl dd:nth-of-type(2) { | ||
| 109 | + width: 12%; | ||
| 110 | +} | ||
| 111 | + | ||
| 112 | +.history-sch-table dl dt:nth-of-type(3), .history-sch-table dl dd:nth-of-type(3) { | ||
| 113 | + width: 14%; | ||
| 114 | +} | ||
| 115 | + | ||
| 116 | +.history-sch-table dl dt:nth-of-type(4), .history-sch-table dl dd:nth-of-type(4) { | ||
| 117 | + width: 14%; | ||
| 118 | +} | ||
| 119 | + | ||
| 120 | +.history-sch-table dl dt:nth-of-type(5), .history-sch-table dl dd:nth-of-type(5) { | ||
| 121 | + width: 12%; | ||
| 122 | +} | ||
| 123 | + | ||
| 124 | +.history-sch-table dl dt:nth-of-type(6), .history-sch-table dl dd:nth-of-type(6) { | ||
| 125 | + width: 10%; | ||
| 126 | +} | ||
| 127 | + | ||
| 128 | +.history-sch-table dl dt:nth-of-type(7), .history-sch-table dl dd:nth-of-type(7) { | ||
| 129 | + width: 12%; | ||
| 130 | +} | ||
| 131 | + | ||
| 132 | +.history-sch-table dl dt:nth-of-type(8), .history-sch-table dl dd:nth-of-type(8) { | ||
| 133 | + width: 10%; | ||
| 134 | +} | ||
| 135 | + | ||
| 136 | +.history-sch-table dl dt:nth-of-type(9), .history-sch-table dl dd:nth-of-type(9) { | ||
| 137 | + width: 6%; | ||
| 138 | +} | ||
| 139 | + | ||
| 140 | +#history-sch-maintain-modal ul.h-s-time, | ||
| 141 | +#history-sch-maintain-modal ul.h-s-line{ | ||
| 142 | + border: 1px solid #f0f0f0; | ||
| 143 | + padding: 9px 0 10px 0; | ||
| 144 | + border-radius: 3px; | ||
| 145 | + position: relative; | ||
| 146 | +} | ||
| 147 | + | ||
| 148 | +#history-sch-maintain-modal ul.h-s-time:before, | ||
| 149 | +#history-sch-maintain-modal ul.h-s-line:before{ | ||
| 150 | + content: "日期"; | ||
| 151 | + position: absolute; | ||
| 152 | + top: -9px; | ||
| 153 | + font-size: 12px; | ||
| 154 | + background: white; | ||
| 155 | + padding: 0 4px; | ||
| 156 | + color: #7d7b7b; | ||
| 157 | + left: 10px; | ||
| 158 | +} | ||
| 159 | + | ||
| 160 | +#history-sch-maintain-modal ul.h-s-line:before{ | ||
| 161 | + content: "线路"; | ||
| 162 | +} | ||
| 163 | + | ||
| 164 | +/*#history-sch-maintain-modal ul.h-s-line li.active{ | ||
| 165 | + | ||
| 166 | +}*/ | ||
| 167 | + | ||
| 168 | +/* | ||
| 169 | +#history-sch-maintain-modal ul.h-s-line li.active a{ | ||
| 170 | + color: white; | ||
| 171 | + background: #009dd8; | ||
| 172 | +} | ||
| 173 | +*/ | ||
| 174 | + | ||
| 175 | +#history-sch-maintain-modal .uk-icon-question-circle{ | ||
| 176 | + color: darkgrey; | ||
| 177 | + font-size: 12px; | ||
| 178 | + margin: 3px; | ||
| 179 | +} | ||
| 180 | + | ||
| 181 | +.history-sch-table.ct_table dl.active, | ||
| 182 | +.history-sch-table.ct_table>.ct_table_body dl.active:hover, | ||
| 183 | +.history-sch-table.ct_table>.ct_table_body dl.context-menu-active { | ||
| 184 | + background: #8baebc; | ||
| 185 | + box-shadow: 0 0 4px #656c71; | ||
| 186 | + color: white; | ||
| 187 | +} | ||
| 188 | + | ||
| 189 | +#history-sch-edit-modal.ct-form-modal form.uk-form-horizontal .uk-form-label{ | ||
| 190 | + width: 60px; | ||
| 191 | +} | ||
| 192 | + | ||
| 193 | +#history-sch-edit-modal.ct-form-modal form.uk-form-horizontal .uk-form-controls { | ||
| 194 | + margin-left: 64px; | ||
| 195 | +} | ||
| 196 | + | ||
| 197 | + | ||
| 198 | + | ||
| 199 | + |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/bc_type_major.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="bctype-major-modal"> | ||
| 2 | + <div class="uk-modal-dialog"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <h2>班次放站</h2> | ||
| 5 | + <form class="uk-form uk-form-horizontal"> | ||
| 6 | + <div class="uk-grid"> | ||
| 7 | + <div class="uk-width-1-2"> | ||
| 8 | + <div class="uk-form-row"> | ||
| 9 | + <label class="uk-form-label" style="width: 75px;">从</label> | ||
| 10 | + <div class="uk-form-controls" style="margin-left: 75px;"> | ||
| 11 | + <select name="startStation"> | ||
| 12 | + </select> | ||
| 13 | + </div> | ||
| 14 | + </div> | ||
| 15 | + </div> | ||
| 16 | + <div class="uk-width-1-2"> | ||
| 17 | + <div class="uk-form-row"> | ||
| 18 | + <label class="uk-form-label" style="width: 75px;">放大站至</label> | ||
| 19 | + <div class="uk-form-controls" style="margin-left: 75px;"> | ||
| 20 | + <select name="endStation"> | ||
| 21 | + </select> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + </div> | ||
| 26 | + <div class="uk-grid"> | ||
| 27 | + <div class="uk-width-1-1"> | ||
| 28 | + <div class="uk-form-row ct-stacked"> | ||
| 29 | + <label class="uk-form-label" for="form-s-t"><i class="uk-icon-bullhorn"></i> 指令内容</label> | ||
| 30 | + <div class="uk-form-controls"> | ||
| 31 | + <textarea style="color: #e53636;" id="form-s-t" cols="30" placeholder="指令内容" rows="5" | ||
| 32 | + name="directiveStr" data-fv-stringlength="true" | ||
| 33 | + data-fv-stringlength-max="50"></textarea> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + </div> | ||
| 37 | + </div> | ||
| 38 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | ||
| 39 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 40 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-send"></i> 确认调整并下发指令 | ||
| 41 | + </button> | ||
| 42 | + </div> | ||
| 43 | + </form> | ||
| 44 | + </div> | ||
| 45 | + | ||
| 46 | + <script> | ||
| 47 | + (function () { | ||
| 48 | + var modal = '#bctype-major-modal' | ||
| 49 | + , sch, stationRoutes, parentModal; | ||
| 50 | + | ||
| 51 | + $('[name=startStation],[name=endStation]', modal).on('change', refreshDirectiveStr); | ||
| 52 | + | ||
| 53 | + | ||
| 54 | + var remarks; | ||
| 55 | + function refreshDirectiveStr() { | ||
| 56 | + //指令内容 | ||
| 57 | + var qdzName = $('[name=startStation]').find("option:selected").text() | ||
| 58 | + , zdzName = $('[name=endStation]').find("option:selected").text(); | ||
| 59 | + remarks=' 由 ' + qdzName + ' 放站至 ' + zdzName; | ||
| 60 | + $('[name=directiveStr]', modal).text('班次:'+sch.dfsj+remarks).trigger('input'); | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + $('[name=startStation]', modal).on('change', function () { | ||
| 64 | + var ops = $('[name=endStation]', modal).find('option'); | ||
| 65 | + | ||
| 66 | + var flag, code = $(this).val(); | ||
| 67 | + $.each(ops, function () { | ||
| 68 | + if (!flag) | ||
| 69 | + $(this).attr('disabled', 'disabled'); | ||
| 70 | + else | ||
| 71 | + $(this).removeAttr('disabled'); | ||
| 72 | + if (this.value == code) | ||
| 73 | + flag = true; | ||
| 74 | + }); | ||
| 75 | + }); | ||
| 76 | + | ||
| 77 | + $('[name=endStation]', modal).on('change', function () { | ||
| 78 | + var ops = $('[name=startStation]', modal).find('option'); | ||
| 79 | + | ||
| 80 | + var flag, code = $(this).val(); | ||
| 81 | + $.each(ops, function () { | ||
| 82 | + if (this.value == code) | ||
| 83 | + flag = true; | ||
| 84 | + | ||
| 85 | + if (flag) | ||
| 86 | + $(this).attr('disabled', 'disabled'); | ||
| 87 | + else | ||
| 88 | + $(this).removeAttr('disabled'); | ||
| 89 | + }); | ||
| 90 | + }); | ||
| 91 | + $(modal).on('init', function (e, data) { | ||
| 92 | + sch = data.sch; | ||
| 93 | + parentModal = data.parentModal; | ||
| 94 | + | ||
| 95 | + //submit | ||
| 96 | + var f = $('form', modal).formValidation(gb_form_validation_opts); | ||
| 97 | + f.on('success.form.fv', function (e) { | ||
| 98 | + e.preventDefault(); | ||
| 99 | + var data = $(this).serializeJSON(); | ||
| 100 | + // notify_wait('准备下发指令') | ||
| 101 | + //下发指令 | ||
| 102 | + $.post('/directive/phrase', {nbbm: sch.clZbh, text: data.directiveStr}, function (rs) { | ||
| 103 | + if (rs == 0) { | ||
| 104 | + notify_succ('指令下发成功'); | ||
| 105 | + changeBcType(); | ||
| 106 | + } | ||
| 107 | + else | ||
| 108 | + notify_err('指令下发失败'); | ||
| 109 | + }); | ||
| 110 | + }); | ||
| 111 | + | ||
| 112 | + //站点路由 | ||
| 113 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) { | ||
| 114 | + return a.stationRouteCode - b.stationRouteCode; | ||
| 115 | + }), 'directions'); | ||
| 116 | + | ||
| 117 | + var opts = ''; | ||
| 118 | + $.each(stationRoutes[sch.xlDir], function () { | ||
| 119 | + opts += '<option value="' + this.stationCode + '">' + this.stationName + '</option>'; | ||
| 120 | + }); | ||
| 121 | + $('[name=startStation]', modal).html(opts).val(sch.qdzCode); | ||
| 122 | + $('[name=endStation]', modal).html(opts).val(sch.zdzCode); | ||
| 123 | + $('[name=startStation]', modal).trigger('change'); | ||
| 124 | + $('[name=endStation]', modal).trigger('change'); | ||
| 125 | + }); | ||
| 126 | + | ||
| 127 | + function changeBcType() { | ||
| 128 | + //将班次类型调整为放站 | ||
| 129 | + gb_common.$post('/realSchedule/changeBcType/'+sch.id, {bcType: 'major', remarks: remarks}, function(rs){ | ||
| 130 | + UIkit.modal(modal).hide(); | ||
| 131 | + gb_schedule_table.updateSchedule(rs.t); | ||
| 132 | + //触发父容器刷新事件 | ||
| 133 | + $(parentModal).trigger('init', {sch: rs.t}); | ||
| 134 | + notify_succ('调整放站成功'); | ||
| 135 | + }); | ||
| 136 | + } | ||
| 137 | + })(); | ||
| 138 | + </script> | ||
| 139 | +</div> |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/bc_type_venting.html
| @@ -28,66 +28,114 @@ | @@ -28,66 +28,114 @@ | ||
| 28 | <div class="uk-form-row ct-stacked"> | 28 | <div class="uk-form-row ct-stacked"> |
| 29 | <label class="uk-form-label" for="form-s-t"><i class="uk-icon-bullhorn"></i> 指令内容</label> | 29 | <label class="uk-form-label" for="form-s-t"><i class="uk-icon-bullhorn"></i> 指令内容</label> |
| 30 | <div class="uk-form-controls"> | 30 | <div class="uk-form-controls"> |
| 31 | - <textarea style="color: #e53636;" id="form-s-t" cols="30" placeholder="指令内容" rows="5" name="directiveStr" data-fv-stringlength="true" data-fv-stringlength-max="50" ></textarea> | 31 | + <textarea style="color: #e53636;" id="form-s-t" cols="30" placeholder="指令内容" rows="5" |
| 32 | + name="directiveStr" data-fv-stringlength="true" | ||
| 33 | + data-fv-stringlength-max="50"></textarea> | ||
| 32 | </div> | 34 | </div> |
| 33 | </div> | 35 | </div> |
| 34 | </div> | 36 | </div> |
| 35 | </div> | 37 | </div> |
| 36 | <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | 38 | <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> |
| 37 | <button type="button" class="uk-button uk-modal-close">取消</button> | 39 | <button type="button" class="uk-button uk-modal-close">取消</button> |
| 38 | - <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-send"></i> 确认调整并下发指令</button> | 40 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-send"></i> 确认调整并下发指令 |
| 41 | + </button> | ||
| 39 | </div> | 42 | </div> |
| 40 | </form> | 43 | </form> |
| 41 | </div> | 44 | </div> |
| 42 | 45 | ||
| 43 | <script> | 46 | <script> |
| 44 | - (function() { | 47 | + (function () { |
| 45 | var modal = '#bctype-venting-modal' | 48 | var modal = '#bctype-venting-modal' |
| 46 | - ,sch,stationRoutes; | ||
| 47 | - $(modal).on('init', function(e, data) { | ||
| 48 | - sch=data.sch; | 49 | + , sch, stationRoutes, parentModal; |
| 49 | 50 | ||
| 50 | - //站点路由 | ||
| 51 | - stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function(a, b){ | ||
| 52 | - return a.stationRouteCode-b.stationRouteCode; | ||
| 53 | - }), 'directions'); | 51 | + $('[name=startStation],[name=endStation]', modal).on('change', refreshDirectiveStr); |
| 54 | 52 | ||
| 55 | - var opts=''; | ||
| 56 | - $.each(stationRoutes[sch.xlDir], function(){ | ||
| 57 | - opts+='<option value="'+this.stationCode+'">'+this.stationName+'</option>'; | ||
| 58 | - }); | ||
| 59 | - $('[name=startStation]',modal).html(opts).val(sch.qdzCode); | ||
| 60 | - $('[name=endStation]',modal).html(opts).val(sch.zdzCode); | 53 | + |
| 54 | + var remarks; | ||
| 55 | + function refreshDirectiveStr() { | ||
| 61 | //指令内容 | 56 | //指令内容 |
| 62 | - $('[name=directiveStr]',modal).text('从 ' + sch.qdzName + ' 直放至 ' + sch.zdzName); | 57 | + var qdzName = $('[name=startStation]').find("option:selected").text() |
| 58 | + , zdzName = $('[name=endStation]').find("option:selected").text(); | ||
| 59 | + | ||
| 60 | + remarks=' 由 ' + qdzName + ' 直放至 ' + zdzName; | ||
| 61 | + $('[name=directiveStr]', modal).text('班次:'+sch.dfsj+ remarks).trigger('input'); | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + $('[name=startStation]', modal).on('change', function () { | ||
| 65 | + var ops = $('[name=endStation]', modal).find('option'); | ||
| 66 | + | ||
| 67 | + var flag, code = $(this).val(); | ||
| 68 | + $.each(ops, function () { | ||
| 69 | + if (!flag) | ||
| 70 | + $(this).attr('disabled', 'disabled'); | ||
| 71 | + else | ||
| 72 | + $(this).removeAttr('disabled'); | ||
| 73 | + if (this.value == code) | ||
| 74 | + flag = true; | ||
| 75 | + }); | ||
| 76 | + }); | ||
| 77 | + | ||
| 78 | + $('[name=endStation]', modal).on('change', function () { | ||
| 79 | + var ops = $('[name=startStation]', modal).find('option'); | ||
| 80 | + | ||
| 81 | + var flag, code = $(this).val(); | ||
| 82 | + $.each(ops, function () { | ||
| 83 | + if (this.value == code) | ||
| 84 | + flag = true; | ||
| 85 | + | ||
| 86 | + if (flag) | ||
| 87 | + $(this).attr('disabled', 'disabled'); | ||
| 88 | + else | ||
| 89 | + $(this).removeAttr('disabled'); | ||
| 90 | + }); | ||
| 91 | + }); | ||
| 92 | + $(modal).on('init', function (e, data) { | ||
| 93 | + sch = data.sch; | ||
| 94 | + parentModal = data.parentModal; | ||
| 63 | 95 | ||
| 64 | //submit | 96 | //submit |
| 65 | var f = $('form', modal).formValidation(gb_form_validation_opts); | 97 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| 66 | - f.on('success.form.fv', function(e) { | 98 | + f.on('success.form.fv', function (e) { |
| 67 | e.preventDefault(); | 99 | e.preventDefault(); |
| 68 | var data = $(this).serializeJSON(); | 100 | var data = $(this).serializeJSON(); |
| 69 | - console.log(data); | 101 | + // notify_wait('准备下发指令') |
| 102 | + //下发指令 | ||
| 103 | + $.post('/directive/phrase', {nbbm: sch.clZbh, text: data.directiveStr}, function (rs) { | ||
| 104 | + if (rs == 0) { | ||
| 105 | + notify_succ('指令下发成功'); | ||
| 106 | + changeBcType(); | ||
| 107 | + } | ||
| 108 | + else | ||
| 109 | + notify_err('指令下发失败'); | ||
| 110 | + }); | ||
| 70 | }); | 111 | }); |
| 71 | 112 | ||
| 72 | - $('[name=startStation],[name=endStation]',modal).on('change', refreshDirectiveStr); | ||
| 73 | - | ||
| 74 | - | ||
| 75 | - function refreshDirectiveStr(){ | ||
| 76 | - //指令内容 | ||
| 77 | - var qdzName=$('[name=startStation]').find("option:selected").text() | ||
| 78 | - ,zdzName=$('[name=endStation]').find("option:selected").text(); | ||
| 79 | - $('[name=directiveStr]',modal).text('从 ' + qdzName + ' 直放至 ' + zdzName); | ||
| 80 | - } | ||
| 81 | 113 | ||
| 82 | - $('[name=startStation]',modal).on('change', function () { | ||
| 83 | - var ops=$('[name=endStation]', modal).find('option'); | 114 | + //站点路由 |
| 115 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) { | ||
| 116 | + return a.stationRouteCode - b.stationRouteCode; | ||
| 117 | + }), 'directions'); | ||
| 84 | 118 | ||
| 85 | - var flag=0, code=$(this).val(); | ||
| 86 | - $.each(ops, function () { | ||
| 87 | - if(this.stationCode==code) | ||
| 88 | - }); | 119 | + var opts = ''; |
| 120 | + $.each(stationRoutes[sch.xlDir], function () { | ||
| 121 | + opts += '<option value="' + this.stationCode + '">' + this.stationName + '</option>'; | ||
| 89 | }); | 122 | }); |
| 123 | + $('[name=startStation]', modal).html(opts).val(sch.qdzCode); | ||
| 124 | + $('[name=endStation]', modal).html(opts).val(sch.zdzCode); | ||
| 125 | + $('[name=startStation]', modal).trigger('change'); | ||
| 126 | + $('[name=endStation]', modal).trigger('change'); | ||
| 90 | }); | 127 | }); |
| 128 | + | ||
| 129 | + function changeBcType() { | ||
| 130 | + //将班次类型调整为直放 | ||
| 131 | + gb_common.$post('/realSchedule/changeBcType/'+sch.id, {bcType: 'venting', remarks: remarks}, function(rs){ | ||
| 132 | + UIkit.modal(modal).hide(); | ||
| 133 | + gb_schedule_table.updateSchedule(rs.t); | ||
| 134 | + //触发父容器刷新事件 | ||
| 135 | + $(parentModal).trigger('init', {sch: rs.t}); | ||
| 136 | + notify_succ('调整直发成功'); | ||
| 137 | + }); | ||
| 138 | + } | ||
| 91 | })(); | 139 | })(); |
| 92 | </script> | 140 | </script> |
| 93 | -</div> | 141 | -</div> |
| 142 | +</div> | ||
| 94 | \ No newline at end of file | 143 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/dftz.html
| @@ -155,16 +155,25 @@ | @@ -155,16 +155,25 @@ | ||
| 155 | var type = $(this).val(); | 155 | var type = $(this).val(); |
| 156 | if(sch.bcType != 'normal') | 156 | if(sch.bcType != 'normal') |
| 157 | return; | 157 | return; |
| 158 | - //if($(this)) | 158 | + |
| 159 | + //重置类型,等待调整界面触发刷新事件 | ||
| 160 | + $(this).val(sch.bcType); | ||
| 161 | + var url, detailModal; | ||
| 159 | if(type=='venting'){ | 162 | if(type=='venting'){ |
| 160 | - //直放 | ||
| 161 | - $.get('/real_control_v2/fragments/line_schedule/context_menu/bc_type_venting.html', function(htmlStr){ | ||
| 162 | - $(document.body).append(htmlStr); | ||
| 163 | - var detailModal='#bctype-venting-modal'; | ||
| 164 | - UIkit.modal(detailModal, {bgclose: true,modal:false}).show(); | ||
| 165 | - $(detailModal).trigger('init', {sch: sch}); | ||
| 166 | - }) | 163 | + url='/real_control_v2/fragments/line_schedule/context_menu/bc_type_venting.html'; |
| 164 | + detailModal='#bctype-venting-modal'; | ||
| 165 | + } | ||
| 166 | + else{ | ||
| 167 | + detailModal='#bctype-major-modal'; | ||
| 168 | + url='/real_control_v2/fragments/line_schedule/context_menu/bc_type_major.html'; | ||
| 167 | } | 169 | } |
| 170 | + | ||
| 171 | + $.get(url, function(htmlStr){ | ||
| 172 | + $(document.body).append(htmlStr); | ||
| 173 | + | ||
| 174 | + UIkit.modal(detailModal, {bgclose: true,modal:false}).show(); | ||
| 175 | + $(detailModal).trigger('init', {sch: sch, parentModal: modal}); | ||
| 176 | + }) | ||
| 168 | }); | 177 | }); |
| 169 | }); | 178 | }); |
| 170 | })(); | 179 | })(); |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/fcxxwt.html
| @@ -163,7 +163,7 @@ | @@ -163,7 +163,7 @@ | ||
| 163 | }); | 163 | }); |
| 164 | 164 | ||
| 165 | //班次类型 | 165 | //班次类型 |
| 166 | - if(sch.bcType=='out'||sch.bcType=='in') | 166 | + if(sch.bcType!='normal') |
| 167 | $('select[name=bcType]', f).attr('disabled','disabled'); | 167 | $('select[name=bcType]', f).attr('disabled','disabled'); |
| 168 | else { | 168 | else { |
| 169 | //正常班次只能改为直放 和 放大站 | 169 | //正常班次只能改为直放 和 放大站 |
| @@ -178,6 +178,32 @@ | @@ -178,6 +178,32 @@ | ||
| 178 | var rem=$('[name=remarks]', f); | 178 | var rem=$('[name=remarks]', f); |
| 179 | rem.val(rem.val() + $(this).val() + ',').trigger('input'); | 179 | rem.val(rem.val() + $(this).val() + ',').trigger('input'); |
| 180 | }); | 180 | }); |
| 181 | + | ||
| 182 | + | ||
| 183 | + $('select[name=bcType]', modal).on('change', function(){ | ||
| 184 | + var type = $(this).val(); | ||
| 185 | + if(sch.bcType != 'normal') | ||
| 186 | + return; | ||
| 187 | + | ||
| 188 | + //重置类型,等待调整界面触发刷新事件 | ||
| 189 | + $(this).val(sch.bcType); | ||
| 190 | + var url, detailModal; | ||
| 191 | + if(type=='venting'){ | ||
| 192 | + url='/real_control_v2/fragments/line_schedule/context_menu/bc_type_venting.html'; | ||
| 193 | + detailModal='#bctype-venting-modal'; | ||
| 194 | + } | ||
| 195 | + else{ | ||
| 196 | + detailModal='#bctype-major-modal'; | ||
| 197 | + url='/real_control_v2/fragments/line_schedule/context_menu/bc_type_major.html'; | ||
| 198 | + } | ||
| 199 | + | ||
| 200 | + $.get(url, function(htmlStr){ | ||
| 201 | + $(document.body).append(htmlStr); | ||
| 202 | + | ||
| 203 | + UIkit.modal(detailModal, {bgclose: true,modal:false}).show(); | ||
| 204 | + $(detailModal).trigger('init', {sch: sch, parentModal: modal}); | ||
| 205 | + }) | ||
| 206 | + }); | ||
| 181 | }); | 207 | }); |
| 182 | })(); | 208 | })(); |
| 183 | </script> | 209 | </script> |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/jhlb.html
| @@ -28,11 +28,19 @@ | @@ -28,11 +28,19 @@ | ||
| 28 | <label {{if sch.destroy}}class="destroy-sch"{{/if}}> | 28 | <label {{if sch.destroy}}class="destroy-sch"{{/if}}> |
| 29 | <input class="i-cbox" name="ids[]" value="{{sch.id}}" type="checkbox" {{if sch.destroy}}disabled{{/if}}> | 29 | <input class="i-cbox" name="ids[]" value="{{sch.id}}" type="checkbox" {{if sch.destroy}}disabled{{/if}}> |
| 30 | {{sch.dfsj}} | 30 | {{sch.dfsj}} |
| 31 | + | ||
| 31 | {{if sch.bcType == "out"}} | 32 | {{if sch.bcType == "out"}} |
| 32 | - <span class="uk-badge uk-badge-success">出场</span> | ||
| 33 | - {{else if sch.bcType == "in"}} | ||
| 34 | - <span class="uk-badge uk-badge-warning">进场</span> | ||
| 35 | - {{/if}} | 33 | + <span class="uk-badge uk-badge-success">出场</span> |
| 34 | + {{else if sch.bcType == "in"}} | ||
| 35 | + <span class="uk-badge uk-badge-warning">进场</span> | ||
| 36 | + {{else if sch.bcType == "venting"}} | ||
| 37 | + <span class="uk-badge uk-badge-danger">直放</span> | ||
| 38 | + {{else if sch.bcType == "major"}} | ||
| 39 | + <span class="uk-badge uk-badge-danger">放站</span> | ||
| 40 | + {{/if}} | ||
| 41 | + {{if sch.sflj}} | ||
| 42 | + <span class="uk-badge uk-badge-danger">临加</span> | ||
| 43 | + {{/if}} | ||
| 36 | {{if sch.destroy}} | 44 | {{if sch.destroy}} |
| 37 | <small>已烂班</small> | 45 | <small>已烂班</small> |
| 38 | {{/if}} | 46 | {{/if}} |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
| @@ -83,14 +83,20 @@ | @@ -83,14 +83,20 @@ | ||
| 83 | {{else}} | 83 | {{else}} |
| 84 | <span class="sjfc-time">{{sch.fcsjActual}}</span> | 84 | <span class="sjfc-time">{{sch.fcsjActual}}</span> |
| 85 | {{/if}} | 85 | {{/if}} |
| 86 | + | ||
| 86 | {{if sch.bcType == "out"}} | 87 | {{if sch.bcType == "out"}} |
| 87 | - <span class="uk-badge uk-badge-success">出场</span> | 88 | + <span class="uk-badge uk-badge-success">出场</span> |
| 88 | {{else if sch.bcType == "in"}} | 89 | {{else if sch.bcType == "in"}} |
| 89 | - <span class="uk-badge uk-badge-warning">进场</span> | 90 | + <span class="uk-badge uk-badge-warning">进场</span> |
| 91 | + {{else if sch.bcType == "venting"}} | ||
| 92 | + <span class="uk-badge uk-badge-danger">直放</span> | ||
| 93 | + {{else if sch.bcType == "major"}} | ||
| 94 | + <span class="uk-badge uk-badge-danger">放站</span> | ||
| 90 | {{/if}} | 95 | {{/if}} |
| 91 | {{if sch.sflj}} | 96 | {{if sch.sflj}} |
| 92 | - <span class="uk-badge uk-badge-danger">临加</span> | 97 | + <span class="uk-badge uk-badge-danger">临加</span> |
| 93 | {{/if}} | 98 | {{/if}} |
| 99 | + | ||
| 94 | {{if sch.cTasks.length > 0}} | 100 | {{if sch.cTasks.length > 0}} |
| 95 | <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> | 101 | <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> |
| 96 | {{/if}} | 102 | {{/if}} |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/multi_dftz.html
| @@ -56,7 +56,7 @@ | @@ -56,7 +56,7 @@ | ||
| 56 | }); | 56 | }); |
| 57 | 57 | ||
| 58 | $('button[type=submit]', modal).on('click', function() { | 58 | $('button[type=submit]', modal).on('click', function() { |
| 59 | - var data = [], text=''; | 59 | + var data = []/*, text=''*/; |
| 60 | var dls = $('.multi-dftz-table .ct_table_body dl', modal); | 60 | var dls = $('.multi-dftz-table .ct_table_body dl', modal); |
| 61 | $.each(dls, function() { | 61 | $.each(dls, function() { |
| 62 | var input = $($('dd', this)[5]).find('input'), | 62 | var input = $($('dd', this)[5]).find('input'), |
| @@ -69,20 +69,27 @@ | @@ -69,20 +69,27 @@ | ||
| 69 | old_dfsj: old, | 69 | old_dfsj: old, |
| 70 | new_dfsj: v | 70 | new_dfsj: v |
| 71 | }); | 71 | }); |
| 72 | - text+=('<span style="color:red;">'+old + '——>' + v + '</span>,'); | 72 | + //text+=('<span style="color:red;">'+old + '——>' + v + '</span>,'); |
| 73 | }); | 73 | }); |
| 74 | 74 | ||
| 75 | - alt_confirm('确定要进行调整?' + text, function(){ | ||
| 76 | - gb_common.$post('/realSchedule/multi_dftz', { | ||
| 77 | - dcsJson: JSON.stringify(data) | ||
| 78 | - }, function(rs) { | ||
| 79 | - if(rs.ts && rs.ts.length > 0){ | ||
| 80 | - gb_schedule_table.updateSchedule(rs.ts); | ||
| 81 | - UIkit.modal(modal).hide(); | ||
| 82 | - notify_succ('待发调整成功'); | ||
| 83 | - } | ||
| 84 | - }); | ||
| 85 | - }, '确定调整'); | 75 | + if(data && data.length > 0){ |
| 76 | + UIkit.modal.confirm('确定要进行调整?', function() { | ||
| 77 | + gb_common.$post('/realSchedule/multi_dftz', { | ||
| 78 | + dcsJson: JSON.stringify(data) | ||
| 79 | + }, function(rs) { | ||
| 80 | + if(rs.ts && rs.ts.length > 0){ | ||
| 81 | + gb_schedule_table.updateSchedule(rs.ts); | ||
| 82 | + UIkit.modal(modal).hide(); | ||
| 83 | + notify_succ('待发调整成功'); | ||
| 84 | + } | ||
| 85 | + }); | ||
| 86 | + }, { | ||
| 87 | + labels: { | ||
| 88 | + Ok: '确定调整', | ||
| 89 | + Cancel: '取消' | ||
| 90 | + } | ||
| 91 | + }); | ||
| 92 | + } | ||
| 86 | }); | 93 | }); |
| 87 | 94 | ||
| 88 | var valChange = function() { | 95 | var valChange = function() { |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sftz.html
| @@ -44,7 +44,7 @@ | @@ -44,7 +44,7 @@ | ||
| 44 | <div class="uk-form-row"> | 44 | <div class="uk-form-row"> |
| 45 | <label class="uk-form-label" >实发时刻</label> | 45 | <label class="uk-form-label" >实发时刻</label> |
| 46 | <div class="uk-form-controls"> | 46 | <div class="uk-form-controls"> |
| 47 | - <input type="time" name="fcsjActual" value="{{fcsjActual}}" autofocus> | 47 | + <input type="time" name="fcsjActual" value="{{fcsjActual}}" required autofocus> |
| 48 | </div> | 48 | </div> |
| 49 | </div> | 49 | </div> |
| 50 | </div> | 50 | </div> |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/tzrc.html
| @@ -89,14 +89,18 @@ | @@ -89,14 +89,18 @@ | ||
| 89 | <label> | 89 | <label> |
| 90 | <input {{if sch.fcsjActual!=null}}disabled{{/if}} type="checkbox" value=1 name="schCBox" class="i-cbox" style="margin-top: 0px;"> | 90 | <input {{if sch.fcsjActual!=null}}disabled{{/if}} type="checkbox" value=1 name="schCBox" class="i-cbox" style="margin-top: 0px;"> |
| 91 | {{sch.dfsj}} | 91 | {{sch.dfsj}} |
| 92 | - {{if sch.bcType == "out"}} | 92 | + {{if sch.bcType == "out"}} |
| 93 | <span class="uk-badge uk-badge-success">出场</span> | 93 | <span class="uk-badge uk-badge-success">出场</span> |
| 94 | - {{else if sch.bcType == "in"}} | 94 | + {{else if sch.bcType == "in"}} |
| 95 | <span class="uk-badge uk-badge-warning">进场</span> | 95 | <span class="uk-badge uk-badge-warning">进场</span> |
| 96 | - {{/if}} | ||
| 97 | - {{if sch.sflj}} | 96 | + {{else if sch.bcType == "venting"}} |
| 97 | + <span class="uk-badge uk-badge-danger">直放</span> | ||
| 98 | + {{else if sch.bcType == "major"}} | ||
| 99 | + <span class="uk-badge uk-badge-danger">放站</span> | ||
| 100 | + {{/if}} | ||
| 101 | + {{if sch.sflj}} | ||
| 98 | <span class="uk-badge uk-badge-danger">临加</span> | 102 | <span class="uk-badge uk-badge-danger">临加</span> |
| 99 | - {{/if}} | 103 | + {{/if}} |
| 100 | {{if sch.cTasks.length > 0}} | 104 | {{if sch.cTasks.length > 0}} |
| 101 | <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> | 105 | <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> |
| 102 | {{/if}} | 106 | {{/if}} |
src/main/resources/static/real_control_v2/fragments/line_schedule/layout.html
| @@ -13,7 +13,6 @@ | @@ -13,7 +13,6 @@ | ||
| 13 | </div> | 13 | </div> |
| 14 | <div class="uk-width-1-6" style="height: calc(100% - 1px);"> | 14 | <div class="uk-width-1-6" style="height: calc(100% - 1px);"> |
| 15 | <div class="card-panel sys-mailbox" style="overflow: auto;"> | 15 | <div class="card-panel sys-mailbox" style="overflow: auto;"> |
| 16 | - | ||
| 17 | </div> | 16 | </div> |
| 18 | </div> | 17 | </div> |
| 19 | </div> | 18 | </div> |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| @@ -53,6 +53,10 @@ | @@ -53,6 +53,10 @@ | ||
| 53 | <span class="uk-badge uk-badge-success">出场</span> | 53 | <span class="uk-badge uk-badge-success">出场</span> |
| 54 | {{else if sch.bcType == "in"}} | 54 | {{else if sch.bcType == "in"}} |
| 55 | <span class="uk-badge uk-badge-warning">进场</span> | 55 | <span class="uk-badge uk-badge-warning">进场</span> |
| 56 | + {{else if sch.bcType == "venting"}} | ||
| 57 | + <span class="uk-badge uk-badge-danger">直放</span> | ||
| 58 | + {{else if sch.bcType == "major"}} | ||
| 59 | + <span class="uk-badge uk-badge-danger">放站</span> | ||
| 56 | {{/if}} | 60 | {{/if}} |
| 57 | {{if sch.sflj}} | 61 | {{if sch.sflj}} |
| 58 | <span class="uk-badge uk-badge-danger">临加</span> | 62 | <span class="uk-badge uk-badge-danger">临加</span> |
| @@ -93,6 +97,10 @@ | @@ -93,6 +97,10 @@ | ||
| 93 | <span class="uk-badge uk-badge-success">出场</span> | 97 | <span class="uk-badge uk-badge-success">出场</span> |
| 94 | {{else if bcType == "in"}} | 98 | {{else if bcType == "in"}} |
| 95 | <span class="uk-badge uk-badge-warning">进场</span> | 99 | <span class="uk-badge uk-badge-warning">进场</span> |
| 100 | + {{else if bcType == "venting"}} | ||
| 101 | + <span class="uk-badge uk-badge-danger">直放</span> | ||
| 102 | + {{else if bcType == "major"}} | ||
| 103 | + <span class="uk-badge uk-badge-danger">放站</span> | ||
| 96 | {{/if}} | 104 | {{/if}} |
| 97 | {{if sflj}} | 105 | {{if sflj}} |
| 98 | <span class="uk-badge uk-badge-danger">临加</span> | 106 | <span class="uk-badge uk-badge-danger">临加</span> |
src/main/resources/static/real_control_v2/fragments/line_schedule/sys_mailbox.html
| @@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
| 13 | </script> | 13 | </script> |
| 14 | 14 | ||
| 15 | <script id="sys-note-42-temp" type="text/html"> | 15 | <script id="sys-note-42-temp" type="text/html"> |
| 16 | - <div class="uk-width-medium-1-1 sys-note-42 sys-mail-item" id="{{domId}}" > | 16 | + <div class="uk-width-medium-1-1 sys-note-42 sys-mail-item" id="{{domId}}" data-id="{{t.id}}"> |
| 17 | <div class="uk-panel uk-panel-box uk-panel-box-secondary"> | 17 | <div class="uk-panel uk-panel-box uk-panel-box-secondary"> |
| 18 | <h5 class="title"> | 18 | <h5 class="title"> |
| 19 | {{t.fcsjActual}} {{t.clZbh}} 已由 {{t.qdzName}} 发出,执行班次 {{t.dfsj}} | 19 | {{t.fcsjActual}} {{t.clZbh}} 已由 {{t.qdzName}} 发出,执行班次 {{t.dfsj}} |
| @@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
| 26 | </script> | 26 | </script> |
| 27 | 27 | ||
| 28 | <script id="sys-note-42_1-temp" type="text/html"> | 28 | <script id="sys-note-42_1-temp" type="text/html"> |
| 29 | - <div class="uk-width-medium-1-1 sys-note-42 sys-mail-item" id="{{domId}}"> | 29 | + <div class="uk-width-medium-1-1 sys-note-42 sys-mail-item" id="{{domId}}" data-id="{{t.id}}"> |
| 30 | <div class="uk-panel uk-panel-box uk-panel-box-secondary"> | 30 | <div class="uk-panel uk-panel-box uk-panel-box-secondary"> |
| 31 | <h5 class="title"> | 31 | <h5 class="title"> |
| 32 | {{t.zdsjActual}} {{t.clZbh}} 到达 {{t.zdzName}};已完成 {{finish}} 个班次; | 32 | {{t.zdsjActual}} {{t.clZbh}} 到达 {{t.zdzName}};已完成 {{finish}} 个班次; |
src/main/resources/static/real_control_v2/fragments/north/nav/all_devices.html
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch/edit.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="history-sch-edit-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 900px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>历史班次编辑</h2></div> | ||
| 6 | + <form class="uk-form uk-form-horizontal"> | ||
| 7 | + </form> | ||
| 8 | + </div> | ||
| 9 | + | ||
| 10 | + <script id="history-sch-edit-form-temp" type="text/html"> | ||
| 11 | + <input type="hidden" name="id" value="{{id}}"/> | ||
| 12 | + | ||
| 13 | + <div class="uk-grid"> | ||
| 14 | + <div class="uk-width-1-3"> | ||
| 15 | + <div class="uk-form-row"> | ||
| 16 | + <label class="uk-form-label" >班次类型</label> | ||
| 17 | + <div class="uk-form-controls"> | ||
| 18 | + <select class="form-control nt-dictionary" disabled data-code="{{bcType}}" name="bcType" data-group=ScheduleType></select> | ||
| 19 | + </div> | ||
| 20 | + </div> | ||
| 21 | + </div> | ||
| 22 | + <div class="uk-width-1-3"> | ||
| 23 | + <div class="uk-form-row"> | ||
| 24 | + <label class="uk-form-label" >起点</label> | ||
| 25 | + <div class="uk-form-controls"> | ||
| 26 | + <input type="text" value="{{qdzName}}" disabled> | ||
| 27 | + </div> | ||
| 28 | + </div> | ||
| 29 | + </div> | ||
| 30 | + <div class="uk-width-1-3"> | ||
| 31 | + <div class="uk-form-row"> | ||
| 32 | + <label class="uk-form-label" >终点</label> | ||
| 33 | + <div class="uk-form-controls"> | ||
| 34 | + <input type="text" value="{{zdzName}}" disabled> | ||
| 35 | + </div> | ||
| 36 | + </div> | ||
| 37 | + </div> | ||
| 38 | + </div> | ||
| 39 | + | ||
| 40 | + <div class="uk-grid"> | ||
| 41 | + <div class="uk-width-1-3"> | ||
| 42 | + <div class="uk-form-row"> | ||
| 43 | + <label class="uk-form-label" >车辆</label> | ||
| 44 | + <div class="uk-form-controls"> | ||
| 45 | + <div class="uk-autocomplete uk-form car-autocom"> | ||
| 46 | + <input type="text" value="{{clZbh}}" name="clZbh" required> | ||
| 47 | + </div> | ||
| 48 | + </div> | ||
| 49 | + </div> | ||
| 50 | + </div> | ||
| 51 | + <div class="uk-width-1-3"> | ||
| 52 | + <div class="uk-form-row"> | ||
| 53 | + <label class="uk-form-label" >驾驶员</label> | ||
| 54 | + <div class="uk-form-controls"> | ||
| 55 | + <div class="uk-autocomplete uk-form jsy-autocom"> | ||
| 56 | + <input type="text" value="{{jGh}}/{{jName}}" name="jsy" required> | ||
| 57 | + </div> | ||
| 58 | + </div> | ||
| 59 | + </div> | ||
| 60 | + </div> | ||
| 61 | + </div> | ||
| 62 | + | ||
| 63 | + <div class="uk-grid"> | ||
| 64 | + <div class="uk-width-1-3"> | ||
| 65 | + <div class="uk-form-row"> | ||
| 66 | + <label class="uk-form-label" >计发</label> | ||
| 67 | + <div class="uk-form-controls"> | ||
| 68 | + <input type="text" value="{{fcsj}}" disabled> | ||
| 69 | + </div> | ||
| 70 | + </div> | ||
| 71 | + </div> | ||
| 72 | + <div class="uk-width-1-3"> | ||
| 73 | + <div class="uk-form-row"> | ||
| 74 | + <label class="uk-form-label" >待发</label> | ||
| 75 | + <div class="uk-form-controls"> | ||
| 76 | + <input type="text" name="dfsj" value="{{dfsj}}" required> | ||
| 77 | + </div> | ||
| 78 | + </div> | ||
| 79 | + </div> | ||
| 80 | + <div class="uk-width-1-3"> | ||
| 81 | + <div class="uk-form-row"> | ||
| 82 | + <label class="uk-form-label" >实发</label> | ||
| 83 | + <div class="uk-form-controls"> | ||
| 84 | + <input type="text" name="fcsjActual" value="{{fcsjActual}}" > | ||
| 85 | + </div> | ||
| 86 | + </div> | ||
| 87 | + </div> | ||
| 88 | + </div> | ||
| 89 | + | ||
| 90 | + <div class="uk-grid"> | ||
| 91 | + <div class="uk-width-1-3"> | ||
| 92 | + <div class="uk-form-row"> | ||
| 93 | + <label class="uk-form-label" >计划里程</label> | ||
| 94 | + <div class="uk-form-controls"> | ||
| 95 | + <input type="text" value="{{jhlc}}" disabled> | ||
| 96 | + </div> | ||
| 97 | + </div> | ||
| 98 | + </div> | ||
| 99 | + <div class="uk-width-1-3"> | ||
| 100 | + <div class="uk-form-row"> | ||
| 101 | + <label class="uk-form-label" >计划终点</label> | ||
| 102 | + <div class="uk-form-controls"> | ||
| 103 | + <input type="text" value="{{zdsj}}" disabled> | ||
| 104 | + </div> | ||
| 105 | + </div> | ||
| 106 | + </div> | ||
| 107 | + <div class="uk-width-1-3"> | ||
| 108 | + <div class="uk-form-row"> | ||
| 109 | + <label class="uk-form-label" >实际终点</label> | ||
| 110 | + <div class="uk-form-controls"> | ||
| 111 | + <input type="text" name="zdsjActual" value="{{zdsjActual}}" > | ||
| 112 | + </div> | ||
| 113 | + </div> | ||
| 114 | + </div> | ||
| 115 | + </div> | ||
| 116 | + | ||
| 117 | + <div class="uk-grid"> | ||
| 118 | + <div class="uk-width-1-1"> | ||
| 119 | + <div class="uk-form-row ct-stacked"> | ||
| 120 | + <label class="uk-form-label" >备注</label> | ||
| 121 | + <div class="uk-form-controls" style="margin-top: 5px;"> | ||
| 122 | + <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-stringlength="true" data-fv-stringlength-max="100" placeholder="备注">{{remarks}}</textarea> | ||
| 123 | + </div> | ||
| 124 | + </div> | ||
| 125 | + </div> | ||
| 126 | + </div> | ||
| 127 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | ||
| 128 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 129 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | ||
| 130 | + </div> | ||
| 131 | + </script> | ||
| 132 | + | ||
| 133 | + <script> | ||
| 134 | + (function() { | ||
| 135 | + var modal = '#history-sch-edit-modal' | ||
| 136 | + ,sch,parentModal; | ||
| 137 | + $(modal).on('init', function(e, data) { | ||
| 138 | + var id = data.id; | ||
| 139 | + parentModal=data.parentModal; | ||
| 140 | + | ||
| 141 | + $.get('/realSchedule/'+id, function (sch) { | ||
| 142 | + var htmlStr = template('history-sch-edit-form-temp', sch); | ||
| 143 | + $('form', modal).html(htmlStr); | ||
| 144 | + | ||
| 145 | + //字典转换 | ||
| 146 | + dictionaryUtils.transformDom($('.nt-dictionary', modal)); | ||
| 147 | + | ||
| 148 | + //----------- Autocomplete -------------- | ||
| 149 | + $.get('/basic/cars', function(rs) { | ||
| 150 | + //车辆 | ||
| 151 | + gb_common.carAutocomplete($('.car-autocom', modal), rs); | ||
| 152 | + }); | ||
| 153 | + $.get('/basic/all_personnel', function(rs) { | ||
| 154 | + //驾驶员 | ||
| 155 | + gb_common.personAutocomplete($('.jsy-autocom', modal), rs); | ||
| 156 | + //售票员 | ||
| 157 | + gb_common.personAutocomplete($('.spy-autocom', modal), rs); | ||
| 158 | + }); | ||
| 159 | + | ||
| 160 | + | ||
| 161 | + //submit | ||
| 162 | + var f = $('form', modal).formValidation(gb_form_validation_opts); | ||
| 163 | + f.on('success.form.fv', function(e) { | ||
| 164 | + e.preventDefault(); | ||
| 165 | + var data = $(this).serializeJSON(); | ||
| 166 | + | ||
| 167 | + //拆分驾驶员工号和姓名 | ||
| 168 | + data.jGh = data.jsy.split('/')[0]; | ||
| 169 | + data.jName = data.jsy.split('/')[1]; | ||
| 170 | + delete data.jsy; | ||
| 171 | + //拆分售票员工号和姓名 | ||
| 172 | + if(data.sGh != null){ | ||
| 173 | + data.sGh = data.spy.split('/')[0]; | ||
| 174 | + data.sName = data.spy.split('/')[1]; | ||
| 175 | + delete data.spy; | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + gb_common.$post('/realSchedule/history', data, function (rs) { | ||
| 179 | + //console.log(rs); | ||
| 180 | + UIkit.modal(modal).hide(); | ||
| 181 | + $(parentModal).trigger('refresh'); | ||
| 182 | + }); | ||
| 183 | + }); | ||
| 184 | + }); | ||
| 185 | + }); | ||
| 186 | + })(); | ||
| 187 | + </script> | ||
| 188 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch_maintain.html
0 → 100644
| 1 | +<div class="uk-modal" id="history-sch-maintain-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 1180px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <h2>历史班次维护</h2> | ||
| 5 | + | ||
| 6 | + <div style="padding-left: 12px;margin: 20px 0"> | ||
| 7 | + <ul class="uk-subnav uk-subnav-pill h-s-time"> | ||
| 8 | + </ul> | ||
| 9 | + </div> | ||
| 10 | + | ||
| 11 | + <div style="padding-left: 12px;"> | ||
| 12 | + <ul class="uk-subnav uk-subnav-pill h-s-line"> | ||
| 13 | + </ul> | ||
| 14 | + </div> | ||
| 15 | + | ||
| 16 | + <div class="uk-panel uk-panel-box uk-panel-box-primary"> | ||
| 17 | + <form class="uk-form search-form"> | ||
| 18 | + <fieldset data-uk-margin> | ||
| 19 | + <span class="horizontal-field">上下行</span> | ||
| 20 | + <select name="xlDir_eq"> | ||
| 21 | + <option value="">全部</option> | ||
| 22 | + <option value="0">上行</option> | ||
| 23 | + <option value="1">下行</option> | ||
| 24 | + </select> | ||
| 25 | + | ||
| 26 | + <span class="horizontal-field">车辆</span> | ||
| 27 | + <div class="uk-autocomplete uk-form autocomplete-cars"> | ||
| 28 | + <input type="text" name="clZbh_like" placeholder="车辆自编号"> | ||
| 29 | + </div> | ||
| 30 | + <span class="horizontal-field">驾驶员</span> | ||
| 31 | + <div class="uk-autocomplete uk-form autocomplete-jsy"> | ||
| 32 | + <input type="text" name="jGh_like" placeholder="驾驶员"> | ||
| 33 | + </div> | ||
| 34 | + <button class="uk-button">检索</button> | ||
| 35 | + </fieldset> | ||
| 36 | + </form> | ||
| 37 | + </div> | ||
| 38 | + | ||
| 39 | + <div class="ct_table_wrap ct_table_no_border history-sch-wrap" style="height: 510px;"> | ||
| 40 | + <div class="ct_table history-sch-table"> | ||
| 41 | + <div class="ct_table_head"> | ||
| 42 | + <dl> | ||
| 43 | + <dt>车辆</dt> | ||
| 44 | + <dt>驾驶员</dt> | ||
| 45 | + <dt>起点</dt> | ||
| 46 | + <dt>终点</dt> | ||
| 47 | + <dt>计发</dt> | ||
| 48 | + <dt>待发</dt> | ||
| 49 | + <dt>实发</dt> | ||
| 50 | + <dt>终点时间</dt> | ||
| 51 | + <dt>备注</dt> | ||
| 52 | + </dl> | ||
| 53 | + </div> | ||
| 54 | + <div class="ct_table_body"> | ||
| 55 | + </div> | ||
| 56 | + </div> | ||
| 57 | + </div> | ||
| 58 | + <div class="uk-modal-footer uk-text-right pagination-wrap"> | ||
| 59 | + </div> | ||
| 60 | + | ||
| 61 | + <div class="load-panel"> | ||
| 62 | + <i class="uk-icon-spinner uk-icon-spin"></i> | ||
| 63 | + 正在加载数据 | ||
| 64 | + </div> | ||
| 65 | + </div> | ||
| 66 | + | ||
| 67 | + <script id="history-sch-maintain-table-temp" type="text/html"> | ||
| 68 | + {{each list as sch i}} | ||
| 69 | + <dl data-id="{{sch.id}}"> | ||
| 70 | + <dd>{{sch.clZbh}}</dd> | ||
| 71 | + <dd>{{sch.jGh}}/{{sch.jName}}</dd> | ||
| 72 | + <dd title="{{sch.qdzName}}">{{sch.qdzName}}</dd> | ||
| 73 | + <dd title="{{sch.zdzName}}">{{sch.zdzName}}</dd> | ||
| 74 | + <dd>{{sch.fcsj}} | ||
| 75 | + {{if sch.bcType == "out"}} | ||
| 76 | + <span class="uk-badge uk-badge-success">出场</span> | ||
| 77 | + {{else if sch.bcType == "in"}} | ||
| 78 | + <span class="uk-badge uk-badge-warning">进场</span> | ||
| 79 | + {{else if sch.bcType == "venting"}} | ||
| 80 | + <span class="uk-badge uk-badge-danger">直放</span> | ||
| 81 | + {{else if sch.bcType == "major"}} | ||
| 82 | + <span class="uk-badge uk-badge-danger">放站</span> | ||
| 83 | + {{/if}} | ||
| 84 | + {{if sch.sflj}} | ||
| 85 | + <span class="uk-badge uk-badge-danger">临加</span> | ||
| 86 | + {{/if}} | ||
| 87 | + {{if sch.cTasks.length > 0}} | ||
| 88 | + <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> | ||
| 89 | + {{/if}}</dd> | ||
| 90 | + <dd>{{sch.dfsj}}</dd> | ||
| 91 | + <dd>{{sch.fcsjActual}}</dd> | ||
| 92 | + <dd>{{sch.zdsjActual}}</dd> | ||
| 93 | + <dd title="{{sch.remarks}}">{{sch.remarks}}</dd> | ||
| 94 | + </dl> | ||
| 95 | + {{/each}} | ||
| 96 | + </script> | ||
| 97 | + | ||
| 98 | + <script> | ||
| 99 | + (function () { | ||
| 100 | + var modal = '#history-sch-maintain-modal'; | ||
| 101 | + $(modal).on('init', function (e, data) { | ||
| 102 | + $.get('/realSchedule/dateArray', function (rs) { | ||
| 103 | + //日期tab | ||
| 104 | + var tsStr = ''; | ||
| 105 | + $.each(rs, function (i) { | ||
| 106 | + tsStr += '<li ' + (i == 0 ? 'class="uk-active"' : '') + '><a>' + this + '</a></li>'; | ||
| 107 | + }); | ||
| 108 | + $('.h-s-time', modal).html(tsStr); | ||
| 109 | + | ||
| 110 | + //线路tab | ||
| 111 | + var xlStr = ''; | ||
| 112 | + $.each(gb_data_basic.activeLines, function (i) { | ||
| 113 | + xlStr += '<li ' + (i == 0 ? 'class="uk-active"' : '') + ' data-id="' + this.lineCode + '"><a>' + this.name + '</a></li>'; | ||
| 114 | + }); | ||
| 115 | + $('.h-s-line', modal).html(xlStr); | ||
| 116 | + | ||
| 117 | + | ||
| 118 | + jsQuery(); | ||
| 119 | + }); | ||
| 120 | + }); | ||
| 121 | + | ||
| 122 | + $(modal).on('refresh', jsQuery); | ||
| 123 | + | ||
| 124 | + $(modal).on('click', '.h-s-time li,.h-s-line li', function () { | ||
| 125 | + if(loading) | ||
| 126 | + return; | ||
| 127 | + $(this).parent().find('li.uk-active').removeClass('uk-active'); | ||
| 128 | + $(this).addClass('uk-active'); | ||
| 129 | + jsQuery(); | ||
| 130 | + }); | ||
| 131 | + | ||
| 132 | + $('.search-form', modal).on('submit', function (e) { | ||
| 133 | + try { | ||
| 134 | + jsQuery(); | ||
| 135 | + }catch(e){ | ||
| 136 | + console.log(e); | ||
| 137 | + } | ||
| 138 | + return false; | ||
| 139 | + }); | ||
| 140 | + | ||
| 141 | + var nbbmArray=[],jsyArray=[],loading; | ||
| 142 | + function jsQuery() { | ||
| 143 | + var data = $('.search-form', modal).serializeJSON(); | ||
| 144 | + var rq = $('.h-s-time li.uk-active', modal).text(), | ||
| 145 | + lineCode = $('.h-s-line li.uk-active', modal).data('id'); | ||
| 146 | + data.scheduleDateStr_eq = rq; | ||
| 147 | + data.xlBm_eq = lineCode; | ||
| 148 | + if(data.jGh_like.indexOf('/')!=-1){ | ||
| 149 | + var jsy=data.jGh_like.split('/'); | ||
| 150 | + data.jGh_like=jsy[0]; | ||
| 151 | + data.jName_like=jsy[1]; | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + $('.load-panel', modal).show(); | ||
| 155 | + loading=true; | ||
| 156 | + $.get('/realSchedule/all', data, function (rs) { | ||
| 157 | + rs.sort(schedule_sort); | ||
| 158 | + var tbodyStr = template('history-sch-maintain-table-temp', {list: rs}); | ||
| 159 | + $('.history-sch-table .ct_table_body', modal).html(tbodyStr); | ||
| 160 | + | ||
| 161 | + //可搜索的车辆自编号和驾驶员 | ||
| 162 | + nbbmArray=[]; | ||
| 163 | + jsyArray=[]; | ||
| 164 | + $.each(rs, function () { | ||
| 165 | + nbbmArray.push({value: this.clZbh}); | ||
| 166 | + jsyArray.push({value: this.jGh+'/'+this.jName, | ||
| 167 | + fullChars: pinyin.getFullChars(this.jName).toUpperCase(), | ||
| 168 | + camelChars: pinyin.getCamelChars(this.jName)}); | ||
| 169 | + }); | ||
| 170 | + //value | ||
| 171 | + nbbmArray=distinctByField(nbbmArray); | ||
| 172 | + jsyArray=distinctByField(jsyArray); | ||
| 173 | + $('.load-panel', modal).hide(); | ||
| 174 | + loading=false; | ||
| 175 | + | ||
| 176 | + }); | ||
| 177 | + } | ||
| 178 | + | ||
| 179 | + //nbbm autocomplete | ||
| 180 | + var carAutoCom=$('.autocomplete-cars', modal); | ||
| 181 | + UIkit.autocomplete(carAutoCom, { | ||
| 182 | + minLength: 1, | ||
| 183 | + delay: 50, | ||
| 184 | + source: function(release) { | ||
| 185 | + var q = $('input', carAutoCom).val().toUpperCase() | ||
| 186 | + ,rs = [], | ||
| 187 | + count = 0; | ||
| 188 | + $.each(nbbmArray, function () { | ||
| 189 | + if(this.value.indexOf(q) != -1){ | ||
| 190 | + rs.push(this); | ||
| 191 | + count++; | ||
| 192 | + } | ||
| 193 | + }); | ||
| 194 | + release && release(rs); | ||
| 195 | + } | ||
| 196 | + }); | ||
| 197 | + | ||
| 198 | + //jsy autocomplete | ||
| 199 | + var jsyAutoCom=$('.autocomplete-jsy', modal); | ||
| 200 | + UIkit.autocomplete(jsyAutoCom, { | ||
| 201 | + minLength: 1, | ||
| 202 | + delay: 50, | ||
| 203 | + source: function(release) { | ||
| 204 | + var q = $('input', jsyAutoCom).val().toUpperCase() | ||
| 205 | + ,rs = [], | ||
| 206 | + count = 0; | ||
| 207 | + | ||
| 208 | + $.each(jsyArray, function() { | ||
| 209 | + if (this.value.indexOf(q) != -1 || this.fullChars.indexOf(q) != -1 || this.camelChars.indexOf(q) != -1){ | ||
| 210 | + rs.push(this); | ||
| 211 | + count++; | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + if (count >= 10) | ||
| 215 | + return false; | ||
| 216 | + }); | ||
| 217 | + release && release(rs); | ||
| 218 | + } | ||
| 219 | + }); | ||
| 220 | + | ||
| 221 | + function schedule_sort(s1, s2) { | ||
| 222 | + return (s1.realExecDate+s1.dfsj).localeCompare(s2.realExecDate+s2.dfsj); | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + function distinctByField(arr, f){ | ||
| 226 | + if(!f) | ||
| 227 | + f = 'value'; | ||
| 228 | + var rs = {}; | ||
| 229 | + $.each(arr, function () { | ||
| 230 | + rs[this[f]]=this; | ||
| 231 | + }); | ||
| 232 | + return gb_common.get_vals(rs); | ||
| 233 | + } | ||
| 234 | + | ||
| 235 | + gb_ct_table.fixedHead($('.ct_table_wrap', modal)); | ||
| 236 | + | ||
| 237 | + //班次点击 | ||
| 238 | + $(modal).on('click contextmenu', '.history-sch-table .ct_table_body dl', function() { | ||
| 239 | + $(this).parent().find('.active').removeClass('active'); | ||
| 240 | + $(this).addClass('active'); | ||
| 241 | + }); | ||
| 242 | + | ||
| 243 | + var callbackHandler={ | ||
| 244 | + edit: function(id){ | ||
| 245 | + open_modal('/real_control_v2/fragments/north/nav/history_sch/edit.html', {id: id, parentModal: modal}, {center: false,bgclose: false, modal: false}); | ||
| 246 | + } | ||
| 247 | + } | ||
| 248 | + | ||
| 249 | + //右键菜单 | ||
| 250 | + $.contextMenu({ | ||
| 251 | + selector: modal+' .history-sch-table .ct_table_body dl', | ||
| 252 | + className: 'schedule-ct-menu', | ||
| 253 | + callback: function(key, options) { | ||
| 254 | + var id = $('.context-menu-active', modal).data('id'); | ||
| 255 | + callbackHandler[key] && callbackHandler[key](id); | ||
| 256 | + }, | ||
| 257 | + items: { | ||
| 258 | + 'edit': { | ||
| 259 | + name: '编辑' | ||
| 260 | + }, | ||
| 261 | + 'child_task':{ | ||
| 262 | + name: '子任务', | ||
| 263 | + disabled: true | ||
| 264 | + }, | ||
| 265 | + 'add': { | ||
| 266 | + name: '新增', | ||
| 267 | + disabled: true | ||
| 268 | + }, | ||
| 269 | + 'delete':{ | ||
| 270 | + name: '删除', | ||
| 271 | + disabled: true | ||
| 272 | + } | ||
| 273 | + } | ||
| 274 | + }); | ||
| 275 | + })(); | ||
| 276 | + </script> | ||
| 277 | +</div> |
src/main/resources/static/real_control_v2/js/data/json/north_toolbar.json
| @@ -47,12 +47,6 @@ | @@ -47,12 +47,6 @@ | ||
| 47 | "icon": "uk-icon-pie-chart" | 47 | "icon": "uk-icon-pie-chart" |
| 48 | }, | 48 | }, |
| 49 | { | 49 | { |
| 50 | - "id": 1.7, | ||
| 51 | - "text": "车辆首末班准点率", | ||
| 52 | - "event": "s_e_punctuality_rate", | ||
| 53 | - "icon": "uk-icon-pie-chart" | ||
| 54 | - }, | ||
| 55 | - { | ||
| 56 | "id": 1.8, | 50 | "id": 1.8, |
| 57 | "divider": true | 51 | "divider": true |
| 58 | }, | 52 | }, |
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
| @@ -93,6 +93,27 @@ var gb_schedule_context_menu = (function() { | @@ -93,6 +93,27 @@ var gb_schedule_context_menu = (function() { | ||
| 93 | notify_err('发送指令失败'); | 93 | notify_err('发送指令失败'); |
| 94 | }); | 94 | }); |
| 95 | }, '确定下发指令'); | 95 | }, '确定下发指令'); |
| 96 | + }, | ||
| 97 | + jgtz: function (schArray) { | ||
| 98 | + var idArr=[]; | ||
| 99 | + $.each(schArray, function(){ | ||
| 100 | + idArr.push(this.id); | ||
| 101 | + }); | ||
| 102 | + var elem = UIkit.modal.prompt('请输入间隔(分钟)',0, function(newValue) { | ||
| 103 | + if (!isNaN(newValue) && newValue>0) { | ||
| 104 | + gb_common.$post_arr('/realSchedule/spaceAdjust', {ids: idArr, space: newValue}, function (rs) { | ||
| 105 | + //刷新数据 | ||
| 106 | + gb_schedule_table.updateSchedule(rs.ts); | ||
| 107 | + notify_succ('调整间隔成功!'); | ||
| 108 | + }); | ||
| 109 | + } else | ||
| 110 | + notify_err('不合理的间隔时间!'); | ||
| 111 | + }, { | ||
| 112 | + labels: { | ||
| 113 | + Ok: '确定调整', | ||
| 114 | + Cancel: '取消' | ||
| 115 | + } | ||
| 116 | + }); | ||
| 96 | } | 117 | } |
| 97 | }; | 118 | }; |
| 98 | 119 | ||
| @@ -162,8 +183,7 @@ var gb_schedule_context_menu = (function() { | @@ -162,8 +183,7 @@ var gb_schedule_context_menu = (function() { | ||
| 162 | name: '待发调整' | 183 | name: '待发调整' |
| 163 | }, | 184 | }, |
| 164 | 'jgtz': { | 185 | 'jgtz': { |
| 165 | - name: '间隔调整', | ||
| 166 | - disabled:true | 186 | + name: '间隔调整' |
| 167 | }, | 187 | }, |
| 168 | 'multi_tzrc': { | 188 | 'multi_tzrc': { |
| 169 | name: '调整人车' | 189 | name: '调整人车' |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| @@ -168,7 +168,7 @@ var gb_schedule_table = (function() { | @@ -168,7 +168,7 @@ var gb_schedule_table = (function() { | ||
| 168 | 168 | ||
| 169 | //计发时间 | 169 | //计发时间 |
| 170 | $(dds[5]).replaceWith(temps['line-schedule-fcsj-temp'](sch)); | 170 | $(dds[5]).replaceWith(temps['line-schedule-fcsj-temp'](sch)); |
| 171 | - $(dds[6]).data('sort-val', sch.dfsjT).attr('dbclick-val', sch.dfsj).html(sch.dfsj); | 171 | + $(dds[6]).attr('data-sort-val', sch.dfsjT).attr('dbclick-val', sch.dfsj).html(sch.dfsj); |
| 172 | 172 | ||
| 173 | //实发时间 | 173 | //实发时间 |
| 174 | calc_sch_real_shift(sch); | 174 | calc_sch_real_shift(sch); |
src/main/resources/static/real_control_v2/js/north/toolbar.js
| @@ -62,6 +62,9 @@ var gb_northToolbar = (function() { | @@ -62,6 +62,9 @@ var gb_northToolbar = (function() { | ||
| 62 | }, | 62 | }, |
| 63 | s_e_punctuality_rate_line: function () { | 63 | s_e_punctuality_rate_line: function () { |
| 64 | open_modal('/real_control_v2/fragments/north/nav/charts/s_e_punctuality_rate_line.html', {}, modal_opts); | 64 | open_modal('/real_control_v2/fragments/north/nav/charts/s_e_punctuality_rate_line.html', {}, modal_opts); |
| 65 | + }, | ||
| 66 | + history_sch_maintain: function () { | ||
| 67 | + open_modal('/real_control_v2/fragments/north/nav/history_sch_maintain.html', {}, {center: false,bgclose: false}); | ||
| 65 | } | 68 | } |
| 66 | } | 69 | } |
| 67 | })(); | 70 | })(); |
src/main/resources/static/real_control_v2/js/websocket/sch_websocket.js
| @@ -163,7 +163,8 @@ var gb_sch_websocket = (function () { | @@ -163,7 +163,8 @@ var gb_sch_websocket = (function () { | ||
| 163 | 163 | ||
| 164 | 164 | ||
| 165 | //42确定 | 165 | //42确定 |
| 166 | - $(document).on('click', '.sys-mailbox .sys-note-42 .uk-button-primary', function () { | 166 | + $(document).on('click', '.sys-mailbox .sys-note-42 .uk-button-primary', function (e) { |
| 167 | + e.stopPropagation(); | ||
| 167 | $(this).parents('.sys-note-42').remove(); | 168 | $(this).parents('.sys-note-42').remove(); |
| 168 | 169 | ||
| 169 | var size = $(this).parents('.sys-mailbox').find('.sys-mail-item').length | 170 | var size = $(this).parents('.sys-mailbox').find('.sys-mail-item').length |
| @@ -172,6 +173,11 @@ var gb_sch_websocket = (function () { | @@ -172,6 +173,11 @@ var gb_sch_websocket = (function () { | ||
| 172 | $('#badge_untreated_num_' + lineCode).text(size); | 173 | $('#badge_untreated_num_' + lineCode).text(size); |
| 173 | }); | 174 | }); |
| 174 | 175 | ||
| 176 | + //42消息点击 | ||
| 177 | + $(document).on('click', '.sys-mailbox .sys-note-42', function () { | ||
| 178 | + alert($(this).data('id')); | ||
| 179 | + }); | ||
| 180 | + | ||
| 175 | //80同意 | 181 | //80同意 |
| 176 | $(document).on('click', '.sys-mailbox .sys-note-80 .uk-button-primary', function () { | 182 | $(document).on('click', '.sys-mailbox .sys-note-80 .uk-button-primary', function () { |
| 177 | var panel = $(this).parents('.sys-note-80') | 183 | var panel = $(this).parents('.sys-note-80') |
src/main/resources/static/real_control_v2/main.html
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" /> | 9 | <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" /> |
| 10 | <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" /> | 10 | <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" /> |
| 11 | <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" /> | 11 | <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" /> |
| 12 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slider.gradient.min.css" /> | ||
| 12 | 13 | ||
| 13 | <!-- main style --> | 14 | <!-- main style --> |
| 14 | <link rel="stylesheet" href="/real_control_v2/css/main.css" /> | 15 | <link rel="stylesheet" href="/real_control_v2/css/main.css" /> |
| @@ -80,6 +81,7 @@ | @@ -80,6 +81,7 @@ | ||
| 80 | <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js"></script> | 81 | <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js"></script> |
| 81 | <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js"></script> | 82 | <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js"></script> |
| 82 | <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js"></script> | 83 | <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js"></script> |
| 84 | + <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/slider.min.js"></script> | ||
| 83 | <!-- jquery contextMenu --> | 85 | <!-- jquery contextMenu --> |
| 84 | <script src="/real_control_v2/assets/js/jquery.contextMenu.min.js"></script> | 86 | <script src="/real_control_v2/assets/js/jquery.contextMenu.min.js"></script> |
| 85 | <script src="/real_control_v2/assets/js/jquery.ui.position.min.js"></script> | 87 | <script src="/real_control_v2/assets/js/jquery.ui.position.min.js"></script> |