Commit c35fb6821d526a3713178a906e4a499ffc259b75
1 parent
b2655791
闵行工时统计报表:实际工时拆成营运和空驶,查询日期改成日期区间,加上全部线路的选项
Showing
7 changed files
with
167 additions
and
68 deletions
src/main/java/com/bsth/controller/report/ReportController.java
| @@ -366,9 +366,9 @@ public class ReportController { | @@ -366,9 +366,9 @@ public class ReportController { | ||
| 366 | 366 | ||
| 367 | @RequestMapping(value="/workingHours" ,method = RequestMethod.POST) | 367 | @RequestMapping(value="/workingHours" ,method = RequestMethod.POST) |
| 368 | public List<Map<String, Object>> workingHours(@RequestParam String gsdm, @RequestParam String fgsdm, | 368 | public List<Map<String, Object>> workingHours(@RequestParam String gsdm, @RequestParam String fgsdm, |
| 369 | - @RequestParam String line, @RequestParam String date, @RequestParam String gh, @RequestParam String cl, | ||
| 370 | - @RequestParam String lineName, @RequestParam String type){ | ||
| 371 | - List<Map<String, Object>> list = service.workingHours(gsdm, fgsdm, line, date, gh, cl); | 369 | + @RequestParam String line, @RequestParam String date, @RequestParam String date2, @RequestParam String gh, |
| 370 | + @RequestParam String cl, @RequestParam String lineName, @RequestParam String type){ | ||
| 371 | + List<Map<String, Object>> list = service.workingHours(gsdm, fgsdm, line, date, date2, gh, cl); | ||
| 372 | if("export".equals(type)){ | 372 | if("export".equals(type)){ |
| 373 | try { | 373 | try { |
| 374 | ReportUtils ee = new ReportUtils(); | 374 | ReportUtils ee = new ReportUtils(); |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| @@ -182,6 +182,16 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -182,6 +182,16 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 182 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 182 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 183 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr = ?1 and s.xlBm = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% order by s.gsBm, s.fgsBm, s.xlBm") | 183 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr = ?1 and s.xlBm = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% order by s.gsBm, s.fgsBm, s.xlBm") |
| 184 | List<ScheduleRealInfo> scheduleByDateAndLine4(String scheduleDate, String line, String gsdm, String fgsdm); | 184 | List<ScheduleRealInfo> scheduleByDateAndLine4(String scheduleDate, String line, String gsdm, String fgsdm); |
| 185 | + | ||
| 186 | + /**按日期区间线路查询*/ | ||
| 187 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | ||
| 188 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr between ?1 and ?2 and s.xlBm = ?3 and s.gsBm like %?4% and s.fgsBm like %?5% order by s.gsBm, s.fgsBm, s.xlBm") | ||
| 189 | + List<ScheduleRealInfo> scheduleByDateAndLine5(String date, String date2, String line, String gsdm, String fgsdm); | ||
| 190 | + | ||
| 191 | + /**按日期区间查询*/ | ||
| 192 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | ||
| 193 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr between ?1 and ?2 and s.gsBm like %?3% and s.fgsBm like %?4% order by s.gsBm, s.fgsBm, s.xlBm") | ||
| 194 | + List<ScheduleRealInfo> scheduleByDates(String date, String date2, String gsdm, String fgsdm); | ||
| 185 | 195 | ||
| 186 | //按照时间段统计 | 196 | //按照时间段统计 |
| 187 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 197 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
src/main/java/com/bsth/repository/schedule/SchedulePlanInfoRepository.java
| @@ -127,5 +127,11 @@ public interface SchedulePlanInfoRepository extends BaseRepository<SchedulePlanI | @@ -127,5 +127,11 @@ public interface SchedulePlanInfoRepository extends BaseRepository<SchedulePlanI | ||
| 127 | 127 | ||
| 128 | @Query(value="select s from SchedulePlanInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 and s.xlBm = ?2 and s.gsBm like %?3% and s.fgsBm like %?4%") | 128 | @Query(value="select s from SchedulePlanInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 and s.xlBm = ?2 and s.gsBm like %?3% and s.fgsBm like %?4%") |
| 129 | List<SchedulePlanInfo> findByDateAndLine(String scheduleDate, String line, String gsdm, String fgsdm); | 129 | List<SchedulePlanInfo> findByDateAndLine(String scheduleDate, String line, String gsdm, String fgsdm); |
| 130 | + | ||
| 131 | + @Query(value="select s from SchedulePlanInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?1 and ?2 and s.xlBm = ?3 and s.gsBm like %?4% and s.fgsBm like %?5%") | ||
| 132 | + List<SchedulePlanInfo> findByDatesAndLine(String date, String date2, String line, String gsdm, String fgsdm); | ||
| 133 | + | ||
| 134 | + @Query(value="select s from SchedulePlanInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?1 and ?2 and s.gsBm like %?3% and s.fgsBm like %?4%") | ||
| 135 | + List<SchedulePlanInfo> findByDates(String date, String date2, String gsdm, String fgsdm); | ||
| 130 | 136 | ||
| 131 | } | 137 | } |
src/main/java/com/bsth/service/report/ReportService.java
| @@ -57,5 +57,5 @@ public interface ReportService { | @@ -57,5 +57,5 @@ public interface ReportService { | ||
| 57 | 57 | ||
| 58 | Map<String, Object> online(Map<String, Object> map); | 58 | Map<String, Object> online(Map<String, Object> map); |
| 59 | 59 | ||
| 60 | - List<Map<String, Object>> workingHours(String gsdm, String fgsdm, String line, String date, String gh, String cl); | 60 | + List<Map<String, Object>> workingHours(String gsdm, String fgsdm, String line, String date, String date2, String gh, String cl); |
| 61 | } | 61 | } |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -3558,60 +3558,108 @@ public class ReportServiceImpl implements ReportService{ | @@ -3558,60 +3558,108 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3558 | } | 3558 | } |
| 3559 | 3559 | ||
| 3560 | @Override | 3560 | @Override |
| 3561 | - public List<Map<String, Object>> workingHours(String gsdm, String fgsdm, String line, String date, | 3561 | + public List<Map<String, Object>> workingHours(String gsdm, String fgsdm, String line, String date, String date2, |
| 3562 | String gh, String cl) { | 3562 | String gh, String cl) { |
| 3563 | List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>(); | 3563 | List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>(); |
| 3564 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 3564 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 3565 | - List<SchedulePlanInfo> planList = schedulePlanInfoRepository.findByDateAndLine(date, line, gsdm, fgsdm); | ||
| 3566 | - List<ScheduleRealInfo> realList = scheduleRealInfoRepository.scheduleByDateAndLine4(date, line, gsdm, fgsdm); | 3565 | + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 3566 | +// List<SchedulePlanInfo> planList = new ArrayList<SchedulePlanInfo>(); | ||
| 3567 | + List<ScheduleRealInfo> realList = new ArrayList<ScheduleRealInfo>(); | ||
| 3568 | + if(line != null && line.trim().length() > 0){ | ||
| 3569 | +// planList = schedulePlanInfoRepository.findByDatesAndLine(date, date2, line, gsdm, fgsdm); | ||
| 3570 | + realList = scheduleRealInfoRepository.scheduleByDateAndLine5(date, date2, line, gsdm, fgsdm); | ||
| 3571 | + } else { | ||
| 3572 | +// planList = schedulePlanInfoRepository.findByDates(date, date2, gsdm, fgsdm); | ||
| 3573 | + realList = scheduleRealInfoRepository.scheduleByDates(date, date2, gsdm, fgsdm); | ||
| 3574 | + } | ||
| 3575 | + | ||
| 3576 | + | ||
| 3567 | Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>(); | 3577 | Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>(); |
| 3568 | - for(SchedulePlanInfo plan : planList){ | ||
| 3569 | - String gsBm = plan.getGsBm(); | ||
| 3570 | - String fgsBm = plan.getFgsBm(); | ||
| 3571 | - String xlBm = plan.getXlBm(); | ||
| 3572 | - String scheduleDate = sdf.format(plan.getScheduleDate()); | ||
| 3573 | - String jGh = plan.getjGh(); | ||
| 3574 | - String jName = plan.getjName(); | ||
| 3575 | -// String sGh = plan.getsGh(); | ||
| 3576 | -// String sName = plan.getsName(); | ||
| 3577 | - String clZbh = plan.getClZbh(); | ||
| 3578 | - String lpName = plan.getLpName(); | ||
| 3579 | - Long bcsj = (long)plan.getBcsj(); | ||
| 3580 | - | ||
| 3581 | - String key = gsBm + "/" + fgsBm + "/" + xlBm + "/" + scheduleDate + "/" | ||
| 3582 | - + jGh + "/" + jName + "/" + clZbh + "/" + lpName; | ||
| 3583 | - if(!(keyMap.containsKey(key))){ | ||
| 3584 | - Map<String, Object> m = new HashMap<String, Object>(); | ||
| 3585 | - m.put("gsBm", gsBm); | ||
| 3586 | - m.put("fgsBm", fgsBm); | ||
| 3587 | - m.put("xlBm", xlBm); | ||
| 3588 | - m.put("date", scheduleDate); | ||
| 3589 | - m.put("jGh", jGh); | ||
| 3590 | - m.put("jName", jName); | ||
| 3591 | -// m.put("sGh", sGh); | ||
| 3592 | -// m.put("sName", sName); | ||
| 3593 | - m.put("clZbh", clZbh); | ||
| 3594 | - m.put("lpName", lpName); | ||
| 3595 | - m.put("jh", 0); | ||
| 3596 | - m.put("sj", 0); | ||
| 3597 | - keyMap.put(key, m); | 3578 | +// for(SchedulePlanInfo plan : planList){ |
| 3579 | +// String gsBm = plan.getGsBm(); | ||
| 3580 | +// String fgsBm = plan.getFgsBm(); | ||
| 3581 | +// String xlBm = plan.getXlBm(); | ||
| 3582 | +//// String scheduleDate = sdf.format(plan.getScheduleDate()); | ||
| 3583 | +// String jGh = plan.getjGh(); | ||
| 3584 | +// String jName = plan.getjName(); | ||
| 3585 | +//// String sGh = plan.getsGh(); | ||
| 3586 | +//// String sName = plan.getsName(); | ||
| 3587 | +// String clZbh = plan.getClZbh(); | ||
| 3588 | +// String lpName = plan.getLpName(); | ||
| 3589 | +// Long bcsj = (long)plan.getBcsj(); | ||
| 3590 | +// | ||
| 3591 | +// String key = gsBm + "/" + fgsBm + "/" + xlBm + "/" | ||
| 3592 | +// + jGh + "/" + jName + "/" + clZbh + "/" + lpName; | ||
| 3593 | +// if(!(keyMap.containsKey(key))){ | ||
| 3594 | +// Map<String, Object> m = new HashMap<String, Object>(); | ||
| 3595 | +// m.put("gsBm", gsBm); | ||
| 3596 | +// m.put("fgsBm", fgsBm); | ||
| 3597 | +// m.put("xlBm", xlBm); | ||
| 3598 | +//// m.put("date", scheduleDate); | ||
| 3599 | +// m.put("jGh", jGh); | ||
| 3600 | +// m.put("jName", jName); | ||
| 3601 | +//// m.put("sGh", sGh); | ||
| 3602 | +//// m.put("sName", sName); | ||
| 3603 | +// m.put("clZbh", clZbh); | ||
| 3604 | +// m.put("lpName", lpName); | ||
| 3605 | +// m.put("jh", 0); | ||
| 3606 | +// m.put("sj", 0); | ||
| 3607 | +// keyMap.put(key, m); | ||
| 3608 | +// } | ||
| 3609 | +// Map<String, Object> map = keyMap.get(key); | ||
| 3610 | +// map.put("jh", bcsj + Long.valueOf(map.get("jh").toString())); | ||
| 3611 | +// } | ||
| 3612 | + for(ScheduleRealInfo plan : realList){ | ||
| 3613 | + if(!(plan.isSflj()) && !(plan.isCcService())){ | ||
| 3614 | + String gsBm = plan.getGsBm(); | ||
| 3615 | + String fgsBm = plan.getFgsBm(); | ||
| 3616 | + String xlBm = plan.getXlBm(); | ||
| 3617 | +// String scheduleDate = sdf.format(plan.getScheduleDate()); | ||
| 3618 | + String jGh = plan.getjGh(); | ||
| 3619 | + String jName = plan.getjName(); | ||
| 3620 | +// String sGh = plan.getsGh(); | ||
| 3621 | +// String sName = plan.getsName(); | ||
| 3622 | + String clZbh = plan.getClZbh(); | ||
| 3623 | + String lpName = plan.getLpName(); | ||
| 3624 | + Long bcsj = (long)plan.getBcsj(); | ||
| 3625 | + | ||
| 3626 | + String key = gsBm + "/" + fgsBm + "/" + xlBm + "/" | ||
| 3627 | + + jGh + "/" + jName + "/" + clZbh + "/" + lpName; | ||
| 3628 | + if(!(keyMap.containsKey(key))){ | ||
| 3629 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 3630 | + m.put("gsBm", gsBm); | ||
| 3631 | + m.put("fgsBm", fgsBm); | ||
| 3632 | + m.put("xlBm", xlBm); | ||
| 3633 | +// m.put("date", scheduleDate); | ||
| 3634 | + m.put("jGh", jGh); | ||
| 3635 | + m.put("jName", jName); | ||
| 3636 | +// m.put("sGh", sGh); | ||
| 3637 | +// m.put("sName", sName); | ||
| 3638 | + m.put("clZbh", clZbh); | ||
| 3639 | + m.put("lpName", lpName); | ||
| 3640 | + m.put("jh", 0); | ||
| 3641 | + m.put("sjyy", 0); | ||
| 3642 | + m.put("sjks", 0); | ||
| 3643 | + keyMap.put(key, m); | ||
| 3644 | + } | ||
| 3645 | + Map<String, Object> map = keyMap.get(key); | ||
| 3646 | + map.put("jh", bcsj + Long.valueOf(map.get("jh").toString())); | ||
| 3598 | } | 3647 | } |
| 3599 | - Map<String, Object> map = keyMap.get(key); | ||
| 3600 | - map.put("jh", bcsj + Long.valueOf(map.get("jh").toString())); | ||
| 3601 | } | 3648 | } |
| 3602 | for(ScheduleRealInfo real : realList){ | 3649 | for(ScheduleRealInfo real : realList){ |
| 3603 | Set<ChildTaskPlan> getcTasks = real.getcTasks(); | 3650 | Set<ChildTaskPlan> getcTasks = real.getcTasks(); |
| 3604 | String gsBm = real.getGsBm(); | 3651 | String gsBm = real.getGsBm(); |
| 3605 | String fgsBm = real.getFgsBm(); | 3652 | String fgsBm = real.getFgsBm(); |
| 3606 | String xlBm = real.getXlBm(); | 3653 | String xlBm = real.getXlBm(); |
| 3607 | - String scheduleDate = real.getScheduleDateStr(); | 3654 | +// String scheduleDate = real.getScheduleDateStr(); |
| 3608 | String jGh = real.getjGh(); | 3655 | String jGh = real.getjGh(); |
| 3609 | String jName = real.getjName(); | 3656 | String jName = real.getjName(); |
| 3610 | // String sGh = real.getsGh(); | 3657 | // String sGh = real.getsGh(); |
| 3611 | // String sName = real.getsName(); | 3658 | // String sName = real.getsName(); |
| 3612 | String clZbh = real.getClZbh(); | 3659 | String clZbh = real.getClZbh(); |
| 3613 | String lpName = real.getLpName(); | 3660 | String lpName = real.getLpName(); |
| 3614 | - Long bcsj = 0l; | 3661 | + Long bcsj_yy = 0l; |
| 3662 | + Long bcsj_ks = 0l; | ||
| 3615 | if(getcTasks.isEmpty()){ | 3663 | if(getcTasks.isEmpty()){ |
| 3616 | if(!(real.isDestroy()) && real.getFcsjActual() != null && real.getZdsjActual() != null | 3664 | if(!(real.isDestroy()) && real.getFcsjActual() != null && real.getZdsjActual() != null |
| 3617 | && real.getFcsjActual().trim().length() > 0 && real.getZdsjActual().trim().length() > 0 | 3665 | && real.getFcsjActual().trim().length() > 0 && real.getZdsjActual().trim().length() > 0 |
| @@ -3625,7 +3673,12 @@ public class ReportServiceImpl implements ReportService{ | @@ -3625,7 +3673,12 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3625 | if(zdsjT < fcsjT){ | 3673 | if(zdsjT < fcsjT){ |
| 3626 | zdsjT += 1440l; | 3674 | zdsjT += 1440l; |
| 3627 | } | 3675 | } |
| 3628 | - bcsj += zdsjT - fcsjT; | 3676 | + if("normal".equals(real.getBcType())){ |
| 3677 | + bcsj_yy += zdsjT - fcsjT; | ||
| 3678 | + } else { | ||
| 3679 | + bcsj_ks += zdsjT - fcsjT; | ||
| 3680 | + } | ||
| 3681 | + | ||
| 3629 | } | 3682 | } |
| 3630 | } else { | 3683 | } else { |
| 3631 | for(ChildTaskPlan task : getcTasks){ | 3684 | for(ChildTaskPlan task : getcTasks){ |
| @@ -3639,19 +3692,23 @@ public class ReportServiceImpl implements ReportService{ | @@ -3639,19 +3692,23 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3639 | if(zdsjT < fcsjT){ | 3692 | if(zdsjT < fcsjT){ |
| 3640 | zdsjT += 1440l; | 3693 | zdsjT += 1440l; |
| 3641 | } | 3694 | } |
| 3642 | - bcsj += zdsjT - fcsjT; | 3695 | + if(task.getMileageType().equals("service")){ |
| 3696 | + bcsj_yy += zdsjT - fcsjT; | ||
| 3697 | + } else { | ||
| 3698 | + bcsj_ks += zdsjT - fcsjT; | ||
| 3699 | + } | ||
| 3643 | } | 3700 | } |
| 3644 | } | 3701 | } |
| 3645 | } | 3702 | } |
| 3646 | 3703 | ||
| 3647 | - String key = gsBm + "/" + fgsBm + "/" + xlBm + "/" + scheduleDate + "/" | 3704 | + String key = gsBm + "/" + fgsBm + "/" + xlBm + "/" |
| 3648 | + jGh + "/" + jName + "/" + clZbh + "/" + lpName; | 3705 | + jGh + "/" + jName + "/" + clZbh + "/" + lpName; |
| 3649 | if(!(keyMap.containsKey(key))){ | 3706 | if(!(keyMap.containsKey(key))){ |
| 3650 | Map<String, Object> m = new HashMap<String, Object>(); | 3707 | Map<String, Object> m = new HashMap<String, Object>(); |
| 3651 | m.put("gsBm", gsBm); | 3708 | m.put("gsBm", gsBm); |
| 3652 | m.put("fgsBm", fgsBm); | 3709 | m.put("fgsBm", fgsBm); |
| 3653 | m.put("xlBm", xlBm); | 3710 | m.put("xlBm", xlBm); |
| 3654 | - m.put("date", scheduleDate); | 3711 | +// m.put("date", scheduleDate); |
| 3655 | m.put("jGh", jGh); | 3712 | m.put("jGh", jGh); |
| 3656 | m.put("jName", jName); | 3713 | m.put("jName", jName); |
| 3657 | // m.put("sGh", sGh); | 3714 | // m.put("sGh", sGh); |
| @@ -3659,11 +3716,13 @@ public class ReportServiceImpl implements ReportService{ | @@ -3659,11 +3716,13 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3659 | m.put("clZbh", clZbh); | 3716 | m.put("clZbh", clZbh); |
| 3660 | m.put("lpName", lpName); | 3717 | m.put("lpName", lpName); |
| 3661 | m.put("jh", 0); | 3718 | m.put("jh", 0); |
| 3662 | - m.put("sj", 0); | 3719 | + m.put("sjyy", 0); |
| 3720 | + m.put("sjks", 0); | ||
| 3663 | keyMap.put(key, m); | 3721 | keyMap.put(key, m); |
| 3664 | } | 3722 | } |
| 3665 | Map<String, Object> map = keyMap.get(key); | 3723 | Map<String, Object> map = keyMap.get(key); |
| 3666 | - map.put("sj", bcsj + Long.valueOf(map.get("sj").toString())); | 3724 | + map.put("sjyy", bcsj_yy + Long.valueOf(map.get("sjyy").toString())); |
| 3725 | + map.put("sjks", bcsj_ks + Long.valueOf(map.get("sjks").toString())); | ||
| 3667 | } | 3726 | } |
| 3668 | 3727 | ||
| 3669 | for(String key : keyMap.keySet()){ | 3728 | for(String key : keyMap.keySet()){ |
| @@ -3689,9 +3748,16 @@ public class ReportServiceImpl implements ReportService{ | @@ -3689,9 +3748,16 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3689 | map.put("xlName", xlName); | 3748 | map.put("xlName", xlName); |
| 3690 | map.put("jsy", map.get("jGh").toString() + "/" + map.get("jName").toString()); | 3749 | map.put("jsy", map.get("jGh").toString() + "/" + map.get("jName").toString()); |
| 3691 | Long jh = Long.valueOf(map.get("jh").toString()); | 3750 | Long jh = Long.valueOf(map.get("jh").toString()); |
| 3692 | - Long sj = Long.valueOf(map.get("sj").toString()); | 3751 | + Long sjyy = Long.valueOf(map.get("sjyy").toString()); |
| 3752 | + Long sjks = Long.valueOf(map.get("sjks").toString()); | ||
| 3693 | map.put("jhTime", jh/60l + "." + (jh%60l>9?jh%60l:("0"+jh%60l))); | 3753 | map.put("jhTime", jh/60l + "." + (jh%60l>9?jh%60l:("0"+jh%60l))); |
| 3694 | - map.put("sjTime", sj/60l + "." + (sj%60l>9?sj%60l:("0"+sj%60l))); | 3754 | + map.put("sjyyTime", sjyy/60l + "." + (sjyy%60l>9?sjyy%60l:("0"+sjyy%60l))); |
| 3755 | + map.put("sjksTime", sjks/60l + "." + (sjks%60l>9?sjks%60l:("0"+sjks%60l))); | ||
| 3756 | + if(date.equals(date2)){ | ||
| 3757 | + map.put("date", date); | ||
| 3758 | + } else { | ||
| 3759 | + map.put("date", date + "至" + date2); | ||
| 3760 | + } | ||
| 3695 | resultList.add(map); | 3761 | resultList.add(map); |
| 3696 | } | 3762 | } |
| 3697 | 3763 |
src/main/resources/static/pages/forms/mould/workingHours.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/workingHours.html
| @@ -35,24 +35,28 @@ | @@ -35,24 +35,28 @@ | ||
| 35 | <span class="item-label" style="width: 80px;">分公司: </span> | 35 | <span class="item-label" style="width: 80px;">分公司: </span> |
| 36 | <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select> | 36 | <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select> |
| 37 | </div> | 37 | </div> |
| 38 | - <div style="display: inline-block;margin-left: 24px;"> | ||
| 39 | - <span class="item-label" style="width: 80px;">线路: </span> | ||
| 40 | - <select class="form-control" name="line" id="line" style="width: 180px;"></select> | 38 | + <div style="display: inline-block;margin-left: 4px;"> |
| 39 | + <span class="item-label" style="width: 80px;">开始时间: </span> | ||
| 40 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | ||
| 41 | + </div> | ||
| 42 | + <div style="display: inline-block;margin-left: 4px;"> | ||
| 43 | + <span class="item-label" style="width: 80px;">结束时间: </span> | ||
| 44 | + <input class="form-control" type="text" id="date2" style="width: 180px;"/> | ||
| 41 | </div> | 45 | </div> |
| 42 | <div style="margin-top: 2px"></div> | 46 | <div style="margin-top: 2px"></div> |
| 43 | - <div style="display: inline-block;margin-left: 33px;"> | ||
| 44 | - <span class="item-label" style="width: 80px;">时间: </span> | ||
| 45 | - <input class="form-control" type="text" id="date" style="width: 180px;"/> | 47 | + <div style="display: inline-block;margin-left: 33px;"> |
| 48 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 49 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 46 | </div> | 50 | </div> |
| 47 | <div style="display: inline-block;margin-left: 28px;"> | 51 | <div style="display: inline-block;margin-left: 28px;"> |
| 48 | <span class="item-label" style="width: 80px;">工号: </span> | 52 | <span class="item-label" style="width: 80px;">工号: </span> |
| 49 | <input class="form-control" type="text" id="gh" style="width: 180px;"/> | 53 | <input class="form-control" type="text" id="gh" style="width: 180px;"/> |
| 50 | </div> | 54 | </div> |
| 51 | - <div style="display: inline-block;margin-left: 24px;"> | 55 | + <div style="display: inline-block;margin-left: 32px;"> |
| 52 | <span class="item-label" style="width: 80px;">车辆: </span> | 56 | <span class="item-label" style="width: 80px;">车辆: </span> |
| 53 | <input class="form-control" type="text" id="cl" style="width: 180px;"/> | 57 | <input class="form-control" type="text" id="cl" style="width: 180px;"/> |
| 54 | </div> | 58 | </div> |
| 55 | - <div class="form-group" style="margin-left: 13px"> | 59 | + <div class="form-group" style="margin-left: 10px"> |
| 56 | <input class="btn btn-default" type="button" id="query" value="筛选"/> | 60 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 57 | <input class="btn btn-default" type="button" id="export" value="导出"/> | 61 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| 58 | </div> | 62 | </div> |
| @@ -63,18 +67,19 @@ | @@ -63,18 +67,19 @@ | ||
| 63 | <table class="table table-bordered table-hover table-checkable" id="forms"> | 67 | <table class="table table-bordered table-hover table-checkable" id="forms"> |
| 64 | <thead> | 68 | <thead> |
| 65 | <tr> | 69 | <tr> |
| 66 | - <th colspan="9">工时统计表</th> | 70 | + <th colspan="10">工时统计表</th> |
| 67 | </tr> | 71 | </tr> |
| 68 | <tr> | 72 | <tr> |
| 69 | - <td>日期</td> | 73 | + <td style="max-width: 160px;min-width: 160px">日期</td> |
| 70 | <td>公司</td> | 74 | <td>公司</td> |
| 71 | <td>分公司</td> | 75 | <td>分公司</td> |
| 72 | <td>线路</td> | 76 | <td>线路</td> |
| 73 | <td>路牌</td> | 77 | <td>路牌</td> |
| 74 | <td>驾驶员</td> | 78 | <td>驾驶员</td> |
| 75 | <td>车辆</td> | 79 | <td>车辆</td> |
| 76 | - <td>计划工时(小时.分钟)</td> | ||
| 77 | - <td>实际工时(小时.分钟)</td> | 80 | + <td>计划工时<font style="font-size: 8px;color: gray;"> /小时.分钟</font></td> |
| 81 | + <td>实际营运工时<font style="font-size: 8px;color: gray;"> /小时.分钟</font></td> | ||
| 82 | + <td>实际空驶工时<font style="font-size: 8px;color: gray;"> /小时.分钟</font></td> | ||
| 78 | </tr> | 83 | </tr> |
| 79 | </thead> | 84 | </thead> |
| 80 | <tbody id="tbody"> | 85 | <tbody id="tbody"> |
| @@ -104,11 +109,11 @@ | @@ -104,11 +109,11 @@ | ||
| 104 | if(day < 10) | 109 | if(day < 10) |
| 105 | day = "0" + day; | 110 | day = "0" + day; |
| 106 | var dateTime = year + "-" + month + "-" + day; | 111 | var dateTime = year + "-" + month + "-" + day; |
| 107 | - $("#date").datetimepicker({ | 112 | + $("#date,#date2").datetimepicker({ |
| 108 | format : 'YYYY-MM-DD', | 113 | format : 'YYYY-MM-DD', |
| 109 | locale : 'zh-cn' | 114 | locale : 'zh-cn' |
| 110 | }); | 115 | }); |
| 111 | - $("#date").val(dateTime); | 116 | + $("#date,#date2").val(dateTime); |
| 112 | 117 | ||
| 113 | var fage=false; | 118 | var fage=false; |
| 114 | var xlList; | 119 | var xlList; |
| @@ -153,7 +158,7 @@ | @@ -153,7 +158,7 @@ | ||
| 153 | var tempData = {}; | 158 | var tempData = {}; |
| 154 | $.get('/report/lineList',function(xlList){ | 159 | $.get('/report/lineList',function(xlList){ |
| 155 | var data = []; | 160 | var data = []; |
| 156 | -// data.push({id: " ", text: "全部线路"}); | 161 | + data.push({id: " ", text: "全部线路"}); |
| 157 | $.get('/user/companyData', function(result){ | 162 | $.get('/user/companyData', function(result){ |
| 158 | for(var i = 0; i < result.length; i++){ | 163 | for(var i = 0; i < result.length; i++){ |
| 159 | var companyCode = result[i].companyCode; | 164 | var companyCode = result[i].companyCode; |
| @@ -190,6 +195,7 @@ | @@ -190,6 +195,7 @@ | ||
| 190 | 195 | ||
| 191 | var line; | 196 | var line; |
| 192 | var date; | 197 | var date; |
| 198 | + var date2; | ||
| 193 | var gsdm; | 199 | var gsdm; |
| 194 | var fgsdm; | 200 | var fgsdm; |
| 195 | var gh; | 201 | var gh; |
| @@ -200,15 +206,20 @@ | @@ -200,15 +206,20 @@ | ||
| 200 | layer.msg("请选择时间"); | 206 | layer.msg("请选择时间"); |
| 201 | return; | 207 | return; |
| 202 | } | 208 | } |
| 209 | + if($("#date2").val() == null || $("#date2").val().trim().length == 0){ | ||
| 210 | + layer.msg("请选择时间"); | ||
| 211 | + return; | ||
| 212 | + } | ||
| 203 | line = $("#line").val(); | 213 | line = $("#line").val(); |
| 204 | date = $("#date").val(); | 214 | date = $("#date").val(); |
| 215 | + date2 = $("#date2").val(); | ||
| 205 | gsdm=$("#gsdm").val(); | 216 | gsdm=$("#gsdm").val(); |
| 206 | fgsdm=$("#fgsdm").val(); | 217 | fgsdm=$("#fgsdm").val(); |
| 207 | gh=$("#gh").val(); | 218 | gh=$("#gh").val(); |
| 208 | cl=$("#cl").val(); | 219 | cl=$("#cl").val(); |
| 209 | lineName=$("#select2-line-container").html(); | 220 | lineName=$("#select2-line-container").html(); |
| 210 | var i = layer.load(2); | 221 | var i = layer.load(2); |
| 211 | - $post('/report/workingHours',{gsdm:gsdm,fgsdm:fgsdm,line:line,date:date,gh:gh,cl:cl,lineName:lineName,type:'query'},function(result){ | 222 | + $post('/report/workingHours',{gsdm:gsdm,fgsdm:fgsdm,line:line,date:date,date2:date2,gh:gh,cl:cl,lineName:lineName,type:'query'},function(result){ |
| 212 | // 把数据填充到模版中 | 223 | // 把数据填充到模版中 |
| 213 | var tbodyHtml = template('workingHours',{list:result}); | 224 | var tbodyHtml = template('workingHours',{list:result}); |
| 214 | // 把渲染好的模版html文本追加到表格中 | 225 | // 把渲染好的模版html文本追加到表格中 |
| @@ -222,15 +233,20 @@ | @@ -222,15 +233,20 @@ | ||
| 222 | layer.msg("请选择时间"); | 233 | layer.msg("请选择时间"); |
| 223 | return; | 234 | return; |
| 224 | } | 235 | } |
| 236 | + if($("#date2").val() == null || $("#date2").val().trim().length == 0){ | ||
| 237 | + layer.msg("请选择时间"); | ||
| 238 | + return; | ||
| 239 | + } | ||
| 225 | line = $("#line").val(); | 240 | line = $("#line").val(); |
| 226 | date = $("#date").val(); | 241 | date = $("#date").val(); |
| 242 | + date2 = $("#date2").val(); | ||
| 227 | gsdm=$("#gsdm").val(); | 243 | gsdm=$("#gsdm").val(); |
| 228 | fgsdm=$("#fgsdm").val(); | 244 | fgsdm=$("#fgsdm").val(); |
| 229 | gh=$("#gh").val(); | 245 | gh=$("#gh").val(); |
| 230 | cl=$("#cl").val(); | 246 | cl=$("#cl").val(); |
| 231 | lineName=$("#select2-line-container").html(); | 247 | lineName=$("#select2-line-container").html(); |
| 232 | var i = layer.load(2); | 248 | var i = layer.load(2); |
| 233 | - $post('/report/workingHours',{gsdm:gsdm,fgsdm:fgsdm,line:line,date:date,gh:gh,cl:cl,lineName:lineName,type:'export'},function(result){ | 249 | + $post('/report/workingHours',{gsdm:gsdm,fgsdm:fgsdm,line:line,date:date,date2:date2,gh:gh,cl:cl,lineName:lineName,type:'export'},function(result){ |
| 234 | window.open("/downloadFile/download?fileName=" | 250 | window.open("/downloadFile/download?fileName=" |
| 235 | +moment(date).format("YYYYMMDD")+"-"+lineName+"-工时统计表"); | 251 | +moment(date).format("YYYYMMDD")+"-"+lineName+"-工时统计表"); |
| 236 | layer.close(i); | 252 | layer.close(i); |
| @@ -249,12 +265,13 @@ | @@ -249,12 +265,13 @@ | ||
| 249 | <td>{{obj.jsy}}</td> | 265 | <td>{{obj.jsy}}</td> |
| 250 | <td>{{obj.clZbh}}</td> | 266 | <td>{{obj.clZbh}}</td> |
| 251 | <td>{{obj.jhTime}}</td> | 267 | <td>{{obj.jhTime}}</td> |
| 252 | - <td>{{obj.sjTime}}</td> | 268 | + <td>{{obj.sjyyTime}}</td> |
| 269 | + <td>{{obj.sjksTime}}</td> | ||
| 253 | </tr> | 270 | </tr> |
| 254 | {{/each}} | 271 | {{/each}} |
| 255 | {{if list.length == 0}} | 272 | {{if list.length == 0}} |
| 256 | <tr> | 273 | <tr> |
| 257 | - <td colspan="9"><h6 class="muted">没有找到相关数据</h6></td> | 274 | + <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td> |
| 258 | </tr> | 275 | </tr> |
| 259 | {{/if}} | 276 | {{/if}} |
| 260 | </script> | 277 | </script> |
| 261 | \ No newline at end of file | 278 | \ No newline at end of file |