Commit f10a219bcba6735af188405e0401b5543efc8956
Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang
Showing
13 changed files
with
1064 additions
and
75 deletions
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| ... | ... | @@ -314,9 +314,9 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | @RequestMapping(value="/findKMBC",method = RequestMethod.GET) |
| 317 | - public Map<String,Object> findKMBC(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName | |
| 317 | + public Map<String,Object> findKMBC(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName | |
| 318 | 318 | ,@RequestParam String date,@RequestParam String line){ |
| 319 | - return scheduleRealInfoService.findKMBC(jName, clZbh,lpName,date,line); | |
| 319 | + return scheduleRealInfoService.findKMBC(jGh, clZbh,lpName,date,line); | |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | @RequestMapping(value="/findKMBCQp",method = RequestMethod.GET) | ... | ... |
src/main/java/com/bsth/controller/report/ReportController.java
| 1 | 1 | package com.bsth.controller.report; |
| 2 | 2 | |
| 3 | +import java.util.HashMap; | |
| 3 | 4 | import java.util.List; |
| 4 | 5 | import java.util.Map; |
| 5 | 6 | |
| ... | ... | @@ -78,5 +79,23 @@ public class ReportController { |
| 78 | 79 | public List<Map<String,Object>> getTtinfo(@RequestParam Map<String, Object> map){ |
| 79 | 80 | return service.getTtinfo(map); |
| 80 | 81 | } |
| 82 | + | |
| 83 | + | |
| 84 | + @RequestMapping(value="/jobFwqk", method = RequestMethod.GET) | |
| 85 | + public List<Map<String,Object>> jobFwqk(@RequestParam Map<String, Object> map){ | |
| 86 | + return service.jobFwqk(map); | |
| 87 | + } | |
| 88 | + | |
| 89 | + @RequestMapping(value="/jobHzxx", method = RequestMethod.GET) | |
| 90 | + public Map<String,Object> jobHzxx(@RequestParam Map<String, Object> map){ | |
| 91 | + Map<String, Object> newMap=service.jobHzxx(map); | |
| 92 | + return newMap; | |
| 93 | + } | |
| 94 | + | |
| 81 | 95 | |
| 96 | + @RequestMapping(value="/jobLjqk", method = RequestMethod.GET) | |
| 97 | + public List<Map<String,Object>> jobLjqk(@RequestParam Map<String, Object> map){ | |
| 98 | + return service.jobLjqk(map); | |
| 99 | + } | |
| 100 | + | |
| 82 | 101 | } | ... | ... |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -89,6 +89,16 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 89 | 89 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 90 | 90 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and s.xlBm=?5 order by realExecDate,fcsj") |
| 91 | 91 | List<ScheduleRealInfo> queryListWaybill(String jName,String clZbh,String lpName,String date,String line); |
| 92 | + | |
| 93 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | |
| 94 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and s.xlBm=?5 order by realExecDate,fcsj") | |
| 95 | + List<ScheduleRealInfo> queryListWaybillXcld(String jGh,String clZbh,String lpName,String date,String line); | |
| 96 | + | |
| 97 | + | |
| 98 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | |
| 99 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.xlBm,s.adjustExps,s.fcsj") | |
| 100 | + List<ScheduleRealInfo> scheduleByDateAndLineTjrb(String line,String date); | |
| 101 | + | |
| 92 | 102 | |
| 93 | 103 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 94 | 104 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.clZbh = ?1 and s.scheduleDate = str_to_date(?2,'%Y-%m-%d') and xlBm =?3 order by realExecDate,fcsj") |
| ... | ... | @@ -119,25 +129,30 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 119 | 129 | void deleteByLineCodeAndDate(String xlBm, String schDate); |
| 120 | 130 | |
| 121 | 131 | //去掉了 xlBm is not null |
| 122 | - @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.realExecDate,s.fcsj, (s.lpName+1)") | |
| 132 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | |
| 133 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.realExecDate,s.fcsj, (s.lpName+1)") | |
| 123 | 134 | List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date); |
| 124 | 135 | |
| 125 | - @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by (s.lpName+1), s.realExecDate,s.fcsj") | |
| 136 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | |
| 137 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by (s.lpName+1), s.realExecDate,s.fcsj") | |
| 126 | 138 | List<ScheduleRealInfo> scheduleByDateAndLineQp(String line,String date); |
| 127 | 139 | |
| 128 | - @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.bcType not in ('in','out') order by s.xlBm") | |
| 140 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | |
| 141 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.bcType not in ('in','out') order by s.xlBm,s.adjustExps,s.fcsj") | |
| 129 | 142 | List<ScheduleRealInfo> scheduleByDateAndLine2(String line,String date); |
| 130 | 143 | |
| 131 | 144 | //按月统计 |
| 132 | - @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m') = ?2 and s.bcType not in ('in','out') order by s.xlBm") | |
| 145 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | |
| 146 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m') = ?2 and s.bcType not in ('in','out') order by s.xlBm") | |
| 133 | 147 | List<ScheduleRealInfo> scheduleByDateAndLine3(String line,String date); |
| 134 | 148 | |
| 135 | 149 | //按照时间段统计 |
| 136 | - @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and s.bcType not in ('in','out') order by s.xlBm") | |
| 150 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | |
| 151 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and s.bcType not in ('in','out') order by s.xlBm") | |
| 137 | 152 | List<ScheduleRealInfo> scheduleByDateAndLineTj(String line,String date,String date2); |
| 138 | 153 | |
| 139 | 154 | //按照时间段统计 |
| 140 | - @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and s.bcType not in ('in','out') order by s.xlBm") | |
| 155 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and s.bcType not in ('in','out') order by s.xlBm") | |
| 141 | 156 | List<ScheduleRealInfo> scheduleByDateAndLineTj2(String line,String date,String date2); |
| 142 | 157 | |
| 143 | 158 | @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,min(s.fcsj) as fcsj ) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY clZbh,fcsj") | ... | ... |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| ... | ... | @@ -92,7 +92,7 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L |
| 92 | 92 | |
| 93 | 93 | Map<String,Object> findKMBC1(String jName,String clZbh, String date,String enddate); |
| 94 | 94 | |
| 95 | - Map<String,Object> findKMBC(String jName,String clZbh,String lpName,String date,String line); | |
| 95 | + Map<String,Object> findKMBC(String jGh,String clZbh,String lpName,String date,String line); | |
| 96 | 96 | |
| 97 | 97 | Map<String,Object> findKMBCQp(String clZbh,String date,String line); |
| 98 | 98 | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -40,6 +40,8 @@ import com.bsth.security.util.SecurityUtils; |
| 40 | 40 | import com.bsth.service.SectionRouteService; |
| 41 | 41 | import com.bsth.service.impl.BaseServiceImpl; |
| 42 | 42 | import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| 43 | +import com.bsth.service.report.CulateMileageService; | |
| 44 | +import com.bsth.service.report.ReportService; | |
| 43 | 45 | import com.bsth.service.schedule.SchedulePlanInfoService; |
| 44 | 46 | import com.bsth.service.sys.DutyEmployeeService; |
| 45 | 47 | import com.bsth.util.*; |
| ... | ... | @@ -120,6 +122,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 120 | 122 | |
| 121 | 123 | @Autowired |
| 122 | 124 | YlbRepository ylbRepository; |
| 125 | + | |
| 126 | + @Autowired | |
| 127 | + ReportService reposrService; | |
| 128 | + | |
| 129 | + @Autowired | |
| 130 | + CulateMileageService culateService; | |
| 123 | 131 | |
| 124 | 132 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 125 | 133 | |
| ... | ... | @@ -1298,7 +1306,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1298 | 1306 | } |
| 1299 | 1307 | |
| 1300 | 1308 | |
| 1301 | - @Override | |
| 1309 | + /* @Override | |
| 1302 | 1310 | public Map<String, Object> findKMBC(String jName, String clZbh, |
| 1303 | 1311 | String lpName, String date, String line) { |
| 1304 | 1312 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); |
| ... | ... | @@ -1398,6 +1406,31 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1398 | 1406 | map.put("zkslc", format.format(ksgl + jcclc)); |
| 1399 | 1407 | // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc)); |
| 1400 | 1408 | return map; |
| 1409 | + }*/ | |
| 1410 | + | |
| 1411 | + public Map<String, Object> findKMBC(String jGh, String clZbh, | |
| 1412 | + String lpName, String date, String line) { | |
| 1413 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 1414 | + List<ScheduleRealInfo> lists=scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line); | |
| 1415 | + double ksgl=culateService.culateKsgl(lists); | |
| 1416 | + double sjgl=culateService.culateSjgl(lists); | |
| 1417 | + double jccgl=culateService.culateJccgl(lists); | |
| 1418 | + double ljgl=culateService.culateLjgl(lists); | |
| 1419 | + map.put("jhlc", culateService.culateJhgl(lists)); //计划里程 | |
| 1420 | + map.put("remMileage", culateService.culateLbgl(lists)); //烂班公里 | |
| 1421 | + map.put("addMileage", ljgl); //临加公里 | |
| 1422 | + map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里 | |
| 1423 | + map.put("ksgl", ksgl);//空驶公里 | |
| 1424 | + map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl))); | |
| 1425 | +// map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage)); | |
| 1426 | + map.put("jhbc", culateService.culateJhbc(lists,"")); | |
| 1427 | + map.put("cjbc", culateService.culateLbbc(lists)); | |
| 1428 | + map.put("ljbc", culateService.culateLjbc(lists,"")); | |
| 1429 | + map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,"")); | |
| 1430 | + map.put("jcclc", jccgl); | |
| 1431 | + map.put("zkslc", Arith.add(ksgl,jccgl)); | |
| 1432 | +// map.put("zkslc", format.format(ksgl + jcclc+addMileageJc)); | |
| 1433 | + return map; | |
| 1401 | 1434 | } |
| 1402 | 1435 | |
| 1403 | 1436 | |
| ... | ... | @@ -1611,10 +1644,55 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1611 | 1644 | } |
| 1612 | 1645 | return rs; |
| 1613 | 1646 | } |
| 1614 | - | |
| 1615 | 1647 | @Override |
| 1616 | 1648 | public List<Map<String, Object>> statisticsDaily(String line, String date, |
| 1617 | 1649 | String xlName, String type) { |
| 1650 | + List<Map<String, Object>> lMap= new ArrayList<Map<String, Object>>(); | |
| 1651 | + List<ScheduleRealInfo> lists = scheduleRealInfoRepository.scheduleByDateAndLine2(line, date); | |
| 1652 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 1653 | + map.put("xlName", xlName); | |
| 1654 | + map.put("jhlc", culateService.culateJhgl(lists)); | |
| 1655 | + map.put("sjgl", culateService.culateSjgl(lists)); | |
| 1656 | + map.put("ssgl", culateService.culateLbgl(lists)); | |
| 1657 | + map.put("ssgl_lz", culateService.culateCJLC(lists, "路阻")); | |
| 1658 | + map.put("ssgl_dm", culateService.culateCJLC(lists, "吊慢")); | |
| 1659 | + map.put("ssgl_gz", culateService.culateCJLC(lists, "故障")); | |
| 1660 | + map.put("ssgl_jf", culateService.culateCJLC(lists, "纠纷")); | |
| 1661 | + map.put("ssgl_zs", culateService.culateCJLC(lists, "肇事")); | |
| 1662 | + map.put("ssgl_qr", culateService.culateCJLC(lists, "缺人")); | |
| 1663 | + map.put("ssgl_qc", culateService.culateCJLC(lists, "缺车")); | |
| 1664 | + map.put("ssgl_kx", culateService.culateCJLC(lists, "客稀")); | |
| 1665 | + map.put("ssgl_qh", culateService.culateCJLC(lists, "气候")); | |
| 1666 | + map.put("ssgl_yw", culateService.culateCJLC(lists, "援外")); | |
| 1667 | + map.put("ssgl_other", culateService.culateCJLC(lists, "其他")); | |
| 1668 | + map.put("ssbc", culateService.culateLbbc(lists)); | |
| 1669 | + map.put("ljgl", culateService.culateLjgl(lists)); | |
| 1670 | + map.put("jhbc", culateService.culateJhbc(lists,"")); | |
| 1671 | + map.put("jhbc_m", culateService.culateJhbc(lists, "zgf")); | |
| 1672 | + map.put("jhbc_a", culateService.culateJhbc(lists, "wgf")); | |
| 1673 | + map.put("sjbc", culateService.culateSjbc(lists,"")); | |
| 1674 | + map.put("sjbc_m", culateService.culateSjbc(lists,"zgf")); | |
| 1675 | + map.put("sjbc_a", culateService.culateSjbc(lists,"wgf")); | |
| 1676 | + map.put("ljbc", culateService.culateLjbc(lists,"")); | |
| 1677 | + map.put("ljbc_m", culateService.culateLjbc(lists,"zgf")); | |
| 1678 | + map.put("ljbc_a", culateService.culateLjbc(lists,"wgf")); | |
| 1679 | + map.put("fzbc", culateService.culateFzbc(lists, "")); | |
| 1680 | + map.put("fzbc_m", culateService.culateFzbc(lists, "zgf")); | |
| 1681 | + map.put("fzbc_a", culateService.culateFzbc(lists, "wgf")); | |
| 1682 | + map.put("dtbc", 0); | |
| 1683 | + map.put("dtbc_m", 0); | |
| 1684 | + map.put("dtbc_a", 0); | |
| 1685 | + map.put("djg", 0); | |
| 1686 | + map.put("djg_m", 0); | |
| 1687 | + map.put("djg_a", 0); | |
| 1688 | + map.put("djg_time", 0); | |
| 1689 | + lMap.add(map); | |
| 1690 | + return lMap; | |
| 1691 | + } | |
| 1692 | + | |
| 1693 | + /* @Override | |
| 1694 | + public List<Map<String, Object>> statisticsDaily(String line, String date, | |
| 1695 | + String xlName, String type) { | |
| 1618 | 1696 | List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); |
| 1619 | 1697 | if (date.length() == 10) |
| 1620 | 1698 | list = scheduleRealInfoRepository.scheduleByDateAndLine2(line, date); |
| ... | ... | @@ -1748,8 +1826,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1748 | 1826 | while (it.hasNext()) { |
| 1749 | 1827 | ChildTaskPlan childTaskPlan = it.next(); |
| 1750 | 1828 | childMileage = childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage(); |
| 1751 | - jhlc += childMileage; | |
| 1752 | - jhlcZ += childMileage; | |
| 1753 | 1829 | if (childTaskPlan.isDestroy()) { |
| 1754 | 1830 | ssgl += childMileage; |
| 1755 | 1831 | ssglZ += childMileage; |
| ... | ... | @@ -2101,7 +2177,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2101 | 2177 | map.put("djg_a", djg_aZ); |
| 2102 | 2178 | map.put("djg_time", djg_timeZ); |
| 2103 | 2179 | lMap.add(map); |
| 2104 | - /* for (int i = 0; i < lMap.size(); i++) { | |
| 2180 | + for (int i = 0; i < lMap.size(); i++) { | |
| 2105 | 2181 | Map<String, Object> m=lMap.get(i); |
| 2106 | 2182 | // m.get("")) |
| 2107 | 2183 | jhlc += Double.parseDouble(m.get("jhlc").toString()); |
| ... | ... | @@ -2138,7 +2214,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2138 | 2214 | m.get("djg_m", djg_m); |
| 2139 | 2215 | m.get("djg_a", djg_a); |
| 2140 | 2216 | m.get("djg_time", djg_time); |
| 2141 | - }*/ | |
| 2217 | + } | |
| 2142 | 2218 | |
| 2143 | 2219 | if (type != null && type.length() != 0 && type.equals("export")) { |
| 2144 | 2220 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| ... | ... | @@ -2158,7 +2234,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2158 | 2234 | } |
| 2159 | 2235 | |
| 2160 | 2236 | return lMap; |
| 2161 | - } | |
| 2237 | + }*/ | |
| 2162 | 2238 | |
| 2163 | 2239 | @Override |
| 2164 | 2240 | public List<Map<String, Object>> statisticsDailyTj(String line, String date,String date2, | ... | ... |
src/main/java/com/bsth/service/report/CulateMileageService.java
0 → 100644
| 1 | +package com.bsth.service.report; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | +import java.util.Map; | |
| 5 | + | |
| 6 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 7 | + | |
| 8 | +public interface CulateMileageService { | |
| 9 | + | |
| 10 | + List<Map<String,Object>> jobFwqk(List<ScheduleRealInfo> lists); | |
| 11 | + double culateLbgl(List<ScheduleRealInfo> lists); | |
| 12 | + int culateLbbc(List<ScheduleRealInfo> lists); | |
| 13 | + | |
| 14 | + List<Map<String,Object>> jobLjqk(List<ScheduleRealInfo> lists); | |
| 15 | + double culateLjgl(List<ScheduleRealInfo> lists); | |
| 16 | + int culateLjbc(List<ScheduleRealInfo> lists,String item); | |
| 17 | + | |
| 18 | + double culateJhgl(List<ScheduleRealInfo> lists); | |
| 19 | + int culateJhbc(List<ScheduleRealInfo> lists,String item); | |
| 20 | + | |
| 21 | + double culateSjgl(List<ScheduleRealInfo> lists); | |
| 22 | + int culateSjbc(List<ScheduleRealInfo> lists,String item); | |
| 23 | + | |
| 24 | + double culateKsgl(List<ScheduleRealInfo> lists); | |
| 25 | + double culateJccgl(List<ScheduleRealInfo> lists); | |
| 26 | + | |
| 27 | + double culateCJLC(List<ScheduleRealInfo> lists,String item); | |
| 28 | + | |
| 29 | + int culateFzbc(List<ScheduleRealInfo> lists,String item); | |
| 30 | +} | |
| 31 | + | ... | ... |
src/main/java/com/bsth/service/report/ReportService.java
| ... | ... | @@ -29,5 +29,9 @@ public interface ReportService { |
| 29 | 29 | List<Map<String, Object>> tbodyTime5(String line ,String ttinfo); |
| 30 | 30 | |
| 31 | 31 | List<Map<String, Object>> getTtinfo(Map<String, Object> map); |
| 32 | - | |
| 32 | + | |
| 33 | + List<Map<String,Object>> jobFwqk(Map<String, Object> map); | |
| 34 | + List<Map<String,Object>> jobLjqk(Map<String, Object> map); | |
| 35 | + | |
| 36 | + Map<String, Object> jobHzxx(Map<String, Object> map); | |
| 33 | 37 | } | ... | ... |
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.report.impl; | |
| 2 | + | |
| 3 | +import java.util.ArrayList; | |
| 4 | +import java.util.HashMap; | |
| 5 | +import java.util.Iterator; | |
| 6 | +import java.util.List; | |
| 7 | +import java.util.Map; | |
| 8 | +import java.util.Set; | |
| 9 | + | |
| 10 | +import org.apache.commons.lang.StringUtils; | |
| 11 | +import org.springframework.stereotype.Service; | |
| 12 | + | |
| 13 | +import com.bsth.entity.realcontrol.ChildTaskPlan; | |
| 14 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 15 | +import com.bsth.service.report.CulateMileageService; | |
| 16 | +import com.bsth.util.Arith; | |
| 17 | + | |
| 18 | +@Service | |
| 19 | +public class CulateMileageServiceImpl implements CulateMileageService{ | |
| 20 | + | |
| 21 | + private static long zgf1 = 6 * 60 + 31, | |
| 22 | + zgf2 = 8 * 60 + 30, | |
| 23 | + wgf1 = 16 * 60 + 1, | |
| 24 | + wgf2 = 18 * 60; | |
| 25 | + @Override | |
| 26 | + public List<Map<String, Object>> jobFwqk(List<ScheduleRealInfo> lists) { | |
| 27 | + // TODO Auto-generated method stub | |
| 28 | + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); | |
| 29 | + for (int i = 0; i < lists.size(); i++) { | |
| 30 | + ScheduleRealInfo scheduleRealInfo = lists.get(i); | |
| 31 | + if (!(scheduleRealInfo.getBcType().equals("in") | |
| 32 | + || scheduleRealInfo.getBcType().equals("out"))) { | |
| 33 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 34 | + if (childTaskPlans.isEmpty()) { | |
| 35 | + Map<String, Object> newMap = new HashMap<String, Object>(); | |
| 36 | + String adjustExps = ""; | |
| 37 | + if (scheduleRealInfo.getAdjustExps() == "" || scheduleRealInfo.getAdjustExps() == null) { | |
| 38 | + adjustExps = "其他"; | |
| 39 | + } else { | |
| 40 | + adjustExps = scheduleRealInfo.getAdjustExps(); | |
| 41 | + } | |
| 42 | + if (scheduleRealInfo.getStatus() == -1) { | |
| 43 | + newMap.put("nr", adjustExps); | |
| 44 | + newMap.put("lp", scheduleRealInfo.getLpName()); | |
| 45 | + newMap.put("nbbm", scheduleRealInfo.getClZbh()); | |
| 46 | + newMap.put("jgh", scheduleRealInfo.getjGh()); | |
| 47 | + newMap.put("dz", scheduleRealInfo.getQdzName()); | |
| 48 | + newMap.put("sj", scheduleRealInfo.getFcsj()); | |
| 49 | + newMap.put("lbbc", 1); | |
| 50 | + newMap.put("lblc", scheduleRealInfo.getJhlcOrig()); | |
| 51 | + newMap.put("jyqp", scheduleRealInfo.getRealMileage()); | |
| 52 | + list.add(newMap); | |
| 53 | + } | |
| 54 | + | |
| 55 | + } else { | |
| 56 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 57 | + while (it.hasNext()) { | |
| 58 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 59 | + if (childTaskPlan.isDestroy()) { | |
| 60 | + String destroyReason = ""; | |
| 61 | + if (childTaskPlan.getDestroyReason() == "" || childTaskPlan.getDestroyReason() == null) { | |
| 62 | + destroyReason = "其他"; | |
| 63 | + } else { | |
| 64 | + destroyReason = childTaskPlan.getDestroyReason(); | |
| 65 | + } | |
| 66 | + Map<String, Object> newMap = new HashMap<String, Object>(); | |
| 67 | + newMap.put("nr", destroyReason); | |
| 68 | + newMap.put("lp", scheduleRealInfo.getLpName()); | |
| 69 | + newMap.put("nbbm", scheduleRealInfo.getClZbh()); | |
| 70 | + newMap.put("jgh", scheduleRealInfo.getjGh()); | |
| 71 | + newMap.put("dz", childTaskPlan.getStartStationName()); | |
| 72 | + newMap.put("sj", childTaskPlan.getStartDate()); | |
| 73 | + newMap.put("lbbc", 0); | |
| 74 | + newMap.put("lblc", childTaskPlan.getMileage()); | |
| 75 | + newMap.put("jyqp", scheduleRealInfo.getRealMileage()); | |
| 76 | + list.add(newMap); | |
| 77 | + | |
| 78 | + } | |
| 79 | + } | |
| 80 | + } | |
| 81 | + } | |
| 82 | + } | |
| 83 | + return list; | |
| 84 | + } | |
| 85 | + | |
| 86 | + @Override | |
| 87 | + public double culateLbgl(List<ScheduleRealInfo> lists) { | |
| 88 | + // TODO Auto-generated method stub | |
| 89 | + double zlblc =0.0; | |
| 90 | + for (int i = 0; i < lists.size(); i++) { | |
| 91 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | |
| 92 | + if (!isInOut(scheduleRealInfo)) { | |
| 93 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 94 | + if(childTaskPlans.isEmpty()){ | |
| 95 | + if(scheduleRealInfo.getStatus() == -1){ | |
| 96 | + zlblc=Arith.add(zlblc,scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); | |
| 97 | + }else{ | |
| 98 | + double jhlc=scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | |
| 99 | + double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig(); | |
| 100 | + double cjlc=Arith.sub(jhlcOrig,jhlc); | |
| 101 | + if(cjlc>0){ | |
| 102 | + zlblc=Arith.add(zlblc, cjlc); | |
| 103 | + } | |
| 104 | + } | |
| 105 | + }else{ | |
| 106 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 107 | + while (it.hasNext()) { | |
| 108 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 109 | + if (childTaskPlan.isDestroy()) { | |
| 110 | + zlblc=Arith.add(zlblc,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage()); | |
| 111 | + } | |
| 112 | + } | |
| 113 | + } | |
| 114 | + } | |
| 115 | + } | |
| 116 | + return zlblc; | |
| 117 | + } | |
| 118 | + | |
| 119 | + @Override | |
| 120 | + public int culateLbbc(List<ScheduleRealInfo> lists) { | |
| 121 | + // TODO Auto-generated method stub | |
| 122 | + int lbbc=0; | |
| 123 | + for (int i = 0; i < lists.size(); i++) { | |
| 124 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | |
| 125 | + if (!(scheduleRealInfo.getBcType().equals("in") | |
| 126 | + || scheduleRealInfo.getBcType().equals("out"))) { | |
| 127 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 128 | + if(childTaskPlans.isEmpty()){ | |
| 129 | + if(scheduleRealInfo.getStatus() == -1){ | |
| 130 | + lbbc++; | |
| 131 | + } | |
| 132 | + }else{ | |
| 133 | + if(scheduleRealInfo.getStatus() == -1){ | |
| 134 | + boolean fage=true; | |
| 135 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 136 | + if(it.hasNext()){ | |
| 137 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 138 | + if(!childTaskPlan.isDestroy()){ | |
| 139 | + if(childTaskPlan.getMileageType().equals("service")){ | |
| 140 | + fage=false; | |
| 141 | + } | |
| 142 | + } | |
| 143 | + | |
| 144 | + } | |
| 145 | + if(fage){ | |
| 146 | + lbbc++; | |
| 147 | + } | |
| 148 | + } | |
| 149 | + } | |
| 150 | + } | |
| 151 | + } | |
| 152 | + return lbbc; | |
| 153 | + } | |
| 154 | + | |
| 155 | + @Override | |
| 156 | + public List<Map<String, Object>> jobLjqk(List<ScheduleRealInfo> lists) { | |
| 157 | + // TODO Auto-generated method stub | |
| 158 | + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); | |
| 159 | + for (int i = 0; i < lists.size(); i++) { | |
| 160 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | |
| 161 | + if (!(scheduleRealInfo.getBcType().equals("in") | |
| 162 | + || scheduleRealInfo.getBcType().equals("out"))) { | |
| 163 | +// Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 164 | +// if(childTaskPlans.isEmpty()){ | |
| 165 | + if(scheduleRealInfo.isSflj()){ | |
| 166 | + Map<String, Object> newMap=new HashMap<String,Object>(); | |
| 167 | + newMap.put("lp", scheduleRealInfo.getLpName()); | |
| 168 | + newMap.put("nbbm", scheduleRealInfo.getClZbh()); | |
| 169 | + newMap.put("jgh", scheduleRealInfo.getjGh()); | |
| 170 | + newMap.put("dz", scheduleRealInfo.getQdzName()); | |
| 171 | + newMap.put("sj", scheduleRealInfo.getFcsj()); | |
| 172 | + newMap.put("ljlc", scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc()); | |
| 173 | + newMap.put("jyqp", scheduleRealInfo.getRealMileage()); | |
| 174 | + list.add(newMap); | |
| 175 | + } | |
| 176 | +// }else{ | |
| 177 | +// Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 178 | +// while (it.hasNext()) { | |
| 179 | +// ChildTaskPlan childTaskPlan = it.next(); | |
| 180 | +// if (childTaskPlan.isDestroy()) { | |
| 181 | +// } | |
| 182 | +// } | |
| 183 | +// } | |
| 184 | + } | |
| 185 | + } | |
| 186 | + return list; | |
| 187 | + } | |
| 188 | + | |
| 189 | + @Override | |
| 190 | + public double culateLjgl(List<ScheduleRealInfo> lists) { | |
| 191 | + // TODO Auto-generated method stub | |
| 192 | + double ljgl=0; | |
| 193 | + for (int i = 0; i < lists.size(); i++) { | |
| 194 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | |
| 195 | + if (!(scheduleRealInfo.getBcType().equals("in") | |
| 196 | + || scheduleRealInfo.getBcType().equals("out"))) { | |
| 197 | + if(!scheduleRealInfo.isDestroy()){ | |
| 198 | + if(scheduleRealInfo.isSflj()){ | |
| 199 | + ljgl=Arith.add(ljgl,scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc()); | |
| 200 | + }else{ | |
| 201 | + double jhlc=scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | |
| 202 | + double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig(); | |
| 203 | + double zjlc=Arith.sub(jhlc, jhlcOrig); | |
| 204 | + if(zjlc>0){ | |
| 205 | + ljgl=Arith.add(zjlc, ljgl); | |
| 206 | + } | |
| 207 | + } | |
| 208 | + } | |
| 209 | + | |
| 210 | + } | |
| 211 | + } | |
| 212 | + return ljgl; | |
| 213 | + } | |
| 214 | + | |
| 215 | + @Override | |
| 216 | + public int culateLjbc(List<ScheduleRealInfo> lists,String item) { | |
| 217 | + // TODO Auto-generated method stub | |
| 218 | + int ljbc=0; | |
| 219 | + for (int i = 0; i < lists.size(); i++) { | |
| 220 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | |
| 221 | + if (!(scheduleRealInfo.getBcType().equals("in") | |
| 222 | + || scheduleRealInfo.getBcType().equals("out"))) { | |
| 223 | + if(scheduleRealInfo.isSflj()){ | |
| 224 | + String[] fcsjStr = scheduleRealInfo.getFcsj().split(":"); | |
| 225 | + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | |
| 226 | + if(item.equals("zgf")){ | |
| 227 | + if(fcsj>=zgf1 && fcsj<=zgf2){ | |
| 228 | + ljbc++; | |
| 229 | + } | |
| 230 | + }else if(item.equals("wgf")){ | |
| 231 | + if(fcsj>=wgf1 && fcsj<=wgf2){ | |
| 232 | + ljbc++; | |
| 233 | + } | |
| 234 | + }else{ | |
| 235 | + ljbc++; | |
| 236 | + } | |
| 237 | + } | |
| 238 | + } | |
| 239 | + } | |
| 240 | + return ljbc; | |
| 241 | + } | |
| 242 | + | |
| 243 | + @Override | |
| 244 | + public double culateJhgl(List<ScheduleRealInfo> lists) { | |
| 245 | + // TODO Auto-generated method stub | |
| 246 | + double jhgl=0; | |
| 247 | + for (int i = 0; i < lists.size(); i++) { | |
| 248 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | |
| 249 | + if (!(scheduleRealInfo.getBcType().equals("in") | |
| 250 | + || scheduleRealInfo.getBcType().equals("out"))) { | |
| 251 | + if(!scheduleRealInfo.isSflj()){ | |
| 252 | + jhgl=Arith.add(jhgl,scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); | |
| 253 | + } | |
| 254 | + } | |
| 255 | + } | |
| 256 | + return jhgl; | |
| 257 | + } | |
| 258 | + | |
| 259 | + @Override | |
| 260 | + public int culateJhbc(List<ScheduleRealInfo> lists,String item) { | |
| 261 | + // TODO Auto-generated method stub | |
| 262 | + int jhbc=0; | |
| 263 | + for (int i = 0; i < lists.size(); i++) { | |
| 264 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | |
| 265 | + if (!(scheduleRealInfo.getBcType().equals("in") | |
| 266 | + || scheduleRealInfo.getBcType().equals("out"))) { | |
| 267 | + if(!scheduleRealInfo.isSflj()){ | |
| 268 | + String[] fcsjStr = scheduleRealInfo.getFcsj().split(":"); | |
| 269 | + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | |
| 270 | + if(item.equals("zgf")){ | |
| 271 | + if(fcsj>=zgf1 && fcsj<=zgf2){ | |
| 272 | + jhbc++; | |
| 273 | + } | |
| 274 | + }else if(item.equals("wgf")){ | |
| 275 | + if(fcsj>=wgf1 && fcsj<=wgf2){ | |
| 276 | + jhbc++; | |
| 277 | + } | |
| 278 | + }else{ | |
| 279 | + jhbc++; | |
| 280 | + } | |
| 281 | + | |
| 282 | + } | |
| 283 | + } | |
| 284 | + } | |
| 285 | + return jhbc; | |
| 286 | + } | |
| 287 | + | |
| 288 | + @Override | |
| 289 | + public double culateSjgl(List<ScheduleRealInfo> lists) { | |
| 290 | + // TODO Auto-generated method stub | |
| 291 | + double sjgl =0; | |
| 292 | + for (int i = 0; i < lists.size(); i++) { | |
| 293 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | |
| 294 | + if (!isInOut(scheduleRealInfo)) { | |
| 295 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 296 | + if(!scheduleRealInfo.isSflj()){ | |
| 297 | + if(childTaskPlans.isEmpty()){ | |
| 298 | + if(scheduleRealInfo.getStatus() != -1){ | |
| 299 | + double jggl=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig(); | |
| 300 | + sjgl=Arith.add(sjgl,jggl); | |
| 301 | + } | |
| 302 | + }else{ | |
| 303 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 304 | + while (it.hasNext()) { | |
| 305 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 306 | + if(childTaskPlan.getMileageType().equals("service")){ | |
| 307 | + if (!childTaskPlan.isDestroy()) { | |
| 308 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 309 | + sjgl=Arith.add(sjgl,jhgl); | |
| 310 | + } | |
| 311 | + } | |
| 312 | + } | |
| 313 | + } | |
| 314 | + } | |
| 315 | + } | |
| 316 | + } | |
| 317 | + return sjgl; | |
| 318 | + } | |
| 319 | + | |
| 320 | + @Override | |
| 321 | + public int culateSjbc(List<ScheduleRealInfo> lists,String item) { | |
| 322 | + // TODO Auto-generated method stub | |
| 323 | + int sjbc=0; | |
| 324 | + for (int i = 0; i < lists.size(); i++) { | |
| 325 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | |
| 326 | + if (!(scheduleRealInfo.getBcType().equals("in") | |
| 327 | + || scheduleRealInfo.getBcType().equals("out"))) { | |
| 328 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 329 | + if(!scheduleRealInfo.isSflj()){ | |
| 330 | + String[] fcsjStr = scheduleRealInfo.getFcsj().split(":"); | |
| 331 | + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | |
| 332 | + if(childTaskPlans.isEmpty()){ | |
| 333 | + if(scheduleRealInfo.getStatus()!=-1){ | |
| 334 | + if(item.equals("zgf")){ | |
| 335 | + if(fcsj>=zgf1 && fcsj<=zgf2){ | |
| 336 | + sjbc++; | |
| 337 | + } | |
| 338 | + }else if(item.equals("wgf")){ | |
| 339 | + if(fcsj>=wgf1 && fcsj<=wgf2){ | |
| 340 | + sjbc++; | |
| 341 | + } | |
| 342 | + }else{ | |
| 343 | + sjbc++; | |
| 344 | + } | |
| 345 | + | |
| 346 | + } | |
| 347 | + }else{ | |
| 348 | + if(scheduleRealInfo.getStatus() == -1){ | |
| 349 | + boolean fage=false; | |
| 350 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 351 | + if(it.hasNext()){ | |
| 352 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 353 | + if(!childTaskPlan.isDestroy()){ | |
| 354 | + if(childTaskPlan.getMileageType().equals("service")){ | |
| 355 | + fage=true; | |
| 356 | + } | |
| 357 | + } | |
| 358 | + | |
| 359 | + } | |
| 360 | + if(fage){ | |
| 361 | + if(item.equals("zgf")){ | |
| 362 | + if(fcsj>=zgf1 && fcsj<=zgf2){ | |
| 363 | + sjbc++; | |
| 364 | + } | |
| 365 | + }else if(item.equals("wgf")){ | |
| 366 | + if(fcsj>=wgf1 && fcsj<=wgf2){ | |
| 367 | + sjbc++; | |
| 368 | + } | |
| 369 | + }else{ | |
| 370 | + sjbc++; | |
| 371 | + } | |
| 372 | + } | |
| 373 | + | |
| 374 | + }else{ | |
| 375 | + if(item.equals("zgf")){ | |
| 376 | + if(fcsj>=zgf1 && fcsj<=zgf2){ | |
| 377 | + sjbc++; | |
| 378 | + } | |
| 379 | + }else if(item.equals("wgf")){ | |
| 380 | + if(fcsj>=wgf1 && fcsj<=wgf2){ | |
| 381 | + sjbc++; | |
| 382 | + } | |
| 383 | + }else{ | |
| 384 | + sjbc++; | |
| 385 | + } | |
| 386 | + } | |
| 387 | + } | |
| 388 | + } | |
| 389 | + } | |
| 390 | + } | |
| 391 | + return sjbc; | |
| 392 | + } | |
| 393 | + | |
| 394 | + @Override | |
| 395 | + public double culateKsgl(List<ScheduleRealInfo> lists) { | |
| 396 | + // TODO Auto-generated method stub | |
| 397 | + double ksgl =0; | |
| 398 | + for (int i = 0; i < lists.size(); i++) { | |
| 399 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | |
| 400 | + if (!(scheduleRealInfo.getBcType().equals("in") | |
| 401 | + || scheduleRealInfo.getBcType().equals("out"))) { | |
| 402 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 403 | + if(!childTaskPlans.isEmpty()){ | |
| 404 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 405 | + while (it.hasNext()) { | |
| 406 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 407 | + if(childTaskPlan.getMileageType().equals("empty")){ | |
| 408 | + if (!childTaskPlan.isDestroy()) { | |
| 409 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 410 | + ksgl=Arith.add(ksgl,jhgl); | |
| 411 | + } | |
| 412 | + } | |
| 413 | + } | |
| 414 | + } | |
| 415 | + } | |
| 416 | + } | |
| 417 | + return ksgl; | |
| 418 | + } | |
| 419 | + | |
| 420 | + @Override | |
| 421 | + public double culateJccgl(List<ScheduleRealInfo> lists) { | |
| 422 | + // TODO Auto-generated method stub | |
| 423 | + double jcclc =0; | |
| 424 | + for (int i = 0; i < lists.size(); i++) { | |
| 425 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | |
| 426 | + if (scheduleRealInfo.getBcType().equals("in") | |
| 427 | + || scheduleRealInfo.getBcType().equals("out")) { | |
| 428 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 429 | + if(childTaskPlans.isEmpty()){ | |
| 430 | + if(!scheduleRealInfo.isDestroy()) | |
| 431 | + jcclc =Arith.add(jcclc, scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); | |
| 432 | + }else{ | |
| 433 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 434 | + while (it.hasNext()) { | |
| 435 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 436 | + if(childTaskPlan.getMileageType().equals("empty")){ | |
| 437 | + if (!childTaskPlan.isDestroy()) { | |
| 438 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 439 | + jcclc=Arith.add(jcclc,jhgl); | |
| 440 | + } | |
| 441 | + } | |
| 442 | + } | |
| 443 | + } | |
| 444 | + } | |
| 445 | + } | |
| 446 | + return jcclc; | |
| 447 | + } | |
| 448 | + | |
| 449 | + public static boolean isInOut(ScheduleRealInfo s){ | |
| 450 | + boolean fage=false; | |
| 451 | + if(s.getBcType().equals("in")){ | |
| 452 | + fage=true; | |
| 453 | + } | |
| 454 | + if(s.getBcType().equals("out")){ | |
| 455 | + fage=true; | |
| 456 | + } | |
| 457 | + | |
| 458 | + return fage; | |
| 459 | + } | |
| 460 | + | |
| 461 | + @Override | |
| 462 | + public double culateCJLC(List<ScheduleRealInfo> list, String item) { | |
| 463 | + // TODO Auto-generated method stub | |
| 464 | + double sum = 0; | |
| 465 | + Set<ChildTaskPlan> cts; | |
| 466 | + for(ScheduleRealInfo sch : list){ | |
| 467 | + if (sch.isSflj()) | |
| 468 | + continue; | |
| 469 | + cts = sch.getcTasks(); | |
| 470 | + //有子任务 | |
| 471 | + if (cts != null && cts.size() > 0) { | |
| 472 | + for(ChildTaskPlan c : cts){ | |
| 473 | + if(c.isDestroy() && c.getDestroyReason().equals(item)) | |
| 474 | + sum = Arith.add(sum, c.getMileage()); | |
| 475 | + } | |
| 476 | + } | |
| 477 | + else if(isInOut(sch)) | |
| 478 | + continue; | |
| 479 | + //主任务烂班 | |
| 480 | + else if(sch.getStatus() == -1){ | |
| 481 | + if(sch.getAdjustExps().equals(item) || | |
| 482 | + (StringUtils.isEmpty(sch.getAdjustExps()) && item.equals("其他"))){ | |
| 483 | + sum = Arith.add(sum, sch.getJhlcOrig()); | |
| 484 | + } | |
| 485 | + } | |
| 486 | + else if(item.equals("其他")){ | |
| 487 | + double diff = Arith.sub(sch.getJhlcOrig(), sch.getJhlc()); | |
| 488 | + if(diff > 0){ | |
| 489 | + sum = Arith.add(sum, diff); | |
| 490 | + } | |
| 491 | + } | |
| 492 | + } | |
| 493 | + return sum; | |
| 494 | + | |
| 495 | + } | |
| 496 | + | |
| 497 | + @Override | |
| 498 | + public int culateFzbc(List<ScheduleRealInfo> lists, String item) { | |
| 499 | + // TODO Auto-generated method stub | |
| 500 | + int fzbc=0; | |
| 501 | + for (int i = 0; i < lists.size(); i++) { | |
| 502 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | |
| 503 | + if (scheduleRealInfo.getBcType().equals("venting")) { | |
| 504 | +// if(!scheduleRealInfo.isSflj()){ | |
| 505 | + String[] fcsjStr = scheduleRealInfo.getFcsj().split(":"); | |
| 506 | + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | |
| 507 | + if(item.equals("zgf")){ | |
| 508 | + if(fcsj>=zgf1 && fcsj<=zgf2){ | |
| 509 | + fzbc++; | |
| 510 | + } | |
| 511 | + }else if(item.equals("wgf")){ | |
| 512 | + if(fcsj>=wgf1 && fcsj<=wgf2){ | |
| 513 | + fzbc++; | |
| 514 | + } | |
| 515 | + }else{ | |
| 516 | + fzbc++; | |
| 517 | + } | |
| 518 | + | |
| 519 | +// } | |
| 520 | + } | |
| 521 | + } | |
| 522 | + return fzbc; | |
| 523 | + } | |
| 524 | + | |
| 525 | +} | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -10,9 +10,12 @@ import java.util.ArrayList; |
| 10 | 10 | import java.util.Calendar; |
| 11 | 11 | import java.util.Date; |
| 12 | 12 | import java.util.HashMap; |
| 13 | +import java.util.Iterator; | |
| 13 | 14 | import java.util.List; |
| 14 | 15 | import java.util.Map; |
| 16 | +import java.util.Set; | |
| 15 | 17 | |
| 18 | +import org.apache.commons.lang.StringUtils; | |
| 16 | 19 | import org.slf4j.Logger; |
| 17 | 20 | import org.slf4j.LoggerFactory; |
| 18 | 21 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -24,11 +27,14 @@ import com.bsth.data.BasicData; |
| 24 | 27 | import com.bsth.entity.StationRoute; |
| 25 | 28 | import com.bsth.entity.excep.ArrivalInfo; |
| 26 | 29 | import com.bsth.entity.oil.Ylb; |
| 30 | +import com.bsth.entity.realcontrol.ChildTaskPlan; | |
| 27 | 31 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 28 | 32 | import com.bsth.entity.schedule.SchedulePlanInfo; |
| 29 | 33 | import com.bsth.repository.StationRouteRepository; |
| 30 | 34 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 35 | +import com.bsth.service.report.CulateMileageService; | |
| 31 | 36 | import com.bsth.service.report.ReportService; |
| 37 | +import com.bsth.util.Arith; | |
| 32 | 38 | import com.bsth.util.db.DBUtils_MS; |
| 33 | 39 | |
| 34 | 40 | @Service |
| ... | ... | @@ -44,6 +50,8 @@ public class ReportServiceImpl implements ReportService{ |
| 44 | 50 | ScheduleRealInfoRepository scheduleRealInfoRepository; |
| 45 | 51 | @Autowired |
| 46 | 52 | StationRouteRepository stationRoutRepository; |
| 53 | + @Autowired | |
| 54 | + CulateMileageService culateService; | |
| 47 | 55 | @Override |
| 48 | 56 | public List<ScheduleRealInfo> queryListBczx(String line, String date,String clzbh) { |
| 49 | 57 | // TODO Auto-generated method stub |
| ... | ... | @@ -1059,4 +1067,242 @@ public class ReportServiceImpl implements ReportService{ |
| 1059 | 1067 | return list; |
| 1060 | 1068 | } |
| 1061 | 1069 | |
| 1070 | + private List<ScheduleRealInfo> getListSinfo(Map<String, Object> map){ | |
| 1071 | + List<ScheduleRealInfo> list =new ArrayList<ScheduleRealInfo>(); | |
| 1072 | + | |
| 1073 | + String sql="select DISTINCT a.* from (select * from bsth_c_s_sp_info_real where 1=1 "; | |
| 1074 | + if(map.get("date")!=null){ | |
| 1075 | + sql += " and schedule_date_str='"+map.get("date").toString()+"'"; | |
| 1076 | + } | |
| 1077 | + if(map.get("line")!=null){ | |
| 1078 | + if(map.get("line").toString()!=""){ | |
| 1079 | + sql += " and xl_bm='"+map.get("line").toString()+"'"; | |
| 1080 | + } | |
| 1081 | + | |
| 1082 | + } | |
| 1083 | + if(map.get("bcType")!=null){ | |
| 1084 | + if(map.get("bcType").toString().equals("inout")){ | |
| 1085 | + sql += " and bc_type in ('in','out')"; | |
| 1086 | + } | |
| 1087 | + | |
| 1088 | + if(map.get("bcType").toString().equals("normal")){ | |
| 1089 | + sql += " and bc_type not in ('in','out')"; | |
| 1090 | + } | |
| 1091 | + } | |
| 1092 | + | |
| 1093 | + sql += " )a left join bsth_c_s_child_task b on a.id=b.schedule"; | |
| 1094 | + list= jdbcTemplate.query(sql, | |
| 1095 | + new RowMapper<ScheduleRealInfo>(){ | |
| 1096 | + @Override | |
| 1097 | + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 1098 | + ScheduleRealInfo m=new ScheduleRealInfo(); | |
| 1099 | + m.setId(rs.getLong("id")); | |
| 1100 | +// m.setBcs(); | |
| 1101 | +// m.setBcsj(); | |
| 1102 | + m.setClZbh(rs.getString("cl_zbh")); | |
| 1103 | + m.setFcsj(rs.getString("fcsj")); | |
| 1104 | + m.setFcsjActual(rs.getString("fcsj_actual")); | |
| 1105 | + m.setjGh(rs.getString("j_gh")); | |
| 1106 | + m.setjName(rs.getString("j_name")); | |
| 1107 | + m.setJhlc(rs.getDouble("jhlc")); | |
| 1108 | + m.setLpName(rs.getString("lp_name")); | |
| 1109 | + m.setQdzCode(rs.getString("qdz_code")); | |
| 1110 | + m.setQdzName(rs.getString("qdz_name")); | |
| 1111 | + m.setRealExecDate(rs.getString("real_exec_date")); | |
| 1112 | + m.setRealMileage(rs.getDouble("real_mileage")); | |
| 1113 | + m.setRemarks(rs.getString("remarks")); | |
| 1114 | + m.setsGh(rs.getString("s_gh")); | |
| 1115 | + m.setsName(rs.getString("s_name")); | |
| 1116 | + m.setScheduleDate(rs.getDate("schedule_date")); | |
| 1117 | + m.setScheduleDateStr(rs.getString("schedule_date_str")); | |
| 1118 | + m.setSflj(rs.getBoolean("sflj")); | |
| 1119 | + m.setSpId(rs.getLong("sp_id")); | |
| 1120 | + m.setStatus(rs.getInt("status")); | |
| 1121 | + m.setXlBm(rs.getString("xl_bm")); | |
| 1122 | + m.setXlDir(rs.getString("xl_dir")); | |
| 1123 | + m.setXlName(rs.getString("xl_name")); | |
| 1124 | + m.setZdsj(rs.getString("zdsj")); | |
| 1125 | + m.setZdsjActual(rs.getString("zdsj_actual")); | |
| 1126 | + m.setZdzCode(rs.getString("zdz_code")); | |
| 1127 | + m.setZdzName(rs.getString("zdz_name")); | |
| 1128 | + m.setCcno(rs.getInt("ccno")); | |
| 1129 | + m.setDfAuto(rs.getBoolean("df_auto")); | |
| 1130 | + m.setFgsBm(rs.getString("fgs_bm")); | |
| 1131 | + m.setFgsName(rs.getString("fgs_name")); | |
| 1132 | + m.setGsBm(rs.getString("gs_bm")); | |
| 1133 | + m.setGsName(rs.getString("gs_name")); | |
| 1134 | + m.setOnline(rs.getBoolean("online")); | |
| 1135 | + m.setAdjustExps(rs.getString("adjust_exps")); | |
| 1136 | + m.setReissue(rs.getBoolean("reissue")); | |
| 1137 | + m.setJhlcOrig(rs.getDouble("jhlc_orig")); | |
| 1138 | + return m; | |
| 1139 | + } | |
| 1140 | + }); | |
| 1141 | + | |
| 1142 | + return list; | |
| 1143 | + } | |
| 1144 | + | |
| 1145 | + @Override | |
| 1146 | + public List<Map<String, Object>> jobFwqk(Map<String, Object> map) { | |
| 1147 | + // TODO Auto-generated method stub | |
| 1148 | + String line=map.get("line").toString(); | |
| 1149 | + String date=map.get("date").toString(); | |
| 1150 | + map.put("bcType", "normal"); | |
| 1151 | + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); | |
| 1152 | + List<ScheduleRealInfo> sList=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); | |
| 1153 | + for (int i = 0; i < sList.size(); i++) { | |
| 1154 | + ScheduleRealInfo scheduleRealInfo = sList.get(i); | |
| 1155 | + if (!(scheduleRealInfo.getBcType().equals("in") | |
| 1156 | + || scheduleRealInfo.getBcType().equals("out"))) { | |
| 1157 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 1158 | + if (childTaskPlans.isEmpty()) { | |
| 1159 | + Map<String, Object> newMap = new HashMap<String, Object>(); | |
| 1160 | + String adjustExps = ""; | |
| 1161 | + if (scheduleRealInfo.getAdjustExps() == "" || scheduleRealInfo.getAdjustExps() == null) { | |
| 1162 | + adjustExps = "其他"; | |
| 1163 | + } else { | |
| 1164 | + adjustExps = scheduleRealInfo.getAdjustExps(); | |
| 1165 | + } | |
| 1166 | + if (scheduleRealInfo.getStatus() == -1) { | |
| 1167 | + newMap.put("nr", adjustExps); | |
| 1168 | + newMap.put("lp", scheduleRealInfo.getLpName()); | |
| 1169 | + newMap.put("nbbm", scheduleRealInfo.getClZbh()); | |
| 1170 | + newMap.put("jgh", scheduleRealInfo.getjGh()); | |
| 1171 | + newMap.put("dz", scheduleRealInfo.getQdzName()); | |
| 1172 | + newMap.put("sj", scheduleRealInfo.getFcsj()); | |
| 1173 | + newMap.put("lbbc", 1); | |
| 1174 | + newMap.put("lblc", scheduleRealInfo.getJhlcOrig()); | |
| 1175 | + newMap.put("jyqp", scheduleRealInfo.getRealMileage()); | |
| 1176 | + list.add(newMap); | |
| 1177 | + } | |
| 1178 | + | |
| 1179 | + } else { | |
| 1180 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1181 | + while (it.hasNext()) { | |
| 1182 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 1183 | + if (childTaskPlan.isDestroy()) { | |
| 1184 | + String destroyReason = ""; | |
| 1185 | + if (childTaskPlan.getDestroyReason() == "" || childTaskPlan.getDestroyReason() == null) { | |
| 1186 | + destroyReason = "其他"; | |
| 1187 | + } else { | |
| 1188 | + destroyReason = childTaskPlan.getDestroyReason(); | |
| 1189 | + } | |
| 1190 | + Map<String, Object> newMap = new HashMap<String, Object>(); | |
| 1191 | + newMap.put("nr", destroyReason); | |
| 1192 | + newMap.put("lp", scheduleRealInfo.getLpName()); | |
| 1193 | + newMap.put("nbbm", scheduleRealInfo.getClZbh()); | |
| 1194 | + newMap.put("jgh", scheduleRealInfo.getjGh()); | |
| 1195 | + newMap.put("dz", childTaskPlan.getStartStationName()); | |
| 1196 | + newMap.put("sj", childTaskPlan.getStartDate()); | |
| 1197 | + newMap.put("lbbc", 0); | |
| 1198 | + newMap.put("lblc", childTaskPlan.getMileage()); | |
| 1199 | + newMap.put("jyqp", scheduleRealInfo.getRealMileage()); | |
| 1200 | + list.add(newMap); | |
| 1201 | + | |
| 1202 | + } | |
| 1203 | + } | |
| 1204 | + } | |
| 1205 | + } | |
| 1206 | + } | |
| 1207 | + return list; | |
| 1208 | + } | |
| 1209 | + | |
| 1210 | + //统计临加班次详细信息 | |
| 1211 | + @Override | |
| 1212 | + public List<Map<String, Object>> jobLjqk(Map<String, Object> map) { | |
| 1213 | + // TODO Auto-generated method stub | |
| 1214 | + String line=map.get("line").toString(); | |
| 1215 | + String date=map.get("date").toString(); | |
| 1216 | + map.put("bcType", "normal"); | |
| 1217 | + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); | |
| 1218 | + List<ScheduleRealInfo> sList=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); | |
| 1219 | + for (int i = 0; i < sList.size(); i++) { | |
| 1220 | + ScheduleRealInfo scheduleRealInfo=sList.get(i); | |
| 1221 | + if (!(scheduleRealInfo.getBcType().equals("in") | |
| 1222 | + || scheduleRealInfo.getBcType().equals("out"))) { | |
| 1223 | +// Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 1224 | +// if(childTaskPlans.isEmpty()){ | |
| 1225 | + if(scheduleRealInfo.isSflj()){ | |
| 1226 | + Map<String, Object> newMap=new HashMap<String,Object>(); | |
| 1227 | + newMap.put("lp", scheduleRealInfo.getLpName()); | |
| 1228 | + newMap.put("nbbm", scheduleRealInfo.getClZbh()); | |
| 1229 | + newMap.put("jgh", scheduleRealInfo.getjGh()); | |
| 1230 | + newMap.put("dz", scheduleRealInfo.getQdzName()); | |
| 1231 | + newMap.put("sj", scheduleRealInfo.getFcsj()); | |
| 1232 | + newMap.put("ljlc", scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc()); | |
| 1233 | + newMap.put("jyqp", scheduleRealInfo.getRealMileage()); | |
| 1234 | + list.add(newMap); | |
| 1235 | + } | |
| 1236 | +// }else{ | |
| 1237 | +// Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1238 | +// while (it.hasNext()) { | |
| 1239 | +// ChildTaskPlan childTaskPlan = it.next(); | |
| 1240 | +// if (childTaskPlan.isDestroy()) { | |
| 1241 | +// } | |
| 1242 | +// } | |
| 1243 | +// } | |
| 1244 | + } | |
| 1245 | + } | |
| 1246 | + return list; | |
| 1247 | + } | |
| 1248 | + | |
| 1249 | + public static double culateCJLC2(List<ScheduleRealInfo> list, String item) { | |
| 1250 | + // TODO Auto-generated method stub | |
| 1251 | + double sum = 0; | |
| 1252 | + Set<ChildTaskPlan> cts; | |
| 1253 | + for(ScheduleRealInfo sch : list){ | |
| 1254 | + if (sch.isSflj()) | |
| 1255 | + continue; | |
| 1256 | + cts = sch.getcTasks(); | |
| 1257 | + //有子任务 | |
| 1258 | + if (cts != null && cts.size() > 0) { | |
| 1259 | + for(ChildTaskPlan c : cts){ | |
| 1260 | + if(c.isDestroy() && c.getDestroyReason().equals(item)) | |
| 1261 | + sum = Arith.add(sum, c.getMileage()); | |
| 1262 | + } | |
| 1263 | + } | |
| 1264 | +// else if(isInOut(sch)) | |
| 1265 | +// continue; | |
| 1266 | + //主任务烂班 | |
| 1267 | + else if(sch.getStatus() == -1){ | |
| 1268 | + if(sch.getAdjustExps().equals(item) || | |
| 1269 | + (StringUtils.isEmpty(sch.getAdjustExps()) && item.equals("其他"))){ | |
| 1270 | + sum = Arith.add(sum, sch.getJhlcOrig()); | |
| 1271 | + } | |
| 1272 | + } | |
| 1273 | + else if(item.equals("其他")){ | |
| 1274 | + double diff = Arith.sub(sch.getJhlcOrig(), sch.getJhlc()); | |
| 1275 | + if(diff > 0){ | |
| 1276 | + sum = Arith.add(sum, diff); | |
| 1277 | + } | |
| 1278 | + } | |
| 1279 | + } | |
| 1280 | + return sum; | |
| 1281 | + | |
| 1282 | + } | |
| 1283 | + @Override | |
| 1284 | + public Map<String, Object> jobHzxx(Map<String, Object> map) { | |
| 1285 | + // TODO Auto-generated method stub | |
| 1286 | + String line=""; | |
| 1287 | + if(map.get("line")!=null){ | |
| 1288 | + line=map.get("line").toString(); | |
| 1289 | + } | |
| 1290 | + String date=""; | |
| 1291 | + if(map.get("date")!=null){ | |
| 1292 | + date=map.get("date").toString(); | |
| 1293 | + } | |
| 1294 | + | |
| 1295 | + List<ScheduleRealInfo> sList=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); | |
| 1296 | + Map<String, Object> newMap=new HashMap<String,Object>(); | |
| 1297 | + newMap.put("jhbc", culateService.culateJhbc(sList,"")); | |
| 1298 | + newMap.put("jhgl", culateService.culateJhgl(sList)); | |
| 1299 | + newMap.put("sjbc", culateService.culateSjbc(sList,"")); | |
| 1300 | + newMap.put("sjgl", culateService.culateSjgl(sList)); | |
| 1301 | + newMap.put("lbgl", culateService.culateLbgl(sList)); | |
| 1302 | + newMap.put("lbbc", culateService.culateLbbc(sList)); | |
| 1303 | + newMap.put("ljgl", culateService.culateLjgl(sList)); | |
| 1304 | + newMap.put("ljbc", culateService.culateLjbc(sList,"")); | |
| 1305 | + newMap.put("ksgl", culateService.culateKsgl(sList)); | |
| 1306 | + return newMap; | |
| 1307 | + } | |
| 1062 | 1308 | } | ... | ... |
src/main/java/com/bsth/util/Arith.java
| ... | ... | @@ -20,9 +20,9 @@ public class Arith { |
| 20 | 20 | * @param v2 加数 |
| 21 | 21 | * @return 两个参数的和 |
| 22 | 22 | */ |
| 23 | - public static double add(double v1,double v2){ | |
| 24 | - BigDecimal b1 = new BigDecimal(Double.toString(v1)); | |
| 25 | - BigDecimal b2 = new BigDecimal(Double.toString(v2)); | |
| 23 | + public static double add(Object v1,Object v2){ | |
| 24 | + BigDecimal b1 = new BigDecimal(v1.toString()); | |
| 25 | + BigDecimal b2 = new BigDecimal(v2.toString()); | |
| 26 | 26 | return b1.add(b2).doubleValue(); |
| 27 | 27 | } |
| 28 | 28 | |
| ... | ... | @@ -32,9 +32,9 @@ public class Arith { |
| 32 | 32 | * @param v2 减数 |
| 33 | 33 | * @return 两个参数的差 |
| 34 | 34 | */ |
| 35 | - public static double sub(double v1,double v2){ | |
| 36 | - BigDecimal b1 = new BigDecimal(Double.toString(v1)); | |
| 37 | - BigDecimal b2 = new BigDecimal(Double.toString(v2)); | |
| 35 | + public static double sub(Object v1,Object v2){ | |
| 36 | + BigDecimal b1 = new BigDecimal(v1.toString()); | |
| 37 | + BigDecimal b2 = new BigDecimal(v2.toString()); | |
| 38 | 38 | return b1.subtract(b2).doubleValue(); |
| 39 | 39 | } |
| 40 | 40 | |
| ... | ... | @@ -44,9 +44,9 @@ public class Arith { |
| 44 | 44 | * @param v2 乘数 |
| 45 | 45 | * @return 两个参数的积 |
| 46 | 46 | */ |
| 47 | - public static double mul(double v1,double v2){ | |
| 48 | - BigDecimal b1 = new BigDecimal(Double.toString(v1)); | |
| 49 | - BigDecimal b2 = new BigDecimal(Double.toString(v2)); | |
| 47 | + public static double mul(Object v1,Object v2){ | |
| 48 | + BigDecimal b1 = new BigDecimal(v1.toString()); | |
| 49 | + BigDecimal b2 = new BigDecimal(v2.toString()); | |
| 50 | 50 | return b1.multiply(b2).doubleValue(); |
| 51 | 51 | } |
| 52 | 52 | |
| ... | ... | @@ -57,7 +57,7 @@ public class Arith { |
| 57 | 57 | * @param v2 除数 |
| 58 | 58 | * @return 两个参数的商 |
| 59 | 59 | */ |
| 60 | - public static double div(double v1,double v2){ | |
| 60 | + public static double div(Object v1,Object v2){ | |
| 61 | 61 | return div(v1,v2,DEF_DIV_SCALE); |
| 62 | 62 | } |
| 63 | 63 | |
| ... | ... | @@ -69,13 +69,13 @@ public class Arith { |
| 69 | 69 | * @param scale 表示表示需要精确到小数点以后几位。 |
| 70 | 70 | * @return 两个参数的商 |
| 71 | 71 | */ |
| 72 | - public static double div(double v1,double v2,int scale){ | |
| 72 | + public static double div(Object v1,Object v2,int scale){ | |
| 73 | 73 | if(scale<0){ |
| 74 | 74 | throw new IllegalArgumentException( |
| 75 | 75 | "The scale must be a positive integer or zero"); |
| 76 | 76 | } |
| 77 | - BigDecimal b1 = new BigDecimal(Double.toString(v1)); | |
| 78 | - BigDecimal b2 = new BigDecimal(Double.toString(v2)); | |
| 77 | + BigDecimal b1 = new BigDecimal(v1.toString()); | |
| 78 | + BigDecimal b2 = new BigDecimal(v2.toString()); | |
| 79 | 79 | return b1.divide(b2,scale,BigDecimal.ROUND_HALF_UP).doubleValue(); |
| 80 | 80 | } |
| 81 | 81 | |
| ... | ... | @@ -85,12 +85,12 @@ public class Arith { |
| 85 | 85 | * @param scale 小数点后保留几位 |
| 86 | 86 | * @return 四舍五入后的结果 |
| 87 | 87 | */ |
| 88 | - public static double round(double v,int scale){ | |
| 88 | + public static double round(Object v,int scale){ | |
| 89 | 89 | if(scale<0){ |
| 90 | 90 | throw new IllegalArgumentException( |
| 91 | 91 | "The scale must be a positive integer or zero"); |
| 92 | 92 | } |
| 93 | - BigDecimal b = new BigDecimal(Double.toString(v)); | |
| 93 | + BigDecimal b = new BigDecimal(v.toString()); | |
| 94 | 94 | BigDecimal one = new BigDecimal("1"); |
| 95 | 95 | return b.divide(one,scale,BigDecimal.ROUND_HALF_UP).doubleValue(); |
| 96 | 96 | } |
| ... | ... | @@ -100,8 +100,8 @@ public class Arith { |
| 100 | 100 | * @param v 需要被转换的数字 |
| 101 | 101 | * @return 返回转换结果 |
| 102 | 102 | */ |
| 103 | - public static float convertsToFloat(double v){ | |
| 104 | - BigDecimal b = new BigDecimal(v); | |
| 103 | + public static float convertsToFloat(Object v){ | |
| 104 | + BigDecimal b = new BigDecimal(v.toString()); | |
| 105 | 105 | return b.floatValue(); |
| 106 | 106 | } |
| 107 | 107 | |
| ... | ... | @@ -110,8 +110,8 @@ public class Arith { |
| 110 | 110 | * @param v 需要被转换的数字 |
| 111 | 111 | * @return 返回转换结果 |
| 112 | 112 | */ |
| 113 | - public static int convertsToInt(double v){ | |
| 114 | - BigDecimal b = new BigDecimal(v); | |
| 113 | + public static int convertsToInt(Object v){ | |
| 114 | + BigDecimal b = new BigDecimal(v.toString()); | |
| 115 | 115 | return b.intValue(); |
| 116 | 116 | } |
| 117 | 117 | |
| ... | ... | @@ -120,8 +120,8 @@ public class Arith { |
| 120 | 120 | * @param v 需要被转换的数字 |
| 121 | 121 | * @return 返回转换结果 |
| 122 | 122 | */ |
| 123 | - public static long convertsToLong(double v){ | |
| 124 | - BigDecimal b = new BigDecimal(v); | |
| 123 | + public static long convertsToLong(Object v){ | |
| 124 | + BigDecimal b = new BigDecimal(v.toString()); | |
| 125 | 125 | return b.longValue(); |
| 126 | 126 | } |
| 127 | 127 | |
| ... | ... | @@ -131,9 +131,9 @@ public class Arith { |
| 131 | 131 | * @param v2 需要被对比的第二个数 |
| 132 | 132 | * @return 返回两个数中大的一个值 |
| 133 | 133 | */ |
| 134 | - public static double returnMax(double v1,double v2){ | |
| 135 | - BigDecimal b1 = new BigDecimal(v1); | |
| 136 | - BigDecimal b2 = new BigDecimal(v2); | |
| 134 | + public static double returnMax(Object v1,Object v2){ | |
| 135 | + BigDecimal b1 = new BigDecimal(v1.toString()); | |
| 136 | + BigDecimal b2 = new BigDecimal(v2.toString()); | |
| 137 | 137 | return b1.max(b2).doubleValue(); |
| 138 | 138 | } |
| 139 | 139 | |
| ... | ... | @@ -143,9 +143,9 @@ public class Arith { |
| 143 | 143 | * @param v2 需要被对比的第二个数 |
| 144 | 144 | * @return 返回两个数中小的一个值 |
| 145 | 145 | */ |
| 146 | - public static double returnMin(double v1,double v2){ | |
| 147 | - BigDecimal b1 = new BigDecimal(v1); | |
| 148 | - BigDecimal b2 = new BigDecimal(v2); | |
| 146 | + public static double returnMin(Object v1,Object v2){ | |
| 147 | + BigDecimal b1 = new BigDecimal(v1.toString()); | |
| 148 | + BigDecimal b2 = new BigDecimal(v2.toString()); | |
| 149 | 149 | return b1.min(b2).doubleValue(); |
| 150 | 150 | } |
| 151 | 151 | |
| ... | ... | @@ -155,9 +155,9 @@ public class Arith { |
| 155 | 155 | * @param v2 需要被对比的第二个数 |
| 156 | 156 | * @return 如果两个数一样则返回0,如果第一个数比第二个数大则返回1,反之返回-1 |
| 157 | 157 | */ |
| 158 | - public static int compareTo(double v1,double v2){ | |
| 159 | - BigDecimal b1 = new BigDecimal(v1); | |
| 160 | - BigDecimal b2 = new BigDecimal(v2); | |
| 158 | + public static int compareTo(Object v1,Object v2){ | |
| 159 | + BigDecimal b1 = new BigDecimal(v1.toString()); | |
| 160 | + BigDecimal b2 = new BigDecimal(v2.toString()); | |
| 161 | 161 | return b1.compareTo(b2); |
| 162 | 162 | } |
| 163 | 163 | } | ... | ... |
src/main/resources/static/pages/forms/statement/jobSummary.html
| ... | ... | @@ -49,16 +49,16 @@ |
| 49 | 49 | <th colspan="10">调度员工作汇总日报</th> |
| 50 | 50 | </tr> |
| 51 | 51 | <tr> |
| 52 | - <td colspan="10">线路:85路 日期:2016/5/26</td> | |
| 52 | + <td colspan="10">线路:<label id="xlid"></label> 日期:<label id="dateid"></label></td> | |
| 53 | 53 | </tr> |
| 54 | 54 | <tr> |
| 55 | - <td colspan="10">安全服务情况:</td> | |
| 55 | + <td colspan="10">安全服务情况</td> | |
| 56 | 56 | </tr> |
| 57 | 57 | <tr> |
| 58 | 58 | <td colspan="2">少驶班次数</td> |
| 59 | - <td colspan="2"> </td> | |
| 59 | + <td colspan="2"><label id="lbbcs"></label> </td> | |
| 60 | 60 | <td colspan="2">少驶公里数</td> |
| 61 | - <td colspan="4"> </td> | |
| 61 | + <td colspan="4"><label id="lbgls"></label> </td> | |
| 62 | 62 | </tr> |
| 63 | 63 | </thead> |
| 64 | 64 | <tbody> |
| ... | ... | @@ -76,23 +76,18 @@ |
| 76 | 76 | <td>烂班里程</td> |
| 77 | 77 | <td>简要情况</td> |
| 78 | 78 | </tr> |
| 79 | - <tr> | |
| 80 | - <td> </td> | |
| 81 | - <td>小计</td> | |
| 82 | - <td colspan="2">少驶班次</td> | |
| 83 | - <td> </td> | |
| 84 | - <td colspan="4">少驶公里</td> | |
| 85 | - <td> </td> | |
| 86 | - </tr> | |
| 79 | + <tbody class="list_lbqk"> | |
| 80 | + | |
| 81 | + </tbody> | |
| 87 | 82 | <tr><td colspan="10"> </td></tr> |
| 88 | 83 | <tr> |
| 89 | 84 | <td colspan="10">服务临加增加情况</td> |
| 90 | 85 | </tr> |
| 91 | 86 | <tr> |
| 92 | - <td colspan="2">临加班次书</td> | |
| 93 | - <td colspan="2"> </td> | |
| 87 | + <td colspan="2">临加班次数</td> | |
| 88 | + <td colspan="2"><label id="ljbcs"></label> </td> | |
| 94 | 89 | <td colspan="2">临加公里数</td> |
| 95 | - <td colspan="4"> </td> | |
| 90 | + <td colspan="4"><label id="ljgls"></label> </td> | |
| 96 | 91 | </tr> |
| 97 | 92 | <tr> |
| 98 | 93 | <td>路牌</td> |
| ... | ... | @@ -100,8 +95,12 @@ |
| 100 | 95 | <td>司售</td> |
| 101 | 96 | <td>地点</td> |
| 102 | 97 | <td>时间</td> |
| 103 | - <td colspan="5">简要情况</td> | |
| 98 | + <td>临加公里</td> | |
| 99 | + <td colspan="4">简要情况</td> | |
| 104 | 100 | </tr> |
| 101 | + <tbody class="list_ljqk"> | |
| 102 | + | |
| 103 | + </tbody> | |
| 105 | 104 | <tr><td colspan="10"> </td></tr> |
| 106 | 105 | <tr> |
| 107 | 106 | <td colspan="10">当日汇总</td> |
| ... | ... | @@ -115,22 +114,22 @@ |
| 115 | 114 | </tr> |
| 116 | 115 | <tr> |
| 117 | 116 | <td colspan="2">班次</td> |
| 118 | - <td> </td> | |
| 119 | - <td> </td> | |
| 117 | + <td><label id="jhbc"></label></td> | |
| 118 | + <td><label id="sjbc"></label></td> | |
| 120 | 119 | <td colspan="3"> </td> |
| 121 | 120 | <td colspan="3"> </td> |
| 122 | 121 | </tr> |
| 123 | 122 | <tr> |
| 124 | 123 | <td colspan="2">公里</td> |
| 125 | - <td> </td> | |
| 126 | - <td> </td> | |
| 124 | + <td><label id="jhgl"></label></td> | |
| 125 | + <td><label id="sjgl"></label></td> | |
| 127 | 126 | <td colspan="3"> </td> |
| 128 | 127 | <td colspan="3"> </td> |
| 129 | 128 | </tr> |
| 130 | 129 | <tr> |
| 131 | 130 | <td colspan="2">临加</td> |
| 132 | 131 | <td> </td> |
| 133 | - <td> </td> | |
| 132 | + <td><label id="sjljgl"></label></td> | |
| 134 | 133 | <td colspan="3"> </td> |
| 135 | 134 | <td colspan="3"> </td> |
| 136 | 135 | </tr> |
| ... | ... | @@ -200,22 +199,93 @@ |
| 200 | 199 | for(var code in result){ |
| 201 | 200 | data.push({id: code, text: result[code]}); |
| 202 | 201 | } |
| 203 | - console.log(data); | |
| 204 | 202 | initPinYinSelect2('#line',data,''); |
| 205 | 203 | |
| 206 | 204 | }) |
| 207 | 205 | |
| 206 | + $("#query").on("click",function(){ | |
| 207 | + var line=$("#line").val();; | |
| 208 | + var lineName=$(".select2-selection__rendered").html(); | |
| 209 | + var date =$("#date").val(); | |
| 210 | + if(line=="" || line==null){ | |
| 211 | + layer.msg('请选择线路.'); | |
| 212 | + }else if(date==""||date==null){ | |
| 213 | + layer.msg('请选择日期.'); | |
| 214 | + }else{ | |
| 215 | + $("#xlid").html(lineName); | |
| 216 | + $("#dateid").html(date); | |
| 217 | + $get('/report/jobFwqk',{line:line,date:date},function(result){ | |
| 218 | + var list_lbqk = template('list_lbqk',{list:result}); | |
| 219 | + // 把渲染好的模版html文本追加到表格中 | |
| 220 | + $('#forms .list_lbqk').html(list_lbqk); | |
| 221 | + }) | |
| 222 | + | |
| 223 | + $get('/report/jobLjqk',{line:line,date:date},function(result){ | |
| 224 | + var list_lbqk = template('list_ljqk',{list:result}); | |
| 225 | + // 把渲染好的模版html文本追加到表格中 | |
| 226 | + $('#forms .list_ljqk').html(list_lbqk); | |
| 227 | + }) | |
| 228 | + | |
| 229 | + $get('/report/jobHzxx',{line:line,date:date},function(result){ | |
| 230 | + console.log(result) | |
| 231 | + $("#jhbc").html(result.jhbc); | |
| 232 | + $("#sjbc").html(result.sjbc) | |
| 233 | + $("#jhgl").html(result.jhgl); | |
| 234 | + $("#sjgl").html(result.sjgl) | |
| 235 | + $("#sjljgl").html(result.ljgl); | |
| 236 | + | |
| 237 | + //临加 | |
| 238 | + $("#ljbcs").html(result.ljbc); | |
| 239 | + $("#ljgls").html(result.ljgl) | |
| 240 | + | |
| 241 | + //烂班 | |
| 242 | + $("#lbbcs").html(result.lbbc); | |
| 243 | + $("#lbgls").html(result.lbgl) | |
| 244 | + }) | |
| 245 | + | |
| 246 | + } | |
| 247 | + | |
| 248 | + }) | |
| 249 | + | |
| 208 | 250 | }); |
| 209 | 251 | </script> |
| 210 | -<script type="text/html" id="list_forms"> | |
| 252 | +<script type="text/html" id="list_lbqk"> | |
| 211 | 253 | {{each list as obj i}} |
| 212 | 254 | <tr> |
| 213 | - | |
| 255 | + <td>{{obj.nr}}</td> | |
| 256 | + <td>{{obj.lp}}</td> | |
| 257 | + <td>{{obj.nbbm}}</td> | |
| 258 | + <td>{{obj.jgh}}</td> | |
| 259 | + <td>{{obj.dz}}</td> | |
| 260 | + <td>{{obj.sj}}</td> | |
| 261 | + <td> </td> | |
| 262 | + <td>{{obj.lbbc}}</td> | |
| 263 | + <td>{{obj.lblc}}</td> | |
| 264 | + <td>{{obj.jyqp}}</td> | |
| 214 | 265 | </tr> |
| 215 | 266 | {{/each}} |
| 216 | 267 | {{if list.length == 0}} |
| 217 | 268 | <tr> |
| 218 | - <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> | |
| 269 | + <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td> | |
| 219 | 270 | </tr> |
| 220 | 271 | {{/if}} |
| 221 | -</script> | |
| 222 | 272 | \ No newline at end of file |
| 273 | +</script> | |
| 274 | + | |
| 275 | +<script type="text/html" id="list_ljqk"> | |
| 276 | + {{each list as obj i}} | |
| 277 | + <tr> | |
| 278 | + <td>{{obj.lp}}</td> | |
| 279 | + <td>{{obj.nbbm}}</td> | |
| 280 | + <td>{{obj.jgh}}</td> | |
| 281 | + <td>{{obj.dz}}</td> | |
| 282 | + <td>{{obj.sj}}</td> | |
| 283 | + <td>{{obj.ljlc}}</td> | |
| 284 | + <td colspan="4">{{obj.jyqp}}</td> | |
| 285 | + </tr> | |
| 286 | + {{/each}} | |
| 287 | + {{if list.length == 0}} | |
| 288 | + <tr> | |
| 289 | + <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td> | |
| 290 | + </tr> | |
| 291 | + {{/if}} | |
| 292 | +</script> | ... | ... |
src/main/resources/static/pages/forms/statement/scheduleDaily.html
src/main/resources/static/pages/forms/statement/waybill.html
| ... | ... | @@ -222,6 +222,7 @@ |
| 222 | 222 | |
| 223 | 223 | var params = new Array(); |
| 224 | 224 | var jName = ''; |
| 225 | + var jGh = ''; | |
| 225 | 226 | $("#info tbody").on("click","tr",function(){ |
| 226 | 227 | if($(this).children().size() < 2){ |
| 227 | 228 | return; |
| ... | ... | @@ -231,6 +232,7 @@ |
| 231 | 232 | params[index] = $(this).text(); |
| 232 | 233 | }); |
| 233 | 234 | jName = params[0].split("\\")[0]; |
| 235 | + jGh = params[0].split("\\")[1]; | |
| 234 | 236 | var id = $("#"+params[1]).val(); |
| 235 | 237 | $get('/realSchedule/MapById',{id:id},function(result){ |
| 236 | 238 | result.scheduleDate = moment(result.scheduleDate).format("YYYY/MM/DD"); |
| ... | ... | @@ -238,13 +240,14 @@ |
| 238 | 240 | // 把渲染好的模版html文本追加到表格中 |
| 239 | 241 | $('#forms .ludan_1').html(ludan_1); |
| 240 | 242 | }); |
| 243 | + console.log(params); | |
| 241 | 244 | $get('/realSchedule/queryListWaybill',{jName:jName,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){ |
| 242 | 245 | getTime(result); |
| 243 | 246 | var ludan_2 = template('ludan_2',{list:result}); |
| 244 | 247 | // 把渲染好的模版html文本追加到表格中 |
| 245 | 248 | $('#forms .ludan_2').html(ludan_2); |
| 246 | 249 | }); |
| 247 | - $get('/realSchedule/findKMBC',{jName:jName,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){ | |
| 250 | + $get('/realSchedule/findKMBC',{jGh:jGh,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){ | |
| 248 | 251 | var ludan_3 = template('ludan_3',result); |
| 249 | 252 | $('#forms .ludan_3').html(ludan_3); |
| 250 | 253 | }); | ... | ... |