Commit 6ce47cf656d9718a8ec9546dc5e690429b045f4a
1 parent
cb9a5767
公里数计算
Showing
1 changed file
with
84 additions
and
27 deletions
src/main/java/com/bsth/server_rs/bigdata/BigscreenService.java
| ... | ... | @@ -33,7 +33,6 @@ import com.bsth.entity.ChildTaskPlan; |
| 33 | 33 | import com.bsth.entity.ScheduleRealInfo; |
| 34 | 34 | import com.bsth.repository.ScheduleRealInfoRepository; |
| 35 | 35 | import com.bsth.util.Arith; |
| 36 | -import com.mysql.fabric.xmlrpc.base.Array; | |
| 37 | 36 | |
| 38 | 37 | @Component |
| 39 | 38 | @Path("/bigscreen") |
| ... | ... | @@ -410,38 +409,31 @@ public class BigscreenService { |
| 410 | 409 | dd1.setTime(dd.getTime() - 1l*1000*60*60*24); |
| 411 | 410 | String date1 = sd.format(dd1); //前一天 |
| 412 | 411 | List<ScheduleRealInfo> findAll = scheduleRealInfoRepository.findAll(date1); |
| 413 | - List<ScheduleRealInfo> list_sj = new ArrayList<ScheduleRealInfo>(); | |
| 412 | + List<ScheduleRealInfo> listSche = new ArrayList<ScheduleRealInfo>(); | |
| 414 | 413 | for(ScheduleRealInfo s : findAll){ |
| 415 | 414 | if(s.getXlBm() != null && yyLine.contains(s.getXlBm())){//营运线路 |
| 416 | - Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 417 | - if (cts != null && cts.size() > 0) { | |
| 418 | - list_sj.add(s); | |
| 419 | - } else { | |
| 420 | - if (s.getZdsjActual() != null && s.getFcsjActual() != null) { | |
| 421 | - list_sj.add(s); | |
| 422 | - } | |
| 423 | - } | |
| 415 | + listSche.add(s); | |
| 424 | 416 | } |
| 425 | 417 | } |
| 426 | - double jhyygl = culateJhgl(findAll);//计划营运公里 | |
| 427 | - double sjgl = culateSjgl(list_sj);//实际公里 | |
| 428 | - double sjljgl = culateLjgl(list_sj);//实际临加公里 | |
| 418 | + double jhyygl = culateJhgl(listSche);//计划营运公里 | |
| 419 | + double sjgl = culateSjgl(listSche);//实际公里 | |
| 420 | + double sjljgl = culateLjgl(listSche);//实际临加公里 | |
| 429 | 421 | double sjyygl = Arith.add(sjgl, sjljgl);//实际营运公里 |
| 430 | - double lz = culateCJLC(list_sj, "路阻"); | |
| 431 | - double dm = culateCJLC(list_sj, "吊慢"); | |
| 432 | - double gz = culateCJLC(list_sj, "故障"); | |
| 433 | - double jf = culateCJLC(list_sj, "纠纷"); | |
| 434 | - double zs = culateCJLC(list_sj, "肇事"); | |
| 435 | - double qr = culateCJLC(list_sj, "缺人"); | |
| 436 | - double qc = culateCJLC(list_sj, "缺车"); | |
| 422 | + double lz = culateCJLC(listSche, "路阻"); | |
| 423 | + double dm = culateCJLC(listSche, "吊慢"); | |
| 424 | + double gz = culateCJLC(listSche, "故障"); | |
| 425 | + double jf = culateCJLC(listSche, "纠纷"); | |
| 426 | + double zs = culateCJLC(listSche, "肇事"); | |
| 427 | + double qr = culateCJLC(listSche, "缺人"); | |
| 428 | + double qc = culateCJLC(listSche, "缺车"); | |
| 437 | 429 | double qrqc = Arith.add(qr, qc);//缺人缺车 |
| 438 | - double kx = culateCJLC(list_sj, "客稀"); | |
| 439 | - double qh = culateCJLC(list_sj, "气候"); | |
| 440 | - double yw = culateCJLC(list_sj, "援外"); | |
| 441 | - double lb_pc = culateCJLC(list_sj, "配车"); | |
| 442 | - double lb_by = culateCJLC(list_sj, "保养"); | |
| 443 | - double lb_cj = culateCJLC(list_sj, "抽减"); | |
| 444 | - double lb_qt = culateCJLC(list_sj, "其他"); | |
| 430 | + double kx = culateCJLC(listSche, "客稀"); | |
| 431 | + double qh = culateCJLC(listSche, "气候"); | |
| 432 | + double yw = culateCJLC(listSche, "援外"); | |
| 433 | + double lb_pc = culateCJLC(listSche, "配车"); | |
| 434 | + double lb_by = culateCJLC(listSche, "保养"); | |
| 435 | + double lb_cj = culateCJLC(listSche, "抽减"); | |
| 436 | + double lb_qt = culateCJLC(listSche, "其他"); | |
| 445 | 437 | double qt = Arith.add(Arith.add(lb_pc, lb_by), Arith.add(lb_cj, lb_qt));//其他 |
| 446 | 438 | |
| 447 | 439 | Map<String, Object> jhyyglMap = new HashMap<String, Object>(); |
| ... | ... | @@ -750,6 +742,71 @@ public class BigscreenService { |
| 750 | 742 | return JSON.parseObject(JSON.toJSONString(resMap)); |
| 751 | 743 | } |
| 752 | 744 | |
| 745 | + @GET | |
| 746 | + @Path("/selectData/getReport") | |
| 747 | + public List<Map<String, Object>> getReport(){ | |
| 748 | + String sql="SELECT ID,REPORT_TYPE,REPORT_GS,REPORT_FGS,REPORT_GSNAME,REPORT_FGSNAME," | |
| 749 | + + " REPORT_DATE,REPORT_BBR,REPORT_XL,REPORT_XLNAME,REPORT_STATION,REPORT_DWSBBM," | |
| 750 | + + " REPORT_DWSBSJ,REPORT_YWSJ,REPORT_SMBWD,REPORT_DJGSJ,REPORT_DJGYY,REPORT_TFSJ," | |
| 751 | + + " REPORT_YXSJ,REPORT_YXBC,REPORT_TZCS,REPORT_SGBH,REPORT_ZBH,REPORT_PZH,REPORT_JSY," | |
| 752 | + + " REPORT_SGSJ,REPORT_SGDD,REPORT_XSFX,REPORT_SGDX,REPORT_DXPZH,REPORT_SGGK," | |
| 753 | + + " REPORT_SSRS,REPORT_SWRS,REPORT_BGR,REPORT_BGRDH,REPORT_BZ,REPORT_ROAD,STATUS," | |
| 754 | + + " CREATE_BY,CREATE_DATE,UPDATE_BY,UPDATE_DATE" | |
| 755 | + + " from bsth_t_report "; | |
| 756 | + List<Map<String, Object>> list=jdbcTemplate.query(sql, | |
| 757 | + new RowMapper<Map<String, Object>>(){ | |
| 758 | + @Override | |
| 759 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 760 | + Map<String, Object> m=new HashMap<String,Object>(); | |
| 761 | + m.put("ID", rs.getString("ID")); | |
| 762 | + m.put("REPORT_TYPE", rs.getString("REPORT_TYPE")); | |
| 763 | + m.put("REPORT_GS", rs.getString("REPORT_GS")); | |
| 764 | + m.put("REPORT_FGS",rs.getString("REPORT_FGS")); | |
| 765 | + m.put("REPORT_GSNAME",rs.getString("REPORT_GSNAME")); | |
| 766 | + m.put("REPORT_FGSNAME",rs.getString("REPORT_FGSNAME")); | |
| 767 | + m.put("REPORT_DATE",rs.getString("REPORT_DATE")); | |
| 768 | + m.put("REPORT_BBR",rs.getString("REPORT_BBR")); | |
| 769 | + m.put("REPORT_XL",rs.getString("REPORT_XL")); | |
| 770 | + m.put("REPORT_XLNAME",rs.getString("REPORT_XLNAME")); | |
| 771 | + m.put("REPORT_STATION",rs.getString("REPORT_STATION")); | |
| 772 | + m.put("REPORT_DWSBBM",rs.getString("REPORT_DWSBBM")); | |
| 773 | + m.put("REPORT_DWSBSJ",rs.getString("REPORT_DWSBSJ")); | |
| 774 | + m.put("REPORT_YWSJ",rs.getString("REPORT_YWSJ")); | |
| 775 | + m.put("REPORT_SMBWD",rs.getString("REPORT_SMBWD")); | |
| 776 | + m.put("REPORT_DJGSJ",rs.getString("REPORT_DJGSJ")); | |
| 777 | + m.put("REPORT_DJGYY",rs.getString("REPORT_DJGYY")); | |
| 778 | + m.put("REPORT_TFSJ",rs.getString("REPORT_TFSJ")); | |
| 779 | + m.put("REPORT_YXSJ",rs.getString("REPORT_YXSJ")); | |
| 780 | + m.put("REPORT_YXBC",rs.getString("REPORT_YXBC")); | |
| 781 | + m.put("REPORT_TZCS",rs.getString("REPORT_TZCS")); | |
| 782 | + m.put("REPORT_SGBH",rs.getString("REPORT_SGBH")); | |
| 783 | + m.put("REPORT_ZBH",rs.getString("REPORT_ZBH")); | |
| 784 | + m.put("REPORT_PZH",rs.getString("REPORT_PZH")); | |
| 785 | + m.put("REPORT_JSY",rs.getString("REPORT_JSY")); | |
| 786 | + m.put("REPORT_SGSJ",rs.getString("REPORT_SGSJ")); | |
| 787 | + m.put("REPORT_SGDD",rs.getString("REPORT_SGDD")); | |
| 788 | + m.put("REPORT_XSFX", rs.getString("REPORT_XSFX")); | |
| 789 | + m.put("REPORT_SGDX", rs.getString("REPORT_SGDX")); | |
| 790 | + m.put("REPORT_DXPZH", rs.getString("REPORT_DXPZH")); | |
| 791 | + m.put("REPORT_SGGK", rs.getString("REPORT_SGGK")); | |
| 792 | + m.put("REPORT_SSRS", rs.getString("REPORT_SSRS")); | |
| 793 | + m.put("REPORT_SWRS", rs.getString("REPORT_SWRS")); | |
| 794 | + m.put("REPORT_BGR", rs.getString("REPORT_BGR")); | |
| 795 | + m.put("REPORT_BGRDH", rs.getString("REPORT_BGRDH")); | |
| 796 | + m.put("REPORT_BZ", rs.getString("REPORT_BZ")); | |
| 797 | + m.put("REPORT_ROAD", rs.getString("REPORT_ROAD")); | |
| 798 | + m.put("STATUS", rs.getString("STATUS")); | |
| 799 | + m.put("CREATE_BY", rs.getString("CREATE_BY")); | |
| 800 | + m.put("CREATE_DATE", rs.getString("CREATE_DATE")); | |
| 801 | + m.put("UPDATE_BY", rs.getString("UPDATE_BY")); | |
| 802 | + m.put("UPDATE_DATE", rs.getString("UPDATE_DATE")); | |
| 803 | + return m; | |
| 804 | + } | |
| 805 | + }); | |
| 806 | + | |
| 807 | + return list; | |
| 808 | + } | |
| 809 | + | |
| 753 | 810 | public List<Map<String, Object>> createMap(String type, String[] dates){ |
| 754 | 811 | List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>(); |
| 755 | 812 | ... | ... |