Commit a1875c5267ecbb3003fd17155a063021a23d2d98

Authored by 廖磊
1 parent 6e93dfe8

1226 提交

src/main/java/com/bsth/controller/oil/YlbController.java
... ... @@ -3,7 +3,9 @@ package com.bsth.controller.oil;
3 3 import java.text.ParseException;
4 4 import java.text.SimpleDateFormat;
5 5 import java.util.ArrayList;
  6 +import java.util.Calendar;
6 7 import java.util.Date;
  8 +import java.util.GregorianCalendar;
7 9 import java.util.HashMap;
8 10 import java.util.Iterator;
9 11 import java.util.List;
... ... @@ -107,8 +109,16 @@ public class YlbController extends BaseController<Ylb, Integer>{
107 109 try {
108 110 String rq=map.get("rq").toString();
109 111 if(!(rq=="")){
  112 +
110 113 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
111   - map.put("rq_eq", sdf.parse(rq));
  114 + Calendar calendar = new GregorianCalendar();
  115 + calendar.setTime(sdf.parse(rq));
  116 + calendar.add(calendar.DATE,1);
  117 + Date date=calendar.getTime();
  118 + map.put("rq_ge", rq);
  119 + map.put("rq_le", sdf.format(date));
  120 + System.out.println(rq);
  121 + System.out.println(sdf.format(date));
112 122 }
113 123 } catch (ParseException e) {
114 124 // TODO Auto-generated catch block
... ...
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -292,8 +292,9 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo,
292 292 }
293 293  
294 294 @RequestMapping(value = "/queryUserInfo")
295   - public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line, @RequestParam String date) {
296   - return scheduleRealInfoService.queryUserInfo(line, date);
  295 + public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line,
  296 + @RequestParam String date,@RequestParam String state) {
  297 + return scheduleRealInfoService.queryUserInfo(line, date,state);
297 298 }
298 299  
299 300 @RequestMapping(value = "/exportWaybill")
... ...
src/main/java/com/bsth/controller/report/ReportController.java
... ... @@ -50,23 +50,28 @@ public class ReportController {
50 50 }
51 51  
52 52 @RequestMapping(value = "/tbodyTime1", method = RequestMethod.GET)
53   - public Map<String, Object> tbodyTime1(@RequestParam String line,@RequestParam String date) {
54   - return service.tbodyTime1(line, date);
  53 + public Map<String, Object> tbodyTime1(@RequestParam String line,@RequestParam String ttinfo) {
  54 + return service.tbodyTime1(line, ttinfo);
55 55 }
56 56  
57 57 @RequestMapping(value = "/tbodyTime2", method = RequestMethod.GET)
58   - public Map<String, Object> tbodyTime2(@RequestParam String line,@RequestParam String date) {
59   - return service.tbodyTime2(line, date);
  58 + public Map<String, Object> tbodyTime2(@RequestParam String line,@RequestParam String ttinfo) {
  59 + return service.tbodyTime2(line, ttinfo);
60 60 }
61 61  
62 62 @RequestMapping(value = "/tbodyTime3", method = RequestMethod.GET)
63   - public List<Map<String, Object>> tbodyTime3(@RequestParam String line,@RequestParam String date) {
64   - return service.tbodyTime3(line, date);
  63 + public List<Map<String, Object>> tbodyTime3(@RequestParam String line,@RequestParam String ttinfo) {
  64 + return service.tbodyTime3(line, ttinfo);
65 65 }
66 66  
67 67 @RequestMapping(value = "/tbodyTime5", method = RequestMethod.GET)
68   - public List<Map<String, Object>> tbodyTime5(@RequestParam String line,@RequestParam String date) {
69   - return service.tbodyTime5(line, date);
  68 + public List<Map<String, Object>> tbodyTime5(@RequestParam String line,@RequestParam String ttinfo) {
  69 + return service.tbodyTime5(line, ttinfo);
  70 + }
  71 +
  72 + @RequestMapping(value="/getTtinfo", method = RequestMethod.GET)
  73 + public List<Map<String,Object>> getTtinfo(@RequestParam Map<String, Object> map){
  74 + return service.getTtinfo(map);
70 75 }
71 76  
72 77 }
... ...
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
... ... @@ -67,7 +67,7 @@ public class GpsRealData implements CommandLineRunner{
67 67 @Override
68 68 public void run(String... arg0) throws Exception {
69 69 logger.info("gpsDataLoader,20,6");
70   - Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 5, TimeUnit.SECONDS);
  70 + //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 5, TimeUnit.SECONDS);
71 71 }
72 72  
73 73 public GpsEntity add(GpsEntity gps) {
... ...
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
... ... @@ -24,6 +24,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
24 24 @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName order by (lpName+1)")
25 25 List<ScheduleRealInfo> queryUserInfo2(String line,String date);
26 26  
  27 + @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName order by (lpName+1)")
  28 + List<ScheduleRealInfo> queryUserInfo3(String line,String date);
  29 +
27 30 @Query(value="select s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 order by bcs")
28 31 List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName);
29 32  
... ...
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
... ... @@ -131,6 +131,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
131 131 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
132 132 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
133 133 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
  134 + t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
134 135 t.setRq(dBefore);
135 136 repository.save(t);
136 137 result = "success";
... ... @@ -216,6 +217,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
216 217 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
217 218 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
218 219 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
  220 + t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
219 221 t.setRq(sdf.parse(rq));
220 222 repository.save(t);
221 223 newMap.put("status", ResponseCode.SUCCESS);
... ...
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
... ... @@ -59,7 +59,7 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
59 59 */
60 60 void adjustConductor(ScheduleRealInfo schedule, String conductor, String conductorName);
61 61  
62   - List<ScheduleRealInfo> queryUserInfo(String line,String date);
  62 + List<ScheduleRealInfo> queryUserInfo(String line,String date,String state);
63 63  
64 64 List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName,String date);
65 65  
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -459,8 +459,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
459 459 }
460 460  
461 461 @Override
462   - public List<ScheduleRealInfo> queryUserInfo(String line, String date) {
463   - return scheduleRealInfoRepository.queryUserInfo2(line, date);
  462 + public List<ScheduleRealInfo> queryUserInfo(String line, String date,String state) {
  463 + if(state.equals("2")){
  464 + return scheduleRealInfoRepository.queryUserInfo2(line, date);
  465 + }else{
  466 + return scheduleRealInfoRepository.queryUserInfo3(line, date);
  467 + }
  468 +
464 469 }
465 470 /**
466 471 *
... ... @@ -613,13 +618,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
613 618  
614 619 @Override
615 620 public List<Object[]> historyMessage(String line, String date, String code) {
616   -
617   - String sql="select t.car_code,d.sender,d.txt_content,d.timestamp from ("
618   - + " select equipment_code,car_code from bsth_c_cars where id in("
619   - + " select cl from bsth_c_s_ccinfo where xl in ( "
620   - + " select id from bsth_c_line where line_code=?1 ))) t"
621   - + " left join bsth_v_directive_60 d on t.equipment_code=d.device_id "
622   - + " where d.timestamp >=?2 and d.timestamp <=?3 and t.car_code like '%?4%'";
623 621 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
624 622 long d= 0;
625 623 long t=0;
... ... @@ -1182,7 +1180,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1182 1180 while(it.hasNext()){
1183 1181 ChildTaskPlan childTaskPlan = it.next();
1184 1182 if(childTaskPlan.getMileageType().equals("empty")){
1185   - ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1183 + if(childTaskPlan.isDestroy()){
  1184 + remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1185 + }else{
  1186 + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1187 + }
1186 1188 }else{
1187 1189 if(childTaskPlan.isDestroy()){
1188 1190 remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
... ... @@ -1240,11 +1242,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1240 1242 @Override
1241 1243 public List<ScheduleRealInfo> queryListWaybill(String jName, String clZbh,
1242 1244 String lpName,String date,String type) {
  1245 + List <ScheduleRealInfo> list=null;
1243 1246 if(type.equals("qp")){
1244   - return scheduleRealInfoRepository.queryListWaybill2(jName,clZbh,lpName,date);
  1247 + list= scheduleRealInfoRepository.queryListWaybill2(jName,clZbh,lpName,date);
1245 1248 }else{
1246   - return scheduleRealInfoRepository.queryListWaybill(jName,clZbh,lpName,date);
  1249 + list= scheduleRealInfoRepository.queryListWaybill(jName,clZbh,lpName,date);
1247 1250 }
  1251 + for (int i = 0; i < list.size(); i++) {
  1252 + ScheduleRealInfo s=list.get(i);
  1253 + String remarks="";
  1254 + if(s.getRemarks()!=null){
  1255 + remarks +=s.getRemarks();
  1256 + }
  1257 + Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
  1258 + if(!childTaskPlans.isEmpty()){
  1259 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  1260 + while(it.hasNext()){
  1261 + ChildTaskPlan c = it.next();
  1262 + if(c.getRemarks()!=null && c.getRemarks().length()>0){
  1263 + remarks += c.getRemarks();
  1264 + }
  1265 +
  1266 + }
  1267 + }
  1268 + s.setRemarks(remarks);
  1269 + }
  1270 +
  1271 + return list;
1248 1272 }
1249 1273  
1250 1274 @Override
... ... @@ -1325,11 +1349,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1325 1349 }else{
1326 1350 ssgl_other += tempJhlc;
1327 1351 }
1328   -
1329   -
1330   - }else{
1331   - ssgl += tempJhlc;
1332   - ssgl_other += tempJhlc;
1333 1352 }
1334 1353 }else{
1335 1354 Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
... ... @@ -1570,6 +1589,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1570 1589 //根据线路代码获取公司
1571 1590 Line li = lineRepository.findByLineCode(scheduleRealInfo.getXlBm());
1572 1591 yesterdayDataList.get(i).put("company", li.getCompany());
  1592 + yesterdayDataList.get(i).put("bCompany", li.getBrancheCompany());
1573 1593 //计算总公里
1574 1594 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
1575 1595 //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班
... ...
src/main/java/com/bsth/service/report/ReportService.java
... ... @@ -19,11 +19,13 @@ public interface ReportService {
19 19  
20 20 List<Object[]> historyMessageCount(String line, String date, String code);
21 21  
22   - Map<String, Object> tbodyTime1(String line ,String date);
  22 + Map<String, Object> tbodyTime1(String line ,String ttinfo);
23 23  
24   - Map<String, Object> tbodyTime2(String line ,String date);
  24 + Map<String, Object> tbodyTime2(String line ,String ttinfo);
25 25  
26   - List<Map<String, Object>> tbodyTime3(String line ,String date);
27   - List<Map<String, Object>> tbodyTime5(String line ,String date);
  26 + List<Map<String, Object>> tbodyTime3(String line ,String ttinfo);
  27 + List<Map<String, Object>> tbodyTime5(String line ,String ttinfo);
  28 +
  29 + List<Map<String, Object>> getTtinfo(Map<String, Object> map);
28 30  
29 31 }
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -257,16 +257,18 @@ public class ReportServiceImpl implements ReportService{
257 257 return list;
258 258 }
259 259 @Override
260   - public Map<String, Object> tbodyTime1(String line, String date) {
  260 + public Map<String, Object> tbodyTime1(String line, String ttinfo) {
261 261 DecimalFormat df = new DecimalFormat("#0.00");
262 262 // TODO Auto-generated method stub
263 263 //查询配车
264   - String sqlPc=" SELECT cl_zbh FROM bsth_c_s_sp_info "
265   - +" where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' "
266   - + " and xl_bm='"+line+"' and bc_type='normal' "
267   - + " group by cl_zbh ";
  264 + String sqlPc=" select count(*) from bsth_c_cars where id in("
  265 + + " select cl from bsth_c_s_ccinfo where xl in ( "
  266 + + " select id from bsth_c_line where line_code='"+line+"' )"
  267 + + " group by equipment_code ) ";
  268 +
268 269 Map<String, Object> map=new HashMap<String,Object>();
269   - List<Map<String, Object>> listPc= jdbcTemplate.query(sqlPc,
  270 +
  271 + /*List<Map<String, Object>> listPc= jdbcTemplate.query(sqlPc,
270 272 new RowMapper<Map<String, Object>>(){
271 273 @Override
272 274 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
... ... @@ -274,13 +276,12 @@ public class ReportServiceImpl implements ReportService{
274 276 m.put("zbh", rs.getString("cl_zbh"));
275 277 return m;
276 278 }
277   - });
  279 + });*/
278 280 //配车
279   - int pcs=listPc.size();
280   -
281   -
282   - String sqlPlan="select jhlc, bc_type ,fcsj from bsth_c_s_sp_info "
283   - + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'";
  281 + int pcs=jdbcTemplate.queryForObject(sqlPc, Integer.class);
  282 +
  283 + String sqlPlan=" SELECT jhlc,bc_type,fcsj FROM bsth_c_s_ttinfo_detail "
  284 + +" where ttinfo ='"+ttinfo+"' ";
284 285  
285 286 //班次
286 287 int zgf_0 = 6*60+31,zgf_1 = 8*60+30,wgf_0 = 16*60+1,wgf_1 = 18*60;
... ... @@ -306,17 +307,10 @@ public class ReportServiceImpl implements ReportService{
306 307 String fcsjs[]=m.get("fcsj").toString().split(":");
307 308  
308 309 zlc +=jhlc;
309   - if(bcType.equals("normal")){
310   - qcBc ++;
311   - if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0
312   - && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){
313   - zqcBc++;
314   - }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0
315   - && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){
316   - wqcBc++;
317   - }
318   - yylc +=jhlc;
319   - }else if(bcType.equals("region")){
  310 + if(bcType.equals("in") || bcType.equals("out")){
  311 + kslc+=jhlc;
  312 + }
  313 + else if(bcType.equals("region")){
320 314 qjBc++;
321 315 if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0
322 316 && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){
... ... @@ -328,7 +322,15 @@ public class ReportServiceImpl implements ReportService{
328 322  
329 323 yylc+=jhlc;
330 324 }else{
331   - kslc+=jhlc;
  325 + qcBc ++;
  326 + if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0
  327 + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){
  328 + zqcBc++;
  329 + }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0
  330 + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){
  331 + wqcBc++;
  332 + }
  333 + yylc +=jhlc;
332 334 }
333 335 }
334 336  
... ... @@ -346,30 +348,91 @@ public class ReportServiceImpl implements ReportService{
346 348 return map;
347 349 }
348 350 @Override
349   - public Map<String, Object> tbodyTime2(String line, String date) {
  351 + public Map<String, Object> tbodyTime2(String line, String ttinfo) {
350 352 DecimalFormat df = new DecimalFormat("#0.00");
351 353 // TODO Auto-generated method stub
352   - //查询配车
353   - String sqlPc=" SELECT sum(bcsj) as yysj ,sum(jhlc) as yygl FROM bsth_c_s_sp_info "
354   - +" where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' "
355   - + " and xl_bm='"+line+"' and bc_type in ('normal' ,'region' )";
  354 + //最早营运时间 区分夜宵线
  355 + String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'";
  356 + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  357 + String[] minSjs = minfcsj.split(":");
  358 + int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]);
  359 + //查询时间里程
  360 + String sqlPc=" (SELECT jhlc,fcsj,bc_type,lp,2 as xh FROM bsth_c_s_ttinfo_detail "
  361 + + " where ttinfo ='"+ttinfo+"' and fcsj <='"+minfcsj+"' ) "
  362 + + " union "
  363 + + " (SELECT jhlc,fcsj,bc_type,lp,1 as xh FROM bsth_c_s_ttinfo_detail "
  364 + + " where ttinfo ='"+ttinfo+"' and fcsj > '"+minfcsj+"') order by lp,xh,fcsj";
  365 +
