Commit 705ee0e09681f1817e942e14bf4c8336fcb92286
1 parent
0510497d
报表更改
Showing
7 changed files
with
167 additions
and
34 deletions
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| ... | ... | @@ -262,6 +262,12 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 262 | 262 | @RequestParam String date,@RequestParam String state) { |
| 263 | 263 | return scheduleRealInfoService.queryUserInfo(line, date,state); |
| 264 | 264 | } |
| 265 | + | |
| 266 | + @RequestMapping(value = "/queryUserInfoPx") | |
| 267 | + public List<ScheduleRealInfo> queryUserInfoPx(@RequestParam String line, | |
| 268 | + @RequestParam String date,@RequestParam String state,@RequestParam String type) { | |
| 269 | + return scheduleRealInfoService.queryUserInfoPx(line, date,state,type); | |
| 270 | + } | |
| 265 | 271 | |
| 266 | 272 | @RequestMapping(value = "/exportWaybill") |
| 267 | 273 | public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName, @RequestParam String clZbh, | ... | ... |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -30,6 +30,12 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 30 | 30 | |
| 31 | 31 | @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by (lpName+1)") |
| 32 | 32 | List<ScheduleRealInfo> queryUserInfo2(String line,String date); |
| 33 | + | |
| 34 | + @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by ?3 desc") | |
| 35 | + List<ScheduleRealInfo> queryUserInfoPxDesc(String line,String date,String state); | |
| 36 | + | |
| 37 | + @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by ?3 asc") | |
| 38 | + List<ScheduleRealInfo> queryUserInfoPxAsc(String line,String date,String state); | |
| 33 | 39 | |
| 34 | 40 | @Query(value="select min(s.id), s.clZbh from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.clZbh ") |
| 35 | 41 | List<ScheduleRealInfo> queryUserInfo3(String line,String date); | ... | ... |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| ... | ... | @@ -62,6 +62,8 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L |
| 62 | 62 | |
| 63 | 63 | List<ScheduleRealInfo> queryUserInfo(String line,String date,String state); |
| 64 | 64 | |
| 65 | + List<ScheduleRealInfo> queryUserInfoPx(String line,String date,String state,String type); | |
| 66 | + | |
| 65 | 67 | List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName,String date,String line); |
| 66 | 68 | |
| 67 | 69 | List<ScheduleRealInfo> exportWaybillQp(String clZbh,String date,String line); | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -56,9 +56,13 @@ import org.joda.time.format.DateTimeFormatter; |
| 56 | 56 | import org.slf4j.Logger; |
| 57 | 57 | import org.slf4j.LoggerFactory; |
| 58 | 58 | import org.springframework.beans.factory.annotation.Autowired; |
| 59 | +import org.springframework.jdbc.core.JdbcTemplate; | |
| 60 | +import org.springframework.jdbc.core.RowMapper; | |
| 59 | 61 | import org.springframework.stereotype.Service; |
| 60 | 62 | |
| 61 | 63 | import java.io.*; |
| 64 | +import java.sql.ResultSet; | |
| 65 | +import java.sql.SQLException; | |
| 62 | 66 | import java.text.DecimalFormat; |
| 63 | 67 | import java.text.ParseException; |
| 64 | 68 | import java.text.SimpleDateFormat; |
| ... | ... | @@ -69,7 +73,8 @@ import java.util.zip.ZipOutputStream; |
| 69 | 73 | @Service |
| 70 | 74 | public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInfo, Long> |
| 71 | 75 | implements ScheduleRealInfoService { |
| 72 | - | |
| 76 | + @Autowired | |
| 77 | + JdbcTemplate jdbcTemplate; | |
| 73 | 78 | @Autowired |
| 74 | 79 | ScheduleRealInfoRepository scheduleRealInfoRepository; |
| 75 | 80 | |
| ... | ... | @@ -448,6 +453,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 448 | 453 | } |
| 449 | 454 | |
| 450 | 455 | } |
| 456 | + | |
| 457 | + @Override | |
| 458 | + public List<ScheduleRealInfo> queryUserInfoPx(String line, String date, String state,String type) { | |
| 459 | +// List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>(); | |
| 460 | + String sqlPlan="select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh," | |
| 461 | + + " s.lp_Name as lpName,s.j_Name as jName,s.s_Gh as sGh,s.s_Name as sName" | |
| 462 | + + " from bsth_c_s_sp_info_real s " | |
| 463 | + + " where s.xl_Bm = '"+line+"' and DATE_FORMAT(s.schedule_Date,'%Y-%m-%d') ='"+date+"' " | |
| 464 | + + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name,s.s_Gh," | |
| 465 | + + " s.s_Name order by "+state+" "+type; | |
| 466 | + List<ScheduleRealInfo> list= jdbcTemplate.query(sqlPlan, | |
| 467 | + new RowMapper<ScheduleRealInfo>(){ | |
| 468 | + @Override | |
| 469 | + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 470 | + ScheduleRealInfo t=new ScheduleRealInfo(); | |
| 471 | + t.setId(rs.getLong("id")); | |
| 472 | + t.setjGh(rs.getString("jGh")); | |
| 473 | + t.setClZbh(rs.getString("clZbh")); | |
| 474 | + t.setLpName(rs.getString("lpName")); | |
| 475 | + t.setjName(rs.getString("jName")); | |
| 476 | + t.setsGh(rs.getString("sGh")); | |
| 477 | + t.setsName(rs.getString("sName")); | |
| 478 | + return t; | |
| 479 | + } | |
| 480 | + }); | |
| 481 | + return list; | |
| 482 | + } | |
| 451 | 483 | |
| 452 | 484 | /** |
| 453 | 485 | * |
| ... | ... | @@ -1360,39 +1392,50 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1360 | 1392 | if (s.getRemarks() != null) { |
| 1361 | 1393 | remarks += s.getRemarks(); |
| 1362 | 1394 | } |
| 1363 | - | |
| 1395 | + | |
| 1364 | 1396 | Set<ChildTaskPlan> childTaskPlans = s.getcTasks(); |
| 1365 | - if (childTaskPlans.isEmpty()) { | |
| 1366 | - if(s.getStatus()==-1){ | |
| 1367 | - if(remarks.indexOf("烂班")>-1){ | |
| 1368 | - remarks +="(烂班)"; | |
| 1369 | - } | |
| 1370 | - s.setRemarks(remarks); | |
| 1371 | - } | |
| 1372 | - | |
| 1373 | - }else{ | |
| 1397 | + if (!childTaskPlans.isEmpty()) { | |
| 1374 | 1398 | s.setFcsjActual(""); |
| 1375 | 1399 | s.setZdsjActual(""); |
| 1376 | 1400 | } |
| 1401 | + | |
| 1402 | + if(s.isDestroy()){ | |
| 1403 | + s.setFcsjActual(""); | |
| 1404 | + s.setZdsjActual(""); | |
| 1405 | + s.setJhlc(0.0); | |
| 1406 | + remarks +="(烂班)"; | |
| 1407 | + s.setRemarks(remarks); | |
| 1408 | + } | |
| 1377 | 1409 | listSchedule.add(s); |
| 1378 | - if(!childTaskPlans.isEmpty()){ | |
| 1379 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1380 | - while (it.hasNext()) { | |
| 1381 | - ChildTaskPlan c = it.next(); | |
| 1382 | - if(!c.isDestroy()){ | |
| 1383 | - ScheduleRealInfo t=new ScheduleRealInfo(); | |
| 1384 | - t.setFcsjActual(c.getStartDate()); | |
| 1385 | - t.setZdsjActual(c.getEndDate()); | |
| 1386 | - t.setQdzName(c.getStartStationName()); | |
| 1387 | - t.setZdzName(c.getEndStationName()); | |
| 1388 | - t.setJhlc( Double.parseDouble(String.valueOf(c.getMileage()))); | |
| 1389 | - t.setRemarks(c.getRemarks()); | |
| 1390 | - t.setAdjustExps("子"); | |
| 1391 | - listSchedule.add(t); | |
| 1392 | - } | |
| 1393 | - } | |
| 1410 | + //计算营运里程,空驶里程 | |
| 1411 | + if (!childTaskPlans.isEmpty()) { | |
| 1412 | + String sqlPc="select * from bsth_c_s_child_task where schedule="+s.getId() +" order by start_date "; | |
| 1413 | + List<ScheduleRealInfo> lists= jdbcTemplate.query(sqlPc, | |
| 1414 | + new RowMapper<ScheduleRealInfo>(){ | |
| 1415 | + @Override | |
| 1416 | + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 1417 | + ScheduleRealInfo t=new ScheduleRealInfo(); | |
| 1418 | + if(rs.getInt("destroy")==0){ | |
| 1419 | + t.setFcsjActual(rs.getString("start_date")); | |
| 1420 | + t.setZdsjActual(rs.getString("end_date")); | |
| 1421 | + t.setJhlc(rs.getDouble("mileage")); | |
| 1422 | + }else{ | |
| 1423 | + t.setFcsjActual(""); | |
| 1424 | + t.setZdsjActual(""); | |
| 1425 | + t.setJhlc(0.0); | |
| 1426 | + } | |
| 1427 | + t.setQdzName(rs.getString("start_station_name")); | |
| 1428 | + t.setZdzName(rs.getString("end_station_name")); | |
| 1429 | + t.setRemarks(rs.getString("remarks")); | |
| 1430 | + t.setAdjustExps("子"); | |
| 1431 | + return t; | |
| 1432 | + } | |
| 1433 | + }); | |
| 1434 | + for (int j = 0; j < lists.size(); j++) { | |
| 1435 | + ScheduleRealInfo t=lists.get(j); | |
| 1436 | + listSchedule.add(t); | |
| 1437 | + } | |
| 1394 | 1438 | } |
| 1395 | - | |
| 1396 | 1439 | } |
| 1397 | 1440 | |
| 1398 | 1441 | return listSchedule; | ... | ... |
src/main/resources/static/pages/forms/statement/scheduleDaily.html
| ... | ... | @@ -43,7 +43,7 @@ |
| 43 | 43 | </form> |
| 44 | 44 | </div> |
| 45 | 45 | <div class="portlet-body"> |
| 46 | - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;height: 400px"> | |
| 46 | + <div class="table-container" id="ddrbBody" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 47 | 47 | <label>日期:<span id="rqxs"></span> 早高峰:6:31~8:30 晚高峰:16:01~18:00</label> |
| 48 | 48 | <table class="table table-bordered table-hover table-checkable" id="forms"> |
| 49 | 49 | <thead> |
| ... | ... | @@ -254,6 +254,7 @@ |
| 254 | 254 | |
| 255 | 255 | <script> |
| 256 | 256 | $(function(){ |
| 257 | + | |
| 257 | 258 | // 关闭左侧栏 |
| 258 | 259 | if (!$('body').hasClass('page-sidebar-closed')) |
| 259 | 260 | $('.menu-toggler.sidebar-toggler').click(); |
| ... | ... | @@ -264,7 +265,7 @@ |
| 264 | 265 | }); |
| 265 | 266 | |
| 266 | 267 | |
| 267 | - | |
| 268 | + $("#ddrbBody").height($(window).height()-300); | |
| 268 | 269 | $.get('/basic/lineCode2Name',function(result){ |
| 269 | 270 | var data=[]; |
| 270 | 271 | ... | ... |
src/main/resources/static/pages/forms/statement/waybill.html
| ... | ... | @@ -50,9 +50,9 @@ |
| 50 | 50 | <table class="table table-bordered table-hover table-checkable pre-scrollable" id="info"> |
| 51 | 51 | <thead> |
| 52 | 52 | <tr class="hidden"> |
| 53 | - <th>人员</th> | |
| 54 | - <th>自编号</th> | |
| 55 | - <th>路牌</th> | |
| 53 | + <th class="rypx" style="cursor:pointer ">人员</th> | |
| 54 | + <th class="zbhpx" style="cursor:pointer ">自编号</th> | |
| 55 | + <th class="lppx" style="cursor:pointer ">路牌</th> | |
| 56 | 56 | </tr> |
| 57 | 57 | </thead> |
| 58 | 58 | <tbody> |
| ... | ... | @@ -95,7 +95,16 @@ |
| 95 | 95 | format : 'YYYY-MM-DD', |
| 96 | 96 | locale : 'zh-cn' |
| 97 | 97 | }); |
| 98 | - | |
| 98 | + | |
| 99 | + var d = new Date(); | |
| 100 | + var year = d.getFullYear(); | |
| 101 | + var month = d.getMonth() + 1; | |
| 102 | + var day = d.getDate(); | |
| 103 | + if(month < 10) | |
| 104 | + month = "0" + month; | |
| 105 | + if(day < 10) | |
| 106 | + day = "0" + day; | |
| 107 | + $("#date").val(year + "-" + month + "-" + day); | |
| 99 | 108 | $.get('/basic/lineCode2Name',function(result){ |
| 100 | 109 | var data=[]; |
| 101 | 110 | |
| ... | ... | @@ -159,6 +168,57 @@ |
| 159 | 168 | $('#info tbody').html(tbodyHtml); |
| 160 | 169 | }); |
| 161 | 170 | }); |
| 171 | + var type="desc"; | |
| 172 | + $(".rypx").on("click",function(){ | |
| 173 | + line = $("#line").val(); | |
| 174 | + date = $("#date").val(); | |
| 175 | + $(".hidden").removeClass("hidden"); | |
| 176 | + $get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"j_Gh",type:type},function(result){ | |
| 177 | + if(type=="desc"){ | |
| 178 | + type ="asc"; | |
| 179 | + }else{ | |
| 180 | + type ="desc"; | |
| 181 | + } | |
| 182 | + // 把数据填充到模版中 | |
| 183 | + var tbodyHtml = template('list_info_px',{list:result}); | |
| 184 | + // 把渲染好的模版html文本追加到表格中 | |
| 185 | + $('#info tbody').html(tbodyHtml); | |
| 186 | + }); | |
| 187 | + }) | |
| 188 | + | |
| 189 | + $(".zbhpx").on("click",function(){ | |
| 190 | + line = $("#line").val(); | |
| 191 | + date = $("#date").val(); | |
| 192 | + $(".hidden").removeClass("hidden"); | |
| 193 | + $get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"clZbh",type:type},function(result){ | |
| 194 | + if(type=="desc"){ | |
| 195 | + type ="asc"; | |
| 196 | + }else{ | |
| 197 | + type ="desc"; | |
| 198 | + } | |
| 199 | + // 把数据填充到模版中 | |
| 200 | + var tbodyHtml = template('list_info_px',{list:result}); | |
| 201 | + // 把渲染好的模版html文本追加到表格中 | |
| 202 | + $('#info tbody').html(tbodyHtml); | |
| 203 | + }); | |
| 204 | + }) | |
| 205 | + | |
| 206 | + $(".lppx").on("click",function(){ | |
| 207 | + line = $("#line").val(); | |
| 208 | + date = $("#date").val(); | |
| 209 | + $(".hidden").removeClass("hidden"); | |
| 210 | + $get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"(lpName+1)",type:type},function(result){ | |
| 211 | + if(type=="desc"){ | |
| 212 | + type ="asc"; | |
| 213 | + }else{ | |
| 214 | + type ="desc"; | |
| 215 | + } | |
| 216 | + // 把数据填充到模版中 | |
| 217 | + var tbodyHtml = template('list_info_px',{list:result}); | |
| 218 | + // 把渲染好的模版html文本追加到表格中 | |
| 219 | + $('#info tbody').html(tbodyHtml); | |
| 220 | + }); | |
| 221 | + }) | |
| 162 | 222 | |
| 163 | 223 | var params = new Array(); |
| 164 | 224 | var jName = ''; |
| ... | ... | @@ -248,6 +308,20 @@ |
| 248 | 308 | </tr> |
| 249 | 309 | {{/if}} |
| 250 | 310 | </script> |
| 311 | +<script type="text/html" id="list_info_px"> | |
| 312 | + {{each list as obj i}} | |
| 313 | + <tr> | |
| 314 | + <td width="45%">{{obj.jName}}\{{obj.jGh}}</td> | |
| 315 | + <td width="32%">{{obj.clZbh}}</td> | |
| 316 | + <td width="23%">{{obj.lpName}}<input type="hidden" id="{{obj.clZbh}}" value="{{obj.id}}"></td> | |
| 317 | + </tr> | |
| 318 | + {{/each}} | |
| 319 | + {{if list.length == 0}} | |
| 320 | + <tr> | |
| 321 | + <td colspan="3"><h6 class="muted">没有找到相关数据</h6></td> | |
| 322 | + </tr> | |
| 323 | + {{/if}} | |
| 324 | +</script> | |
| 251 | 325 | <script type="text/html" id="ludan_1"> |
| 252 | 326 | <tr> |
| 253 | 327 | <td colspan="14">行车路单</td> | ... | ... |
src/main/resources/static/pages/forms/statement/waybillQp.html
| ... | ... | @@ -188,6 +188,7 @@ |
| 188 | 188 | $('#forms .ludan_2').html(ludan_2); |
| 189 | 189 | }); |
| 190 | 190 | $post('/realSchedule/findKMBCQp',{clZbh:params[0],date:date,line:line},function(result){ |
| 191 | + console.log(result); | |
| 191 | 192 | var ludan_3 = template('ludan_3',{map:result}); |
| 192 | 193 | $('#forms .ludan_3').html(ludan_3); |
| 193 | 194 | }); | ... | ... |