Commit 3556aca1509534a8a54c5bd8b8bbae39b0c45646
1 parent
8c10e233
170106
Showing
8 changed files
with
113 additions
and
37 deletions
src/main/java/com/bsth/controller/oil/YlbController.java
| ... | ... | @@ -106,24 +106,24 @@ public class YlbController extends BaseController<Ylb, Integer>{ |
| 106 | 106 | @RequestParam(defaultValue = "DESC") String direction){ |
| 107 | 107 | |
| 108 | 108 | Direction d; |
| 109 | - try { | |
| 109 | +// try { | |
| 110 | 110 | String rq=map.get("rq").toString(); |
| 111 | 111 | if(!(rq=="")){ |
| 112 | - | |
| 113 | - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 114 | - Calendar calendar = new GregorianCalendar(); | |
| 115 | - calendar.setTime(sdf.parse(rq)); | |
| 116 | - calendar.add(calendar.DATE,1); | |
| 117 | - Date date=calendar.getTime(); | |
| 118 | - map.put("rq_ge", rq); | |
| 119 | - map.put("rq_le", sdf.format(date)); | |
| 120 | - System.out.println(rq); | |
| 121 | - System.out.println(sdf.format(date)); | |
| 122 | - } | |
| 123 | - } catch (ParseException e) { | |
| 124 | - // TODO Auto-generated catch block | |
| 125 | - e.printStackTrace(); | |
| 112 | +// | |
| 113 | +// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 114 | +// Calendar calendar = new GregorianCalendar(); | |
| 115 | +// calendar.setTime(sdf.parse(rq)); | |
| 116 | +// calendar.add(calendar.DATE,1); | |
| 117 | +// Date date=calendar.getTime(); | |
| 118 | + map.put("rq_eq", rq); | |
| 119 | +// map.put("rq_lt", sdf.format(date)); | |
| 120 | +// System.out.println(rq); | |
| 121 | +// System.out.println(sdf.format(date)); | |
| 126 | 122 | } |
| 123 | +// } catch (ParseException e) { | |
| 124 | +// // TODO Auto-generated catch block | |
| 125 | +// e.printStackTrace(); | |
| 126 | +// } | |
| 127 | 127 | if(null != direction && direction.equals("ASC")) |
| 128 | 128 | d = Direction.ASC; |
| 129 | 129 | else | ... | ... |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -110,7 +110,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 110 | 110 | @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2") |
| 111 | 111 | List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date); |
| 112 | 112 | |
| 113 | - @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY xlBm,clZbh") | |
| 113 | + @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY realExecDate,fcsj,xlBm,clZbh") | |
| 114 | 114 | List<Map<String,Object>> yesterdayDataList(String line,String date); |
| 115 | 115 | |
| 116 | 116 | @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir") | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -132,7 +132,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 132 | 132 | t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); |
| 133 | 133 | t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); |
| 134 | 134 | t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); |
| 135 | - t.setRq(dBefore); | |
| 135 | + t.setRq(sdf.parse(rq)); | |
| 136 | 136 | repository.save(t); |
| 137 | 137 | result = "success"; |
| 138 | 138 | } catch (Exception e) { | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -1566,7 +1566,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1566 | 1566 | |
| 1567 | 1567 | @Override |
| 1568 | 1568 | public List<ScheduleRealInfo> realScheduleList(String line, String date) { |
| 1569 | - List<ScheduleRealInfo> listInfo = scheduleRealInfoRepository.queryUserInfo(line, date); | |
| 1569 | + /*List<ScheduleRealInfo> listInfo = scheduleRealInfoRepository.queryUserInfo(line, date); | |
| 1570 | 1570 | List<ScheduleRealInfo> listTotal = scheduleRealInfoRepository.scheduleByDateAndLine(line, date); |
| 1571 | 1571 | for(ScheduleRealInfo info:listInfo){ |
| 1572 | 1572 | for(ScheduleRealInfo total:listTotal){ |
| ... | ... | @@ -1574,7 +1574,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1574 | 1574 | |
| 1575 | 1575 | } |
| 1576 | 1576 | } |
| 1577 | - } | |
| 1577 | + }*/ | |
| 1578 | 1578 | return scheduleRealInfoRepository.scheduleByDateAndLine(line, date); |
| 1579 | 1579 | } |
| 1580 | 1580 | |
| ... | ... | @@ -1584,8 +1584,84 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1584 | 1584 | // String date = sdfMonth.format(org.apache.commons.lang.time.DateUtils.addDays(new Date(), -1)); |
| 1585 | 1585 | // String date = "2016-09-20"; |
| 1586 | 1586 | List<Map<String,Object>> yesterdayDataList = scheduleRealInfoRepository.yesterdayDataList(line, date); |
| 1587 | - List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date); | |
| 1588 | - for(ScheduleRealInfo scheduleRealInfo:list){ | |
| 1587 | +// List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date); | |
| 1588 | + for(int x=0;x<yesterdayDataList.size();x++){ | |
| 1589 | + String jName=yesterdayDataList.get(x).get("jGh").toString(); | |
| 1590 | + String clZbh=yesterdayDataList.get(x).get("clZbh").toString(); | |
| 1591 | + List<ScheduleRealInfo> lists=scheduleRealInfoRepository.queryListWaybill3(jName, clZbh, date); | |
| 1592 | + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0,jcclc=0; | |
| 1593 | + float addMileage = 0l,remMileage = 0l; | |
| 1594 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 1595 | + boolean fage=true; | |
| 1596 | + for(ScheduleRealInfo scheduleRealInfo : lists){ | |
| 1597 | + if(fage){ | |
| 1598 | + //根据线路代码获取公司 | |
| 1599 | + Line li = lineRepository.findByLineCode(scheduleRealInfo.getXlBm()); | |
| 1600 | + yesterdayDataList.get(x).put("company", li.getCompany()); | |
| 1601 | + yesterdayDataList.get(x).put("bCompany", li.getBrancheCompany()); | |
| 1602 | + fage=false; | |
| 1603 | + } | |
| 1604 | + if(scheduleRealInfo != null){ | |
| 1605 | + //计划里程(主任务过滤掉临加班次), | |
| 1606 | + //烂班里程(主任务烂班), | |
| 1607 | + //临加里程(主任务临加), | |
| 1608 | + //计划班次,烂班班次,增加班次 | |
| 1609 | + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | |
| 1610 | + if(scheduleRealInfo.isSflj()){ | |
| 1611 | + addMileage += tempJhlc; | |
| 1612 | + }else{ | |
| 1613 | + if( !(scheduleRealInfo.getBcType().equals("in") | |
| 1614 | + ||scheduleRealInfo.getBcType().equals("out")) ){ | |
| 1615 | + jhlc += tempJhlc; | |
| 1616 | + } | |
| 1617 | + | |
| 1618 | + if(scheduleRealInfo.getStatus() == -1){ | |
| 1619 | + remMileage += tempJhlc; | |
| 1620 | + } | |
| 1621 | + } | |
| 1622 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 1623 | + //计算营运里程,空驶里程 | |
| 1624 | + if(childTaskPlans.isEmpty()){ | |
| 1625 | + if(scheduleRealInfo.getBcType().equals("in") || | |
| 1626 | + scheduleRealInfo.getBcType().equals("out")){ | |
| 1627 | + jcclc +=tempJhlc; | |
| 1628 | + } | |
| 1629 | + //主任务 放空班次属于营运 | |
| 1630 | +// else if(scheduleRealInfo.getBcType().equals("venting")){ | |
| 1631 | +// ksgl += tempJhlc; | |
| 1632 | +// } | |
| 1633 | + else{ | |
| 1634 | + if(scheduleRealInfo.getStatus() != -1){ | |
| 1635 | + yygl += tempJhlc; | |
| 1636 | + } | |
| 1637 | + } | |
| 1638 | + }else{ | |
| 1639 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1640 | + while(it.hasNext()){ | |
| 1641 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 1642 | + if(childTaskPlan.getMileageType().equals("empty")){ | |
| 1643 | + if(childTaskPlan.isDestroy()){ | |
| 1644 | + remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 1645 | + }else{ | |
| 1646 | + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 1647 | + } | |
| 1648 | + }else{ | |
| 1649 | + if(childTaskPlan.isDestroy()){ | |
| 1650 | + remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 1651 | + }else{ | |
| 1652 | + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 1653 | + } | |
| 1654 | + } | |
| 1655 | + } | |
| 1656 | + } | |
| 1657 | + } | |
| 1658 | + } | |
| 1659 | + | |
| 1660 | + yesterdayDataList.get(x).put("totalKilometers", yygl+ksgl+jcclc); | |
| 1661 | + | |
| 1662 | + } | |
| 1663 | + | |
| 1664 | + /* for(ScheduleRealInfo scheduleRealInfo:list){ | |
| 1589 | 1665 | if(scheduleRealInfo != null){ |
| 1590 | 1666 | for(int i=0;i<yesterdayDataList.size();i++){ |
| 1591 | 1667 | if(scheduleRealInfo.getXlBm().equals(yesterdayDataList.get(i).get("xlBm")) && scheduleRealInfo.getClZbh().equals(yesterdayDataList.get(i).get("clZbh")) |
| ... | ... | @@ -1613,7 +1689,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1613 | 1689 | } |
| 1614 | 1690 | } |
| 1615 | 1691 | } |
| 1616 | - } | |
| 1692 | + }*/ | |
| 1617 | 1693 | //增加顺序号 |
| 1618 | 1694 | for(int i=0;i<yesterdayDataList.size();i++){ |
| 1619 | 1695 | if(i == 0){ | ... | ... |
src/main/resources/application-dev.properties
| ... | ... | @@ -7,13 +7,13 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy |
| 7 | 7 | #DATABASE |
| 8 | 8 | spring.jpa.database= MYSQL |
| 9 | 9 | spring.jpa.show-sql= true |
| 10 | -spring.datasource.driver-class-name= com.mysql.jdbc.Driver | |
| 11 | -spring.datasource.url= jdbc:mysql://127.0.0.1/qp_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 12 | -spring.datasource.username= root | |
| 13 | -spring.datasource.password= | |
| 14 | -#spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 10 | +#spring.datasource.driver-class-name= com.mysql.jdbc.Driver | |
| 11 | +#spring.datasource.url= jdbc:mysql://192.168.168.201/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 15 | 12 | #spring.datasource.username= root |
| 16 | -#spring.datasource.password= root | |
| 13 | +#spring.datasource.password= 123456 | |
| 14 | +spring.datasource.url= jdbc:mysql://localhost/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 15 | +spring.datasource.username= root | |
| 16 | +spring.datasource.password= root | |
| 17 | 17 | #DATASOURCE |
| 18 | 18 | spring.datasource.max-active=100 |
| 19 | 19 | spring.datasource.max-idle=8 | ... | ... |
src/main/resources/ms-jdbc.properties
| ... | ... | @@ -4,6 +4,6 @@ |
| 4 | 4 | #ms.mysql.password= 123456 |
| 5 | 5 | |
| 6 | 6 | ms.mysql.driver= com.mysql.jdbc.Driver |
| 7 | -ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8 | |
| 7 | +ms.mysql.url= jdbc:mysql://192.168.168.117:3306/ms?useUnicode=true&characterEncoding=utf-8 | |
| 8 | 8 | ms.mysql.username= root |
| 9 | -ms.mysql.password= root2jsp | |
| 10 | 9 | \ No newline at end of file |
| 10 | +ms.mysql.password= root | |
| 11 | 11 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forms/statement/scheduleDaily.html
| ... | ... | @@ -269,7 +269,6 @@ |
| 269 | 269 | for(var code in result){ |
| 270 | 270 | data.push({id: code, text: result[code]}); |
| 271 | 271 | } |
| 272 | - console.log(data); | |
| 273 | 272 | initPinYinSelect2('#line',data,''); |
| 274 | 273 | |
| 275 | 274 | }) |
| ... | ... | @@ -282,7 +281,8 @@ |
| 282 | 281 | var scheduleDaily_1 = template('scheduleDaily_1',{list:result}); |
| 283 | 282 | $('#forms .scheduleDaily_1').html(scheduleDaily_1); |
| 284 | 283 | }); |
| 285 | - $.get('/realSchedule/queryUserInfo',{line:line,date:date},function(result){ | |
| 284 | + $.get('/realSchedule/queryUserInfo',{line:line,date:date,state:2},function(result){ | |
| 285 | + console.log(result); | |
| 286 | 286 | var scheduleDaily_2 = template('scheduleDaily_2',{list:result}); |
| 287 | 287 | $('#forms .scheduleDaily_2').html(scheduleDaily_2); |
| 288 | 288 | }); |
| ... | ... | @@ -346,10 +346,10 @@ |
| 346 | 346 | {{if i%5 == 0}} |
| 347 | 347 | <tr> |
| 348 | 348 | {{/if}} |
| 349 | - <td colspan="2">{{obj.lpName}}</td> | |
| 350 | - <td colspan="2">{{obj.clZbh}}</td> | |
| 351 | - <td>{{obj.jGh}}</td> | |
| 352 | - <td>{{obj.sGh}}</td> | |
| 349 | + <td colspan="2">{{obj[3]}}</td> | |
| 350 | + <td colspan="2">{{obj[2]}}</td> | |
| 351 | + <td>{{obj[4]}}</td> | |
| 352 | + <td> </td> | |
| 353 | 353 | <td> </td> |
| 354 | 354 | <td> </td> |
| 355 | 355 | {{if (i+1)%5 == 0}} | ... | ... |
src/main/resources/static/pages/report/timetable/timetable.html