356 366 Map<String, Object> map=new HashMap<String,Object>();
357 367 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc,
358 368 new RowMapper<Map<String, Object>>(){
359 369 @Override
360 370 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
361 371 Map<String, Object> m=new HashMap<String,Object>();
362   - m.put("yysj", rs.getInt("yysj"));
363   - m.put("yygl", rs.getString("yygl")==null?"0":rs.getString("yygl"));
  372 + m.put("fcsj", rs.getString("fcsj"));
  373 + m.put("yygl", rs.getString("jhlc")==null?"0":rs.getString("jhlc"));
  374 + m.put("bcType", rs.getString("bc_type"));
  375 + m.put("lp", rs.getString("lp"));
364 376 return m;
365 377 }
366 378 });
367 379 int yysj=0 ;
368 380 double yycs=0 ,yygl=0;
369   - if(list.size()>0){
370   - Map<String, Object> m=list.get(0);
371   - yysj=Integer.parseInt((m.get("yysj").toString()));
372   - yygl=Double.parseDouble(m.get("yygl").toString());
  381 + String lp ="0";
  382 + int sj=0;
  383 +
  384 + for(int i=0;i<list.size();i++){
  385 + Map<String, Object> m=list.get(i);
  386 + String time=m.get("fcsj").toString();
  387 + String[] times = time.split(":");
  388 + if(lp.equals(m.get("lp").toString())){
  389 + if(Integer.parseInt(times[0])*60+Integer.parseInt(times[1]) <=minSj){
  390 + if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){
  391 + if(m.get("bcType").equals("in")){
  392 + if(sj!=0){
  393 + yysj +=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1])-sj;
  394 + }
  395 + sj=0;
  396 + }
  397 + }else{
  398 + yygl += Double.parseDouble(m.get("yygl").toString());
  399 +
  400 + if(sj==0){
  401 + sj=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1]);
  402 + }else{
  403 + yysj +=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1])-sj;
  404 + sj=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1]);
  405 + }
  406 + }
  407 + }else{
  408 + if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){
  409 + if(m.get("bcType").equals("in")){
  410 + if(sj!=0){
  411 + yysj +=Integer.parseInt(times[0])*60+Integer.parseInt(times[1])-sj;
  412 + }
  413 + sj=0;
  414 + }
  415 + }else{
  416 + yygl += Double.parseDouble(m.get("yygl").toString());
  417 +
  418 + if(sj==0){
  419 + sj=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]);
  420 + }else{
  421 + yysj +=Integer.parseInt(times[0])*60+Integer.parseInt(times[1])-sj;
  422 + sj=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]);
  423 + }
  424 + }
  425 + }
  426 + }else{
  427 + if( !(m.get("bcType").equals("in") || m.get("bcType").equals("out"))){
  428 + yygl += Double.parseDouble(m.get("yygl").toString());
  429 + sj =Integer.parseInt(times[0])*60+Integer.parseInt(times[1]);
  430 + }else{
  431 + sj=0;
  432 + }
  433 + lp=m.get("lp").toString();
  434 +
  435 + }
