Commit 43525ad6fdbcfa68c00d9a7c5221e4b6a3a1824a
1 parent
0618c00b
mcy
Showing
10 changed files
with
423 additions
and
49 deletions
src/main/java/com/bsth/controller/forms/ExportController.java
| @@ -13,8 +13,10 @@ import org.springframework.web.bind.annotation.RequestMethod; | @@ -13,8 +13,10 @@ import org.springframework.web.bind.annotation.RequestMethod; | ||
| 13 | import org.springframework.web.bind.annotation.RequestParam; | 13 | import org.springframework.web.bind.annotation.RequestParam; |
| 14 | import org.springframework.web.bind.annotation.RestController; | 14 | import org.springframework.web.bind.annotation.RestController; |
| 15 | 15 | ||
| 16 | +import com.bsth.data.BasicData; | ||
| 16 | import com.bsth.entity.mcy_forms.Allline; | 17 | import com.bsth.entity.mcy_forms.Allline; |
| 17 | import com.bsth.entity.mcy_forms.Changetochange; | 18 | import com.bsth.entity.mcy_forms.Changetochange; |
| 19 | +import com.bsth.entity.mcy_forms.Daily; | ||
| 18 | import com.bsth.entity.mcy_forms.Executionrate; | 20 | import com.bsth.entity.mcy_forms.Executionrate; |
| 19 | import com.bsth.entity.mcy_forms.Linepasswengerflow; | 21 | import com.bsth.entity.mcy_forms.Linepasswengerflow; |
| 20 | import com.bsth.entity.mcy_forms.Operationservice; | 22 | import com.bsth.entity.mcy_forms.Operationservice; |
| @@ -319,8 +321,31 @@ public class ExportController { | @@ -319,8 +321,31 @@ public class ExportController { | ||
| 319 | List<Turnoutrate> turnoutrate = formsService.turnoutrate(map); | 321 | List<Turnoutrate> turnoutrate = formsService.turnoutrate(map); |
| 320 | Map<String, Object> map1 = new HashMap<String, Object>(); | 322 | Map<String, Object> map1 = new HashMap<String, Object>(); |
| 321 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | 323 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 324 | + /*Float xlts=0f; | ||
| 325 | + Float jh=0f; | ||
| 326 | + Float sj=0f; | ||
| 327 | + Float qz=0f; | ||
| 328 | + Float ccl=0f; | ||
| 329 | + Float bcjh=0f; | ||
| 330 | + Float bcsj=0f; | ||
| 331 | + Float bczxl=0f; | ||
| 332 | + Float gs=0f; | ||
| 333 | + Float zhgs=0f;*/ | ||
| 334 | + | ||
| 322 | for (Turnoutrate l : turnoutrate) { | 335 | for (Turnoutrate l : turnoutrate) { |
| 323 | Map<String, Object> m = new HashMap<String, Object>(); | 336 | Map<String, Object> m = new HashMap<String, Object>(); |
| 337 | + | ||
| 338 | + /* xlts +=l.getGs()==""?0f:Float.valueOf(l.getGs()); | ||
| 339 | + jh +=l.getZhgs()==""?0f:Float.valueOf(l.getZhgs()); | ||
| 340 | + sj +=l.getXl()==""?0f:Float.valueOf(l.getXl()); | ||
| 341 | + ccl +=l.getCchjh()==""?0f:Float.valueOf(l.getCchjh()); | ||
| 342 | + bcjh +=l.getCchsj()==""?0f:Float.valueOf(l.getCchsj()); | ||
| 343 | + bcsj +=l.getChl()==""?0f:Float.valueOf(l.getChl()); | ||
| 344 | + bczxl +=l.getBcjh()==""?0f:Float.valueOf(l.getBcjh()); | ||
| 345 | + gs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl()); | ||
| 346 | + zhgs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl()); | ||
| 347 | + | ||
| 348 | + */ | ||
| 324 | m.put("rq", l.getRq()); | 349 | m.put("rq", l.getRq()); |
| 325 | m.put("gs", l.getGs()); | 350 | m.put("gs", l.getGs()); |
| 326 | m.put("zhgs", l.getZhgs()); | 351 | m.put("zhgs", l.getZhgs()); |
| @@ -334,6 +359,19 @@ public class ExportController { | @@ -334,6 +359,19 @@ public class ExportController { | ||
| 334 | m.put("bbzxl", l.getBbzxl()); | 359 | m.put("bbzxl", l.getBbzxl()); |
| 335 | m.put("sm", l.getSm()); | 360 | m.put("sm", l.getSm()); |
| 336 | resList.add(m); | 361 | resList.add(m); |
| 362 | + | ||
| 363 | + /*m=new HashMap<String,Object>(); | ||
| 364 | + m.put("total_xlts", jh); | ||
| 365 | + m.put("total_jh", jh); | ||
| 366 | + m.put("total_sj", sj); | ||
| 367 | + m.put("total_qz", qz); | ||
| 368 | + m.put("total_ccl", ccl); | ||
| 369 | + m.put("total_bcjh", bcjh); | ||
| 370 | + m.put("total_bcsj", bcsj); | ||
| 371 | + m.put("total_bczxl", bczxl); | ||
| 372 | + m.put("total_gs", gs); | ||
| 373 | + m.put("total_zhgs", zhgs); | ||
| 374 | + */ | ||
| 337 | } | 375 | } |
| 338 | 376 | ||
| 339 | try { | 377 | try { |
| @@ -356,8 +394,29 @@ public class ExportController { | @@ -356,8 +394,29 @@ public class ExportController { | ||
| 356 | List<Executionrate> executionrate = formsService.executionrate(map); | 394 | List<Executionrate> executionrate = formsService.executionrate(map); |
| 357 | Map<String, Object> map1 = new HashMap<String, Object>(); | 395 | Map<String, Object> map1 = new HashMap<String, Object>(); |
| 358 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | 396 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 397 | + /* Float xlts=0f; | ||
| 398 | + Float jh=0f; | ||
| 399 | + Float sj=0f; | ||
| 400 | + Float ccl=0f; | ||
| 401 | + Float bcjh=0f; | ||
| 402 | + Float bcsj=0f; | ||
| 403 | + Float bczxl=0f; | ||
| 404 | + Float gs=0f; | ||
| 405 | + Float zhgs=0f;*/ | ||
| 406 | + | ||
| 359 | for (Executionrate l : executionrate) { | 407 | for (Executionrate l : executionrate) { |
| 360 | Map<String, Object> m = new HashMap<String, Object>(); | 408 | Map<String, Object> m = new HashMap<String, Object>(); |
| 409 | + /* xlts +=l.getGs()==""?0f:Float.valueOf(l.getGs()); | ||
| 410 | + jh +=l.getZhgs()==""?0f:Float.valueOf(l.getZhgs()); | ||
| 411 | + sj +=l.getXl()==""?0f:Float.valueOf(l.getXl()); | ||
| 412 | + ccl +=l.getCchjh()==""?0f:Float.valueOf(l.getCchjh()); | ||
| 413 | + bcjh +=l.getCchsj()==""?0f:Float.valueOf(l.getCchsj()); | ||
| 414 | + bcsj +=l.getChl()==""?0f:Float.valueOf(l.getChl()); | ||
| 415 | + bczxl +=l.getBcjh()==""?0f:Float.valueOf(l.getBcjh()); | ||
| 416 | + gs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl()); | ||
| 417 | + zhgs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl()); | ||
| 418 | + | ||
| 419 | + */ | ||
| 361 | m.put("rq", l.getRq()); | 420 | m.put("rq", l.getRq()); |
| 362 | m.put("gs", l.getGs()); | 421 | m.put("gs", l.getGs()); |
| 363 | m.put("zhgs", l.getZhgs()); | 422 | m.put("zhgs", l.getZhgs()); |
| @@ -370,6 +429,19 @@ public class ExportController { | @@ -370,6 +429,19 @@ public class ExportController { | ||
| 370 | m.put("bbzxl", l.getBbzxl()); | 429 | m.put("bbzxl", l.getBbzxl()); |
| 371 | m.put("sm", l.getSm()); | 430 | m.put("sm", l.getSm()); |
| 372 | resList.add(m); | 431 | resList.add(m); |
| 432 | + | ||
| 433 | + | ||
| 434 | + /* m=new HashMap<String,Object>(); | ||
| 435 | + m.put("total_xlts", jh); | ||
| 436 | + m.put("total_jh", jh); | ||
| 437 | + m.put("total_sj", sj); | ||
| 438 | + m.put("total_ccl", ccl); | ||
| 439 | + m.put("total_bcjh", bcjh); | ||
| 440 | + m.put("total_bcsj", bcsj); | ||
| 441 | + m.put("total_bczxl", bczxl); | ||
| 442 | + m.put("total_gs", gs); | ||
| 443 | + m.put("total_zhgs", zhgs);*/ | ||
| 444 | + | ||
| 373 | } | 445 | } |
| 374 | 446 | ||
| 375 | try { | 447 | try { |
| @@ -393,12 +465,31 @@ public class ExportController { | @@ -393,12 +465,31 @@ public class ExportController { | ||
| 393 | List<Allline> allline = formsService.allline(map); | 465 | List<Allline> allline = formsService.allline(map); |
| 394 | Map<String, Object> map1 = new HashMap<String, Object>(); | 466 | Map<String, Object> map1 = new HashMap<String, Object>(); |
| 395 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | 467 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 468 | + /* Integer jh=0; | ||
| 469 | + Integer sj=0; | ||
| 470 | + Integer ccl=0; | ||
| 471 | + Integer bcjh=0; | ||
| 472 | + Float bcsj=0f; | ||
| 473 | + Integer bczxl=0; | ||
| 474 | + Integer gs=0; | ||
| 475 | + Float zhgs=0f; | ||
| 476 | + */ | ||
| 396 | for (Allline l : allline) { | 477 | for (Allline l : allline) { |
| 397 | Map<String, Object> m = new HashMap<String, Object>(); | 478 | Map<String, Object> m = new HashMap<String, Object>(); |
| 479 | + | ||
| 480 | + /*jh +=l.getGsgs()=="" ? 0: Integer.valueOf(l.getGsgs()); | ||
| 481 | + sj +=l.getFgsgs()==""?0: Integer.valueOf(l.getFgsgs()); | ||
| 482 | + ccl +=l.getCchjh()==""?0: Integer.valueOf(l.getCchjh()); | ||
| 483 | + bcjh +=l.getCchsj()==""?0: Integer.valueOf(l.getCchsj()); | ||
| 484 | + bcsj +=l.getChl()==""?0f:Float.valueOf(l.getChl()); | ||
| 485 | + bczxl +=l.getBcjh()==""?0: Integer.valueOf(l.getBcjh()); | ||
| 486 | + gs +=l.getBbzxl()==""?0: Integer.valueOf(l.getBbzxl()); | ||
| 487 | + zhgs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl()); | ||
| 488 | + */ | ||
| 398 | m.put("rq", l.getRq()); | 489 | m.put("rq", l.getRq()); |
| 399 | - m.put("gs", l.getGs()); | ||
| 400 | - m.put("zhgs", l.getZhgs()); | ||
| 401 | - m.put("xl", l.getXl()); | 490 | + m.put("gs", l.getGsgs()); |
| 491 | + m.put("zhgs", l.getFgsgs()); | ||
| 492 | + //m.put("xl", l.getXl()); | ||
| 402 | m.put("cchjh", l.getCchjh()); | 493 | m.put("cchjh", l.getCchjh()); |
| 403 | m.put("cchsj", l.getCchsj()); | 494 | m.put("cchsj", l.getCchsj()); |
| 404 | m.put("chl", l.getChl()); | 495 | m.put("chl", l.getChl()); |
| @@ -407,6 +498,17 @@ public class ExportController { | @@ -407,6 +498,17 @@ public class ExportController { | ||
| 407 | m.put("bbzxl", l.getBbzxl()); | 498 | m.put("bbzxl", l.getBbzxl()); |
| 408 | m.put("sm", l.getSm()); | 499 | m.put("sm", l.getSm()); |
| 409 | resList.add(m); | 500 | resList.add(m); |
| 501 | + | ||
| 502 | + /*m=new HashMap<String,Object>(); | ||
| 503 | + m.put("total_jh", jh); | ||
| 504 | + m.put("total_sj", sj); | ||
| 505 | + m.put("total_ccl", ccl); | ||
| 506 | + m.put("total_bcjh", bcjh); | ||
| 507 | + m.put("total_bcsj", bcsj); | ||
| 508 | + m.put("total_bczxl", bczxl); | ||
| 509 | + m.put("total_gs", gs); | ||
| 510 | + m.put("total_zhgs", zhgs); | ||
| 511 | + */ | ||
| 410 | } | 512 | } |
| 411 | 513 | ||
| 412 | try { | 514 | try { |
| @@ -422,6 +524,56 @@ public class ExportController { | @@ -422,6 +524,56 @@ public class ExportController { | ||
| 422 | 524 | ||
| 423 | 525 | ||
| 424 | 526 | ||
| 527 | + //班次日报表 | ||
| 528 | + @RequestMapping(value = "/dailyExport", method = RequestMethod.POST) | ||
| 529 | + public List<Map<String, Object>> dailyExport(@RequestParam Map<String, Object> map) { | ||
| 530 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 531 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 532 | + ReportUtils ee = new ReportUtils(); | ||
| 533 | + List<Daily> allline = formsService.daily(map); | ||
| 534 | + | ||
| 535 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 536 | + Float zgl=0f; | ||
| 537 | + Float ks=0f; | ||
| 538 | + Float yh=0f; | ||
| 539 | + Float bc=0f; | ||
| 540 | + Map<String, Object> m ; | ||
| 541 | + for (Daily d : allline) { | ||
| 542 | + m = new HashMap<String, Object>(); | ||
| 543 | + zgl +=d.getZlc()==""?0f:Float.valueOf(d.getZlc()); | ||
| 544 | + ks +=d.getJzl1()==""?0f:Float.valueOf(d.getJzl1()); | ||
| 545 | + yh +=d.getYh()==""?0f:Float.valueOf(d.getYh()); | ||
| 546 | + bc +=d.getBc()==""?0f:Float.valueOf(d.getBc()); | ||
| 547 | + m.put("zbh", d.getZbh()); | ||
| 548 | + m.put("jgh",d.getJgh()); | ||
| 549 | + m.put("jName", d.getjName()); | ||
| 550 | + m.put("zlc", d.getZlc()); | ||
| 551 | + m.put("jzl1", d.getJzl1()); | ||
| 552 | + m.put("yh", d.getYh()); | ||
| 553 | + m.put("bc", d.getBc()); | ||
| 554 | + | ||
| 555 | + resList.add(m); | ||
| 556 | + } | ||
| 557 | + | ||
| 558 | + m=new HashMap<String,Object>(); | ||
| 559 | + m.put("total_zgl", zgl); | ||
| 560 | + m.put("total_ks", ks); | ||
| 561 | + m.put("total_yh", yh); | ||
| 562 | + m.put("total_bc", bc); | ||
| 563 | + | ||
| 564 | + m.put("line", BasicData.lineCode2NameMap.get(map.get("line").toString())); | ||
| 565 | + m.put("date", map.get("date").toString()); | ||
| 566 | + try { | ||
| 567 | + listI.add(resList.iterator()); | ||
| 568 | + String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\"; | ||
| 569 | + ee.excelReplace(listI, new Object[] { m }, path + "mould\\daily.xls", path + "export\\班次日报表" | ||
| 570 | + + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls"); | ||
| 571 | + } catch (Exception e) { | ||
| 572 | + e.printStackTrace(); | ||
| 573 | + } | ||
| 574 | + return resList; | ||
| 575 | + } | ||
| 576 | + | ||
| 425 | 577 | ||
| 426 | 578 | ||
| 427 | } | 579 | } |
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
| @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController; | @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController; | ||
| 11 | 11 | ||
| 12 | import com.bsth.entity.mcy_forms.Allline; | 12 | import com.bsth.entity.mcy_forms.Allline; |
| 13 | import com.bsth.entity.mcy_forms.Changetochange; | 13 | import com.bsth.entity.mcy_forms.Changetochange; |
| 14 | +import com.bsth.entity.mcy_forms.Daily; | ||
| 14 | import com.bsth.entity.mcy_forms.Executionrate; | 15 | import com.bsth.entity.mcy_forms.Executionrate; |
| 15 | import com.bsth.entity.mcy_forms.Linepasswengerflow; | 16 | import com.bsth.entity.mcy_forms.Linepasswengerflow; |
| 16 | import com.bsth.entity.mcy_forms.Operationservice; | 17 | import com.bsth.entity.mcy_forms.Operationservice; |
| @@ -112,4 +113,12 @@ public class MCY_FormsController { | @@ -112,4 +113,12 @@ public class MCY_FormsController { | ||
| 112 | 113 | ||
| 113 | return formsService.allline(map); | 114 | return formsService.allline(map); |
| 114 | } | 115 | } |
| 116 | + | ||
| 117 | + // 营运线路名称统计表 | ||
| 118 | + @RequestMapping(value = "/daily", method = RequestMethod.POST) | ||
| 119 | + public List<Daily> daily(@RequestParam Map<String, Object> map) { | ||
| 120 | + | ||
| 121 | + return formsService.daily(map); | ||
| 122 | + } | ||
| 123 | + | ||
| 115 | } | 124 | } |
src/main/java/com/bsth/entity/mcy_forms/Daily.java
0 → 100644
| 1 | +package com.bsth.entity.mcy_forms; | ||
| 2 | + | ||
| 3 | +public class Daily { | ||
| 4 | + | ||
| 5 | + private String rq;//日期 | ||
| 6 | + | ||
| 7 | + public String getRq() { | ||
| 8 | + return rq; | ||
| 9 | + } | ||
| 10 | + | ||
| 11 | + public void setRq(String rq) { | ||
| 12 | + this.rq = rq; | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + private String zbh;//车牌号 | ||
| 16 | + | ||
| 17 | + private String jgh;//员工号 | ||
| 18 | + | ||
| 19 | + private String jName;//驾驶员 | ||
| 20 | + | ||
| 21 | + private String zlc;//里程 | ||
| 22 | + | ||
| 23 | + private String jzl1;//空驶公里 | ||
| 24 | + | ||
| 25 | + private String yh;//油耗 | ||
| 26 | + | ||
| 27 | + private String bc;//班次 | ||
| 28 | + | ||
| 29 | + public String getZbh() { | ||
| 30 | + return zbh; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + public void setZbh(String zbh) { | ||
| 34 | + this.zbh = zbh; | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + public String getJgh() { | ||
| 38 | + return jgh; | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + public void setJgh(String jgh) { | ||
| 42 | + this.jgh = jgh; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + public String getjName() { | ||
| 46 | + return jName; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + public void setjName(String jName) { | ||
| 50 | + this.jName = jName; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + public String getZlc() { | ||
| 54 | + return zlc; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + public void setZlc(String zlc) { | ||
| 58 | + this.zlc = zlc; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + public String getJzl1() { | ||
| 62 | + return jzl1; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + public void setJzl1(String jzl1) { | ||
| 66 | + this.jzl1 = jzl1; | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + public String getYh() { | ||
| 70 | + return yh; | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + public void setYh(String yh) { | ||
| 74 | + this.yh = yh; | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + public String getBc() { | ||
| 78 | + return bc; | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + public void setBc(String bc) { | ||
| 82 | + this.bc = bc; | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + | ||
| 86 | + | ||
| 87 | + | ||
| 88 | + | ||
| 89 | +} |
src/main/java/com/bsth/service/forms/ExportService.java
| @@ -2,6 +2,7 @@ package com.bsth.service.forms; | @@ -2,6 +2,7 @@ package com.bsth.service.forms; | ||
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | 4 | ||
| 5 | +import com.bsth.entity.mcy_forms.Daily; | ||
| 5 | import com.bsth.entity.mcy_forms.Linepasswengerflow; | 6 | import com.bsth.entity.mcy_forms.Linepasswengerflow; |
| 6 | import com.bsth.entity.mcy_forms.Operationservice; | 7 | import com.bsth.entity.mcy_forms.Operationservice; |
| 7 | import com.bsth.entity.mcy_forms.Shifday; | 8 | import com.bsth.entity.mcy_forms.Shifday; |
| @@ -28,6 +29,6 @@ public interface ExportService { | @@ -28,6 +29,6 @@ public interface ExportService { | ||
| 28 | public void operationservice(String startDate, String endDate, String lpName, | 29 | public void operationservice(String startDate, String endDate, String lpName, |
| 29 | List<Operationservice> resList); | 30 | List<Operationservice> resList); |
| 30 | 31 | ||
| 31 | - | 32 | + |
| 32 | 33 | ||
| 33 | } | 34 | } |
src/main/java/com/bsth/service/forms/FormsService.java
| @@ -5,6 +5,7 @@ import java.util.Map; | @@ -5,6 +5,7 @@ import java.util.Map; | ||
| 5 | 5 | ||
| 6 | import com.bsth.entity.mcy_forms.Allline; | 6 | import com.bsth.entity.mcy_forms.Allline; |
| 7 | import com.bsth.entity.mcy_forms.Changetochange; | 7 | import com.bsth.entity.mcy_forms.Changetochange; |
| 8 | +import com.bsth.entity.mcy_forms.Daily; | ||
| 8 | import com.bsth.entity.mcy_forms.Executionrate; | 9 | import com.bsth.entity.mcy_forms.Executionrate; |
| 9 | import com.bsth.entity.mcy_forms.Linepasswengerflow; | 10 | import com.bsth.entity.mcy_forms.Linepasswengerflow; |
| 10 | import com.bsth.entity.mcy_forms.Operationservice; | 11 | import com.bsth.entity.mcy_forms.Operationservice; |
| @@ -39,4 +40,6 @@ public interface FormsService { | @@ -39,4 +40,6 @@ public interface FormsService { | ||
| 39 | public List<Executionrate> executionrate(Map<String, Object> map); | 40 | public List<Executionrate> executionrate(Map<String, Object> map); |
| 40 | 41 | ||
| 41 | public List<Allline> allline(Map<String, Object> map); | 42 | public List<Allline> allline(Map<String, Object> map); |
| 43 | + | ||
| 44 | + public List<Daily> daily(Map<String, Object> map); | ||
| 42 | } | 45 | } |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| @@ -25,6 +25,7 @@ import com.bsth.entity.mcy_forms.Vehicleloading; | @@ -25,6 +25,7 @@ import com.bsth.entity.mcy_forms.Vehicleloading; | ||
| 25 | import com.bsth.entity.mcy_forms.Waybillday; | 25 | import com.bsth.entity.mcy_forms.Waybillday; |
| 26 | import com.bsth.entity.mcy_forms.Allline; | 26 | import com.bsth.entity.mcy_forms.Allline; |
| 27 | import com.bsth.entity.mcy_forms.Changetochange; | 27 | import com.bsth.entity.mcy_forms.Changetochange; |
| 28 | +import com.bsth.entity.mcy_forms.Daily; | ||
| 28 | import com.bsth.entity.mcy_forms.Executionrate; | 29 | import com.bsth.entity.mcy_forms.Executionrate; |
| 29 | import com.bsth.service.forms.CommonService; | 30 | import com.bsth.service.forms.CommonService; |
| 30 | import com.bsth.service.forms.FormsService; | 31 | import com.bsth.service.forms.FormsService; |
| @@ -708,4 +709,46 @@ public class FormsServiceImpl implements FormsService { | @@ -708,4 +709,46 @@ public class FormsServiceImpl implements FormsService { | ||
| 708 | 709 | ||
| 709 | return list; | 710 | return list; |
| 710 | } | 711 | } |
| 712 | + | ||
| 713 | + @Override | ||
| 714 | + public List<Daily> daily(Map<String, Object> map) { | ||
| 715 | + | ||
| 716 | + String sql ="select r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name " | ||
| 717 | + + " from bsth_c_s_sp_info_real r LEFT JOIN bsth_c_ylb y ON r.cl_zbh = y.nbbm " | ||
| 718 | + + " WHERE 1 = 1" | ||
| 719 | + + " and r.xl_bm='" + map.get("line").toString() + "'" | ||
| 720 | + + " and to_days(r.schedule_date)=to_days('"+map.get("date").toString()+"')" | ||
| 721 | + + " AND r.gs_bm is not null"; | ||
| 722 | + | ||
| 723 | + if(map.get("gsdmDaily").toString()!=""){ | ||
| 724 | + sql+=" and r.gs_bm='"+map.get("gsdmDaily").toString()+"'"; | ||
| 725 | + } | ||
| 726 | + if(map.get("fgsdmDaily").toString()!=""){ | ||
| 727 | + sql+=" and r.fgs_bm='"+map.get("fgsdmDaily").toString()+"'"; | ||
| 728 | + } | ||
| 729 | + sql += " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "; | ||
| 730 | + | ||
| 731 | + List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() { | ||
| 732 | + @Override | ||
| 733 | + public Daily mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 734 | + Daily daily = new Daily(); | ||
| 735 | + daily.setRq(arg0.getString("schedule_date_str")); | ||
| 736 | + daily.setZbh(arg0.getString("cl_zbh")); | ||
| 737 | + daily.setJgh(arg0.getString("j_gh")); | ||
| 738 | + daily.setjName(arg0.getString("j_name")); | ||
| 739 | + daily.setYh(arg0.getString("YH")); | ||
| 740 | + return daily; | ||
| 741 | + } | ||
| 742 | + }); | ||
| 743 | + | ||
| 744 | + for(int i=0;i<list.size();i++){ | ||
| 745 | + Daily d=list.get(i); | ||
| 746 | + Map<String, Object> maps = new HashMap<>(); | ||
| 747 | + maps = commonService.findKMBC2(d.getJgh(),d.getZbh(),d.getRq()); | ||
| 748 | + d.setJzl1(maps.get("ksgl").toString()); | ||
| 749 | + d.setZlc(maps.get("realMileage").toString()); | ||
| 750 | + d.setBc(maps.get("sjbc").toString()); | ||
| 751 | + } | ||
| 752 | + return list; | ||
| 753 | + } | ||
| 711 | } | 754 | } |
src/main/resources/static/pages/forms/mould/allline.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/daily.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/daily.html
| @@ -26,7 +26,15 @@ | @@ -26,7 +26,15 @@ | ||
| 26 | <div class="col-md-12"> | 26 | <div class="col-md-12"> |
| 27 | <div class="portlet light porttlet-fit bordered"> | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | <div class="portlet-title"> | 28 | <div class="portlet-title"> |
| 29 | - <form class="form-inline" action=""> | 29 | + <form class="form-inline" action=""> |
| 30 | + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_daily"> | ||
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 32 | + <select class="form-control" name="company" id="gsdmDaily" style="width: 140px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_daily"> | ||
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 36 | + <select class="form-control" name="subCompany" id="fgsdmDaily" style="width: 140px;"></select> | ||
| 37 | + </div> | ||
| 30 | <div style="display: inline-block;"> | 38 | <div style="display: inline-block;"> |
| 31 | <span class="item-label" style="width: 80px;">线路: </span> | 39 | <span class="item-label" style="width: 80px;">线路: </span> |
| 32 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> | 40 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| @@ -64,15 +72,15 @@ | @@ -64,15 +72,15 @@ | ||
| 64 | <td>班次</td> | 72 | <td>班次</td> |
| 65 | </tr> | 73 | </tr> |
| 66 | </thead> | 74 | </thead> |
| 67 | - <tbody class="dailyInfo"> | 75 | + <tbody id="tbody"> |
| 68 | 76 | ||
| 69 | </tbody> | 77 | </tbody> |
| 70 | <tr> | 78 | <tr> |
| 71 | <td colspan="3">小计</td> | 79 | <td colspan="3">小计</td> |
| 72 | <td><span id="total_zgl"> </span></td> | 80 | <td><span id="total_zgl"> </span></td> |
| 73 | - <td><span id="total_ksgl"> </span></td> | 81 | + <td><span id="total_ks"> </span></td> |
| 74 | <td><span id="total_yh"> </span></td> | 82 | <td><span id="total_yh"> </span></td> |
| 75 | - <td><span id="total_bcs"> </span></td> | 83 | + <td><span id="total_bc"> </span></td> |
| 76 | </tr> | 84 | </tr> |
| 77 | </table> | 85 | </table> |
| 78 | </div> | 86 | </div> |
| @@ -82,7 +90,9 @@ | @@ -82,7 +90,9 @@ | ||
| 82 | </div> | 90 | </div> |
| 83 | 91 | ||
| 84 | <script> | 92 | <script> |
| 85 | - $(function(){ | 93 | + $(function(){ |
| 94 | + var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'}; | ||
| 95 | + | ||
| 86 | // 关闭左侧栏 | 96 | // 关闭左侧栏 |
| 87 | if (!$('body').hasClass('page-sidebar-closed')) | 97 | if (!$('body').hasClass('page-sidebar-closed')) |
| 88 | $('.menu-toggler.sidebar-toggler').click(); | 98 | $('.menu-toggler.sidebar-toggler').click(); |
| @@ -92,6 +102,42 @@ | @@ -92,6 +102,42 @@ | ||
| 92 | locale : 'zh-cn' | 102 | locale : 'zh-cn' |
| 93 | }); | 103 | }); |
| 94 | 104 | ||
| 105 | + var obj = []; | ||
| 106 | + $.get('/user/companyData', function(result){ | ||
| 107 | + obj = result; | ||
| 108 | + var options = ''; | ||
| 109 | + for(var i = 0; i < obj.length; i++){ | ||
| 110 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + if(obj.length ==0){ | ||
| 114 | + $("#gsdmDiv_daily").css('display','none'); | ||
| 115 | + $('#gsdmDiv_daily').css('display','none'); | ||
| 116 | + }else if(obj.length ==1){ | ||
| 117 | + $("#fgsdmDiv_daily").css('display','none'); | ||
| 118 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | ||
| 119 | + $('#fgsdmDiv_daily').css('display','none'); | ||
| 120 | + } | ||
| 121 | + $('#gsdmDaily').html(options); | ||
| 122 | + updateCompany(); | ||
| 123 | + }); | ||
| 124 | + | ||
| 125 | + $("#gsdmDaily").on("change",updateCompany); | ||
| 126 | + function updateCompany(){ | ||
| 127 | + var company = $('#gsdmDaily').val(); | ||
| 128 | + var options = ''; | ||
| 129 | + for(var i = 0; i < obj.length; i++){ | ||
| 130 | + if(obj[i].companyCode == company){ | ||
| 131 | + var children = obj[i].children; | ||
| 132 | + for(var j = 0; j < children.length; j++){ | ||
| 133 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 134 | + } | ||
| 135 | + } | ||
| 136 | + } | ||
| 137 | + $('#fgsdmDaily').html(options); | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + | ||
| 95 | $.get('/basic/lineCode2Name',function(result){ | 141 | $.get('/basic/lineCode2Name',function(result){ |
| 96 | var data=[]; | 142 | var data=[]; |
| 97 | 143 | ||
| @@ -101,50 +147,82 @@ | @@ -101,50 +147,82 @@ | ||
| 101 | initPinYinSelect2('#line',data,''); | 147 | initPinYinSelect2('#line',data,''); |
| 102 | 148 | ||
| 103 | }) | 149 | }) |
| 104 | - var line; | ||
| 105 | - var date; | ||
| 106 | - $("#query").on("click",function(){ | ||
| 107 | - line = $("#line").val(); | ||
| 108 | - var lineName=$("#select2-line-container").html(); | ||
| 109 | - date = $("#date").val(); | ||
| 110 | - $get('/realSchedule/dailyInfo',{line:line,date:date,type:'query'},function(result){ | ||
| 111 | - $("#form_line").text(lineName); | ||
| 112 | - $("#form_date").text(date); | ||
| 113 | - var total_zgl = 0,total_ksgl = 0,total_yh = 0,total_bcs = 0; | ||
| 114 | - $.each(result, function(i, obj) { | ||
| 115 | - total_zgl = Number(obj.zgl)+Number(total_zgl); | ||
| 116 | - total_ksgl = Number(obj.ksgl)+Number(total_ksgl); | ||
| 117 | - total_yh = Number(0)+Number(total_yh); | ||
| 118 | - total_bcs = Number(obj.bcs)+Number(total_bcs); | ||
| 119 | - }); | ||
| 120 | - $("#total_zgl").text(total_zgl.toFixed(2)); | ||
| 121 | - $("#total_ksgl").text(total_ksgl.toFixed(2)); | ||
| 122 | - $("#total_yh").text(total_yh.toFixed(2)); | ||
| 123 | - $("#total_bcs").text(total_bcs); | ||
| 124 | - | ||
| 125 | - // 把数据填充到模版中 | ||
| 126 | - var tbodyHtml = template('dailyInfo',{list:result}); | ||
| 127 | - // 把渲染好的模版html文本追加到表格中 | ||
| 128 | - $('#forms .dailyInfo').html(tbodyHtml); | ||
| 129 | - }); | 150 | + |
| 151 | + var line; | ||
| 152 | + var date; | ||
| 153 | + var gsdmDaily; | ||
| 154 | + var fgsdmDaily; | ||
| 155 | + $("#query").on("click",function(){ | ||
| 156 | + | ||
| 157 | + line = $("#line").val(); | ||
| 158 | + var lineName=$("#select2-line-container").html(); | ||
| 159 | + date = $("#date").val(); | ||
| 160 | + gsdmDaily=$("#gsdmDaily").val(); | ||
| 161 | + fgsdmDaily = $("#fgsdmDaily").val(); | ||
| 162 | + | ||
| 163 | + $post('/mcy_forms/daily',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily, line:line,date:date,type:'query'},function(result){ | ||
| 164 | + $("#form_line").text(lineName); | ||
| 165 | + $("#form_date").text(date); | ||
| 166 | + // 把数据填充到模版中 | ||
| 167 | + var tbodyHtml = template('dailyInfo',{list:result}); | ||
| 168 | + // 把渲染好的模版html文本追加到表格中 | ||
| 169 | + $('#tbody').html(tbodyHtml); | ||
| 170 | + line = $("#line").val(); | ||
| 171 | + | ||
| 172 | + startDate = $("#startDate").val(); | ||
| 173 | + endDate = $("#endDate").val(); | ||
| 174 | + $("#sDate").text(startDate); | ||
| 175 | + $("#eDate").text(endDate); | ||
| 176 | + | ||
| 177 | + var total_zgl = 0,total_ks = 0; | ||
| 178 | + var total_yh = 0,total_bc = 0; | ||
| 179 | + | ||
| 180 | + $.each(result, function(i, obj) { | ||
| 181 | + total_zgl +=Number(obj.zlc); | ||
| 182 | + total_ks +=Number(obj.jzl1); | ||
| 183 | + total_yh += Number(obj.yh); | ||
| 184 | + total_bc += Number(obj.bc); | ||
| 185 | + | ||
| 186 | + }); | ||
| 187 | + $("#total_zgl").text(total_zgl.toFixed(2)); | ||
| 188 | + $("#total_ks").text(total_ks.toFixed(2)); | ||
| 189 | + $("#total_yh").text(total_yh.toFixed(2)); | ||
| 190 | + $("#total_bc").text(total_bc.toFixed(2)); | ||
| 191 | + | ||
| 192 | + var temp = {}; | ||
| 193 | + var today_account = 0; | ||
| 194 | + | ||
| 195 | + temp["line"] = $("#line").text(); | ||
| 196 | + $.each(result, function(i, obj) { | ||
| 197 | + if(moment(obj.schedule_date_str).format("YYYY-MM-DD") == moment(obj.startDate).format("YYYY-MM-DD")){ | ||
| 198 | + today_account++; | ||
| 199 | + } | ||
| 200 | + obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss"); | ||
| 201 | + }); | ||
| 202 | + }) | ||
| 203 | + }); | ||
| 204 | + | ||
| 205 | + $("#export").on("click",function(){ | ||
| 206 | + line = $("#line").val(); | ||
| 207 | + date = $("#date").val(); | ||
| 208 | + gsdmDaily=$("#gsdmDaily").val(); | ||
| 209 | + fgsdmDaily = $("#fgsdmDaily").val(); | ||
| 210 | + $post('/mcy_export/dailyExport',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily,line:line,date:date,type:'export'},function(result){ | ||
| 211 | + window.open("/downloadFile/download?fileName=班次日报表"+moment(date).format("YYYYMMDD")); | ||
| 130 | }); | 212 | }); |
| 131 | - $("#export").on("click",function(){ | ||
| 132 | - $get('/realSchedule/dailyInfo',{line:line,date:date,type:'export'},function(result){ | ||
| 133 | - window.open("/downloadFile/download?fileName=班次日报"+moment(date).format("YYYYMMDD")); | ||
| 134 | - }); | ||
| 135 | - }); | ||
| 136 | - }); | 213 | + }); |
| 214 | +}); | ||
| 137 | </script> | 215 | </script> |
| 138 | <script type="text/html" id="dailyInfo"> | 216 | <script type="text/html" id="dailyInfo"> |
| 139 | {{each list as obj i}} | 217 | {{each list as obj i}} |
| 140 | <tr> | 218 | <tr> |
| 141 | - <td>{{obj.clZbh}}</td> | ||
| 142 | - <td>{{obj.jGh}}</td> | 219 | + <td>{{obj.zbh}}</td> |
| 220 | + <td>{{obj.jgh}}</td> | ||
| 143 | <td>{{obj.jName}}</td> | 221 | <td>{{obj.jName}}</td> |
| 144 | - <td>{{obj.zgl}}</td> | ||
| 145 | - <td>{{obj.ksgl}}</td> | ||
| 146 | - <td>0</td> | ||
| 147 | - <td>{{obj.bcs}}</td> | 222 | + <td>{{obj.zlc}}</td> |
| 223 | + <td>{{obj.jzl1}}</td> | ||
| 224 | + <td>{{obj.yh}}</td> | ||
| 225 | + <td>{{obj.bc}}</td> | ||
| 148 | </tr> | 226 | </tr> |
| 149 | {{/each}} | 227 | {{/each}} |
| 150 | {{if list.length == 0}} | 228 | {{if list.length == 0}} |
src/main/resources/static/pages/mforms/alllines/allline.html
| @@ -230,8 +230,7 @@ | @@ -230,8 +230,7 @@ | ||
| 230 | var total_bcjh = 0, total_bcsj = 0, total_bczxl = 0; | 230 | var total_bcjh = 0, total_bcsj = 0, total_bczxl = 0; |
| 231 | var total_gs = 0; | 231 | var total_gs = 0; |
| 232 | var total_zhgs = 0; | 232 | var total_zhgs = 0; |
| 233 | - $ | ||
| 234 | - .each( | 233 | + $.each( |
| 235 | result, | 234 | result, |
| 236 | function(i, obj) { | 235 | function(i, obj) { |
| 237 | total_gs += Number(obj.gsgs); | 236 | total_gs += Number(obj.gsgs); |