Commit 7a316f0f39865cc6978b8a7b33457eb11265e742
1 parent
f9527eb1
调度日报,统计日报未执行不计算。行车路单日报表
Showing
8 changed files
with
212 additions
and
132 deletions
src/main/java/com/bsth/entity/mcy_forms/Waybillday.java
| ... | ... | @@ -20,6 +20,8 @@ public class Waybillday { |
| 20 | 20 | |
| 21 | 21 | private String zlc;//里程 |
| 22 | 22 | |
| 23 | + private String sh;//损耗 | |
| 24 | + | |
| 23 | 25 | public String getJgh() { |
| 24 | 26 | return jgh; |
| 25 | 27 | } |
| ... | ... | @@ -110,6 +112,15 @@ public class Waybillday { |
| 110 | 112 | public void setYl(String yl) { |
| 111 | 113 | this.yl = yl; |
| 112 | 114 | } |
| 115 | + | |
| 116 | + public String getSh() { | |
| 117 | + return sh; | |
| 118 | + } | |
| 119 | + | |
| 120 | + public void setSh(String sh) { | |
| 121 | + this.sh = sh; | |
| 122 | + } | |
| 123 | + | |
| 113 | 124 | |
| 114 | 125 | |
| 115 | 126 | } | ... | ... |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -22,7 +22,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 22 | 22 | List<ScheduleRealInfo> findByLines(List<String> lines); |
| 23 | 23 | |
| 24 | 24 | |
| 25 | - @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and bc_type not in ('in','out') order by (lpName+1),clZbh,realExecDate,fcsj") | |
| 25 | + @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and bc_type not in ('in','out') order by (lpName+1),clZbh,realExecDate,dfsj") | |
| 26 | 26 | List<ScheduleRealInfo> scheduleDailyQp(String line,String date); |
| 27 | 27 | |
| 28 | 28 | @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.id,s.jGh,s.clZbh,s.lpName order by (lpName+1)") |
| ... | ... | @@ -87,11 +87,11 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 87 | 87 | List<ScheduleRealInfo> correctForm(String line,String startDate,String endDate,String lpName,String code); |
| 88 | 88 | |
| 89 | 89 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 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") | |
| 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,dfsj") | |
| 91 | 91 | List<ScheduleRealInfo> queryListWaybill(String jName,String clZbh,String lpName,String date,String line); |
| 92 | 92 | |
| 93 | 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") | |
| 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,dfsj") | |
| 95 | 95 | List<ScheduleRealInfo> queryListWaybillXcld(String jGh,String clZbh,String lpName,String date,String line); |
| 96 | 96 | |
| 97 | 97 | // @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| ... | ... | @@ -104,11 +104,11 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 107 | - @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") | |
| 107 | + @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,dfsj") | |
| 108 | 108 | List<ScheduleRealInfo> queryListWaybill2(String clZbh,String date,String line); |
| 109 | 109 | |
| 110 | 110 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 111 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh like %?1% and s.clZbh like %?2% and s.scheduleDate = str_to_date(?3,'%Y-%m-%d') and s.gsBm like %?4% and s.fgsBm like %?5% order by realExecDate,fcsj") | |
| 111 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh like %?1% and s.clZbh like %?2% and s.scheduleDate = str_to_date(?3,'%Y-%m-%d') and s.gsBm like %?4% and s.fgsBm like %?5% order by realExecDate,dfsj") | |
| 112 | 112 | List<ScheduleRealInfo> queryListWaybill3(String jName,String clZbh,String date,String gsbm,String fgsbm); |
| 113 | 113 | |
| 114 | 114 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| ... | ... | @@ -133,11 +133,11 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 133 | 133 | |
| 134 | 134 | //去掉了 xlBm is not null |
| 135 | 135 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 136 | - @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)") | |
| 136 | + @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.dfsj, (s.lpName+1)") | |
| 137 | 137 | List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date); |
| 138 | 138 | |
| 139 | 139 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 140 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm =?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by (s.lpName+1), s.realExecDate,s.fcsj") | |
| 140 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm =?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by (s.lpName+1), s.realExecDate,s.dfsj") | |
| 141 | 141 | List<ScheduleRealInfo> scheduleByDateAndLineQp(String line,String date); |
| 142 | 142 | |
| 143 | 143 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | ... | ... |
src/main/java/com/bsth/service/forms/impl/ExportServiceImpl.java
| ... | ... | @@ -35,12 +35,14 @@ public class ExportServiceImpl implements ExportService{ |
| 35 | 35 | |
| 36 | 36 | for(Waybillday w : list){ |
| 37 | 37 | Map<String, Object> m = new HashMap<String, Object>(); |
| 38 | - m.put("carPlate", w.getCarPlate()); | |
| 38 | + m.put("carPlate", w.getNbbm()); | |
| 39 | 39 | m.put("jzl1", w.getJzl1()); |
| 40 | 40 | m.put("jzl", w.getJzl()); |
| 41 | 41 | m.put("yh", w.getYh()); |
| 42 | + m.put("sh", w.getSh()); | |
| 42 | 43 | m.put("jName", w.getjName()); |
| 43 | 44 | m.put("zlc", w.getZlc()); |
| 45 | + m.put("jy", ""); | |
| 44 | 46 | resList.add(m); |
| 45 | 47 | } |
| 46 | 48 | |
| ... | ... | @@ -48,7 +50,7 @@ public class ExportServiceImpl implements ExportService{ |
| 48 | 50 | listI.add(resList.iterator()); |
| 49 | 51 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 50 | 52 | ee.excelReplace(listI, new Object[] { map }, path+"mould/waybillday.xls", |
| 51 | - path+"export/行车路单日报表" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | |
| 53 | + path+"export/行车路单日报表.xls"); | |
| 52 | 54 | } catch (Exception e) { |
| 53 | 55 | e.printStackTrace(); |
| 54 | 56 | } | ... | ... |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| ... | ... | @@ -64,48 +64,69 @@ public class FormsServiceImpl implements FormsService { |
| 64 | 64 | // 行车路单日报表 |
| 65 | 65 | @Override |
| 66 | 66 | public List<Waybillday> waybillday(Map<String, Object> map) { |
| 67 | - | |
| 68 | - | |
| 69 | - | |
| 70 | - String sql=" select t.*,z.jzl,z.yh from (" | |
| 71 | - + " select x.j_gh,x.cl_zbh,x.j_name,x.schedule_date," | |
| 72 | - + " x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name from bsth_c_s_sp_info_real x " | |
| 73 | - + " where to_days( x.schedule_date)=to_days('"+map.get("date").toString() + "') " | |
| 74 | - + " and x.gs_bm='"+map.get("gsdmWaybillday").toString()+"' " | |
| 75 | - + " and x.fgs_bm='"+map.get("fgsdmWaybillday").toString()+"' " | |
| 76 | - + " and xl_bm like '%"+ map.get("line").toString().trim()+"%'" | |
| 77 | - + " GROUP BY x.j_gh,x.cl_zbh,x.j_name," | |
| 78 | - + " x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name ) t" | |
| 79 | - + " LEFT join (select y.rq,y.xlbm,y.nbbm,y.jsy,y.jzl,y.yh from" | |
| 80 | - + " bsth_c_ylb y where 1=1 " | |
| 81 | - + " and to_days(y.RQ)=to_days('"+map.get("date").toString() + "') " | |
| 82 | - + " and y.XLBM like '%"+ map.get("line").toString().trim()+"%'" | |
| 83 | - + " and y.ssgsdm='"+map.get("gsdmWaybillday").toString()+"'" | |
| 84 | - + " and y.fgsdm='"+map.get("gsdmWaybillday").toString()+"') z " | |
| 85 | - + " on t.cl_zbh=z.nbbm "; | |
| 67 | + String line=map.get("line").toString(); | |
| 68 | + String date=map.get("date").toString(); | |
| 69 | + | |
| 70 | + String sql="select " | |
| 71 | + + " r.cl_zbh,r.j_gh,r.j_name" | |
| 72 | + + " from bsth_c_s_sp_info_real r where " | |
| 73 | + + " r.schedule_date_str = '"+date+"'" | |
| 74 | + + " and r.xl_bm = '"+line+"' " | |
| 75 | + + " group by " | |
| 76 | + + " r.cl_zbh,r.j_gh,r.j_name"; | |
| 86 | 77 | |
| 87 | 78 | List<Waybillday> list = jdbcTemplate.query(sql, new RowMapper<Waybillday>() { |
| 79 | + | |
| 88 | 80 | @Override |
| 89 | 81 | public Waybillday mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 90 | - Waybillday wbd = new Waybillday(); | |
| 91 | - wbd.setCarPlate(arg0.getString("cl_zbh")); | |
| 92 | - wbd.setJzl(arg0.getString("jzl")); | |
| 93 | - wbd.setYh(arg0.getString("yh")); | |
| 94 | - wbd.setjName(arg0.getString("j_name")); | |
| 95 | - wbd.setRq(arg0.getString("schedule_date")); | |
| 96 | - wbd.setJgh(arg0.getString("j_gh")); | |
| 97 | - return wbd; | |
| 98 | - } | |
| 82 | + Waybillday w=new Waybillday(); | |
| 83 | + w.setJgh(arg0.getString("j_gh")); | |
| 84 | + w.setjName(arg0.getString("j_name")); | |
| 85 | + w.setNbbm(arg0.getString("cl_zbh")); | |
| 86 | + return w; | |
| 87 | + | |
| 88 | + }; | |
| 99 | 89 | }); |
| 100 | - | |
| 101 | - for(int i=0;i<list.size();i++){ | |
| 90 | + List<ScheduleRealInfo> realList= scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); | |
| 91 | + List<Ylb> listYlb= ylbRepository.obtainYl(date, "", "", line, "", "xlbm"); | |
| 92 | + double jzl=0.0,sh=0.0,yh=0.0; | |
| 93 | + for (int i = 0; i < list.size(); i++) { | |
| 102 | 94 | Waybillday w=list.get(i); |
| 103 | - Map<String, Object> maps = new HashMap<>(); | |
| 104 | - maps = commonService.findKMBC2(w.getJgh(), w.getCarPlate(), | |
| 105 | - w.getRq()); | |
| 106 | - w.setJzl1(maps.get("ksgl").toString()); | |
| 107 | - w.setZlc(maps.get("realMileage").toString()); | |
| 108 | - | |
| 95 | + List<ScheduleRealInfo> listInfo=new ArrayList<ScheduleRealInfo>(); | |
| 96 | + for (int j = 0; j < realList.size(); j++) { | |
| 97 | + ScheduleRealInfo s=realList.get(j); | |
| 98 | + if(w.getNbbm().equals(s.getClZbh()) && w.getJgh().equals(w.getJgh())){ | |
| 99 | + listInfo.add(s); | |
| 100 | + } | |
| 101 | + } | |
| 102 | + | |
| 103 | + double sjgl=culateMileageService.culateSjgl(listInfo); | |
| 104 | + double ljgl=culateMileageService.culateLjgl(listInfo); | |
| 105 | + double zyygl=Arith.add(sjgl, ljgl); | |
| 106 | + double jccg=culateMileageService.culateJccgl(listInfo); | |
| 107 | + double ksgl=culateMileageService.culateKsgl(listInfo); | |
| 108 | + double zksgl=Arith.add(jccg, ksgl); | |
| 109 | + | |
| 110 | + w.setJzl1(String.valueOf(zksgl)); | |
| 111 | + w.setZlc(String.valueOf(Arith.add(zyygl, zksgl))); | |
| 112 | + | |
| 113 | + | |
| 114 | + jzl=0.0; | |
| 115 | + sh=0.0; | |
| 116 | + yh=0.0; | |
| 117 | + for (int j = 0; j < listYlb.size(); j++) { | |
| 118 | + Ylb y=listYlb.get(j); | |
| 119 | + if(w.getNbbm().equals(y.getNbbm()) && w.getJgh().equals(y.getJsy())){ | |
| 120 | + jzl=Arith.add(jzl, y.getJzl()); | |
| 121 | + sh=Arith.add(sh, y.getSh()); | |
| 122 | + yh=Arith.add(yh, y.getYh()); | |
| 123 | + } | |
| 124 | + } | |
| 125 | + | |
| 126 | + w.setJzl(String.valueOf(jzl)); | |
| 127 | + w.setYh(String.valueOf(yh)); | |
| 128 | + w.setSh(String.valueOf(sh)); | |
| 129 | + | |
| 109 | 130 | } |
| 110 | 131 | return list; |
| 111 | 132 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -1668,35 +1668,42 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1668 | 1668 | public List<Map<String, Object>> statisticsDaily(String line, String date, |
| 1669 | 1669 | String xlName, String type) { |
| 1670 | 1670 | List<Map<String, Object>> lMap= new ArrayList<Map<String, Object>>(); |
| 1671 | - List<ScheduleRealInfo> lists = scheduleRealInfoRepository.scheduleByDateAndLine2(line, date); | |
| 1671 | + List<ScheduleRealInfo>list_s=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date); | |
| 1672 | + List<ScheduleRealInfo> lists =new ArrayList<ScheduleRealInfo>(); | |
| 1673 | + for (int i = 0; i < list_s.size(); i++) { | |
| 1674 | + ScheduleRealInfo s=list_s.get(i); | |
| 1675 | + if(s.getZdsjActual()!=null){ | |
| 1676 | + lists.add(s); | |
| 1677 | + } | |
| 1678 | + } | |
| 1672 | 1679 | Map<String, Object> map = new HashMap<String, Object>(); |
| 1673 | 1680 | map.put("xlName", xlName); |
| 1674 | - double jhlc=culateService.culateJhgl(lists); | |
| 1681 | + double jhlc=culateService.culateJhgl(list_s); | |
| 1675 | 1682 | map.put("jhlc",jhlc); |
| 1676 | 1683 | map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists))); |
| 1677 | - double lbgl=culateService.culateLbgl(lists); | |
| 1684 | + double lbgl=culateService.culateLbgl(list_s); | |
| 1678 | 1685 | map.put("ssgl", lbgl); |
| 1679 | - map.put("ssgl_lz", culateService.culateCJLC(lists, "路阻")); | |
| 1680 | - map.put("ssgl_dm", culateService.culateCJLC(lists, "吊慢")); | |
| 1681 | - map.put("ssgl_gz", culateService.culateCJLC(lists, "故障")); | |
| 1682 | - map.put("ssgl_jf", culateService.culateCJLC(lists, "纠纷")); | |
| 1683 | - map.put("ssgl_zs", culateService.culateCJLC(lists, "肇事")); | |
| 1684 | - map.put("ssgl_qr", culateService.culateCJLC(lists, "缺人")); | |
| 1685 | - map.put("ssgl_qc", culateService.culateCJLC(lists, "缺车")); | |
| 1686 | - map.put("ssgl_kx", culateService.culateCJLC(lists, "客稀")); | |
| 1687 | - map.put("ssgl_qh", culateService.culateCJLC(lists, "气候")); | |
| 1688 | - map.put("ssgl_yw", culateService.culateCJLC(lists, "援外")); | |
| 1689 | - double ssgl_pc=culateService.culateCJLC(lists, "配车"); | |
| 1690 | - double ssgl_by=culateService.culateCJLC(lists, "保养"); | |
| 1691 | - double ssgl_cj=culateService.culateCJLC(lists, "抽减"); | |
| 1692 | - double ssgl_qt=culateService.culateCJLC(lists, "其他"); | |
| 1686 | + map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻")); | |
| 1687 | + map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢")); | |
| 1688 | + map.put("ssgl_gz", culateService.culateCJLC(list_s, "故障")); | |
| 1689 | + map.put("ssgl_jf", culateService.culateCJLC(list_s, "纠纷")); | |
| 1690 | + map.put("ssgl_zs", culateService.culateCJLC(list_s, "肇事")); | |
| 1691 | + map.put("ssgl_qr", culateService.culateCJLC(list_s, "缺人")); | |
| 1692 | + map.put("ssgl_qc", culateService.culateCJLC(list_s, "缺车")); | |
| 1693 | + map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀")); | |
| 1694 | + map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候")); | |
| 1695 | + map.put("ssgl_yw", culateService.culateCJLC(list_s, "援外")); | |
| 1696 | + double ssgl_pc=culateService.culateCJLC(list_s, "配车"); | |
| 1697 | + double ssgl_by=culateService.culateCJLC(list_s, "保养"); | |
| 1698 | + double ssgl_cj=culateService.culateCJLC(list_s, "抽减"); | |
| 1699 | + double ssgl_qt=culateService.culateCJLC(list_s, "其他"); | |
| 1693 | 1700 | map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt))); |
| 1694 | - map.put("ssbc", culateService.culateLbbc(lists)); | |
| 1701 | + map.put("ssbc", culateService.culateLbbc(list_s)); | |
| 1695 | 1702 | double ljgl=culateService.culateLjgl(lists); |
| 1696 | 1703 | map.put("ljgl", ljgl); |
| 1697 | - map.put("jhbc", culateService.culateJhbc(lists,"")); | |
| 1698 | - map.put("jhbc_m", culateService.culateJhbc(lists, "zgf")); | |
| 1699 | - map.put("jhbc_a", culateService.culateJhbc(lists, "wgf")); | |
| 1704 | + map.put("jhbc", culateService.culateJhbc(list_s,"")); | |
| 1705 | + map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf")); | |
| 1706 | + map.put("jhbc_a", culateService.culateJhbc(list_s, "wgf")); | |
| 1700 | 1707 | map.put("sjbc", culateService.culateSjbc(lists,"")); |
| 1701 | 1708 | map.put("sjbc_m", culateService.culateSjbc(lists,"zgf")); |
| 1702 | 1709 | map.put("sjbc_a", culateService.culateSjbc(lists,"wgf")); |
| ... | ... | @@ -2264,11 +2271,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2264 | 2271 | return lMap; |
| 2265 | 2272 | }*/ |
| 2266 | 2273 | |
| 2267 | - public final Map<String, Object> staticTj(List<ScheduleRealInfo> lists){ | |
| 2274 | + public final Map<String, Object> staticTj(List<ScheduleRealInfo> list){ | |
| 2275 | + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | |
| 2276 | + for(int i=0;i<list.size();i++){ | |
| 2277 | + ScheduleRealInfo s=list.get(i); | |
| 2278 | + if(s.getZdsjActual()!=null){ | |
| 2279 | + lists.add(s); | |
| 2280 | + } | |
| 2281 | + } | |
| 2268 | 2282 | Map<String, Object> map = new HashMap<String, Object>(); |
| 2269 | 2283 | map.put("xlName", lists.get(0).getXlName()); |
| 2270 | - double jhyygl=culateService.culateJhgl(lists);//计划营运公里 | |
| 2271 | - double jhjcclc= culateService.culateJhJccgl(lists);//计划进出场公里(计划空驶公里) | |
| 2284 | + double jhyygl=culateService.culateJhgl(list);//计划营运公里 | |
| 2285 | + double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里) | |
| 2272 | 2286 | map.put("jhlc", jhyygl); |
| 2273 | 2287 | map.put("jcclc", jhjcclc); |
| 2274 | 2288 | map.put("jhzlc", Arith.add(jhyygl, jhjcclc)); |
| ... | ... | @@ -2284,23 +2298,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2284 | 2298 | map.put("sjgl",zyygl); |
| 2285 | 2299 | map.put("sjksgl", zksgl); |
| 2286 | 2300 | |
| 2287 | - map.put("ssgl", culateService.culateLbgl(lists)); | |
| 2288 | - map.put("ssgl_lz", culateService.culateCJLC(lists, "路阻")); | |
| 2289 | - map.put("ssgl_dm", culateService.culateCJLC(lists, "吊慢")); | |
| 2290 | - map.put("ssgl_gz", culateService.culateCJLC(lists, "故障")); | |
| 2291 | - map.put("ssgl_jf", culateService.culateCJLC(lists, "纠纷")); | |
| 2292 | - map.put("ssgl_zs", culateService.culateCJLC(lists, "肇事")); | |
| 2293 | - map.put("ssgl_qr", culateService.culateCJLC(lists, "缺人")); | |
| 2294 | - map.put("ssgl_qc", culateService.culateCJLC(lists, "缺车")); | |
| 2295 | - map.put("ssgl_kx", culateService.culateCJLC(lists, "客稀")); | |
| 2296 | - map.put("ssgl_qh", culateService.culateCJLC(lists, "气候")); | |
| 2297 | - map.put("ssgl_yw", culateService.culateCJLC(lists, "援外")); | |
| 2298 | - map.put("ssgl_other", culateService.culateCJLC(lists, "其他")); | |
| 2299 | - map.put("ssbc", culateService.culateLbbc(lists)); | |
| 2301 | + map.put("ssgl", culateService.culateLbgl(list)); | |
| 2302 | + map.put("ssgl_lz", culateService.culateCJLC(list, "路阻")); | |
| 2303 | + map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢")); | |
| 2304 | + map.put("ssgl_gz", culateService.culateCJLC(list, "故障")); | |
| 2305 | + map.put("ssgl_jf", culateService.culateCJLC(list, "纠纷")); | |
| 2306 | + map.put("ssgl_zs", culateService.culateCJLC(list, "肇事")); | |
| 2307 | + map.put("ssgl_qr", culateService.culateCJLC(list, "缺人")); | |
| 2308 | + map.put("ssgl_qc", culateService.culateCJLC(list, "缺车")); | |
| 2309 | + map.put("ssgl_kx", culateService.culateCJLC(list, "客稀")); | |
| 2310 | + map.put("ssgl_qh", culateService.culateCJLC(list, "气候")); | |
| 2311 | + map.put("ssgl_yw", culateService.culateCJLC(list, "援外")); | |
| 2312 | + map.put("ssgl_other", culateService.culateCJLC(list, "其他")); | |
| 2313 | + map.put("ssbc", culateService.culateLbbc(list)); | |
| 2300 | 2314 | map.put("ljgl", ljgl); |
| 2301 | - map.put("jhbc", culateService.culateJhbc(lists,"")); | |
| 2302 | - map.put("jhbc_m", culateService.culateJhbc(lists, "zgf")); | |
| 2303 | - map.put("jhbc_a", culateService.culateJhbc(lists, "wgf")); | |
| 2315 | + map.put("jhbc", culateService.culateJhbc(list,"")); | |
| 2316 | + map.put("jhbc_m", culateService.culateJhbc(list, "zgf")); | |
| 2317 | + map.put("jhbc_a", culateService.culateJhbc(list, "wgf")); | |
| 2304 | 2318 | map.put("sjbc", culateService.culateSjbc(lists,"")); |
| 2305 | 2319 | map.put("sjbc_m", culateService.culateSjbc(lists,"zgf")); |
| 2306 | 2320 | map.put("sjbc_a", culateService.culateSjbc(lists,"wgf")); |
| ... | ... | @@ -2324,6 +2338,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2324 | 2338 | public List<Map<String, Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2, |
| 2325 | 2339 | String xlName, String type) { |
| 2326 | 2340 | List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); |
| 2341 | + List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); | |
| 2327 | 2342 | List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); |
| 2328 | 2343 | line =line.trim(); |
| 2329 | 2344 | if(line.equals("")){ |
| ... | ... | @@ -2333,6 +2348,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2333 | 2348 | //查询单条线路 |
| 2334 | 2349 | list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2); |
| 2335 | 2350 | } |
| 2351 | + for (int i = 0; i < list.size(); i++) { | |
| 2352 | + ScheduleRealInfo s=list.get(i); | |
| 2353 | + if(s.getZdsjActual()!=null){ | |
| 2354 | + list_s.add(s); | |
| 2355 | + } | |
| 2356 | + } | |
| 2336 | 2357 | List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>(); |
| 2337 | 2358 | for (int i = 0; i < list.size(); i++) { |
| 2338 | 2359 | if(i<list.size()-1){ |
| ... | ... | @@ -2366,12 +2387,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2366 | 2387 | map.put("jcclc", jhjcclc); |
| 2367 | 2388 | map.put("jhzlc", Arith.add(jhyygl, jhjcclc)); |
| 2368 | 2389 | |
| 2369 | - double ljgl= culateService.culateLjgl(list); | |
| 2370 | - double sjyygl= culateService.culateSjgl(list); | |
| 2390 | + double ljgl= culateService.culateLjgl(list_s); | |
| 2391 | + double sjyygl= culateService.culateSjgl(list_s); | |
| 2371 | 2392 | double zyygl= Arith.add(sjyygl,ljgl); |
| 2372 | 2393 | |
| 2373 | - double sjjccgl=culateService.culateJccgl(list); | |
| 2374 | - double sjksgl=culateService.culateKsgl(list); | |
| 2394 | + double sjjccgl=culateService.culateJccgl(list_s); | |
| 2395 | + double sjksgl=culateService.culateKsgl(list_s); | |
| 2375 | 2396 | double zksgl=Arith.add(sjjccgl, sjksgl); |
| 2376 | 2397 | map.put("sjzgl", Arith.add(zyygl, zksgl)); |
| 2377 | 2398 | map.put("sjgl",zyygl); |
| ... | ... | @@ -2393,15 +2414,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2393 | 2414 | map.put("jhbc", culateService.culateJhbc(list,"")); |
| 2394 | 2415 | map.put("jhbc_m", culateService.culateJhbc(list, "zgf")); |
| 2395 | 2416 | map.put("jhbc_a", culateService.culateJhbc(list, "wgf")); |
| 2396 | - map.put("sjbc", culateService.culateSjbc(list,"")); | |
| 2397 | - map.put("sjbc_m", culateService.culateSjbc(list,"zgf")); | |
| 2398 | - map.put("sjbc_a", culateService.culateSjbc(list,"wgf")); | |
| 2399 | - map.put("ljbc", culateService.culateLjbc(list,"")); | |
| 2400 | - map.put("ljbc_m", culateService.culateLjbc(list,"zgf")); | |
| 2401 | - map.put("ljbc_a", culateService.culateLjbc(list,"wgf")); | |
| 2402 | - map.put("fzbc", culateService.culateFzbc(list, "")); | |
| 2403 | - map.put("fzbc_m", culateService.culateFzbc(list, "zgf")); | |
| 2404 | - map.put("fzbc_a", culateService.culateFzbc(list, "wgf")); | |
| 2417 | + map.put("sjbc", culateService.culateSjbc(list_s,"")); | |
| 2418 | + map.put("sjbc_m", culateService.culateSjbc(list_s,"zgf")); | |
| 2419 | + map.put("sjbc_a", culateService.culateSjbc(list_s,"wgf")); | |
| 2420 | + map.put("ljbc", culateService.culateLjbc(list_s,"")); | |
| 2421 | + map.put("ljbc_m", culateService.culateLjbc(list_s,"zgf")); | |
| 2422 | + map.put("ljbc_a", culateService.culateLjbc(list_s,"wgf")); | |
| 2423 | + map.put("fzbc", culateService.culateFzbc(list_s, "")); | |
| 2424 | + map.put("fzbc_m", culateService.culateFzbc(list_s, "zgf")); | |
| 2425 | + map.put("fzbc_a", culateService.culateFzbc(list_s, "wgf")); | |
| 2405 | 2426 | map.put("dtbc", 0); |
| 2406 | 2427 | map.put("dtbc_m", 0); |
| 2407 | 2428 | map.put("dtbc_a", 0); | ... | ... |
src/main/resources/static/pages/forms/mould/jobSummary.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/waybillday.xls
No preview for this file type
src/main/resources/static/pages/mforms/waybilldays/waybillday.html
| ... | ... | @@ -59,10 +59,10 @@ |
| 59 | 59 | <th>空驶公里</th> |
| 60 | 60 | <th>加注量</th> |
| 61 | 61 | <th>机油</th> |
| 62 | - <th>油耗</th> | |
| 62 | + <th>损耗</th> | |
| 63 | 63 | <th>驾驶员</th> |
| 64 | 64 | <th>里程</th> |
| 65 | - <th>用油</th> | |
| 65 | + <th>油耗</th> | |
| 66 | 66 | </tr> |
| 67 | 67 | </thead> |
| 68 | 68 | <tbody> |
| ... | ... | @@ -86,27 +86,38 @@ |
| 86 | 86 | format : 'YYYY-MM-DD', |
| 87 | 87 | locale : 'zh-cn' |
| 88 | 88 | }); |
| 89 | - | |
| 89 | + var d = new Date(); | |
| 90 | + var year = d.getFullYear(); | |
| 91 | + var month = d.getMonth() + 1; | |
| 92 | + var day = d.getDate(); | |
| 93 | + if(month < 10) | |
| 94 | + month = "0" + month; | |
| 95 | + if(day < 10) | |
| 96 | + day = "0" + day; | |
| 97 | + $("#date").val(year + "-" + month + "-" + day); | |
| 98 | + var fage=false; | |
| 90 | 99 | var obj = []; |
| 91 | - $.get('/user/companyData', function(result){ | |
| 92 | - obj = result; | |
| 93 | - var options = ''; | |
| 94 | - for(var i = 0; i < obj.length; i++){ | |
| 95 | - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 96 | - } | |
| 97 | - | |
| 98 | - if(obj.length ==0){ | |
| 99 | - $("#gsdmDiv_waybillday").css('display','none'); | |
| 100 | - $('#fgsdmDiv_waybillday').css('display','none'); | |
| 101 | - }else if(obj.length ==1){ | |
| 102 | - $("#gsdmDiv_waybillday").css('display','none'); | |
| 103 | - if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 104 | - $('#fgsdmDiv_waybillday').css('display','none'); | |
| 105 | - } | |
| 106 | - $('#gsdmWaybillday').html(options); | |
| 107 | - updateCompany(); | |
| 108 | - }); | |
| 109 | - | |
| 100 | + var xlList; | |
| 101 | + $.get('/report/lineList',function(result){ | |
| 102 | + xlList=result; | |
| 103 | + $.get('/user/companyData', function(result){ | |
| 104 | + obj = result; | |
| 105 | + var options = ''; | |
| 106 | + for(var i = 0; i < obj.length; i++){ | |
| 107 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 108 | + } | |
| 109 | + | |
| 110 | + if(obj.length ==0){ | |
| 111 | + $("#gsdmDiv_waybillday").css('display','none'); | |
| 112 | + }else if(obj.length ==1){ | |
| 113 | + $("#gsdmDiv_waybillday").css('display','none'); | |
| 114 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 115 | + $('#fgsdmDiv_waybillday').css('display','none'); | |
| 116 | + } | |
| 117 | + $('#gsdmWaybillday').html(options); | |
| 118 | + updateCompany(); | |
| 119 | + }); | |
| 120 | + }) | |
| 110 | 121 | $("#gsdmWaybillday").on("change",updateCompany); |
| 111 | 122 | function updateCompany(){ |
| 112 | 123 | var company = $('#gsdmWaybillday').val(); |
| ... | ... | @@ -120,18 +131,32 @@ |
| 120 | 131 | } |
| 121 | 132 | } |
| 122 | 133 | $('#fgsdmWaybillday').html(options); |
| 134 | + initXl(); | |
| 123 | 135 | } |
| 124 | - | |
| 125 | - | |
| 126 | - $.get('/basic/lineCode2Name',function(result){ | |
| 136 | + $("#fgsdmWaybillday").on("change",initXl); | |
| 137 | + function initXl(){ | |
| 127 | 138 | var data=[]; |
| 128 | - | |
| 129 | - for(var code in result){ | |
| 130 | - data.push({id: code, text: result[code]}); | |
| 139 | + if(fage){ | |
| 140 | + $("#line").select2("destroy").html(''); | |
| 141 | + } | |
| 142 | + var fgs=$('#fgsdmWaybillday').val(); | |
| 143 | + var gs=$('#gsdmWaybillday').val(); | |
| 144 | + for(var i=0;i<xlList.length;i++){ | |
| 145 | + if(gs!=""){ | |
| 146 | + if(fgs!=""){ | |
| 147 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | |
| 148 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 149 | + } | |
| 150 | + }else{ | |
| 151 | + if(xlList[i]["gsbm"]==gs){ | |
| 152 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 153 | + } | |
| 154 | + } | |
| 155 | + } | |
| 131 | 156 | } |
| 132 | 157 | initPinYinSelect2('#line',data,''); |
| 133 | - | |
| 134 | - }) | |
| 158 | + fage=true; | |
| 159 | + } | |
| 135 | 160 | var line; |
| 136 | 161 | var date; |
| 137 | 162 | var gsdmWaybillday; |
| ... | ... | @@ -144,7 +169,7 @@ |
| 144 | 169 | if(date=="" || date ==null){ |
| 145 | 170 | layer.msg('请选择日期.'); |
| 146 | 171 | }else{ |
| 147 | - $post('/mcy_forms/waybillday',{gsdmWaybillday:gsdmWaybillday,fgsdmWaybillday:fgsdmWaybillday, line:line,date:date,type:'query'},function(result){ | |
| 172 | + $post('/mcy_forms/waybillday',{line:line,date:date,type:'query'},function(result){ | |
| 148 | 173 | $.each(result, function(i, obj) { |
| 149 | 174 | obj.requestType = reqCodeMap[obj.requestType]; |
| 150 | 175 | }); |
| ... | ... | @@ -162,7 +187,7 @@ |
| 162 | 187 | gsdmWaybillday=$("#gsdmWaybillday").val(); |
| 163 | 188 | fgsdmWaybillday = $("#fgsdmWaybillday").val(); |
| 164 | 189 | $post('/mcy_export/waybilldayExport',{gsdmWaybillday:gsdmWaybillday,fgsdmWaybillday:fgsdmWaybillday,line:line,date:date,type:'export'},function(result){ |
| 165 | - window.open("/downloadFile/download?fileName=行车路单日报表"+moment(date).format("YYYYMMDD")); | |
| 190 | + window.open("/downloadFile/download?fileName=行车路单日报表"); | |
| 166 | 191 | }); |
| 167 | 192 | }); |
| 168 | 193 | }); |
| ... | ... | @@ -170,11 +195,11 @@ |
| 170 | 195 | <script type="text/html" id="waybillday"> |
| 171 | 196 | {{each list as obj i}} |
| 172 | 197 | <tr> |
| 173 | - <td>{{obj.carPlate}}</td> | |
| 198 | + <td>{{obj.nbbm}}</td> | |
| 174 | 199 | <td>{{obj.jzl1}} </td> |
| 175 | 200 | <td>{{obj.jzl}}</td> |
| 176 | 201 | <td> </td> |
| 177 | - <td>{{obj.yh}}</td> | |
| 202 | + <td>{{obj.sh}}</td> | |
| 178 | 203 | <td>{{obj.jName}}</td> |
| 179 | 204 | <td>{{obj.zlc}}</td> |
| 180 | 205 | <td>{{obj.yh}}</td> | ... | ... |