373 436 }
374 437 if(yysj>0){
375 438 yycs =yygl/(yysj*1.0/60);
... ... @@ -767,4 +830,34 @@ public class ReportServiceImpl implements ReportService{
767 830 newList.add(newmap5);
768 831 return newList;
769 832 }
  833 + @Override
  834 + public List<Map<String, Object>> getTtinfo(Map<String, Object> map) {
  835 + // TODO Auto-generated method stub
  836 + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
  837 + String line = map.get("line").toString();
  838 + try {
  839 + String sql = "select tt.id, tt.name from bsth_c_s_ttinfo tt "
  840 + + "left join bsth_c_line cl on cl.id = tt.xl "
  841 + + " where tt.is_cancel = 0 and tt.is_enable_dis_template = 1";
  842 + if(line.length() != 0){
  843 + sql += " and cl.line_code = '"+line+"'";
  844 + }
  845 + sql += " order by tt.create_date desc";
  846 +
  847 + list = jdbcTemplate.query(sql,
  848 + new RowMapper<Map<String, Object>>(){
  849 + @Override
  850 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  851 + Map<String, Object> map = new HashMap<String, Object>();
  852 + map.put("id", rs.getString("id"));
  853 + map.put("name", rs.getString("name"));
  854 + return map;
  855 + }
  856 + });
  857 + }catch (Exception e) {
  858 + // TODO Auto-generated catch block
  859 + e.printStackTrace();
  860 + }
  861 + return list;
  862 + }
