Commit a86bbb3a73eebaa035ead00f8f6f50e258beb47e
1 parent
cc698739
定时器统计班次公里线程修改
Showing
7 changed files
with
56 additions
and
25 deletions
src/main/java/com/bsth/data/schedule/thread/CalcOilThread.java
| @@ -38,25 +38,35 @@ public class CalcOilThread extends Thread{ | @@ -38,25 +38,35 @@ public class CalcOilThread extends Thread{ | ||
| 38 | 38 | ||
| 39 | @Override | 39 | @Override |
| 40 | public void run() { | 40 | public void run() { |
| 41 | + logger.info("开始计算油量平衡表...."); | ||
| 41 | try{ | 42 | try{ |
| 42 | - logger.info("开始计算路单里程加注量...."); | ||
| 43 | ylbService.obtainDsq(); | 43 | ylbService.obtainDsq(); |
| 44 | +// logger.info("开始计算班次准点率...."); | ||
| 45 | +// sheetService.saveSheetList(""); | ||
| 46 | +// logger.info("计算班次准点率结束!"); | ||
| 47 | + } catch(Exception e){ | ||
| 48 | + logger.error("计算油量平衡表失败",e); | ||
| 49 | + } | ||
| 50 | + try{ | ||
| 51 | + logger.info("开始计算电量平衡表...."); | ||
| 44 | dlbService.obtainDsq(); | 52 | dlbService.obtainDsq(); |
| 53 | + } catch(Exception e){ | ||
| 54 | + logger.error("计算电量平衡表失败",e); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + try{ | ||
| 45 | logger.info("计算路单里程加注量结束!"); | 58 | logger.info("计算路单里程加注量结束!"); |
| 46 | - logger.info("开始计算班次准点率...."); | ||
| 47 | - //sheetService.saveSheetList(""); | ||
| 48 | - logger.info("计算班次准点率结束!"); | ||
| 49 | - | ||
| 50 | - logger.info("开始保存重新统计数据...."); | ||
| 51 | calcWaybillService.autoGenerate("", ""); | 59 | calcWaybillService.autoGenerate("", ""); |
| 52 | - logger.info("重新统计保存结束!"); | ||
| 53 | - logger.info("开始保存统计日报...."); | ||
| 54 | - calcWaybillService.calcDaily("", ""); | ||
| 55 | - logger.info("统计日报保存结束!"); | ||
| 56 | - } catch(Exception e){ | ||
| 57 | - logger.error("计算路单里程加注量失败",e); | 60 | + }catch(Exception e){ |
| 61 | + logger.error("计算路单里程失败",e); | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + logger.info("开始保存统计日报...."); | ||
| 65 | + try{ | ||
| 66 | + calcWaybillService.calcDaily("", ""); | ||
| 67 | + }catch(Exception e){ | ||
| 68 | + logger.error("统计日报失败",e); | ||
| 58 | } | 69 | } |
| 59 | - | ||
| 60 | //清除指令数据 | 70 | //清除指令数据 |
| 61 | dayOfDirectives.clearAll(); | 71 | dayOfDirectives.clearAll(); |
| 62 | //清除安全驾驶数据 | 72 | //清除安全驾驶数据 |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -209,14 +209,12 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -209,14 +209,12 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 209 | }else{ | 209 | }else{ |
| 210 | addList.add(t); | 210 | addList.add(t); |
| 211 | } | 211 | } |
| 212 | - | ||
| 213 | } | 212 | } |
| 214 | } | 213 | } |
| 215 | 214 | ||
| 216 | } | 215 | } |
| 217 | if(addList.size()>0){ | 216 | if(addList.size()>0){ |
| 218 | try { | 217 | try { |
| 219 | - | ||
| 220 | new BatchSaveUtils<Ylb>().saveList2(addList, Ylb.class); | 218 | new BatchSaveUtils<Ylb>().saveList2(addList, Ylb.class); |
| 221 | } catch (Exception e) { | 219 | } catch (Exception e) { |
| 222 | // TODO: handle exception | 220 | // TODO: handle exception |
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
| @@ -585,8 +585,6 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -585,8 +585,6 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 585 | } | 585 | } |
| 586 | } | 586 | } |
| 587 | } | 587 | } |
| 588 | - | ||
| 589 | - | ||
| 590 | } | 588 | } |
| 591 | } else { | 589 | } else { |
| 592 | Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | 590 | Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); |
| @@ -598,7 +596,6 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -598,7 +596,6 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 598 | if (!childTaskPlan.isDestroy()) { | 596 | if (!childTaskPlan.isDestroy()) { |
| 599 | Float jhgl = childTaskPlan.getMileage() == null ? 0 | 597 | Float jhgl = childTaskPlan.getMileage() == null ? 0 |
| 600 | : childTaskPlan.getMileage(); | 598 | : childTaskPlan.getMileage(); |
| 601 | - | ||
| 602 | if(item.equals("zgf")){ | 599 | if(item.equals("zgf")){ |
| 603 | if(fcsj>=zgf1 && fcsj<=zgf2){ | 600 | if(fcsj>=zgf1 && fcsj<=zgf2){ |
| 604 | sjgl = Arith.add(sjgl, jhgl); | 601 | sjgl = Arith.add(sjgl, jhgl); |
src/main/resources/static/pages/forms/statement/scheduleDaily.html
| @@ -467,7 +467,7 @@ | @@ -467,7 +467,7 @@ | ||
| 467 | divFrom2 = window.document.getElementById('forms_1'); | 467 | divFrom2 = window.document.getElementById('forms_1'); |
| 468 | divFrom2.style.width=divFrom1.offsetWidth+"px"; | 468 | divFrom2.style.width=divFrom1.offsetWidth+"px"; |
| 469 | }); | 469 | }); |
| 470 | - $.get('/realSchedule/realScheduleList_zrw',{line:line,date:date,type:"query"},function(result){ | 470 | + $.get('/realSchedule/realScheduleList',{line:line,date:date,type:"query"},function(result){ |
| 471 | getTime(result); | 471 | getTime(result); |
| 472 | var scheduleDaily_3 = template('scheduleDaily_3',{list:result}); | 472 | var scheduleDaily_3 = template('scheduleDaily_3',{list:result}); |
| 473 | $('#forms_2 .scheduleDaily_3').html(scheduleDaily_3); | 473 | $('#forms_2 .scheduleDaily_3').html(scheduleDaily_3); |
| @@ -513,7 +513,7 @@ | @@ -513,7 +513,7 @@ | ||
| 513 | params['xlName'] = xlName; | 513 | params['xlName'] = xlName; |
| 514 | params['type'] = "export"; | 514 | params['type'] = "export"; |
| 515 | params['state'] = '2'; | 515 | params['state'] = '2'; |
| 516 | - params['genre'] = 'zrw'; | 516 | + params['genre'] = ''; |
| 517 | $get('/realSchedule/scheduleDailyExport', params, function(result){ | 517 | $get('/realSchedule/scheduleDailyExport', params, function(result){ |
| 518 | if(date.length == 10) | 518 | if(date.length == 10) |
| 519 | window.open("/downloadFile/download?fileName="+moment(date).format("YYYYMMDD")+"-"+lineName+"-调度日报"); | 519 | window.open("/downloadFile/download?fileName="+moment(date).format("YYYYMMDD")+"-"+lineName+"-调度日报"); |
src/main/resources/static/pages/forms/statement/waybill.html
| @@ -308,14 +308,20 @@ | @@ -308,14 +308,20 @@ | ||
| 308 | jGh = params[0].split("\\")[1]; | 308 | jGh = params[0].split("\\")[1]; |
| 309 | var id = params[3]; | 309 | var id = params[3]; |
| 310 | var obj = $(this); | 310 | var obj = $(this); |
| 311 | - $get('/realSchedule/MapById',{id:id},function(result){ | 311 | + $get('/realSchedule/MapById',{id:id},function(result){ |
| 312 | result.scheduleDate = moment(result.scheduleDate).format("YYYY/MM/DD"); | 312 | result.scheduleDate = moment(result.scheduleDate).format("YYYY/MM/DD"); |
| 313 | var ludan_1 = template('ludan_1',result); | 313 | var ludan_1 = template('ludan_1',result); |
| 314 | // 把渲染好的模版html文本追加到表格中 | 314 | // 把渲染好的模版html文本追加到表格中 |
| 315 | $('#forms .ludan_1').html(ludan_1); | 315 | $('#forms .ludan_1').html(ludan_1); |
| 316 | - }); | 316 | + }); |
| 317 | $get('/realSchedule/queryListWaybill',{jGh:jGh,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){ | 317 | $get('/realSchedule/queryListWaybill',{jGh:jGh,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){ |
| 318 | - getTime(result); | 318 | + getTime(result); |
| 319 | + /* $get('/realSchedule/MapById',{id:result[0].id},function(result){ | ||
| 320 | + result.scheduleDate = moment(result.scheduleDate).format("YYYY/MM/DD"); | ||
| 321 | + var ludan_1 = template('ludan_1',result); | ||
| 322 | + // 把渲染好的模版html文本追加到表格中 | ||
| 323 | + $('#forms .ludan_1').html(ludan_1); | ||
| 324 | + }); */ | ||
| 319 | var ludan_2 = template('ludan_2',{list:result}); | 325 | var ludan_2 = template('ludan_2',{list:result}); |
| 320 | // 把渲染好的模版html文本追加到表格中 | 326 | // 把渲染好的模版html文本追加到表格中 |
| 321 | $('#forms .ludan_2').html(ludan_2); | 327 | $('#forms .ludan_2').html(ludan_2); |
src/main/resources/static/pages/forms/statement/waybillQp.html
| @@ -228,14 +228,30 @@ | @@ -228,14 +228,30 @@ | ||
| 228 | function getTime(list){ | 228 | function getTime(list){ |
| 229 | $.each(list, function(i, obj) { | 229 | $.each(list, function(i, obj) { |
| 230 | if(obj.zdsj != null && obj.zdsjActual != null ){ | 230 | if(obj.zdsj != null && obj.zdsjActual != null ){ |
| 231 | - var zdsjActual = (obj.zdsjActual).split(":"); | 231 | + /* var zdsjActual = (obj.zdsjActual).split(":"); |
| 232 | var zdsj = (obj.zdsj).split(":"); | 232 | var zdsj = (obj.zdsj).split(":"); |
| 233 | if(zdsjActual[0]*60+Number(zdsjActual[1]) > zdsj[0]*60+Number(zdsj[1])){ | 233 | if(zdsjActual[0]*60+Number(zdsjActual[1]) > zdsj[0]*60+Number(zdsj[1])){ |
| 234 | obj["slow"] = (zdsjActual[0]*60+Number(zdsjActual[1])) - (zdsj[0]*60+Number(zdsj[1])); | 234 | obj["slow"] = (zdsjActual[0]*60+Number(zdsjActual[1])) - (zdsj[0]*60+Number(zdsj[1])); |
| 235 | } | 235 | } |
| 236 | else if(zdsjActual[0]*60+Number(zdsjActual[1]) < zdsj[0]*60+Number(zdsj[1])){ | 236 | else if(zdsjActual[0]*60+Number(zdsjActual[1]) < zdsj[0]*60+Number(zdsj[1])){ |
| 237 | obj["fast"] = (zdsj[0]*60+Number(zdsj[1])) - (zdsjActual[0]*60+Number(zdsjActual[1])); | 237 | obj["fast"] = (zdsj[0]*60+Number(zdsj[1])) - (zdsjActual[0]*60+Number(zdsjActual[1])); |
| 238 | - } | 238 | + } */ |
| 239 | + var zdsjActual = (obj.zdsjActual).split(":"); | ||
| 240 | + var zdsj = (obj.zdsj).split(":"); | ||
| 241 | + if(zdsjActual[0]*60+Number(zdsjActual[1]) > zdsj[0]*60+Number(zdsj[1])){ | ||
| 242 | + if(zdsjActual[0]*60+Number(zdsjActual[1]) - zdsj[0]*60+Number(zdsj[1]) > 1000){ | ||
| 243 | + obj["fast"] = (zdsj[0]*60+Number(zdsj[1])) - (zdsjActual[0]*60+Number(zdsjActual[1])) + 1440; | ||
| 244 | + } else { | ||
| 245 | + obj["slow"] = (zdsjActual[0]*60+Number(zdsjActual[1])) - (zdsj[0]*60+Number(zdsj[1])); | ||
| 246 | + } | ||
| 247 | + } | ||
| 248 | + else if(zdsjActual[0]*60+Number(zdsjActual[1]) < zdsj[0]*60+Number(zdsj[1])){ | ||
| 249 | + if((zdsj[0]*60+Number(zdsj[1])) - (zdsjActual[0]*60+Number(zdsjActual[1])) > 1000){ | ||
| 250 | + obj["slow"] = (zdsjActual[0]*60+Number(zdsjActual[1])) - (zdsj[0]*60+Number(zdsj[1])) + 1440; | ||
| 251 | + } else { | ||
| 252 | + obj["fast"] = (zdsj[0]*60+Number(zdsj[1])) - (zdsjActual[0]*60+Number(zdsjActual[1])); | ||
| 253 | + } | ||
| 254 | + } | ||
| 239 | } | 255 | } |
| 240 | }); | 256 | }); |
| 241 | } | 257 | } |
src/main/resources/static/pages/oil/list_ph.html
| @@ -185,6 +185,7 @@ | @@ -185,6 +185,7 @@ | ||
| 185 | <td width="8%">日期</td> | 185 | <td width="8%">日期</td> |
| 186 | <td width="5%">公司</td> | 186 | <td width="5%">公司</td> |
| 187 | <td width="8%">线路</td> | 187 | <td width="8%">线路</td> |
| 188 | + <td width="2%">路牌</td> | ||
| 188 | <td width="5%">自编号</td> | 189 | <td width="5%">自编号</td> |
| 189 | <td width="7%">驾驶员</td> | 190 | <td width="7%">驾驶员</td> |
| 190 | <td width="4%">加油量</td> | 191 | <td width="4%">加油量</td> |
| @@ -250,6 +251,9 @@ | @@ -250,6 +251,9 @@ | ||
| 250 | {{/if}} | 251 | {{/if}} |
| 251 | 252 | ||
| 252 | </td> | 253 | </td> |
| 254 | + <td width="2%"> | ||
| 255 | + {{obj.lp}} | ||
| 256 | + </td> | ||
| 253 | <td width="5%"> | 257 | <td width="5%"> |
| 254 | <lable data-id="{{obj.id}}" class="in_carpark_nbbm">{{obj.nbbm}}</lable> | 258 | <lable data-id="{{obj.id}}" class="in_carpark_nbbm">{{obj.nbbm}}</lable> |
| 255 | 259 |