Commit f819254fa42a707a5db2dcc37a861eb7562a85c5
1 parent
af8425bb
25-04-01工单:纯电车日报表加字段,班次日报表加字段,油量导入表加导出,行车路单重点标记子任务与临加班次,新增氢气车日报表。
Showing
16 changed files
with
634 additions
and
33 deletions
src/main/java/com/bsth/controller/RefuelController.java
| @@ -29,6 +29,11 @@ public class RefuelController extends BaseController<Refuel, Long> { | @@ -29,6 +29,11 @@ public class RefuelController extends BaseController<Refuel, Long> { | ||
| 29 | public List<Refuel> query(@RequestParam Map<String, Object> map){ | 29 | public List<Refuel> query(@RequestParam Map<String, Object> map){ |
| 30 | return refuelService.query(map); | 30 | return refuelService.query(map); |
| 31 | } | 31 | } |
| 32 | + | ||
| 33 | + @RequestMapping(value = "/exportRefuel", method = RequestMethod.GET) | ||
| 34 | + public List<Map<String, Object>> exportRefuel(@RequestParam Map<String, Object> map){ | ||
| 35 | + return refuelService.exportRefuel(map); | ||
| 36 | + } | ||
| 32 | 37 | ||
| 33 | @RequestMapping(value = "/queryDaily", method = RequestMethod.GET) | 38 | @RequestMapping(value = "/queryDaily", method = RequestMethod.GET) |
| 34 | public List<Map<String, Object>> queryDaily(@RequestParam Map<String, Object> map){ | 39 | public List<Map<String, Object>> queryDaily(@RequestParam Map<String, Object> map){ |
| @@ -55,6 +60,16 @@ public class RefuelController extends BaseController<Refuel, Long> { | @@ -55,6 +60,16 @@ public class RefuelController extends BaseController<Refuel, Long> { | ||
| 55 | return refuelService.exportQueryDc(map); | 60 | return refuelService.exportQueryDc(map); |
| 56 | } | 61 | } |
| 57 | 62 | ||
| 63 | + @RequestMapping(value = "/queryQc", method = RequestMethod.GET) | ||
| 64 | + public List<Map<String, Object>> queryQc(@RequestParam Map<String, Object> map){ | ||
| 65 | + return refuelService.queryQc(map); | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + @RequestMapping(value = "/exportQueryQc", method = RequestMethod.GET) | ||
| 69 | + public List<Map<String, Object>> exportQueryQc(@RequestParam Map<String, Object> map){ | ||
| 70 | + return refuelService.exportQueryQc(map); | ||
| 71 | + } | ||
| 72 | + | ||
| 58 | @RequestMapping(value = "/uploadFile",method = RequestMethod.POST) | 73 | @RequestMapping(value = "/uploadFile",method = RequestMethod.POST) |
| 59 | public String uploadFile(MultipartFile file) throws Exception{ | 74 | public String uploadFile(MultipartFile file) throws Exception{ |
| 60 | File newFile = new File( | 75 | File newFile = new File( |
src/main/java/com/bsth/controller/forms/ExportController.java
| @@ -759,22 +759,30 @@ public class ExportController { | @@ -759,22 +759,30 @@ public class ExportController { | ||
| 759 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | 759 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 760 | double zgl=0.0; | 760 | double zgl=0.0; |
| 761 | double ks=0.0; | 761 | double ks=0.0; |
| 762 | + double lblc=0.0, ljlc=0.0; | ||
| 762 | double yh=0.0; | 763 | double yh=0.0; |
| 763 | - int bc=0; | 764 | + int bc=0, carDay=0; |
| 764 | Map<String, Object> m ; | 765 | Map<String, Object> m ; |
| 765 | for (Daily d : allline) { | 766 | for (Daily d : allline) { |
| 766 | m = new HashMap<String, Object>(); | 767 | m = new HashMap<String, Object>(); |
| 767 | m.put("zbh", d.getZbh()); | 768 | m.put("zbh", d.getZbh()); |
| 769 | + m.put("lp", d.getLp()); | ||
| 768 | m.put("jgh",d.getJgh()); | 770 | m.put("jgh",d.getJgh()); |
| 769 | m.put("jName", d.getjName()); | 771 | m.put("jName", d.getjName()); |
| 770 | m.put("zlc", d.getZlc()); | 772 | m.put("zlc", d.getZlc()); |
| 771 | m.put("jzl1", d.getJzl1()); | 773 | m.put("jzl1", d.getJzl1()); |
| 774 | + m.put("lblc", d.getLblc()); | ||
| 775 | + m.put("ljlc", d.getLjlc()); | ||
| 772 | m.put("yh", d.getYh()); | 776 | m.put("yh", d.getYh()); |
| 773 | m.put("bc", d.getBc()); | 777 | m.put("bc", d.getBc()); |
| 778 | + m.put("carDay", d.getCarDay()); | ||
| 774 | zgl =Arith.add(zgl, d.getZlc()); | 779 | zgl =Arith.add(zgl, d.getZlc()); |
| 775 | ks =Arith.add(ks, d.getJzl1()); | 780 | ks =Arith.add(ks, d.getJzl1()); |
| 781 | + lblc =Arith.add(lblc, d.getLblc()); | ||
| 782 | + ljlc =Arith.add(ljlc, d.getLjlc()); | ||
| 776 | yh =Arith.add(yh, d.getYh()); | 783 | yh =Arith.add(yh, d.getYh()); |
| 777 | bc +=Integer.parseInt(d.getBc()); | 784 | bc +=Integer.parseInt(d.getBc()); |
| 785 | + carDay +=d.getCarDay(); | ||
| 778 | 786 | ||
| 779 | resList.add(m); | 787 | resList.add(m); |
| 780 | } | 788 | } |
| @@ -782,8 +790,11 @@ public class ExportController { | @@ -782,8 +790,11 @@ public class ExportController { | ||
| 782 | m=new HashMap<String,Object>(); | 790 | m=new HashMap<String,Object>(); |
| 783 | m.put("total_zgl", zgl); | 791 | m.put("total_zgl", zgl); |
| 784 | m.put("total_ks", ks); | 792 | m.put("total_ks", ks); |
| 793 | + m.put("total_lblc", lblc); | ||
| 794 | + m.put("total_ljlc", ljlc); | ||
| 785 | m.put("total_yh", yh); | 795 | m.put("total_yh", yh); |
| 786 | m.put("total_bc", bc); | 796 | m.put("total_bc", bc); |
| 797 | + m.put("total_carDay", carDay); | ||
| 787 | 798 | ||
| 788 | m.put("line", BasicData.lineCode2NameMap.get(map.get("line").toString())); | 799 | m.put("line", BasicData.lineCode2NameMap.get(map.get("line").toString())); |
| 789 | m.put("date", map.get("date").toString()); | 800 | m.put("date", map.get("date").toString()); |
src/main/java/com/bsth/entity/mcy_forms/Daily.java
| @@ -25,6 +25,14 @@ public class Daily { | @@ -25,6 +25,14 @@ public class Daily { | ||
| 25 | private String yh;//油耗 | 25 | private String yh;//油耗 |
| 26 | 26 | ||
| 27 | private String bc;//班次 | 27 | private String bc;//班次 |
| 28 | + | ||
| 29 | + private String lp;//路牌 | ||
| 30 | + | ||
| 31 | + private String lblc;//损失公里(少驶、烂班) | ||
| 32 | + | ||
| 33 | + private String ljlc;//加车公里(临加) | ||
| 34 | + | ||
| 35 | + private int carDay;//车日 | ||
| 28 | 36 | ||
| 29 | public String getZbh() { | 37 | public String getZbh() { |
| 30 | return zbh; | 38 | return zbh; |
| @@ -81,9 +89,37 @@ public class Daily { | @@ -81,9 +89,37 @@ public class Daily { | ||
| 81 | public void setBc(String bc) { | 89 | public void setBc(String bc) { |
| 82 | this.bc = bc; | 90 | this.bc = bc; |
| 83 | } | 91 | } |
| 84 | - | ||
| 85 | - | ||
| 86 | - | ||
| 87 | 92 | ||
| 93 | + public String getLp() { | ||
| 94 | + return lp; | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + public void setLp(String lp) { | ||
| 98 | + this.lp = lp; | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + public String getLblc() { | ||
| 102 | + return lblc; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + public void setLblc(String lblc) { | ||
| 106 | + this.lblc = lblc; | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + public String getLjlc() { | ||
| 110 | + return ljlc; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + public void setLjlc(String ljlc) { | ||
| 114 | + this.ljlc = ljlc; | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + public int getCarDay() { | ||
| 118 | + return carDay; | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + public void setCarDay(int carDay) { | ||
| 122 | + this.carDay = carDay; | ||
| 123 | + } | ||
| 88 | 124 | ||
| 89 | } | 125 | } |
src/main/java/com/bsth/repository/RefuelRepository.java
| @@ -64,4 +64,7 @@ public interface RefuelRepository extends BaseRepository<Refuel, Long> { | @@ -64,4 +64,7 @@ public interface RefuelRepository extends BaseRepository<Refuel, Long> { | ||
| 64 | @Query(value="select s from Cars s where s.sfdc=?1") | 64 | @Query(value="select s from Cars s where s.sfdc=?1") |
| 65 | List<Cars> findCarsBySfdc(Boolean sfdc); | 65 | List<Cars> findCarsBySfdc(Boolean sfdc); |
| 66 | 66 | ||
| 67 | + @Query(value="select s from Cars s where s.hydrogen=?1") | ||
| 68 | + List<Cars> findCarsByHydrogen(Boolean hydrogen); | ||
| 69 | + | ||
| 67 | } | 70 | } |
src/main/java/com/bsth/service/RefuelService.java
| @@ -13,15 +13,21 @@ public interface RefuelService extends BaseService<Refuel, Long> { | @@ -13,15 +13,21 @@ public interface RefuelService extends BaseService<Refuel, Long> { | ||
| 13 | 13 | ||
| 14 | List<Refuel> query(Map<String, Object> map); | 14 | List<Refuel> query(Map<String, Object> map); |
| 15 | 15 | ||
| 16 | + List<Map<String, Object>> exportRefuel(Map<String, Object> map); | ||
| 17 | + | ||
| 16 | List<Map<String, Object>> queryDaily(Map<String, Object> map); | 18 | List<Map<String, Object>> queryDaily(Map<String, Object> map); |
| 17 | 19 | ||
| 18 | List<Map<String, Object>> queryYc(Map<String, Object> map); | 20 | List<Map<String, Object>> queryYc(Map<String, Object> map); |
| 19 | 21 | ||
| 20 | - List<Map<String, Object>> queryDc(Map<String, Object> map); | ||
| 21 | - | ||
| 22 | List<Map<String, Object>> exportQueryYc(Map<String, Object> map); | 22 | List<Map<String, Object>> exportQueryYc(Map<String, Object> map); |
| 23 | 23 | ||
| 24 | + List<Map<String, Object>> queryDc(Map<String, Object> map); | ||
| 25 | + | ||
| 24 | List<Map<String, Object>> exportQueryDc(Map<String, Object> map); | 26 | List<Map<String, Object>> exportQueryDc(Map<String, Object> map); |
| 25 | 27 | ||
| 28 | + List<Map<String, Object>> queryQc(Map<String, Object> map); | ||
| 29 | + | ||
| 30 | + List<Map<String, Object>> exportQueryQc(Map<String, Object> map); | ||
| 31 | + | ||
| 26 | public String importExcel(File file); | 32 | public String importExcel(File file); |
| 27 | } | 33 | } |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| @@ -3003,7 +3003,7 @@ public class FormsServiceImpl implements FormsService { | @@ -3003,7 +3003,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 3003 | } | 3003 | } |
| 3004 | 3004 | ||
| 3005 | List<String> objList = new ArrayList<String>(); | 3005 | List<String> objList = new ArrayList<String>(); |
| 3006 | - String sql="select r.schedule_date_str, " | 3006 | + String sql="select r.schedule_date_str,r.lp_name, " |
| 3007 | + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm " | 3007 | + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm " |
| 3008 | + " from bsth_c_s_sp_info_real r where " | 3008 | + " from bsth_c_s_sp_info_real r where " |
| 3009 | + " r.schedule_date_str = ? "; | 3009 | + " r.schedule_date_str = ? "; |
| @@ -3011,16 +3011,17 @@ public class FormsServiceImpl implements FormsService { | @@ -3011,16 +3011,17 @@ public class FormsServiceImpl implements FormsService { | ||
| 3011 | if(!xlbm.equals("")){ | 3011 | if(!xlbm.equals("")){ |
| 3012 | sql += " and r.xl_bm = ? "; | 3012 | sql += " and r.xl_bm = ? "; |
| 3013 | objList.add(xlbm); | 3013 | objList.add(xlbm); |
| 3014 | + } else { | ||
| 3015 | + if(!gsbm.equals("")){ | ||
| 3016 | + sql += " and r.gs_bm = ? "; | ||
| 3017 | + objList.add(gsbm); | ||
| 3018 | + } | ||
| 3019 | + if(!fgsbm.equals("")){ | ||
| 3020 | + sql += " and r.fgs_bm = ? "; | ||
| 3021 | + objList.add(fgsbm); | ||
| 3022 | + } | ||
| 3014 | } | 3023 | } |
| 3015 | - if(!gsbm.equals("")){ | ||
| 3016 | - sql += " and r.gs_bm = ? "; | ||
| 3017 | - objList.add(gsbm); | ||
| 3018 | - } | ||
| 3019 | - if(!fgsbm.equals("")){ | ||
| 3020 | - sql += " and r.fgs_bm = ? "; | ||
| 3021 | - objList.add(fgsbm); | ||
| 3022 | - } | ||
| 3023 | - sql += " group by r.schedule_date_str," | 3024 | + sql += " group by r.schedule_date_str,r.lp_name," |
| 3024 | + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | 3025 | + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; |
| 3025 | 3026 | ||
| 3026 | List<Daily> list = jdbcTemplate.query(sql, objList.toArray(), new RowMapper<Daily>() { | 3027 | List<Daily> list = jdbcTemplate.query(sql, objList.toArray(), new RowMapper<Daily>() { |
| @@ -3028,9 +3029,9 @@ public class FormsServiceImpl implements FormsService { | @@ -3028,9 +3029,9 @@ public class FormsServiceImpl implements FormsService { | ||
| 3028 | public Daily mapRow(ResultSet arg0, int arg1) throws SQLException { | 3029 | public Daily mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 3029 | Daily daily = new Daily(); | 3030 | Daily daily = new Daily(); |
| 3030 | daily.setRq(arg0.getString("schedule_date_str")); | 3031 | daily.setRq(arg0.getString("schedule_date_str")); |
| 3032 | + daily.setLp(arg0.getString("lp_name")); | ||
| 3031 | daily.setZbh(arg0.getString("cl_zbh")); | 3033 | daily.setZbh(arg0.getString("cl_zbh")); |
| 3032 | daily.setJgh(arg0.getString("j_gh")); | 3034 | daily.setJgh(arg0.getString("j_gh")); |
| 3033 | -// daily.setjName(arg0.getString("j_name")); | ||
| 3034 | return daily; | 3035 | return daily; |
| 3035 | } | 3036 | } |
| 3036 | }); | 3037 | }); |
| @@ -3081,11 +3082,15 @@ public class FormsServiceImpl implements FormsService { | @@ -3081,11 +3082,15 @@ public class FormsServiceImpl implements FormsService { | ||
| 3081 | double zksgl=Arith.add(ksgl, jccgl); | 3082 | double zksgl=Arith.add(ksgl, jccgl); |
| 3082 | double ljgl=culateMileageService.culateLjgl(sList); | 3083 | double ljgl=culateMileageService.culateLjgl(sList); |
| 3083 | double sjgl=culateMileageService.culateSjgl(sList); | 3084 | double sjgl=culateMileageService.culateSjgl(sList); |
| 3085 | + double lbgl=culateMileageService.culateLbgl(sList); | ||
| 3084 | double zyygl=Arith.add(ljgl, sjgl); | 3086 | double zyygl=Arith.add(ljgl, sjgl); |
| 3085 | 3087 | ||
| 3086 | d.setJzl1(String.valueOf(zksgl));//空驶公里 | 3088 | d.setJzl1(String.valueOf(zksgl));//空驶公里 |
| 3087 | - d.setZlc(String.valueOf(Arith.add(zksgl, zyygl))); | 3089 | + d.setZlc(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 |
| 3088 | d.setBc(String.valueOf(culateMileageService.culateSjbc(sList, "")+culateMileageService.culateLjbc(sList, ""))); | 3090 | d.setBc(String.valueOf(culateMileageService.culateSjbc(sList, "")+culateMileageService.culateLjbc(sList, ""))); |
| 3091 | + d.setLblc(String.valueOf(lbgl)); // 损失公里 | ||
| 3092 | + d.setLjlc(String.valueOf(ljgl)); // 加车公里 | ||
| 3093 | + d.setCarDay(1); // 车日 | ||
| 3089 | } | 3094 | } |
| 3090 | return list; | 3095 | return list; |
| 3091 | } | 3096 | } |
src/main/java/com/bsth/service/impl/RefuelServiceImpl.java
| @@ -132,6 +132,50 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -132,6 +132,50 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | @Override | 134 | @Override |
| 135 | + public List<Map<String, Object>> exportRefuel(Map<String, Object> map) { | ||
| 136 | + // TODO Auto-generated method stub | ||
| 137 | + | ||
| 138 | + List<Refuel> refuelList = this.query(map); | ||
| 139 | + | ||
| 140 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 141 | + for(int i = 0; i < refuelList.size(); i++){ | ||
| 142 | + Refuel r = refuelList.get(i); | ||
| 143 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 144 | + m.put("no", i + 1); | ||
| 145 | + m.put("dateStr", r.getDateStr()); | ||
| 146 | + m.put("lineName", r.getLineName()); | ||
| 147 | + m.put("car", r.getCar()); | ||
| 148 | + m.put("driver", r.getDriver()); | ||
| 149 | + m.put("outOil", r.getOutOil()!=null?r.getOutOil():""); | ||
| 150 | + m.put("inOil", r.getInOil()!=null?r.getInOil():""); | ||
| 151 | + m.put("inStation0", r.getInStation0()!=null?r.getInStation0():""); | ||
| 152 | + m.put("inStation5", r.getInStation5()!=null?r.getInStation5():""); | ||
| 153 | + m.put("oilCard0", r.getOilCard0()!=null?r.getOilCard0():""); | ||
| 154 | + m.put("oilCard10", r.getOilCard10()!=null?r.getOilCard10():""); | ||
| 155 | + m.put("eastStation0", r.getEastStation0()!=null?r.getEastStation0():""); | ||
| 156 | + m.put("eastStation10", r.getEastStation10()!=null?r.getEastStation10():""); | ||
| 157 | + m.put("outStation0", r.getOutStation0()!=null?r.getOutStation0():""); | ||
| 158 | + m.put("outStation10", r.getOutStation10()!=null?r.getOutStation10():""); | ||
| 159 | + resList.add(m); | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + String date = map.get("date").toString(); | ||
| 163 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 164 | + Map<String,Object> m = new HashMap<String, Object>(); | ||
| 165 | + ReportUtils ee = new ReportUtils(); | ||
| 166 | + try { | ||
| 167 | + listI.add(resList.iterator()); | ||
| 168 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | ||
| 169 | + ee.excelReplace(listI, new Object[] { m }, path+"mould/refuel.xls", | ||
| 170 | + path+"export/" + date + "-油量导入.xls"); | ||
| 171 | + } catch (Exception e) { | ||
| 172 | + // TODO: handle exception | ||
| 173 | + e.printStackTrace(); | ||
| 174 | + } | ||
| 175 | + return resList; | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + @Override | ||
| 135 | public List<Map<String, Object>> queryDaily(Map<String, Object> map) { | 179 | public List<Map<String, Object>> queryDaily(Map<String, Object> map) { |
| 136 | // TODO Auto-generated method stub | 180 | // TODO Auto-generated method stub |
| 137 | DecimalFormat df = new DecimalFormat("0.##"); | 181 | DecimalFormat df = new DecimalFormat("0.##"); |
| @@ -737,7 +781,7 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -737,7 +781,7 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 737 | for(ScheduleRealInfo s : scheList){ | 781 | for(ScheduleRealInfo s : scheList){ |
| 738 | if(s.getClZbh() != null && nbbms.contains(s.getClZbh())){ | 782 | if(s.getClZbh() != null && nbbms.contains(s.getClZbh())){ |
| 739 | if(s.getClZbh().length() > 0 && s.getjGh() != null){ | 783 | if(s.getClZbh().length() > 0 && s.getjGh() != null){ |
| 740 | - String key = s.getClZbh() + "/" + s.getjGh(); | 784 | + String key = s.getClZbh() + "/" + s.getLpName() + "/" + s.getjGh(); |
| 741 | if(!(sMap.containsKey(key))){ | 785 | if(!(sMap.containsKey(key))){ |
| 742 | sMap.put(key, new ArrayList<ScheduleRealInfo>()); | 786 | sMap.put(key, new ArrayList<ScheduleRealInfo>()); |
| 743 | sKeyList.add(key); | 787 | sKeyList.add(key); |
| @@ -815,7 +859,8 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -815,7 +859,8 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 815 | m.put("date", scheList.get(0).getScheduleDateStr()); | 859 | m.put("date", scheList.get(0).getScheduleDateStr()); |
| 816 | m.put("line", list2.get(0).getXlName()); | 860 | m.put("line", list2.get(0).getXlName()); |
| 817 | m.put("car", split[0]); | 861 | m.put("car", split[0]); |
| 818 | - m.put("driver", split[1]); | 862 | + m.put("lp", split[1]); |
| 863 | + m.put("driver", split[2]); | ||
| 819 | m.put("out", ""); | 864 | m.put("out", ""); |
| 820 | m.put("in", ""); | 865 | m.put("in", ""); |
| 821 | m.put("jdl", ""); | 866 | m.put("jdl", ""); |
| @@ -837,6 +882,7 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -837,6 +882,7 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 837 | lastMap.put("date", "合计"); | 882 | lastMap.put("date", "合计"); |
| 838 | lastMap.put("line", ""); | 883 | lastMap.put("line", ""); |
| 839 | lastMap.put("car", ""); | 884 | lastMap.put("car", ""); |
| 885 | + lastMap.put("lp", ""); | ||
| 840 | lastMap.put("driver", ""); | 886 | lastMap.put("driver", ""); |
| 841 | lastMap.put("out", ""); | 887 | lastMap.put("out", ""); |
| 842 | lastMap.put("in", ""); | 888 | lastMap.put("in", ""); |
| @@ -881,6 +927,189 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -881,6 +927,189 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 881 | } | 927 | } |
| 882 | 928 | ||
| 883 | @Override | 929 | @Override |
| 930 | + public List<Map<String, Object>> queryQc(Map<String, Object> map) { | ||
| 931 | + // TODO Auto-generated method stub | ||
| 932 | + DecimalFormat df = new DecimalFormat("0.##"); | ||
| 933 | + | ||
| 934 | + String date = "", car = "%%", xlbm = ""; | ||
| 935 | + if(map.get("date") != null){ | ||
| 936 | + date = map.get("date").toString(); | ||
| 937 | + } | ||
| 938 | + if(map.get("car") != null){ | ||
| 939 | + car = "%" + map.get("car").toString() + "%"; | ||
| 940 | + } | ||
| 941 | + if(map.get("line") != null){ | ||
| 942 | + xlbm = map.get("line").toString(); | ||
| 943 | + } | ||
| 944 | + | ||
| 945 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 946 | + Map<String, Object> lastMap = new HashMap<String, Object>(); | ||
| 947 | + String realMileage_z = "0", ksMileage_z = "0", ssMileage_z = "0", | ||
| 948 | + jhbc_z = "0", sjbc_z = "0", bc_z = "0", yybc_z = "0", cr_z = "0"; | ||
| 949 | + | ||
| 950 | + List<String> sKeyList = new ArrayList<String>(); | ||
| 951 | + Map<String, List<ScheduleRealInfo>> sMap = new HashMap<String, List<ScheduleRealInfo>>(); | ||
| 952 | + List<ScheduleRealInfo> scheList = new ArrayList<ScheduleRealInfo>(); | ||
| 953 | + if(xlbm.length() > 0){ | ||
| 954 | + String[] split = xlbm.split(","); | ||
| 955 | + for(String s : split){ | ||
| 956 | + scheList.addAll(repository.scheduleByDateAndLine(date, car, s)); | ||
| 957 | + } | ||
| 958 | + } else { | ||
| 959 | + scheList = repository.scheduleByDateAndCar(date, car); | ||
| 960 | + } | ||
| 961 | + List<Cars> findCarsByHydrogen = repository.findCarsByHydrogen(true); | ||
| 962 | + | ||
| 963 | + Set<String> nbbms = new HashSet<String>(); | ||
| 964 | + for(Cars c : findCarsByHydrogen){ //所有氢能源车 | ||
| 965 | + nbbms.add(c.getInsideCode()); | ||
| 966 | + } | ||
| 967 | + | ||
| 968 | + for(ScheduleRealInfo s : scheList){ | ||
| 969 | + if(s.getClZbh() != null && nbbms.contains(s.getClZbh())){ | ||
| 970 | + if(s.getClZbh().length() > 0 && s.getjGh() != null){ | ||
| 971 | + String key = s.getClZbh() + "/" + s.getLpName() + "/" + s.getjGh(); | ||
| 972 | + if(!(sMap.containsKey(key))){ | ||
| 973 | + sMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 974 | + sKeyList.add(key); | ||
| 975 | + } | ||
| 976 | + sMap.get(key).add(s); | ||
| 977 | + } | ||
| 978 | + } | ||
| 979 | + } | ||
| 980 | + | ||
| 981 | + for(String key : sKeyList){ | ||
| 982 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 983 | + List<ScheduleRealInfo> list2 = sMap.get(key); | ||
| 984 | + String[] split = key.split("/"); | ||
| 985 | + | ||
| 986 | + String realMileage = "", ksMileage = "", ssMileage = "", | ||
| 987 | + bc = "", jhbc = "", sjbc = "", ljbc = "", cr = ""; | ||
| 988 | + String remarks = ""; | ||
| 989 | + | ||
| 990 | + Double sjgl = culateMileageService.culateSjgl(list2); | ||
| 991 | + Double ksgl = culateMileageService.culateKsgl(list2); | ||
| 992 | + Double jccgl = culateMileageService.culateJccgl(list2); | ||
| 993 | + Double ljgl = culateMileageService.culateLjgl(list2); | ||
| 994 | + | ||
| 995 | + realMileage = add(add(sjgl, ksgl), add(jccgl, ljgl)); | ||
| 996 | + ksMileage = add(ksgl, jccgl); | ||
| 997 | + ssMileage = "" + culateMileageService.culateLbgl(list2); | ||
| 998 | + jhbc = "" + culateMileageService.culateJhbc(list2, ""); | ||
| 999 | + sjbc = "" + culateMileageService.culateSjbc(list2, ""); | ||
| 1000 | + ljbc = "" + culateMileageService.culateLjbc(list2, ""); | ||
| 1001 | + int bcInt = 0; | ||
| 1002 | + for(ScheduleRealInfo s : list2){ | ||
| 1003 | + if(!s.isCcService() && s.getStatus() != -1){ | ||
| 1004 | + bcInt++; | ||
| 1005 | + } | ||
| 1006 | + } | ||
| 1007 | + bc = "" + bcInt; | ||
| 1008 | + cr = "1"; | ||
| 1009 | + | ||
| 1010 | + realMileage_z = new BigDecimal(realMileage_z).add(new BigDecimal(realMileage)).toString(); | ||
| 1011 | + ksMileage_z = new BigDecimal(ksMileage_z).add(new BigDecimal(ksMileage)).toString(); | ||
| 1012 | + if(ssMileage.length() > 0){ | ||
| 1013 | + ssMileage_z = new BigDecimal(ssMileage_z).add(new BigDecimal(ssMileage)).toString(); | ||
| 1014 | + } | ||
| 1015 | + jhbc_z = new BigDecimal(jhbc_z).add(new BigDecimal(jhbc)).toString(); | ||
| 1016 | + sjbc_z = new BigDecimal(sjbc_z).add(new BigDecimal(sjbc)).toString(); | ||
| 1017 | + bc_z = new BigDecimal(bc_z).add(new BigDecimal(bc)).toString(); | ||
| 1018 | + yybc_z = new BigDecimal(yybc_z).add(new BigDecimal(sjbc)).add(new BigDecimal(ljbc)).toString(); | ||
| 1019 | + cr_z = new BigDecimal(cr_z).add(new BigDecimal(cr)).toString(); | ||
| 1020 | + | ||
| 1021 | + for(ScheduleRealInfo s : list2){ | ||
| 1022 | + String remark = ""; | ||
| 1023 | + if(s.getRemarks() != null){ | ||
| 1024 | + remark += s.getRemarks().trim(); | ||
| 1025 | + } | ||
| 1026 | + if (s.isDestroy()) { | ||
| 1027 | + remark += "(烂班)"; | ||
| 1028 | + } | ||
| 1029 | + if(remark.length() > 0 && remarks.length() > 0){ | ||
| 1030 | + remarks += ";"; | ||
| 1031 | + } | ||
| 1032 | + remarks += remark; | ||
| 1033 | + Set<ChildTaskPlan> childTaskPlans = s.getcTasks(); | ||
| 1034 | + for(ChildTaskPlan c : childTaskPlans){ | ||
| 1035 | + remark = ""; | ||
| 1036 | + if(c.getRemarks() != null){ | ||
| 1037 | + remark = c.getRemarks().trim(); | ||
| 1038 | + } | ||
| 1039 | + if(remark.length() > 0 && remarks.length() > 0){ | ||
| 1040 | + remarks += ";"; | ||
| 1041 | + } | ||
| 1042 | + remarks += remark; | ||
| 1043 | + } | ||
| 1044 | + } | ||
| 1045 | + | ||
| 1046 | + m.put("date", scheList.get(0).getScheduleDateStr()); | ||
| 1047 | + m.put("line", list2.get(0).getXlName()); | ||
| 1048 | + m.put("car", split[0]); | ||
| 1049 | + m.put("lp", split[1]); | ||
| 1050 | + m.put("driver", split[2]); | ||
| 1051 | + m.put("jql", ""); | ||
| 1052 | + m.put("jqje", ""); | ||
| 1053 | + m.put("realMileage", realMileage); | ||
| 1054 | + m.put("ksMileage", ksMileage); | ||
| 1055 | + m.put("ssMileage", ssMileage); | ||
| 1056 | + m.put("consume", ""); | ||
| 1057 | + m.put("bc", bc); | ||
| 1058 | + m.put("jhbc", jhbc); | ||
| 1059 | + m.put("sjbc", sjbc); | ||
| 1060 | + m.put("yybc", Integer.valueOf(sjbc)+Integer.valueOf(ljbc)); | ||
| 1061 | + m.put("cr", cr); | ||
| 1062 | + m.put("remark", remarks); | ||
| 1063 | + | ||
| 1064 | + resList.add(m); | ||
| 1065 | + } | ||
| 1066 | + | ||
| 1067 | + lastMap.put("date", "合计"); | ||
| 1068 | + lastMap.put("line", ""); | ||
| 1069 | + lastMap.put("car", ""); | ||
| 1070 | + lastMap.put("lp", ""); | ||
| 1071 | + lastMap.put("driver", ""); | ||
| 1072 | + lastMap.put("jql", ""); | ||
| 1073 | + lastMap.put("jqje", ""); | ||
| 1074 | + lastMap.put("realMileage", realMileage_z); | ||
| 1075 | + lastMap.put("ksMileage", ksMileage_z); | ||
| 1076 | + lastMap.put("ssMileage", ssMileage_z); | ||
| 1077 | + lastMap.put("consume", ""); | ||
| 1078 | + lastMap.put("bc", bc_z); | ||
| 1079 | + lastMap.put("yybc", yybc_z); | ||
| 1080 | + lastMap.put("jhbc", jhbc_z); | ||
| 1081 | + lastMap.put("sjbc", sjbc_z); | ||
| 1082 | + lastMap.put("cr", cr_z); | ||
| 1083 | + lastMap.put("remark", ""); | ||
| 1084 | + | ||
| 1085 | + resList.add(lastMap); | ||
| 1086 | + | ||
| 1087 | + return resList; | ||
| 1088 | + } | ||
| 1089 | + | ||
| 1090 | + @Override | ||
| 1091 | + public List<Map<String, Object>> exportQueryQc(Map<String, Object> map) { | ||
| 1092 | + // TODO Auto-generated method stub | ||
| 1093 | + | ||
| 1094 | + List<Map<String, Object>> list = this.queryQc(map); | ||
| 1095 | + | ||
| 1096 | + String date = map.get("date").toString(); | ||
| 1097 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 1098 | + Map<String,Object> m = new HashMap<String, Object>(); | ||
| 1099 | + ReportUtils ee = new ReportUtils(); | ||
| 1100 | + try { | ||
| 1101 | + listI.add(list.iterator()); | ||
| 1102 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | ||
| 1103 | + ee.excelReplace(listI, new Object[] { m }, path+"mould/refuelQc.xls", | ||
| 1104 | + path+"export/" + date + "-氢气车日报表.xls"); | ||
| 1105 | + } catch (Exception e) { | ||
| 1106 | + // TODO: handle exception | ||
| 1107 | + e.printStackTrace(); | ||
| 1108 | + } | ||
| 1109 | + return list; | ||
| 1110 | + } | ||
| 1111 | + | ||
| 1112 | + @Override | ||
| 884 | public String importExcel(File file) { | 1113 | public String importExcel(File file) { |
| 885 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 1114 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 886 | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 1115 | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
src/main/resources/static/pages/forms/mould/daily.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/refuel.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/refuelDc.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/refuelQc.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/daily.html
| @@ -55,33 +55,40 @@ | @@ -55,33 +55,40 @@ | ||
| 55 | <table class="table table-bordered table-hover table-checkable" id="forms"> | 55 | <table class="table table-bordered table-hover table-checkable" id="forms"> |
| 56 | <thead> | 56 | <thead> |
| 57 | <tr> | 57 | <tr> |
| 58 | - <th colspan="7">调度班次日报</th> | 58 | + <th colspan="11">调度班次日报</th> |
| 59 | </tr> | 59 | </tr> |
| 60 | <tr> | 60 | <tr> |
| 61 | <td>路线:</td> | 61 | <td>路线:</td> |
| 62 | - <td colspan="2"><span id="form_line"> </span></td> | 62 | + <td colspan="3"><span id="form_line"> </span></td> |
| 63 | <td>时间:</td> | 63 | <td>时间:</td> |
| 64 | - <td colspan="3"><span id="form_date"> </span></td> | 64 | + <td colspan="6"><span id="form_date"> </span></td> |
| 65 | </tr> | 65 | </tr> |
| 66 | <tr> | 66 | <tr> |
| 67 | <td>车辆</td> | 67 | <td>车辆</td> |
| 68 | + <td>路牌</td> | ||
| 68 | <td>工号</td> | 69 | <td>工号</td> |
| 69 | <td>姓名</td> | 70 | <td>姓名</td> |
| 70 | <td>总公里</td> | 71 | <td>总公里</td> |
| 71 | <td>空驶公里</td> | 72 | <td>空驶公里</td> |
| 73 | + <td>损失公里</td> | ||
| 74 | + <td>加车公里</td> | ||
| 72 | <td>油耗</td> | 75 | <td>油耗</td> |
| 73 | <td>班次</td> | 76 | <td>班次</td> |
| 77 | + <td>车日</td> | ||
| 74 | </tr> | 78 | </tr> |
| 75 | </thead> | 79 | </thead> |
| 76 | <tbody id="tbody"> | 80 | <tbody id="tbody"> |
| 77 | 81 | ||
| 78 | </tbody> | 82 | </tbody> |
| 79 | <tr> | 83 | <tr> |
| 80 | - <td colspan="3">小计</td> | 84 | + <td colspan="4">小计</td> |
| 81 | <td><span id="total_zgl"> </span></td> | 85 | <td><span id="total_zgl"> </span></td> |
| 82 | <td><span id="total_ks"> </span></td> | 86 | <td><span id="total_ks"> </span></td> |
| 87 | + <td><span id="total_lbgl"> </span></td> | ||
| 88 | + <td><span id="total_ljgl"> </span></td> | ||
| 83 | <td><span id="total_yh"> </span></td> | 89 | <td><span id="total_yh"> </span></td> |
| 84 | <td><span id="total_bc"> </span></td> | 90 | <td><span id="total_bc"> </span></td> |
| 91 | + <td><span id="total_carDay"> </span></td> | ||
| 85 | </tr> | 92 | </tr> |
| 86 | </table> | 93 | </table> |
| 87 | </div> | 94 | </div> |
| @@ -212,18 +219,26 @@ | @@ -212,18 +219,26 @@ | ||
| 212 | 219 | ||
| 213 | var total_zgl = 0,total_ks = 0; | 220 | var total_zgl = 0,total_ks = 0; |
| 214 | var total_yh = 0,total_bc = 0; | 221 | var total_yh = 0,total_bc = 0; |
| 222 | + var total_lbgl = 0,total_ljgl = 0; | ||
| 223 | + var total_carDay = 0; | ||
| 215 | 224 | ||
| 216 | $.each(result, function(i, obj) { | 225 | $.each(result, function(i, obj) { |
| 217 | - total_zgl +=Number(obj.zlc*10000); | ||
| 218 | - total_ks +=Number(obj.jzl1*10000); | 226 | + total_zgl += Number(obj.zlc*10000); |
| 227 | + total_ks += Number(obj.jzl1*10000); | ||
| 219 | total_yh += Number(obj.yh*10000); | 228 | total_yh += Number(obj.yh*10000); |
| 220 | total_bc += Number(obj.bc); | 229 | total_bc += Number(obj.bc); |
| 230 | + total_lbgl += Number(obj.lblc*10000); | ||
| 231 | + total_ljgl += Number(obj.ljlc*10000); | ||
| 232 | + total_carDay += Number(obj.carDay); | ||
| 221 | 233 | ||
| 222 | }); | 234 | }); |
| 223 | $("#total_zgl").text((total_zgl/10000).toFixed(3)); | 235 | $("#total_zgl").text((total_zgl/10000).toFixed(3)); |
| 224 | $("#total_ks").text((total_ks/10000).toFixed(3)); | 236 | $("#total_ks").text((total_ks/10000).toFixed(3)); |
| 225 | $("#total_yh").text((total_yh/10000).toFixed(2)); | 237 | $("#total_yh").text((total_yh/10000).toFixed(2)); |
| 226 | $("#total_bc").text(total_bc.toFixed(0)); | 238 | $("#total_bc").text(total_bc.toFixed(0)); |
| 239 | + $("#total_lbgl").text((total_lbgl/10000).toFixed(3)); | ||
| 240 | + $("#total_ljgl").text((total_ljgl/10000).toFixed(3)); | ||
| 241 | + $("#total_carDay").text(total_carDay.toFixed(0)); | ||
| 227 | 242 | ||
| 228 | var temp = {}; | 243 | var temp = {}; |
| 229 | var today_account = 0; | 244 | var today_account = 0; |
| @@ -261,17 +276,21 @@ | @@ -261,17 +276,21 @@ | ||
| 261 | {{each list as obj i}} | 276 | {{each list as obj i}} |
| 262 | <tr> | 277 | <tr> |
| 263 | <td>{{obj.zbh}}</td> | 278 | <td>{{obj.zbh}}</td> |
| 279 | + <td>{{obj.lp}}</td> | ||
| 264 | <td>{{obj.jgh}}</td> | 280 | <td>{{obj.jgh}}</td> |
| 265 | <td>{{obj.jName}}</td> | 281 | <td>{{obj.jName}}</td> |
| 266 | <td>{{obj.zlc}}</td> | 282 | <td>{{obj.zlc}}</td> |
| 267 | <td>{{obj.jzl1}}</td> | 283 | <td>{{obj.jzl1}}</td> |
| 284 | + <td>{{obj.lblc}}</td> | ||
| 285 | + <td>{{obj.ljlc}}</td> | ||
| 268 | <td>{{obj.yh}}</td> | 286 | <td>{{obj.yh}}</td> |
| 269 | - <td>{{obj.bc}}</td> | 287 | + <td>{{obj.bc}}</td> |
| 288 | + <td>{{obj.carDay}}</td> | ||
| 270 | </tr> | 289 | </tr> |
| 271 | {{/each}} | 290 | {{/each}} |
| 272 | {{if list.length == 0}} | 291 | {{if list.length == 0}} |
| 273 | <tr> | 292 | <tr> |
| 274 | - <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> | 293 | + <td colspan="11"><h6 class="muted">没有找到相关数据</h6></td> |
| 275 | </tr> | 294 | </tr> |
| 276 | {{/if}} | 295 | {{/if}} |
| 277 | </script> | 296 | </script> |
| 278 | \ No newline at end of file | 297 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/refuel.html
| @@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
| 45 | <div class="form-group"> | 45 | <div class="form-group"> |
| 46 | <input class="btn btn-default" type="button" id="query" value="筛选"/> | 46 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 47 | <input class="btn btn-default" type="button" id="upload" value="导入Excel"/> | 47 | <input class="btn btn-default" type="button" id="upload" value="导入Excel"/> |
| 48 | -<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | 48 | + <input class="btn btn-default" type="button" id="export" value="导出"/> |
| 49 | </div> | 49 | </div> |
| 50 | </form> | 50 | </form> |
| 51 | </div> | 51 | </div> |
| @@ -123,6 +123,22 @@ | @@ -123,6 +123,22 @@ | ||
| 123 | $.get('refuelUpload.html', function(m){$(pjaxContainer).append(m);}); | 123 | $.get('refuelUpload.html', function(m){$(pjaxContainer).append(m);}); |
| 124 | }); | 124 | }); |
| 125 | 125 | ||
| 126 | + $("#export").on("click",function(){ | ||
| 127 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | ||
| 128 | + layer.msg("请选择日期"); | ||
| 129 | + return; | ||
| 130 | + } | ||
| 131 | + date = $("#date").val(); | ||
| 132 | + car = $("#car").val(); | ||
| 133 | + driver = $("#driver").val(); | ||
| 134 | + var i = layer.load(2); | ||
| 135 | + $get('/refuel/exportRefuel',{date:date,car:car,driver:driver,type:'export'},function(result){ | ||
| 136 | + window.open("/downloadFile/download?fileName=" | ||
| 137 | + +date+"-油量导入"); | ||
| 138 | + layer.close(i); | ||
| 139 | + }); | ||
| 140 | + }); | ||
| 141 | + | ||
| 126 | }); | 142 | }); |
| 127 | </script> | 143 | </script> |
| 128 | <script type="text/html" id="refuel"> | 144 | <script type="text/html" id="refuel"> |
src/main/resources/static/pages/forms/statement/refuelDc.html
| @@ -53,6 +53,7 @@ | @@ -53,6 +53,7 @@ | ||
| 53 | <td>日期</td> | 53 | <td>日期</td> |
| 54 | <td>路别</td> | 54 | <td>路别</td> |
| 55 | <td>车号</td> | 55 | <td>车号</td> |
| 56 | + <td>路牌</td> | ||
| 56 | <td>驾驶员</td> | 57 | <td>驾驶员</td> |
| 57 | <td>出场电容</td> | 58 | <td>出场电容</td> |
| 58 | <td>进场电容</td> | 59 | <td>进场电容</td> |
| @@ -222,6 +223,7 @@ | @@ -222,6 +223,7 @@ | ||
| 222 | <td>{{obj.date}}</td> | 223 | <td>{{obj.date}}</td> |
| 223 | <td>{{obj.line}}</td> | 224 | <td>{{obj.line}}</td> |
| 224 | <td>{{obj.car}}</td> | 225 | <td>{{obj.car}}</td> |
| 226 | + <td>{{obj.lp}}</td> | ||
| 225 | <td>{{obj.driver}}</td> | 227 | <td>{{obj.driver}}</td> |
| 226 | <td></td> | 228 | <td></td> |
| 227 | <td></td> | 229 | <td></td> |
src/main/resources/static/pages/forms/statement/refuelQc.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + | ||
| 15 | + .table > tbody + tbody { | ||
| 16 | + border-top: 1px solid; } | ||
| 17 | + .btn-default{ | ||
| 18 | + margin-left: 5px; | ||
| 19 | + } | ||
| 20 | +</style> | ||
| 21 | + | ||
| 22 | +<div class="page-head"> | ||
| 23 | + <div class="page-title"> | ||
| 24 | + <h1>氢气车日报表</h1> | ||
| 25 | + </div> | ||
| 26 | +</div> | ||
| 27 | + | ||
| 28 | +<div class="row"> | ||
| 29 | + <div class="col-md-12"> | ||
| 30 | + <div class="portlet light porttlet-fit bordered"> | ||
| 31 | + <div class="portlet-title"> | ||
| 32 | + <form class="form-inline" action=""> | ||
| 33 | + <div style="display: inline-block;margin-left: 24px;"> | ||
| 34 | + <span class="item-label" style="width: 80px;"> 日期: </span> | ||
| 35 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | ||
| 36 | + </div> | ||
| 37 | + <div style="display: inline-block;"> | ||
| 38 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 39 | + <select class="form-control" name="line" id="line" style="width: 180px;" multiple="multiple"></select> | ||
| 40 | + </div> | ||
| 41 | + <div class="form-group"> | ||
| 42 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 43 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 44 | + </div> | ||
| 45 | + </form> | ||
| 46 | + </div> | ||
| 47 | + <div class="portlet-body"> | ||
| 48 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 49 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 50 | + <thead> | ||
| 51 | + <tr> | ||
| 52 | + <td>序号</td> | ||
| 53 | + <td>日期</td> | ||
| 54 | + <td>路别</td> | ||
| 55 | + <td>车号</td> | ||
| 56 | + <td>路牌</td> | ||
| 57 | + <td>驾驶员</td> | ||
| 58 | + <td>加氢量<br/>(公斤)</td> | ||
| 59 | + <td>加氢金额<br/>(元)</td> | ||
| 60 | + <td>路单公里</td> | ||
| 61 | + <td>空驶公里</td> | ||
| 62 | + <td>损失公里</td> | ||
| 63 | + <td>班次</td> | ||
| 64 | + <td>营运班次</td> | ||
| 65 | + <td>车日</td> | ||
| 66 | + <td>备注</td> | ||
| 67 | + </tr> | ||
| 68 | + </thead> | ||
| 69 | + <tbody id="tbody"> | ||
| 70 | + | ||
| 71 | + </tbody> | ||
| 72 | + </table> | ||
| 73 | + </div> | ||
| 74 | + </div> | ||
| 75 | + </div> | ||
| 76 | + </div> | ||
| 77 | +</div> | ||
| 78 | + | ||
| 79 | +<script> | ||
| 80 | + $(function(){ | ||
| 81 | + | ||
| 82 | + // 关闭左侧栏 | ||
| 83 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 84 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 85 | + | ||
| 86 | + var d = new Date(); | ||
| 87 | + d.setTime(d.getTime() - 1*1000*60*60*24); | ||
| 88 | + var year = d.getFullYear(); | ||
| 89 | + var month = d.getMonth() + 1; | ||
| 90 | + var day = d.getDate(); | ||
| 91 | + if(month < 10) | ||
| 92 | + month = "0" + month; | ||
| 93 | + if(day < 10) | ||
| 94 | + day = "0" + day; | ||
| 95 | + var dateTime = year + "-" + month + "-" + day; | ||
| 96 | + $("#date").datetimepicker({ | ||
| 97 | + format : 'YYYY-MM-DD', | ||
| 98 | + locale : 'zh-cn' | ||
| 99 | + }); | ||
| 100 | + $("#date").val(dateTime); | ||
| 101 | + | ||
| 102 | + $.get('/report/lineList',function(xlList){ | ||
| 103 | + var data = []; | ||
| 104 | +// data.push({id: " ", text: "全部线路"}); | ||
| 105 | + $.get('/user/companyData', function(result){ | ||
| 106 | + for(var i = 0; i < result.length; i++){ | ||
| 107 | + var companyCode = result[i].companyCode; | ||
| 108 | + var children = result[i].children; | ||
| 109 | + for(var j = 0; j < children.length; j++){ | ||
| 110 | + var code = children[j].code; | ||
| 111 | + for(var k=0;k < xlList.length;k++ ){ | ||
| 112 | + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | ||
| 113 | + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | ||
| 114 | +// tempData[xlList[k]["xlbm"]] = companyCode+":"+code; | ||
| 115 | + } | ||
| 116 | + } | ||
| 117 | + } | ||
| 118 | + } | ||
| 119 | + initPinYinSelect2('#line',data,''); | ||
| 120 | + initCl(); | ||
| 121 | + }); | ||
| 122 | + }); | ||
| 123 | + //重置 | ||
| 124 | + $('#czcl').on('click', function () { | ||
| 125 | + $('#code').val('').change(); | ||
| 126 | + }); | ||
| 127 | + $("#line").on("change",initCl); | ||
| 128 | + function initCl(){ | ||
| 129 | + $('#code').select2({ | ||
| 130 | + ajax: { | ||
| 131 | + url: '/report/carList', | ||
| 132 | + dataType: 'json', | ||
| 133 | + delay: 150, | ||
| 134 | + data: function(params){ | ||
| 135 | + return{nbbm: params.term,xlbm:$('#line').val()}; | ||
| 136 | + }, | ||
| 137 | + processResults: function (data) { | ||
| 138 | + return { | ||
| 139 | + results: data | ||
| 140 | + }; | ||
| 141 | + }, | ||
| 142 | + cache: true | ||
| 143 | + }, | ||
| 144 | + templateResult: function(repo){ | ||
| 145 | + if (repo.loading) return repo.text; | ||
| 146 | + var h = '<span>'+repo.text+'</span>'; | ||
| 147 | + h += (repo.lineName?' <span class="select2-desc">'+repo.lineName+'</span>':''); | ||
| 148 | + return h; | ||
| 149 | + }, | ||
| 150 | + escapeMarkup: function (markup) { return markup; }, | ||
| 151 | + minimumInputLength: 1, | ||
| 152 | + templateSelection: function(repo){ | ||
| 153 | + return repo.text; | ||
| 154 | + }, | ||
| 155 | + language: { | ||
| 156 | + noResults: function(){ | ||
| 157 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 158 | + }, | ||
| 159 | + inputTooShort : function(e) { | ||
| 160 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 161 | + }, | ||
| 162 | + searching : function() { | ||
| 163 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 164 | + } | ||
| 165 | + } | ||
| 166 | + }); | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + | ||
| 170 | + var line = "", date = "", car = ""; | ||
| 171 | + $("#query").on("click",function(){ | ||
| 172 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | ||
| 173 | + layer.msg("请选择日期"); | ||
| 174 | + return; | ||
| 175 | + } | ||
| 176 | + line = ""; | ||
| 177 | + $($("#line").val()).each(function(i, e){ | ||
| 178 | + line += e + ","; | ||
| 179 | + }); | ||
| 180 | + if(line.length > 0){ | ||
| 181 | + line = line.substring(0, line.length - 1); | ||
| 182 | + } else { | ||
| 183 | + layer.msg("请选择线路"); | ||
| 184 | + return; | ||
| 185 | + } | ||
| 186 | + date = $("#date").val(); | ||
| 187 | + car = $("#code").val(); | ||
| 188 | + var i = layer.load(2); | ||
| 189 | + $get('/refuel/queryQc',{line:line,date:date,car:car,type:'query'},function(result){ | ||
| 190 | + // 把数据填充到模版中 | ||
| 191 | + var tbodyHtml = template('refuel_qc',{list:result}); | ||
| 192 | + // 把渲染好的模版html文本追加到表格中 | ||
| 193 | + $('#tbody').html(tbodyHtml); | ||
| 194 | + layer.close(i); | ||
| 195 | + }); | ||
| 196 | + }); | ||
| 197 | + | ||
| 198 | + $("#export").on("click",function(){ | ||
| 199 | + if(date && date != ""){ | ||
| 200 | + var i = layer.load(2); | ||
| 201 | + var params = {}; | ||
| 202 | + params['line'] = line; | ||
| 203 | + params['date'] = date; | ||
| 204 | + params['car'] = car; | ||
| 205 | + $get('/refuel/exportQueryQc', params, function(result){ | ||
| 206 | + layer.close(i); | ||
| 207 | + window.open("/downloadFile/download?fileName=" | ||
| 208 | + +date+"-氢气车日报表"); | ||
| 209 | + layer.close(i); | ||
| 210 | + }); | ||
| 211 | + } | ||
| 212 | + }); | ||
| 213 | + | ||
| 214 | +}); | ||
| 215 | +</script> | ||
| 216 | +<script type="text/html" id="refuel_qc"> | ||
| 217 | + {{each list as obj i}} | ||
| 218 | + <tr> | ||
| 219 | + <td>{{i + 1}}</td> | ||
| 220 | + <td>{{obj.date}}</td> | ||
| 221 | + <td>{{obj.line}}</td> | ||
| 222 | + <td>{{obj.car}}</td> | ||
| 223 | + <td>{{obj.lp}}</td> | ||
| 224 | + <td>{{obj.driver}}</td> | ||
| 225 | + <td>{{obj.jql}}</td> | ||
| 226 | + <td>{{obj.jqje}}</td> | ||
| 227 | + <td>{{obj.realMileage}}</td> | ||
| 228 | + <td>{{obj.ksMileage}}</td> | ||
| 229 | + <td>{{obj.ssMileage}}</td> | ||
| 230 | + <td>{{obj.bc}}</td> | ||
| 231 | + <td>{{obj.yybc}}</td> | ||
| 232 | + <td>{{obj.cr}}</td> | ||
| 233 | + <td title="{{obj.remark}}"> | ||
| 234 | + {{if obj.remark !=""}} | ||
| 235 | + <div class="caption"> | ||
| 236 | + | ||
| 237 | + <font style="font-size: 24px;font-weight: bold;">!</font> | ||
| 238 | + | ||
| 239 | + </div> | ||
| 240 | + {{/if}} | ||
| 241 | + </td> | ||
| 242 | + </tr> | ||
| 243 | + {{/each}} | ||
| 244 | + {{if list.length == 0}} | ||
| 245 | + <tr> | ||
| 246 | + <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 247 | + </tr> | ||
| 248 | + {{/if}} | ||
| 249 | +</script> | ||
| 0 | \ No newline at end of file | 250 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/waybillQp.html
| @@ -318,14 +318,24 @@ | @@ -318,14 +318,24 @@ | ||
| 318 | <script type="text/html" id="ludan_2"> | 318 | <script type="text/html" id="ludan_2"> |
| 319 | {{each list as obj i}} | 319 | {{each list as obj i}} |
| 320 | <tr> | 320 | <tr> |
| 321 | - <td> | 321 | + |
| 322 | {{if obj.adjustExps == "子"}} | 322 | {{if obj.adjustExps == "子"}} |
| 323 | - {{obj.adjustExps}} | 323 | + <td title="子任务" style="font-size: 20px;font-weight: bold;"> |
| 324 | + {{obj.adjustExps}} | ||
| 325 | + </td> | ||
| 324 | {{/if}} | 326 | {{/if}} |
| 325 | {{if obj.adjustExps != "子"}} | 327 | {{if obj.adjustExps != "子"}} |
| 326 | - {{i+1}} | 328 | + {{if obj.sflj == true}} |
| 329 | + <td title="临加班次" style="font-size: 20px;font-weight: bold;"> | ||
| 330 | + 临 | ||
| 331 | + </td> | ||
| 332 | + {{/if}} | ||
| 333 | + {{if obj.sflj == false}} | ||
| 334 | + <td> | ||
| 335 | + {{i+1}} | ||
| 336 | + </td> | ||
| 337 | + {{/if}} | ||
| 327 | {{/if}} | 338 | {{/if}} |
| 328 | - </td> | ||
| 329 | <td>{{obj.lpName}}</td> | 339 | <td>{{obj.lpName}}</td> |
| 330 | <td>{{obj.jGh}}{{obj.jName}}</td> | 340 | <td>{{obj.jGh}}{{obj.jName}}</td> |
| 331 | <td> | 341 | <td> |