770 863 }
... ...
src/main/resources/application-dev.properties
... ... @@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
8 8 spring.jpa.database= MYSQL
9 9 spring.jpa.show-sql= true
10 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11   -spring.datasource.url= jdbc:mysql://192.168.168.201/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  11 +spring.datasource.url= jdbc:mysql://127.0.0.1/qp_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 12 spring.datasource.username= root
13   -spring.datasource.password= 123456
  13 +spring.datasource.password=
14 14 #spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
15 15 #spring.datasource.username= root
16 16 #spring.datasource.password= root
... ...
src/main/resources/ms-jdbc.properties
... ... @@ -3,7 +3,12 @@
3 3 #ms.mysql.username= root
4 4 #ms.mysql.password= 123456
5 5  
  6 +#ms.mysql.driver= com.mysql.jdbc.Driver
  7 +#ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8
  8 +#ms.mysql.username= root
  9 +#ms.mysql.password= root2jsp
  10 +
6 11 ms.mysql.driver= com.mysql.jdbc.Driver
7   -ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8
  12 +ms.mysql.url= jdbc:mysql://192.168.168.117:3306/ms?useUnicode=true&characterEncoding=utf-8
8 13 ms.mysql.username= root
9   -ms.mysql.password= root2jsp
10 14 \ No newline at end of file
  15 +ms.mysql.password= root
