Commit 3029e7f7ac64acc82e4cc1237fd9f9169204a0c1
Merge branch 'minhang' of http://192.168.168.201:8888/panzhaov5/bsth_control into minhang
Showing
4 changed files
with
42 additions
and
43 deletions
src/main/java/com/bsth/controller/report/ReportController.java
| @@ -367,8 +367,8 @@ public class ReportController { | @@ -367,8 +367,8 @@ public class ReportController { | ||
| 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 date2, @RequestParam String gh, | 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); | 370 | + @RequestParam String cl, @RequestParam String lpName, @RequestParam String lineName, @RequestParam String type){ |
| 371 | + List<Map<String, Object>> list = service.workingHours(gsdm, fgsdm, line, date, date2, gh, cl, lpName); | ||
| 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/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 date2, String gh, String cl); | 60 | + List<Map<String, Object>> workingHours(String gsdm, String fgsdm, String line, String date, String date2, String gh, String cl, String lpName); |
| 61 | } | 61 | } |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -3556,7 +3556,7 @@ public class ReportServiceImpl implements ReportService{ | @@ -3556,7 +3556,7 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3556 | 3556 | ||
| 3557 | @Override | 3557 | @Override |
| 3558 | public List<Map<String, Object>> workingHours(String gsdm, String fgsdm, String line, String date, String date2, | 3558 | public List<Map<String, Object>> workingHours(String gsdm, String fgsdm, String line, String date, String date2, |
| 3559 | - String gh, String cl) { | 3559 | + String gh, String cl, String lp) { |
| 3560 | List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>(); | 3560 | List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>(); |
| 3561 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 3561 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 3562 | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 3562 | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| @@ -3572,40 +3572,6 @@ public class ReportServiceImpl implements ReportService{ | @@ -3572,40 +3572,6 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3572 | 3572 | ||
| 3573 | 3573 | ||
| 3574 | Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>(); | 3574 | Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>(); |
| 3575 | -// for(SchedulePlanInfo plan : planList){ | ||
| 3576 | -// String gsBm = plan.getGsBm(); | ||
| 3577 | -// String fgsBm = plan.getFgsBm(); | ||
| 3578 | -// String xlBm = plan.getXlBm(); | ||
| 3579 | -//// String scheduleDate = sdf.format(plan.getScheduleDate()); | ||
| 3580 | -// String jGh = plan.getjGh(); | ||
| 3581 | -// String jName = plan.getjName(); | ||
| 3582 | -//// String sGh = plan.getsGh(); | ||
| 3583 | -//// String sName = plan.getsName(); | ||
| 3584 | -// String clZbh = plan.getClZbh(); | ||
| 3585 | -// String lpName = plan.getLpName(); | ||
| 3586 | -// Long bcsj = (long)plan.getBcsj(); | ||
| 3587 | -// | ||
| 3588 | -// String key = gsBm + "/" + fgsBm + "/" + xlBm + "/" | ||
| 3589 | -// + jGh + "/" + jName + "/" + clZbh + "/" + lpName; | ||
| 3590 | -// if(!(keyMap.containsKey(key))){ | ||
| 3591 | -// Map<String, Object> m = new HashMap<String, Object>(); | ||
| 3592 | -// m.put("gsBm", gsBm); | ||
| 3593 | -// m.put("fgsBm", fgsBm); | ||
| 3594 | -// m.put("xlBm", xlBm); | ||
| 3595 | -//// m.put("date", scheduleDate); | ||
| 3596 | -// m.put("jGh", jGh); | ||
| 3597 | -// m.put("jName", jName); | ||
| 3598 | -//// m.put("sGh", sGh); | ||
| 3599 | -//// m.put("sName", sName); | ||
| 3600 | -// m.put("clZbh", clZbh); | ||
| 3601 | -// m.put("lpName", lpName); | ||
| 3602 | -// m.put("jh", 0); | ||
| 3603 | -// m.put("sj", 0); | ||
| 3604 | -// keyMap.put(key, m); | ||
| 3605 | -// } | ||
| 3606 | -// Map<String, Object> map = keyMap.get(key); | ||
| 3607 | -// map.put("jh", bcsj + Long.valueOf(map.get("jh").toString())); | ||
| 3608 | -// } | ||
| 3609 | for(ScheduleRealInfo plan : realList){ | 3575 | for(ScheduleRealInfo plan : realList){ |
| 3610 | if(!(plan.isSflj()) && !(plan.isCcService())){ | 3576 | if(!(plan.isSflj()) && !(plan.isCcService())){ |
| 3611 | String gsBm = plan.getGsBm(); | 3577 | String gsBm = plan.getGsBm(); |
| @@ -3722,6 +3688,15 @@ public class ReportServiceImpl implements ReportService{ | @@ -3722,6 +3688,15 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3722 | map.put("sjks", bcsj_ks + Long.valueOf(map.get("sjks").toString())); | 3688 | map.put("sjks", bcsj_ks + Long.valueOf(map.get("sjks").toString())); |
| 3723 | } | 3689 | } |
| 3724 | 3690 | ||
| 3691 | + Map<String, Object> sumMap = new HashMap<String, Object>(); | ||
| 3692 | + sumMap.put("date", "小计"); | ||
| 3693 | + sumMap.put("gsName", ""); | ||
| 3694 | + sumMap.put("fgsName", ""); | ||
| 3695 | + sumMap.put("xlName", ""); | ||
| 3696 | + sumMap.put("lpName", ""); | ||
| 3697 | + sumMap.put("jsy", ""); | ||
| 3698 | + sumMap.put("clZbh", ""); | ||
| 3699 | + Long jh_sum = 0l, sjyy_sum = 0l, sjks_sum = 0l; | ||
| 3725 | for(String key : keyMap.keySet()){ | 3700 | for(String key : keyMap.keySet()){ |
| 3726 | Map<String, Object> map = keyMap.get(key); | 3701 | Map<String, Object> map = keyMap.get(key); |
| 3727 | if(gh.trim().length() > 0){ | 3702 | if(gh.trim().length() > 0){ |
| @@ -3734,6 +3709,11 @@ public class ReportServiceImpl implements ReportService{ | @@ -3734,6 +3709,11 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3734 | continue; | 3709 | continue; |
| 3735 | } | 3710 | } |
| 3736 | } | 3711 | } |
| 3712 | + if(lp.trim().length() > 0){ | ||
| 3713 | + if(!(map.get("lpName").toString().toLowerCase().contains(lp.toLowerCase()))){ | ||
| 3714 | + continue; | ||
| 3715 | + } | ||
| 3716 | + } | ||
| 3737 | String gsBm = map.get("gsBm").toString(); | 3717 | String gsBm = map.get("gsBm").toString(); |
| 3738 | String fgsBm = map.get("fgsBm").toString(); | 3718 | String fgsBm = map.get("fgsBm").toString(); |
| 3739 | String xlBm = map.get("xlBm").toString(); | 3719 | String xlBm = map.get("xlBm").toString(); |
| @@ -3747,17 +3727,26 @@ public class ReportServiceImpl implements ReportService{ | @@ -3747,17 +3727,26 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3747 | Long jh = Long.valueOf(map.get("jh").toString()); | 3727 | Long jh = Long.valueOf(map.get("jh").toString()); |
| 3748 | Long sjyy = Long.valueOf(map.get("sjyy").toString()); | 3728 | Long sjyy = Long.valueOf(map.get("sjyy").toString()); |
| 3749 | Long sjks = Long.valueOf(map.get("sjks").toString()); | 3729 | Long sjks = Long.valueOf(map.get("sjks").toString()); |
| 3750 | - map.put("jhTime", jh/60l + "." + (jh%60l>9?jh%60l:("0"+jh%60l))); | ||
| 3751 | - map.put("sjyyTime", sjyy/60l + "." + (sjyy%60l>9?sjyy%60l:("0"+sjyy%60l))); | ||
| 3752 | - map.put("sjksTime", sjks/60l + "." + (sjks%60l>9?sjks%60l:("0"+sjks%60l))); | 3730 | + map.put("jhTime", jh > 0l ? jh/60l + "." + (jh%60l>9?jh%60l:("0"+jh%60l)) : "0.0"); |
| 3731 | + map.put("sjyyTime", sjyy > 0l ? sjyy/60l + "." + (sjyy%60l>9?sjyy%60l:("0"+sjyy%60l)) : "0.0"); | ||
| 3732 | + map.put("sjksTime", sjks > 0l ? sjks/60l + "." + (sjks%60l>9?sjks%60l:("0"+sjks%60l)) : "0.0"); | ||
| 3753 | if(date.equals(date2)){ | 3733 | if(date.equals(date2)){ |
| 3754 | map.put("date", date); | 3734 | map.put("date", date); |
| 3755 | } else { | 3735 | } else { |
| 3756 | map.put("date", date + "至" + date2); | 3736 | map.put("date", date + "至" + date2); |
| 3757 | } | 3737 | } |
| 3738 | + | ||
| 3739 | + jh_sum += jh; | ||
| 3740 | + sjyy_sum += sjyy; | ||
| 3741 | + sjks_sum += sjks; | ||
| 3742 | + | ||
| 3758 | resultList.add(map); | 3743 | resultList.add(map); |
| 3759 | } | 3744 | } |
| 3760 | 3745 | ||
| 3746 | + sumMap.put("jhTime", jh_sum > 0l ? jh_sum/60l + "." + (jh_sum%60l>9?jh_sum%60l:("0"+jh_sum%60l)) : "0.0"); | ||
| 3747 | + sumMap.put("sjyyTime", sjyy_sum > 0l ? sjyy_sum/60l + "." + (sjyy_sum%60l>9?sjyy_sum%60l:("0"+sjyy_sum%60l)) : "0.0"); | ||
| 3748 | + sumMap.put("sjksTime", sjks_sum > 0l ? sjks_sum/60l + "." + (sjks_sum%60l>9?sjks_sum%60l:("0"+sjks_sum%60l)) : "0.0"); | ||
| 3749 | + | ||
| 3761 | Collections.sort(resultList, new Comparator<Map<String, Object>>() { | 3750 | Collections.sort(resultList, new Comparator<Map<String, Object>>() { |
| 3762 | @Override | 3751 | @Override |
| 3763 | public int compare(Map<String, Object> c1, Map<String, Object> c2) { | 3752 | public int compare(Map<String, Object> c1, Map<String, Object> c2) { |
| @@ -3805,6 +3794,9 @@ public class ReportServiceImpl implements ReportService{ | @@ -3805,6 +3794,9 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3805 | } | 3794 | } |
| 3806 | }); | 3795 | }); |
| 3807 | 3796 | ||
| 3797 | + //小计,排序结束后再插入 | ||
| 3798 | + resultList.add(sumMap); | ||
| 3799 | + | ||
| 3808 | return resultList; | 3800 | return resultList; |
| 3809 | } | 3801 | } |
| 3810 | 3802 |
src/main/resources/static/pages/forms/statement/workingHours.html
| @@ -56,6 +56,10 @@ | @@ -56,6 +56,10 @@ | ||
| 56 | <span class="item-label" style="width: 80px;">车辆: </span> | 56 | <span class="item-label" style="width: 80px;">车辆: </span> |
| 57 | <input class="form-control" type="text" id="cl" style="width: 180px;"/> | 57 | <input class="form-control" type="text" id="cl" style="width: 180px;"/> |
| 58 | </div> | 58 | </div> |
| 59 | + <div style="display: inline-block;margin-left: 32px;"> | ||
| 60 | + <span class="item-label" style="width: 80px;">路牌: </span> | ||
| 61 | + <input class="form-control" type="text" id="lpName" style="width: 180px;"/> | ||
| 62 | + </div> | ||
| 59 | <div class="form-group" style="margin-left: 10px"> | 63 | <div class="form-group" style="margin-left: 10px"> |
| 60 | <input class="btn btn-default" type="button" id="query" value="筛选"/> | 64 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 61 | <input class="btn btn-default" type="button" id="export" value="导出"/> | 65 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| @@ -200,6 +204,7 @@ | @@ -200,6 +204,7 @@ | ||
| 200 | var fgsdm; | 204 | var fgsdm; |
| 201 | var gh; | 205 | var gh; |
| 202 | var cl; | 206 | var cl; |
| 207 | + var lpName; | ||
| 203 | var lineName=$("#select2-line-container").html(); | 208 | var lineName=$("#select2-line-container").html(); |
| 204 | $("#query").on("click",function(){ | 209 | $("#query").on("click",function(){ |
| 205 | if($("#date").val() == null || $("#date").val().trim().length == 0){ | 210 | if($("#date").val() == null || $("#date").val().trim().length == 0){ |
| @@ -217,9 +222,10 @@ | @@ -217,9 +222,10 @@ | ||
| 217 | fgsdm=$("#fgsdm").val(); | 222 | fgsdm=$("#fgsdm").val(); |
| 218 | gh=$("#gh").val(); | 223 | gh=$("#gh").val(); |
| 219 | cl=$("#cl").val(); | 224 | cl=$("#cl").val(); |
| 225 | + lpName=$("#lpName").val(); | ||
| 220 | lineName=$("#select2-line-container").html(); | 226 | lineName=$("#select2-line-container").html(); |
| 221 | var i = layer.load(2); | 227 | var i = layer.load(2); |
| 222 | - $post('/report/workingHours',{gsdm:gsdm,fgsdm:fgsdm,line:line,date:date,date2:date2,gh:gh,cl:cl,lineName:lineName,type:'query'},function(result){ | 228 | + $post('/report/workingHours',{gsdm:gsdm,fgsdm:fgsdm,line:line,date:date,date2:date2,gh:gh,cl:cl,lpName:lpName,lineName:lineName,type:'query'},function(result){ |
| 223 | // 把数据填充到模版中 | 229 | // 把数据填充到模版中 |
| 224 | var tbodyHtml = template('workingHours',{list:result}); | 230 | var tbodyHtml = template('workingHours',{list:result}); |
| 225 | // 把渲染好的模版html文本追加到表格中 | 231 | // 把渲染好的模版html文本追加到表格中 |
| @@ -244,9 +250,10 @@ | @@ -244,9 +250,10 @@ | ||
| 244 | fgsdm=$("#fgsdm").val(); | 250 | fgsdm=$("#fgsdm").val(); |
| 245 | gh=$("#gh").val(); | 251 | gh=$("#gh").val(); |
| 246 | cl=$("#cl").val(); | 252 | cl=$("#cl").val(); |
| 253 | + lpName=$("#lpName").val(); | ||
| 247 | lineName=$("#select2-line-container").html(); | 254 | lineName=$("#select2-line-container").html(); |
| 248 | var i = layer.load(2); | 255 | var i = layer.load(2); |
| 249 | - $post('/report/workingHours',{gsdm:gsdm,fgsdm:fgsdm,line:line,date:date,date2:date2,gh:gh,cl:cl,lineName:lineName,type:'export'},function(result){ | 256 | + $post('/report/workingHours',{gsdm:gsdm,fgsdm:fgsdm,line:line,date:date,date2:date2,gh:gh,cl:cl,lpName:lpName,lineName:lineName,type:'export'},function(result){ |
| 250 | window.open("/downloadFile/download?fileName=" | 257 | window.open("/downloadFile/download?fileName=" |
| 251 | +moment(date).format("YYYYMMDD")+"-"+lineName+"-工时统计表"); | 258 | +moment(date).format("YYYYMMDD")+"-"+lineName+"-工时统计表"); |
| 252 | layer.close(i); | 259 | layer.close(i); |