Commit d6acb4c47a5d3c7f0e32ba448f77b215129e2bc7
1 parent
f82abec7
工作汇总,日报表,月报表。。。
Showing
8 changed files
with
134 additions
and
26 deletions
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| ... | ... | @@ -219,13 +219,11 @@ public class FormsServiceImpl implements FormsService { |
| 219 | 219 | // if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){ |
| 220 | 220 | // sList.add(s); |
| 221 | 221 | // } |
| 222 | - | |
| 223 | 222 | if(empnames.equals("驾驶员")){ |
| 224 | - if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){ | |
| 223 | + if(d.getJgh().equals(s.getjGh())){ | |
| 225 | 224 | sList.add(s); |
| 226 | 225 | } |
| 227 | 226 | }else if(empnames.equals("售票员")){ |
| 228 | -// shif.setjName(arg0.getString("s_name")==null ? "":arg0.getString("s_name")); | |
| 229 | 227 | String sgh=s.getsGh()==null?"":s.getsGh(); |
| 230 | 228 | if(d.getSgh().equals(sgh) && d.getZbh().equals(s.getClZbh())){ |
| 231 | 229 | sList.add(s); |
| ... | ... | @@ -244,16 +242,17 @@ public class FormsServiceImpl implements FormsService { |
| 244 | 242 | double ljgl=culateMileageService.culateLjgl(sList); |
| 245 | 243 | double sjgl=culateMileageService.culateSjgl(sList); |
| 246 | 244 | double zyygl=Arith.add(ljgl, sjgl); |
| 247 | - double cjbc=culateMileageService.culateLbbc(sList); | |
| 248 | - double Ljbc=culateMileageService.culateLjbc(sList,""); | |
| 245 | + int cjbc=culateMileageService.culateLbbc(sList); | |
| 246 | + int ljbc=culateMileageService.culateLjbc(sList,""); | |
| 247 | + int sjbc=culateMileageService.culateSjbc(sList, ""); | |
| 249 | 248 | double cjgl=culateMileageService.culateLbgl(sList); |
| 250 | 249 | double zjgl=culateMileageService.culateLjgl(sList); |
| 251 | 250 | d.setEmptMileage(String.valueOf(zksgl));//空驶公里 |
| 252 | 251 | d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 |
| 253 | - d.setSjbc(String.valueOf(culateMileageService.culateSjbc(sList, "")+culateMileageService.culateLjbc(sList, ""))); | |
| 252 | + d.setSjbc(String.valueOf(sjbc+ljbc)); | |
| 254 | 253 | d.setJhlc(String.valueOf(zyygl));//运营里程 |
| 255 | 254 | d.setCjbc(String.valueOf(cjbc));//抽检班次 |
| 256 | - d.setLjbc(String.valueOf(Ljbc));//增加班次 | |
| 255 | + d.setLjbc(String.valueOf(ljbc));//增加班次 | |
| 257 | 256 | d.setRemMileage(String.valueOf(cjgl));//抽检里程 |
| 258 | 257 | d.setAddMileage(String.valueOf(zjgl));//增加里程 |
| 259 | 258 | |
| ... | ... | @@ -330,22 +329,23 @@ public class FormsServiceImpl implements FormsService { |
| 330 | 329 | double zyygl=Arith.add(ljgl, sjgl); |
| 331 | 330 | double jhgl=culateMileageService.culateJhgl(sList); |
| 332 | 331 | double cjgl=culateMileageService.culateLbgl(sList); |
| 333 | - double jhbc =culateMileageService.culateJhbc(sList,""); | |
| 334 | - double cjbc=culateMileageService.culateLbbc(sList); | |
| 335 | - double Ljbc=culateMileageService.culateLjbc(sList,""); | |
| 332 | + int jhbc =culateMileageService.culateJhbc(sList,""); | |
| 333 | + int cjbc=culateMileageService.culateLbbc(sList); | |
| 334 | + int ljbc=culateMileageService.culateLjbc(sList,""); | |
| 335 | + int sjbc=culateMileageService.culateSjbc(sList, ""); | |
| 336 | 336 | double zjgl=culateMileageService.culateLjgl(sList); |
| 337 | 337 | d.setEmptMileage(String.valueOf(zksgl));//空驶公里 |
| 338 | 338 | d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 |
| 339 | - d.setSjbc(String.valueOf(culateMileageService.culateSjbc(sList, "")+culateMileageService.culateLjbc(sList, ""))); | |
| 339 | + d.setSjbc(String.valueOf(sjbc+ljbc)); | |
| 340 | 340 | d.setJhlc(String.valueOf(jhgl));//计划里程 |
| 341 | 341 | d.setYygl(String.valueOf(zyygl));//运营公里 |
| 342 | 342 | d.setSjjhlc(String.valueOf(sjgl));//实际计划里程 |
| 343 | 343 | d.setRemMileage(String.valueOf(cjgl));//抽减里程 |
| 344 | 344 | d.setJhbc(String.valueOf(jhbc));//计划班次 |
| 345 | 345 | d.setCjbc(String.valueOf(cjbc));//抽检班次 |
| 346 | - d.setLjbc(String.valueOf(Ljbc));//增加班次 | |
| 346 | + d.setLjbc(String.valueOf(ljbc));//增加班次 | |
| 347 | 347 | d.setAddMileage(String.valueOf(zjgl));//增加公里 |
| 348 | - d.setSjjhbc(String.valueOf(culateMileageService.culateSjbc(sList, "")));//实际计划班次 | |
| 348 | + d.setSjjhbc(String.valueOf(sjbc));//实际计划班次 | |
| 349 | 349 | } |
| 350 | 350 | return list; |
| 351 | 351 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -501,7 +501,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 501 | 501 | + " from bsth_c_s_sp_info_real s " |
| 502 | 502 | + " where s.xl_Bm = '" + line + "' and DATE_FORMAT(s.schedule_Date,'%Y-%m-%d') ='" + date + "' " |
| 503 | 503 | + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name" |
| 504 | - + " order by (" + state + "),schedule_date_str,fcsj " + type; | |
| 504 | + + " order by (" + state + "),dateStr,fcsj " + type; | |
| 505 | 505 | List<ScheduleRealInfo> list = jdbcTemplate.query(sqlPlan, |
| 506 | 506 | new RowMapper<ScheduleRealInfo>() { |
| 507 | 507 | @Override |
| ... | ... | @@ -1394,7 +1394,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1394 | 1394 | lists.add(s); |
| 1395 | 1395 | } |
| 1396 | 1396 | } |
| 1397 | - double ksgl=culateService.culateKsgl(lists); | |
| 1397 | + double ksgl=culateService.culateKsgl(list); | |
| 1398 | 1398 | double sjgl=culateService.culateSjgl(lists); |
| 1399 | 1399 | double jccgl=culateService.culateJccgl(lists); |
| 1400 | 1400 | double ljgl=culateService.culateLjgl(lists); | ... | ... |
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
| 1 | 1 | package com.bsth.service.report.impl; |
| 2 | 2 | |
| 3 | 3 | import java.util.ArrayList; |
| 4 | +import java.util.Collections; | |
| 4 | 5 | import java.util.HashMap; |
| 5 | 6 | import java.util.Iterator; |
| 6 | 7 | import java.util.List; |
| ... | ... | @@ -14,6 +15,7 @@ import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 14 | 15 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 15 | 16 | import com.bsth.service.report.CulateMileageService; |
| 16 | 17 | import com.bsth.util.Arith; |
| 18 | +import com.bsth.util.ComparableJob; | |
| 17 | 19 | |
| 18 | 20 | @Service |
| 19 | 21 | public class CulateMileageServiceImpl implements CulateMileageService{ |
| ... | ... | @@ -25,6 +27,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 25 | 27 | @Override |
| 26 | 28 | public List<Map<String, Object>> jobFwqk(List<ScheduleRealInfo> lists) { |
| 27 | 29 | // TODO Auto-generated method stub |
| 30 | + String[] lblxs = {"配车", "保养","故障","肇事","路阻","纠纷","缺人","客稀","缺车","气候","援外","吊慢","抽减","其他" }; | |
| 28 | 31 | List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); |
| 29 | 32 | for (int i = 0; i < lists.size(); i++) { |
| 30 | 33 | ScheduleRealInfo scheduleRealInfo = lists.get(i); |
| ... | ... | @@ -47,7 +50,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 47 | 50 | newMap.put("dz", scheduleRealInfo.getQdzName()); |
| 48 | 51 | newMap.put("sj", scheduleRealInfo.getFcsj()); |
| 49 | 52 | newMap.put("lbbc", 1); |
| 50 | - newMap.put("lblc", scheduleRealInfo.getJhlcOrig()); | |
| 53 | + newMap.put("lblc", scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); | |
| 51 | 54 | newMap.put("jyqp", scheduleRealInfo.getRealMileage()); |
| 52 | 55 | list.add(newMap); |
| 53 | 56 | } |
| ... | ... | @@ -71,7 +74,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 71 | 74 | newMap.put("dz", childTaskPlan.getStartStationName()); |
| 72 | 75 | newMap.put("sj", childTaskPlan.getStartDate()); |
| 73 | 76 | newMap.put("lbbc", 0); |
| 74 | - newMap.put("lblc", childTaskPlan.getMileage()); | |
| 77 | + newMap.put("lblc", childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage()); | |
| 75 | 78 | newMap.put("jyqp", scheduleRealInfo.getRealMileage()); |
| 76 | 79 | list.add(newMap); |
| 77 | 80 | |
| ... | ... | @@ -80,7 +83,33 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 80 | 83 | } |
| 81 | 84 | } |
| 82 | 85 | } |
| 83 | - return list; | |
| 86 | + List<Map<String, Object>> listNew=new ArrayList<Map<String,Object>>(); | |
| 87 | + for (int i = 0; i < lblxs.length; i++) { | |
| 88 | + String lx=lblxs[i]; | |
| 89 | + double lblc=0.0; | |
| 90 | + int lbbc=0; | |
| 91 | + for (int j = 0; j < list.size(); j++) { | |
| 92 | + Map<String, Object> m1=list.get(j); | |
| 93 | + m1.put("lx", 0); | |
| 94 | + listNew.add(m1); | |
| 95 | + if(lx.equals(m1.get("nr").toString())){ | |
| 96 | + lblc =Arith.add(lblc,Double.parseDouble(m1.get("lblc").toString())); | |
| 97 | + lbbc += Integer.parseInt(m1.get("lbbc").toString()); | |
| 98 | + } | |
| 99 | + } | |
| 100 | + Map<String, Object> newMap = new HashMap<String, Object>(); | |
| 101 | + newMap.put("lx", 1); | |
| 102 | + newMap.put("nr", lx); | |
| 103 | + newMap.put("lp", "小计"); | |
| 104 | + newMap.put("nbbm", "少驶公里"); | |
| 105 | + newMap.put("dz", lbbc); | |
| 106 | + newMap.put("sj", "少驶公里"); | |
| 107 | + newMap.put("lblc", lblc); | |
| 108 | + listNew.add(newMap); | |
| 109 | + | |
| 110 | + } | |
| 111 | + Collections.sort(listNew, new ComparableJob()); | |
| 112 | + return listNew; | |
| 84 | 113 | } |
| 85 | 114 | |
| 86 | 115 | @Override | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -8,6 +8,7 @@ import java.text.ParseException; |
| 8 | 8 | import java.text.SimpleDateFormat; |
| 9 | 9 | import java.util.ArrayList; |
| 10 | 10 | import java.util.Calendar; |
| 11 | +import java.util.Collections; | |
| 11 | 12 | import java.util.Date; |
| 12 | 13 | import java.util.HashMap; |
| 13 | 14 | import java.util.Iterator; |
| ... | ... | @@ -38,6 +39,7 @@ import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 38 | 39 | import com.bsth.service.report.CulateMileageService; |
| 39 | 40 | import com.bsth.service.report.ReportService; |
| 40 | 41 | import com.bsth.util.Arith; |
| 42 | +import com.bsth.util.ComparableJob; | |
| 41 | 43 | import com.bsth.util.db.DBUtils_MS; |
| 42 | 44 | |
| 43 | 45 | @Service |
| ... | ... | @@ -1150,6 +1152,7 @@ public class ReportServiceImpl implements ReportService{ |
| 1150 | 1152 | @Override |
| 1151 | 1153 | public List<Map<String, Object>> jobFwqk(Map<String, Object> map) { |
| 1152 | 1154 | // TODO Auto-generated method stub |
| 1155 | + String[] lblxs = {"配车", "保养","故障","肇事","路阻","纠纷","缺人","客稀","缺车","气候","援外","吊慢","抽减","其他" }; | |
| 1153 | 1156 | String line=map.get("line").toString(); |
| 1154 | 1157 | String date=map.get("date").toString(); |
| 1155 | 1158 | map.put("bcType", "normal"); |
| ... | ... | @@ -1179,7 +1182,7 @@ public class ReportServiceImpl implements ReportService{ |
| 1179 | 1182 | newMap.put("sj", scheduleRealInfo.getFcsj()); |
| 1180 | 1183 | newMap.put("lbbc", 1); |
| 1181 | 1184 | newMap.put("lblc", scheduleRealInfo.getJhlcOrig()); |
| 1182 | - newMap.put("jyqp", scheduleRealInfo.getRealMileage()); | |
| 1185 | + newMap.put("jyqp", scheduleRealInfo.getRemarks()); | |
| 1183 | 1186 | list.add(newMap); |
| 1184 | 1187 | } |
| 1185 | 1188 | |
| ... | ... | @@ -1205,7 +1208,7 @@ public class ReportServiceImpl implements ReportService{ |
| 1205 | 1208 | newMap.put("sj", childTaskPlan.getStartDate()); |
| 1206 | 1209 | newMap.put("lbbc", 0); |
| 1207 | 1210 | newMap.put("lblc", childTaskPlan.getMileage()); |
| 1208 | - newMap.put("jyqp", scheduleRealInfo.getRealMileage()); | |
| 1211 | + newMap.put("jyqp", childTaskPlan.getRemarks()); | |
| 1209 | 1212 | list.add(newMap); |
| 1210 | 1213 | |
| 1211 | 1214 | } |
| ... | ... | @@ -1213,7 +1216,36 @@ public class ReportServiceImpl implements ReportService{ |
| 1213 | 1216 | } |
| 1214 | 1217 | } |
| 1215 | 1218 | } |
| 1216 | - return list; | |
| 1219 | + List<Map<String, Object>> listNew=new ArrayList<Map<String,Object>>(); | |
| 1220 | + for (int i = 0; i < lblxs.length; i++) { | |
| 1221 | + String lx=lblxs[i]; | |
| 1222 | + double lblc=0.0; | |
| 1223 | + int lbbc=0; | |
| 1224 | + for (int j = 0; j < list.size(); j++) { | |
| 1225 | + Map<String, Object> m1=list.get(j); | |
| 1226 | + if(lx.equals(m1.get("nr").toString())){ | |
| 1227 | + m1.put("lx", 0); | |
| 1228 | + listNew.add(m1); | |
| 1229 | + lblc =Arith.add(lblc,Double.parseDouble(m1.get("lblc").toString())); | |
| 1230 | + lbbc += Integer.parseInt(m1.get("lbbc").toString()); | |
| 1231 | + } | |
| 1232 | + } | |
| 1233 | + if(lblc>0){ | |
| 1234 | + Map<String, Object> newMap = new HashMap<String, Object>(); | |
| 1235 | + newMap.put("lx", 1); | |
| 1236 | + newMap.put("nr", lx); | |
| 1237 | + newMap.put("lp", "小计"); | |
| 1238 | + newMap.put("nbbm", "少驶班次"); | |
| 1239 | + newMap.put("jgh", lbbc); | |
| 1240 | + newMap.put("sj", "少驶公里"); | |
| 1241 | + newMap.put("lblc", lblc); | |
| 1242 | + listNew.add(newMap); | |
| 1243 | + } | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + } | |
| 1247 | + Collections.sort(listNew, new ComparableJob()); | |
| 1248 | + return listNew; | |
| 1217 | 1249 | } |
| 1218 | 1250 | |
| 1219 | 1251 | //统计临加班次详细信息 | ... | ... |
src/main/java/com/bsth/util/ComparableJob.java
0 → 100644
| 1 | +package com.bsth.util; | |
| 2 | + | |
| 3 | +import java.util.Comparator; | |
| 4 | +import java.util.Map; | |
| 5 | + | |
| 6 | + | |
| 7 | +public class ComparableJob implements Comparator<Map<String, Object>>{ | |
| 8 | + | |
| 9 | + @Override | |
| 10 | + public int compare(Map<String, Object> o1, Map<String, Object> o2) { | |
| 11 | + // TODO Auto-generated method stub | |
| 12 | + return o1.get("nr").toString().compareTo(o2.get("nr").toString()); | |
| 13 | + } | |
| 14 | + | |
| 15 | +} | ... | ... |
src/main/resources/static/pages/forms/statement/jobSummary.html
| ... | ... | @@ -277,6 +277,27 @@ |
| 277 | 277 | initPinYinSelect2('#line',data,''); |
| 278 | 278 | |
| 279 | 279 | }) */ |
| 280 | + | |
| 281 | + jQuery.fn.rowspan = function(colIdx) { //封装的一个JQuery小插件 | |
| 282 | + return this.each(function(){ | |
| 283 | + var that; | |
| 284 | + $('tr', this).each(function(row) { | |
| 285 | + $('td:eq('+colIdx+')', this).filter(':visible').each(function(col) { | |
| 286 | + if (that!=null && $(this).html() == $(that).html()) { | |
| 287 | + rowspan = $(that).attr("rowSpan"); | |
| 288 | + if (rowspan == undefined) { | |
| 289 | + $(that).attr("rowSpan",1); | |
| 290 | + rowspan = $(that).attr("rowSpan"); } | |
| 291 | + rowspan = Number(rowspan)+1; | |
| 292 | + $(that).attr("rowSpan",rowspan); | |
| 293 | + $(this).hide(); | |
| 294 | + } else { | |
| 295 | + that = this; | |
| 296 | + } | |
| 297 | + }); | |
| 298 | + }); | |
| 299 | + }); | |
| 300 | + } | |
| 280 | 301 | $("#query").on("click",function(){ |
| 281 | 302 | var line=$("#line").val();; |
| 282 | 303 | var lineName=$(".select2-selection__rendered").html(); |
| ... | ... | @@ -292,6 +313,11 @@ |
| 292 | 313 | var list_lbqk = template('list_lbqk',{list:result}); |
| 293 | 314 | // 把渲染好的模版html文本追加到表格中 |
| 294 | 315 | $('#forms .list_lbqk').html(list_lbqk); |
| 316 | + $('#forms .list_lbqk').rowspan(0); | |
| 317 | + $('#forms .list_lbqk').rowspan(1); | |
| 318 | + $('#forms .list_lbqk').rowspan(2); | |
| 319 | + $('#forms .list_lbqk').rowspan(3); | |
| 320 | + | |
| 295 | 321 | }) |
| 296 | 322 | |
| 297 | 323 | $get('/report/jobLjqk',{line:line,date:date},function(result){ |
| ... | ... | @@ -328,13 +354,19 @@ |
| 328 | 354 | <td>{{obj.nr}}</td> |
| 329 | 355 | <td>{{obj.lp}}</td> |
| 330 | 356 | <td>{{obj.nbbm}}</td> |
| 331 | - <td>{{obj.jgh}}</td> | |
| 357 | + <td {{if obj.lx ==1}} colspan="2" {{/if}}>{{obj.jgh}}</td> | |
| 358 | + {{if obj.lx ==0}} | |
| 332 | 359 | <td>{{obj.dz}}</td> |
| 333 | - <td>{{obj.sj}}</td> | |
| 360 | + {{/if}} | |
| 361 | + <td {{if obj.lx ==1}} colspan="3" {{/if}}>{{obj.sj}}</td> | |
| 362 | + {{if obj.lx ==0}} | |
| 334 | 363 | <td> </td> |
| 335 | 364 | <td>{{obj.lbbc}}</td> |
| 336 | - <td>{{obj.lblc}}</td> | |
| 365 | + {{/if}} | |
| 366 | + <td {{if obj.lx ==1}} colspan="2" {{/if}}>{{obj.lblc}}</td> | |
| 367 | + {{if obj.lx ==0}} | |
| 337 | 368 | <td>{{obj.jyqp}}</td> |
| 369 | + {{/if}} | |
| 338 | 370 | </tr> |
| 339 | 371 | {{/each}} |
| 340 | 372 | {{if list.length == 0}} | ... | ... |
src/main/resources/static/pages/forms/statement/scheduleDaily.html
| ... | ... | @@ -551,7 +551,7 @@ letter-spacing: 20px; |
| 551 | 551 | <td>{{obj.fast}}</td> |
| 552 | 552 | <td>{{obj.slow}}</td> |
| 553 | 553 | <td>{{obj.fcsj}}</td> |
| 554 | - <td>{{obj.fcsjActual}} | |
| 554 | + <td style="word-break: keep-all;white-space:nowrap;">{{obj.fcsjActual}} | |
| 555 | 555 | {{if obj.bcType== "in"}} |
| 556 | 556 | (进) |
| 557 | 557 | {{/if}} | ... | ... |