11 16 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/scheduleDaily.html
... ... @@ -42,7 +42,7 @@
42 42 </form>
43 43 </div>
44 44 <div class="portlet-body">
45   - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  45 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;height: 400px">
46 46 <label>早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
47 47 <table class="table table-bordered table-hover table-checkable" id="forms">
48 48 <thead>
... ...
src/main/resources/static/pages/forms/statement/scheduleDailyQp.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; margin-left: 10px;" id="company1">
  31 + <span class="item-label" style="width: 80px;">公司: </span>
  32 + <select class="form-control" name="company" id="company" style="width: 160px;"></select>
  33 + </div>
  34 + <div style="display: inline-block; margin-left: 10px;" id="subCompany1">
  35 + <span class="item-label" style="width: 80px;">分公司: </span>
  36 + <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
  37 + </div>
  38 + <div style="display: inline-block; margin-left: 10px;">
  39 + <span class="item-label" style="width: 80px;">线路: </span>
  40 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  41 + </div>
  42 + <div style="display: inline-block;margin-left: 10px;">
  43 + <span class="item-label" style="width: 80px;">时间: </span>
  44 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  45 + </div>
  46 + <div class="form-group">
  47 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  48 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  49 + </div>
  50 + </form>
  51 + </div>
  52 + <div class="portlet-body" >
  53 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 506px;height: 400px">
  54 + <table class="table table-bordered table-hover table-checkable" id="forms">
  55 + <thead>
  56 + <tr >
  57 + <th style="text-align:center;vertical-align:middle;" rowspan="3">路牌</th>
  58 + <th style="text-align:center;vertical-align:middle;"
  59 + rowspan="2" colspan="2">车号</th>
  60 + <th rowspan="3">班别</th>
  61 + <th colspan="3" style="text-align:center;vertical-align:middle;">驾驶员</th>
  62 + <th colspan="3" style="text-align:center;vertical-align:middle;">售票员</th>
  63 + <th rowspan="3" style="text-align:center;vertical-align:middle;">路牌</th>
  64 + <th rowspan="3" style="text-align:center;vertical-align:middle;">记录项目</th>
  65 + <th colspan="3" style="text-align:center;vertical-align:middle;">1</th>
  66 + <th colspan="3" style="text-align:center;vertical-align:middle;">2</th>
  67 + <th colspan="3" style="text-align:center;vertical-align:middle;">3</th>
  68 + <th colspan="3" style="text-align:center;vertical-align:middle;">4</th>
  69 + <th colspan="3" style="text-align:center;vertical-align:middle;">5</th>
  70 + <th colspan="3" style="text-align:center;vertical-align:middle;">6</th>
  71 + <th colspan="3" style="text-align:center;vertical-align:middle;">7</th>
  72 + <th colspan="3" style="text-align:center;vertical-align:middle;">8</th>
  73 + <th colspan="3" style="text-align:center;vertical-align:middle;">9</th>
  74 + <th colspan="3" style="text-align:center;vertical-align:middle;">10</th>
  75 + <th colspan="3" style="text-align:center;vertical-align:middle;">11</th>
  76 + <th colspan="3" style="text-align:center;vertical-align:middle;">12</th>
  77 + <th colspan="3" style="text-align:center;vertical-align:middle;">13</th>
  78 +
  79 + </tr>
  80 + <tr>
  81 +
  82 + <th rowspan="2">职号</th>
  83 + <th colspan="2">接班时间</th>
  84 + <th rowspan="2">职号</th>
  85 + <th colspan="2">接班时间</th>
  86 + <th rowspan="2">到达</th>
  87 + <th rowspan="2">早/迟</th>
  88 + <th rowspan="2">开出</th>
  89 + <th rowspan="2">到达</th>
  90 + <th rowspan="2">早/迟</th>
  91 + <th rowspan="2">开出</th>
  92 + <th rowspan="2">到达</th>
  93 + <th rowspan="2">早/迟</th>
  94 + <th rowspan="2">开出</th>
  95 + <th rowspan="2">到达</th>
  96 + <th rowspan="2">早/迟</th>
  97 + <th rowspan="2">开出</th>
  98 + <th rowspan="2">到达</th>
  99 + <th rowspan="2">早/迟</th>
  100 + <th rowspan="2">开出</th>
  101 + <th rowspan="2">到达</th>
  102 + <th rowspan="2">早/迟</th>
  103 + <th rowspan="2">开出</th>
  104 + <th rowspan="2">到达</th>
  105 + <th rowspan="2">早/迟</th>
  106 + <th rowspan="2">开出</th>
  107 + <th rowspan="2">到达</th>
  108 + <th rowspan="2">早/迟</th>
  109 + <th rowspan="2">开出</th>
  110 + <th rowspan="2">到达</th>
  111 + <th rowspan="2">早/迟</th>
  112 + <th rowspan="2">开出</th>
  113 + <th rowspan="2">到达</th>
  114 + <th rowspan="2">早/迟</th>
  115 + <th rowspan="2">开出</th>
  116 + <th rowspan="2">到达</th>
  117 + <th rowspan="2">早/迟</th>
  118 + <th rowspan="2">开出</th>
  119 + <th rowspan="2">到达</th>
  120 + <th rowspan="2">早/迟</th>
  121 + <th rowspan="2">开出</th>
  122 + <th rowspan="2">到达</th>
  123 + <th rowspan="2">早/迟</th>
  124 + <th rowspan="2">开出</th>
  125 + </tr>
  126 + <tr>
  127 + <th>出场</th>
  128 + <th>调换</th>
  129 + <th>1</th>
  130 + <th>2</th>
  131 + <th>1</th>
  132 + <th>2</th>
  133 + </tr>
  134 + </thead>
  135 + <tbody>
  136 + <tr >
  137 + <td></td>
  138 + <td>
  139 + </td>
  140 + <td></td>
  141 + <td></td>
  142 + <td></td>
  143 + <td colspan="46">
  144 + <div>
  145 +
  146 + </div>
  147 + </td>
  148 + </tr>
  149 +
  150 + </tbody>
  151 + </table>
  152 + <div style="text-align: right;">
  153 + <ul id="pagination" class="pagination"></ul>
  154 + </div>
  155 + </div>
  156 + </div>
  157 + </div>
  158 + </div>
  159 +</div>
  160 +
  161 +<script>
  162 + $(function(){
  163 +
  164 + // 关闭左侧栏
  165 + if (!$('body').hasClass('page-sidebar-closed'))
  166 + $('.menu-toggler.sidebar-toggler').click();
  167 +
  168 + $("#date").datetimepicker({
  169 + format : 'YYYY-MM-DD',
  170 + locale : 'zh-cn'
  171 + });
  172 +
  173 + var d = new Date();
  174 + var year = d.getFullYear();
  175 + var month = d.getMonth() + 1;
  176 + var day = d.getDate();
  177 + if(month < 10)
  178 + month = "0" + month;
  179 + if(day < 10)
  180 + day = "0" + day;
  181 + $("#date").val(year + "-" + month + "-" + day);
  182 +
  183 + $.get('/basic/lineCode2Name',function(result){
  184 + var data=[];
  185 +
  186 + data.push({id: " ", text: "全部线路"});
  187 + for(var code in result){
  188 + data.push({id: code, text: result[code]});
  189 + }
  190 + initPinYinSelect2('#line',data,'');
  191 + })
  192 +
  193 + var obj = [];
  194 + $.get('/user/companyData', function(result){
  195 + obj = result;
  196 + var options = '';
  197 + for(var i = 0; i < obj.length; i++){
  198 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  199 + }
  200 + if(obj.length == 1){
  201 + $('#company1').hide();
  202 + if(obj[0].children.length == 1)
  203 + $('#subCompany1').hide();
  204 + }
  205 + $('#company').html(options);
  206 + updateCompany();
  207 + });
  208 + $("#company").on("change",updateCompany);
  209 + function updateCompany(){
  210 + var company = $('#company').val();
  211 + var options = '';
  212 + for(var i = 0; i < obj.length; i++){
  213 + if(obj[i].companyCode == company){
  214 + var children = obj[i].children;
  215 + for(var j = 0; j < children.length; j++){
  216 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  217 + }
  218 + }
  219 + }
  220 + $('#subCompany').html(options);
  221 + }
  222 +
  223 +
  224 + $("#query").on("click",jsDoQuery);
  225 +
  226 + var line = $("#line").val();
  227 + var date = $("#date").val();
  228 + var company = $("#company").val();
  229 + var subCompany = $("#subCompany").val();
  230 + function jsDoQuery(pagination){
  231 + var params = {};
  232 + line = $("#line").val();
  233 + date = $("#date").val();
  234 + company = $("#company").val();
  235 + subCompany = $("#subCompany").val();
  236 + if(line == " ")
  237 + line = "";
  238 + params['line'] = line;
  239 + params['date'] = date;
  240 + params['type'] = "query";
  241 + params['company'] = company;
  242 + params['subCompany'] = subCompany;
  243 + $(".hidden").removeClass("hidden");
  244 + /* $get('/pcpc/workDaily', params, function(result){
  245 + // 把数据填充到模版中
  246 + var tbodyHtml = template('list_workDaily',{list:result});
  247 + // 把渲染好的模版html文本追加到表格中
  248 + $('#forms tbody').html(tbodyHtml);
  249 +
  250 + }); */
  251 + }
  252 +
  253 + $("#export").on("click",function(){
  254 + $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){
  255 + window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD"));
  256 + });
  257 + });
  258 +
  259 +
  260 + });
  261 +
  262 +</script>
  263 +<script type="text/html" id="list_workDaily">
  264 + {{each list as obj i}}
  265 + <tr>
  266 + <td>{{obj.date}}</td>
  267 + <td>{{obj.line}}</td>
  268 + <td>{{obj.jhbc}}</td>
  269 + <td>{{obj.dftz}}</td>
  270 + <td>{{obj.dftzl}}</td>
  271 + <td>{{obj.ccl}}</td>
  272 + <td>{{obj.upfk}}</td>
  273 + <td>{{obj.updk}}</td>
  274 + <td>{{obj.dnfk}}</td>
  275 + <td>{{obj.dndk}}</td>
  276 + <td>{{obj.upfm}}</td>
  277 + <td>{{obj.updm}}</td>
  278 + <td>{{obj.dnfm}}</td>
  279 + <td>{{obj.dndm}}</td>
  280 + <td>{{obj.wdzs}}</td>
  281 + <td>{{obj.smbzdl}}</td>
  282 + <td>{{obj.gfbczxl}}</td>
  283 + </tr>
  284 + {{/each}}
  285 + {{if list.length == 0}}
  286 + <tr>
  287 + <td colspan="17"><h6 class="muted">没有找到相关数据</h6></td>
  288 + </tr>
  289 + {{/if}}
  290 +</script>
... ...
src/main/resources/static/pages/forms/statement/waybill.html
... ... @@ -152,7 +152,7 @@
152 152 var line = $("#line").val();
153 153 date = $("#date").val();
154 154 $(".hidden").removeClass("hidden");
155   - $get('/realSchedule/queryUserInfo',{line:line,date:date},function(result){
  155 + $get('/realSchedule/queryUserInfo',{line:line,date:date,state:2},function(result){
156 156 // 把数据填充到模版中
157 157 var tbodyHtml = template('list_info',{list:result});
158 158 // 把渲染好的模版html文本追加到表格中
... ...
src/main/resources/static/pages/forms/statement/waybillQp.html
... ... @@ -152,7 +152,7 @@
152 152 var line = $("#line").val();
153 153 date = $("#date").val();
154 154 $(".hidden").removeClass("hidden");
155   - $get('/realSchedule/queryUserInfo',{line:line,date:date},function(result){
  155 + $get('/realSchedule/queryUserInfo',{line:line,date:date,state:3},function(result){
156 156 // 把数据填充到模版中
157 157 var tbodyHtml = template('list_info',{list:result});
158 158 // 把渲染好的模版html文本追加到表格中
... ...
src/main/resources/static/pages/oil/list.html
... ... @@ -330,7 +330,6 @@
330 330 $('tr.filter .filter-submit').on('click', function () {
331 331 var ylbGsdm=$("#ylbListGsdmId").val();
332 332 var ylbFgsdm=$("#ylbListFgsdmId").val();
333   - console.log();
334 333 if ($("#rq").val() == "" || $("#rq").val() ==null){
335 334 layer.msg('请选择日期.');
336 335 }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){
... ...
src/main/resources/static/pages/report/timetable/timetable.html
... ... @@ -40,8 +40,8 @@
40 40 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
41 41 </div>
42 42 <div style="display: inline-block;margin-left: 15px;">
43   - <span class="item-label" style="width: 80px;">时间: </span>
44   - <input class="form-control" type="text" id="date" style="width: 180px;"/>
  43 + <span class="item-label" style="width: 80px;">时刻表: </span>
  44 + <select class="form-control" name="ttinfo" id="ttinfo" style="width: 180px;"></select>
45 45 </div>
46 46 <div class="form-group">
47 47 <input class="btn btn-default" type="button" id="query" value="查询"/>
... ... @@ -196,10 +196,6 @@
196 196 if (!$('body').hasClass('page-sidebar-closed'))
197 197 $('.menu-toggler.sidebar-toggler').click();
198 198  
199   - $("#date").datetimepicker({
200   - format : 'YYYY-MM-DD',
201   - locale : 'zh-cn'
202   - });
203 199  
204 200 var obj = [];
205 201 $.get('/user/companyData', function(result){
... ... @@ -246,27 +242,49 @@
246 242  
247 243 })
248 244  
  245 +
  246 + var flag = 0;
  247 + function updateTtinfo(){
  248 + if(flag == 1)
  249 + return;
  250 + flag = 1;
  251 + var treeData = [];
  252 + var params = {};
  253 + params['line'] = $("#line").val();
  254 + $get('/report/getTtinfo', params, function(result){
  255 + treeData = createTreeData(result);
  256 + var options = '<option value="">请选择...</option>';
  257 + $.each(treeData, function(i, g){
  258 + options += '<option value="'+g.id+'">'+g.name+'</option>';
  259 + });
  260 + $('#ttinfo').html(options)/* .select2() */;
  261 + flag = 0;
  262 + });
  263 + }
  264 +
  265 + $("#line").on("change", function(){
  266 + updateTtinfo();
  267 + })
  268 +
249 269 //查询
250 270 $("#query").on('click',function(){
251   - console.log($("#gsdmTime").val());
252   - console.log($("#fgsdmTime").val());
253 271 var line = $("#line").val();
254 272 var xlName = $("#select2-line-container").html();
255   - var date = $("#date").val();
256   - if(date==null|| date==""){
257   - layer.msg('请选择日期.');
258   - }else if(line==null || line ==""){
  273 + var ttinfo = $("#ttinfo").val();
  274 + if(line==null || line ==""){
259 275 layer.msg('请选择线路.');
  276 + }else if(ttinfo==null|| ttinfo==""){
  277 + layer.msg('请选择时刻表.');
260 278 }else{
261   - $get('/report/tbodyTime1',{line:line,date:date},function(result){
  279 + $get('/report/tbodyTime1',{line:line,ttinfo:ttinfo},function(result){
262 280 var tbodyTime1 = template('tbodyTime1',{map:result});
263 281 $('#formsTime1 .tbody_time_1').html(tbodyTime1);
264 282 });
265   - $.get('/report/tbodyTime2',{line:line,date:date},function(result){
  283 + $.get('/report/tbodyTime2',{line:line,ttinfo:ttinfo},function(result){
266 284 var tbodyTime2 = template('tbodyTime2',{map:result});
267 285 $('#formsTime2 .tbody_time_2').html(tbodyTime2);
268   - });
269   - $.get('/report/tbodyTime3',{line:line,date:date},function(result){
  286 + });/*
  287 + $.get('/report/tbodyTime3',{line:line,ttinfo:ttinfo},function(result){
270 288  
271 289 var tbodyTime3 = template('tbodyTime3',{list:result});
272 290 $('#formsTime3 .tbody_time_3').html(tbodyTime3);
... ... @@ -274,15 +292,17 @@
274 292 var divTime2 = window.document.getElementById('formsTime2');
275 293 console.log(divTime3.offsetHeight);
276 294 divTime2.style.height=divTime3.offsetHeight+"px";
277   - });/*
  295 + }); */
  296 +
  297 + /*
278 298 $.get('/report/tbodyTime4',{line:line,date:date},function(result){
279 299 var scheduleDaily_3 = template('scheduleDaily_3',{list:result});
280 300 $('#forms .scheduleDaily_3').html(scheduleDaily_3);
281 301 });*/
282   - $.get('/report/tbodyTime5',{line:line,date:date},function(result){
  302 + /* $.get('/report/tbodyTime5',{line:line,ttinfo:ttinfo},function(result){
283 303 var tbodyTime5 = template('tbodyTime5',{list:result});
284 304 $('#formsTime5 .tbody_time_5').html(tbodyTime5);
285   - });
  305 + }); */
286 306 }
287 307  
288 308  
... ...