Commit d63cf9218133c4db1dcc1323f3cb6b8b40516f30
1 parent
60d9da6b
报表
Showing
10 changed files
with
711 additions
and
28 deletions
src/main/java/com/bsth/controller/forms/ExportController.java
0 → 100644
| 1 | +package com.bsth.controller.forms; | |
| 2 | + | |
| 3 | +import java.text.SimpleDateFormat; | |
| 4 | +import java.util.ArrayList; | |
| 5 | +import java.util.HashMap; | |
| 6 | +import java.util.Iterator; | |
| 7 | +import java.util.List; | |
| 8 | +import java.util.Map; | |
| 9 | + | |
| 10 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 11 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 12 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 13 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 14 | +import org.springframework.web.bind.annotation.RestController; | |
| 15 | + | |
| 16 | +import com.bsth.entity.mcy_forms.Linepasswengerflow; | |
| 17 | +import com.bsth.entity.mcy_forms.Operationservice; | |
| 18 | +import com.bsth.entity.mcy_forms.Shifday; | |
| 19 | +import com.bsth.entity.mcy_forms.Shiftuehiclemanth; | |
| 20 | +import com.bsth.entity.mcy_forms.Singledata; | |
| 21 | +import com.bsth.entity.mcy_forms.Vehicleloading; | |
| 22 | +import com.bsth.entity.mcy_forms.Waybillday; | |
| 23 | +import com.bsth.service.forms.ExportService; | |
| 24 | +import com.bsth.service.forms.FormsService; | |
| 25 | +import com.bsth.util.ReportUtils; | |
| 26 | + | |
| 27 | +@RestController | |
| 28 | +@RequestMapping("mcy_export") | |
| 29 | +public class ExportController { | |
| 30 | + | |
| 31 | + @Autowired | |
| 32 | + FormsService formsService; | |
| 33 | + | |
| 34 | + @Autowired | |
| 35 | + ExportService exportService; | |
| 36 | + | |
| 37 | + //行车路单日报表 | |
| 38 | + @RequestMapping(value = "/waybilldayExport",method = RequestMethod.POST) | |
| 39 | + public List<Waybillday> waybilldayExport(@RequestParam Map<String, Object> map){ | |
| 40 | + List<Waybillday> waybillday = formsService.waybillday(map); | |
| 41 | + exportService.waybillday(map.get("date").toString(), waybillday); | |
| 42 | + return waybillday; | |
| 43 | + } | |
| 44 | + | |
| 45 | + | |
| 46 | + //线路客流量报表 | |
| 47 | + @RequestMapping(value = "/linepasswengerflowExport",method = RequestMethod.POST) | |
| 48 | + public List<Map<String, Object>> linepasswengerflowExport(@RequestParam Map<String, Object> map){ | |
| 49 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 50 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 51 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 52 | + ReportUtils ee = new ReportUtils(); | |
| 53 | + List<Linepasswengerflow> linepasswengerflow = formsService.linepasswengerflow(map); | |
| 54 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 55 | + int i=1; | |
| 56 | + for(Linepasswengerflow l : linepasswengerflow){ | |
| 57 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 58 | + m.put("i", i); | |
| 59 | + m.put("stationName", l.getStationName()); | |
| 60 | + m.put("1", " "); | |
| 61 | + m.put("2", " "); | |
| 62 | + resList.add(m); | |
| 63 | + i++; | |
| 64 | + } | |
| 65 | + | |
| 66 | + try { | |
| 67 | + listI.add(resList.iterator()); | |
| 68 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 69 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\linepassengerflow.xls", | |
| 70 | + path+"export\\线路客流量报表" + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls"); | |
| 71 | + } catch (Exception e) { | |
| 72 | + e.printStackTrace(); | |
| 73 | + } | |
| 74 | + return resList; | |
| 75 | + } | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + //班次车辆人员日统计 | |
| 80 | + @RequestMapping(value = "/shifdayExport",method = RequestMethod.POST) | |
| 81 | + public List<Map<String, Object>> shifdayExport(@RequestParam Map<String, Object> map){ | |
| 82 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 83 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 84 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 85 | + ReportUtils ee = new ReportUtils(); | |
| 86 | + List<Shifday> shifday = formsService.shifday(map); | |
| 87 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 88 | + for(Shifday l : shifday){ | |
| 89 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 90 | + m.put("jName",l.getjName()); | |
| 91 | + m.put("sName", l.getsName()); | |
| 92 | + m.put("lpName", l.getLpName()); | |
| 93 | + m.put("carPlate", l.getCarPlate()); | |
| 94 | + m.put("jhlc", l.getJhlc()); | |
| 95 | + //m.put("sjjhlc", l.getSjjhlc()); | |
| 96 | + m.put("yygl", l.getYygl()); | |
| 97 | + m.put("emptMileage", l.getEmptMileage()); | |
| 98 | + m.put("remMileage", l.getRemMileage()); | |
| 99 | + m.put("addMileage", l.getAddMileage()); | |
| 100 | + m.put("totalm", l.getTotalm()); | |
| 101 | + m.put("jhbc", l.getJhbc()); | |
| 102 | + //m.put("sjjhbc", l.getSjjhbc()); | |
| 103 | + m.put("cjbc", l.getCjbc()); | |
| 104 | + m.put("ljbc", l.getLjbc()); | |
| 105 | + m.put("sjbc", l.getSjbc()); | |
| 106 | + resList.add(m); | |
| 107 | + } | |
| 108 | + | |
| 109 | + try { | |
| 110 | + listI.add(resList.iterator()); | |
| 111 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 112 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\shifday.xls", | |
| 113 | + path+"export\\班次车辆人员日报表" + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls"); | |
| 114 | + } catch (Exception e) { | |
| 115 | + e.printStackTrace(); | |
| 116 | + } | |
| 117 | + return resList; | |
| 118 | + } | |
| 119 | + | |
| 120 | + //班次车辆人员月统计 | |
| 121 | + @RequestMapping(value = "/shiftuehiclemanthExport",method = RequestMethod.POST) | |
| 122 | + public List<Map<String, Object>> shiftuehiclemanthExport(@RequestParam Map<String, Object> map){ | |
| 123 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 124 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 125 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 126 | + ReportUtils ee = new ReportUtils(); | |
| 127 | + List<Shiftuehiclemanth> shiftuehiclemanth = formsService.shiftuehiclemanth(map); | |
| 128 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 129 | + int i=1; | |
| 130 | + for(Shiftuehiclemanth l : shiftuehiclemanth){ | |
| 131 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 132 | + m.put("i", i); | |
| 133 | + m.put("jName",l.getjName() ); | |
| 134 | + m.put("jhlc", l.getJhlc()); | |
| 135 | + m.put("emptMileage",l.getEmptMileage() ); | |
| 136 | + m.put("remMileage", l.getRemMileage()); | |
| 137 | + m.put("addMileage", l.getAddMileage()); | |
| 138 | + m.put("totalm", l.getTotalm()); | |
| 139 | + m.put("cjbc", l.getCjbc()); | |
| 140 | + m.put("ljbc", l.getLjbc()); | |
| 141 | + m.put("sjbc", l.getSjbc()); | |
| 142 | + resList.add(m); | |
| 143 | + i++; | |
| 144 | + } | |
| 145 | + | |
| 146 | + try { | |
| 147 | + listI.add(resList.iterator()); | |
| 148 | + | |
| 149 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 150 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\shiftuehiclemanth.xls", | |
| 151 | + path+"export\\班次车辆人员月报表" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 152 | + | |
| 153 | + } catch (Exception e) { | |
| 154 | + e.printStackTrace(); | |
| 155 | + } | |
| 156 | + | |
| 157 | + return resList; | |
| 158 | + } | |
| 159 | + | |
| 160 | + | |
| 161 | + //路单数据报表 | |
| 162 | + @RequestMapping(value = "/singledataExport",method = RequestMethod.POST) | |
| 163 | + public List<Map<String, Object>> singledataExport(@RequestParam Map<String, Object> map){ | |
| 164 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 165 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 166 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 167 | + ReportUtils ee = new ReportUtils(); | |
| 168 | + List<Singledata> singledata = formsService.singledata(map); | |
| 169 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 170 | + int i=1; | |
| 171 | + for(Singledata l : singledata){ | |
| 172 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 173 | + m.put("i", i); | |
| 174 | + m.put("rQ",l.getrQ()); | |
| 175 | + m.put("gS", l.getgS()); | |
| 176 | + m.put("xL",l.getxL() ); | |
| 177 | + m.put("clzbh", l.getClzbh()); | |
| 178 | + m.put("jsy", l.getJsy()); | |
| 179 | + m.put("jName", l.getjName()); | |
| 180 | + m.put("sgh", l.getSgh()); | |
| 181 | + m.put("sName", l.getsName()); | |
| 182 | + m.put("jhlc", l.getJhlc()); | |
| 183 | + m.put("emptMileage", l.getEmptMileage()); | |
| 184 | + m.put("hyl", l.getHyl()); | |
| 185 | + m.put("jzl", l.getJzl()); | |
| 186 | + m.put("unyyyl",l.getUnyyyl()); | |
| 187 | + m.put("jhjl", l.getJhjl()); | |
| 188 | + resList.add(m); | |
| 189 | + i++; | |
| 190 | + } | |
| 191 | + | |
| 192 | + try { | |
| 193 | + listI.add(resList.iterator()); | |
| 194 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 195 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\singledata.xls", | |
| 196 | + path+"export\\路单报表" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 197 | + } catch (Exception e) { | |
| 198 | + e.printStackTrace(); | |
| 199 | + } | |
| 200 | + | |
| 201 | + return resList; | |
| 202 | + } | |
| 203 | + | |
| 204 | + //车辆加注 | |
| 205 | + @RequestMapping(value = "/vehicleloadingExport",method = RequestMethod.POST) | |
| 206 | + public List<Map<String, Object>> vehicleloadingExport(@RequestParam Map<String, Object> map){ | |
| 207 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 208 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 209 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 210 | + ReportUtils ee = new ReportUtils(); | |
| 211 | + List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("line").toString(), map.get("date").toString()); | |
| 212 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 213 | + int i=1; | |
| 214 | + for(Vehicleloading l : vehicleloading){ | |
| 215 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 216 | + m.put("i", i); | |
| 217 | + m.put("rQ", l.getrQ()); | |
| 218 | + m.put("gS", l.getgS()); | |
| 219 | + m.put("xL", l.getxL()); | |
| 220 | + m.put("clzbh", l.getClzbh()); | |
| 221 | + m.put("hyl", l.getHyl()); | |
| 222 | + m.put("jzl", l.getJzl()); | |
| 223 | + m.put("ls", l.getLs()); | |
| 224 | + m.put("jhlc", l.getJhlc()); | |
| 225 | + m.put("unyyyl", l.getUnyyyl()); | |
| 226 | + m.put("jhbc", l.getJhbc()); | |
| 227 | + m.put("sjbc", l.getSjbc()); | |
| 228 | + resList.add(m); | |
| 229 | + i++; | |
| 230 | + } | |
| 231 | + | |
| 232 | + try { | |
| 233 | + listI.add(resList.iterator()); | |
| 234 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 235 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\vehicleloading.xls", | |
| 236 | + path+"export\\车辆加注" + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls"); | |
| 237 | + } catch (Exception e) { | |
| 238 | + e.printStackTrace(); | |
| 239 | + } | |
| 240 | + return resList; | |
| 241 | + } | |
| 242 | + | |
| 243 | + //运营服务阶段报表 | |
| 244 | + @RequestMapping(value = "/operationserviceExport",method = RequestMethod.POST) | |
| 245 | + public List<Map<String, Object>> operationserviceExport(@RequestParam Map<String, Object> map){ | |
| 246 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 247 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 248 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 249 | + ReportUtils ee = new ReportUtils(); | |
| 250 | + List<Operationservice> operationservice = formsService.operationservice(map); | |
| 251 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 252 | + int i=1; | |
| 253 | + for(Operationservice l : operationservice){ | |
| 254 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 255 | + m.put("i", i); | |
| 256 | + m.put("xlName", l.getXlName()); | |
| 257 | + m.put("jzl", l.getJzl()); | |
| 258 | + m.put("xhl", l.getXhl()); | |
| 259 | + m.put("xsgl", l.getXsgl()); | |
| 260 | + m.put("emptMileage", l.getEmptMileage()); | |
| 261 | + m.put("sjbc", l.getSjbc()); | |
| 262 | + resList.add(m); | |
| 263 | + i++; | |
| 264 | + } | |
| 265 | + | |
| 266 | + try { | |
| 267 | + listI.add(resList.iterator()); | |
| 268 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 269 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\operationservice.xls", | |
| 270 | + path+"export\\运营服务阶段报表" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 271 | + } catch (Exception e) { | |
| 272 | + e.printStackTrace(); | |
| 273 | + } | |
| 274 | + return resList; | |
| 275 | + } | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | +} | ... | ... |
src/main/java/com/bsth/controller/oil/YlbController.java
| ... | ... | @@ -4,6 +4,7 @@ import java.text.ParseException; |
| 4 | 4 | import java.text.SimpleDateFormat; |
| 5 | 5 | import java.util.ArrayList; |
| 6 | 6 | import java.util.Date; |
| 7 | +import java.util.HashMap; | |
| 7 | 8 | import java.util.Iterator; |
| 8 | 9 | import java.util.List; |
| 9 | 10 | import java.util.Map; |
| ... | ... | @@ -23,6 +24,7 @@ import com.bsth.entity.oil.Ylb; |
| 23 | 24 | import com.bsth.entity.sys.SysUser; |
| 24 | 25 | import com.bsth.security.util.SecurityUtils; |
| 25 | 26 | import com.bsth.service.oil.YlbService; |
| 27 | +import com.bsth.util.ReportUtils; | |
| 26 | 28 | import com.google.common.base.Splitter; |
| 27 | 29 | |
| 28 | 30 | @RestController |
| ... | ... | @@ -131,4 +133,58 @@ public class YlbController extends BaseController<Ylb, Integer>{ |
| 131 | 133 | return yblService.oilListMonth(line, date); |
| 132 | 134 | } |
| 133 | 135 | |
| 136 | + | |
| 137 | + @RequestMapping(value = "/listExport",method = RequestMethod.POST) | |
| 138 | + public List<Map<String, Object>> listExport(@RequestParam Map<String, Object> map){ | |
| 139 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 140 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 141 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 142 | + ReportUtils ee = new ReportUtils(); | |
| 143 | + String rq=map.get("rq").toString(); | |
| 144 | + if(!(rq=="")){ | |
| 145 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 146 | + try { | |
| 147 | + map.put("rq_eq", sdfMonth.parse(rq)); | |
| 148 | + } catch (ParseException e) { | |
| 149 | + // TODO Auto-generated catch block | |
| 150 | + e.printStackTrace(); | |
| 151 | + } | |
| 152 | + } | |
| 153 | + List<Ylb> ylb= (List<Ylb>)yblService.list(map); | |
| 154 | +// (new CustomerSpecs<Ylb>(map)).iterator(); | |
| 155 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 156 | + for (Ylb y : ylb) { | |
| 157 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 158 | + m.put("rq", y.getRq()); | |
| 159 | + m.put("gsname",y.getGsname() ); | |
| 160 | + m.put("xlname", y.getXlname()); | |
| 161 | + m.put("nbbm", y.getNbbm()); | |
| 162 | + m.put("jsy", y.getJsy()); | |
| 163 | + m.put("jzl", y.getJzl()); | |
| 164 | + m.put("czlc", y.getCzlc()); | |
| 165 | + m.put("jzlc", y.getJzlc()); | |
| 166 | + m.put("czyl", y.getCzyl()); | |
| 167 | + m.put("jzyl", y.getJzyl()); | |
| 168 | + m.put("yh", y.getYh()); | |
| 169 | + m.put("rylx", y.getRylx()); | |
| 170 | + m.put("ns", y.getNs()); | |
| 171 | + m.put("shyy", y.getShyy()); | |
| 172 | + m.put("sh", y.getSh()); | |
| 173 | + m.put("zlc", y.getZlc()); | |
| 174 | + m.put("yhlx", y.getYhlx()); | |
| 175 | + m.put("bglyh", y.getBglyh()); | |
| 176 | + resList.add(m); | |
| 177 | + } | |
| 178 | + try { | |
| 179 | + listI.add(resList.iterator()); | |
| 180 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 181 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\list.xls", | |
| 182 | + path+"export\\进出场存油量" + sdfSimple.format(sdfMonth.parse(map.get("rq").toString())) + ".xls"); | |
| 183 | + } catch (Exception e) { | |
| 184 | + e.printStackTrace(); | |
| 185 | + } | |
| 186 | + | |
| 187 | + return resList; | |
| 188 | + | |
| 189 | + } | |
| 134 | 190 | } | ... | ... |
src/main/java/com/bsth/service/forms/ExportService.java
0 → 100644
| 1 | +package com.bsth.service.forms; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | + | |
| 5 | +import com.bsth.entity.mcy_forms.Linepasswengerflow; | |
| 6 | +import com.bsth.entity.mcy_forms.Operationservice; | |
| 7 | +import com.bsth.entity.mcy_forms.Shifday; | |
| 8 | +import com.bsth.entity.mcy_forms.Shiftuehiclemanth; | |
| 9 | +import com.bsth.entity.mcy_forms.Singledata; | |
| 10 | +import com.bsth.entity.mcy_forms.Vehicleloading; | |
| 11 | +import com.bsth.entity.mcy_forms.Waybillday; | |
| 12 | + | |
| 13 | +public interface ExportService { | |
| 14 | + | |
| 15 | + public void waybillday(String date, List<Waybillday> resList); | |
| 16 | + | |
| 17 | + public void linepasswengerflow(String date,List<Linepasswengerflow> resList); | |
| 18 | + | |
| 19 | + public void shifday(String date, List<Shifday> resList); | |
| 20 | + | |
| 21 | + public void shiftuehiclemanth(String startDate, String endDate, String lpName, | |
| 22 | + List<Shiftuehiclemanth> resList); | |
| 23 | + | |
| 24 | + public void singledata(String startDate, String endDate, String lpName, List<Singledata> resList); | |
| 25 | + | |
| 26 | + public void vehicleloading(String date, List<Vehicleloading> resList); | |
| 27 | + | |
| 28 | + public void operationservice(String startDate, String endDate, String lpName, | |
| 29 | + List<Operationservice> resList); | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | +} | ... | ... |
src/main/java/com/bsth/service/forms/impl/ExportServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.forms.impl; | |
| 2 | + | |
| 3 | +import java.text.SimpleDateFormat; | |
| 4 | +import java.util.ArrayList; | |
| 5 | +import java.util.HashMap; | |
| 6 | +import java.util.Iterator; | |
| 7 | +import java.util.List; | |
| 8 | +import java.util.Map; | |
| 9 | +import org.springframework.stereotype.Service; | |
| 10 | + | |
| 11 | +import com.bsth.entity.mcy_forms.Linepasswengerflow; | |
| 12 | +import com.bsth.entity.mcy_forms.Operationservice; | |
| 13 | +import com.bsth.entity.mcy_forms.Shifday; | |
| 14 | +import com.bsth.entity.mcy_forms.Shiftuehiclemanth; | |
| 15 | +import com.bsth.entity.mcy_forms.Singledata; | |
| 16 | +import com.bsth.entity.mcy_forms.Vehicleloading; | |
| 17 | +import com.bsth.entity.mcy_forms.Waybillday; | |
| 18 | +import com.bsth.service.forms.ExportService; | |
| 19 | +import com.bsth.util.ReportUtils; | |
| 20 | + | |
| 21 | +@Service | |
| 22 | +public class ExportServiceImpl implements ExportService{ | |
| 23 | + | |
| 24 | + | |
| 25 | + //行车路单日报表 | |
| 26 | + @Override | |
| 27 | + public void waybillday(String date, List<Waybillday> list) { | |
| 28 | + | |
| 29 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 30 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 31 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 32 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 33 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 34 | + ReportUtils ee = new ReportUtils(); | |
| 35 | + | |
| 36 | + for(Waybillday w : list){ | |
| 37 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 38 | + m.put("carPlate", w.getCarPlate()); | |
| 39 | + m.put("jzl1", w.getJzl1()); | |
| 40 | + m.put("jzl", w.getJzl()); | |
| 41 | + m.put("yh", w.getYh()); | |
| 42 | + m.put("jName", w.getjName()); | |
| 43 | + m.put("zlc", w.getZlc()); | |
| 44 | + resList.add(m); | |
| 45 | + } | |
| 46 | + | |
| 47 | + try { | |
| 48 | + listI.add(resList.iterator()); | |
| 49 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 50 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\waybillday.xls", | |
| 51 | + path+"export\\行车路单日报表" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | |
| 52 | + } catch (Exception e) { | |
| 53 | + e.printStackTrace(); | |
| 54 | + } | |
| 55 | + } | |
| 56 | + | |
| 57 | + //线路客流量报表 | |
| 58 | + @Override | |
| 59 | + public void linepasswengerflow(String date, List<Linepasswengerflow> list) { | |
| 60 | + | |
| 61 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 62 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 63 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 64 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 65 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 66 | + ReportUtils ee = new ReportUtils(); | |
| 67 | + for(Linepasswengerflow l : list){ | |
| 68 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 69 | + m.put("stationName", l.getStationName()); | |
| 70 | + resList.add(m); | |
| 71 | + } | |
| 72 | + | |
| 73 | + try { | |
| 74 | + listI.add(resList.iterator()); | |
| 75 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 76 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\linepasswengerflow.xls", | |
| 77 | + path+"export\\线路客流量报表" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | |
| 78 | + } catch (Exception e) { | |
| 79 | + e.printStackTrace(); | |
| 80 | + } | |
| 81 | + | |
| 82 | + } | |
| 83 | + | |
| 84 | + | |
| 85 | + //班次车辆人员日统计 | |
| 86 | + @Override | |
| 87 | + public void shifday(String date,List<Shifday> list) { | |
| 88 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 89 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 90 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 91 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 92 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 93 | + ReportUtils ee = new ReportUtils(); | |
| 94 | + | |
| 95 | + for(Shifday l : list){ | |
| 96 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 97 | + m.put("jName",l.getjName()); | |
| 98 | + m.put("sName", l.getsName()); | |
| 99 | + m.put("lpName", l.getLpName()); | |
| 100 | + m.put("carPlate", l.getCarPlate()); | |
| 101 | + m.put("jhlc", l.getJhlc()); | |
| 102 | + m.put("sjjhlc", l.getSjjhlc()); | |
| 103 | + m.put("yygl", l.getYygl()); | |
| 104 | + m.put("emptMileage", l.getEmptMileage()); | |
| 105 | + m.put("remMileage", l.getRemMileage()); | |
| 106 | + m.put("addMileage", l.getAddMileage()); | |
| 107 | + m.put("totalm", l.getTotalm()); | |
| 108 | + m.put("jhbc", l.getJhbc()); | |
| 109 | + m.put("sjjhbc", l.getSjjhbc()); | |
| 110 | + m.put("cjbc", l.getCjbc()); | |
| 111 | + m.put("ljbc", l.getLjbc()); | |
| 112 | + m.put("sjbc", l.getSjbc()); | |
| 113 | + resList.add(m); | |
| 114 | + } | |
| 115 | + | |
| 116 | + try { | |
| 117 | + listI.add(resList.iterator()); | |
| 118 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 119 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\shifday.xls", | |
| 120 | + path+"export\\班次车辆人员日报表" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | |
| 121 | + } catch (Exception e) { | |
| 122 | + e.printStackTrace(); | |
| 123 | + } | |
| 124 | + | |
| 125 | + } | |
| 126 | + | |
| 127 | + //班次车辆人员月统计 | |
| 128 | + @Override | |
| 129 | + public void shiftuehiclemanth(String startDate,String endDate,String lpName, List<Shiftuehiclemanth> list) { | |
| 130 | + | |
| 131 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 132 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 133 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 134 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 135 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 136 | + ReportUtils ee = new ReportUtils(); | |
| 137 | + | |
| 138 | + for(Shiftuehiclemanth l : list){ | |
| 139 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 140 | + m.put("jName",l.getjName() ); | |
| 141 | + m.put("jhlc", l.getJhlc()); | |
| 142 | + m.put("emptMileage",l.getEmptMileage() ); | |
| 143 | + m.put("remMileage", l.getRemMileage()); | |
| 144 | + m.put("addMileage", l.getAddMileage()); | |
| 145 | + m.put("totalm", l.getTotalm()); | |
| 146 | + m.put("cjbc", l.getCjbc()); | |
| 147 | + m.put("ljbc", l.getLjbc()); | |
| 148 | + m.put("sjbc", l.getSjbc()); | |
| 149 | + resList.add(m); | |
| 150 | + } | |
| 151 | + | |
| 152 | + try { | |
| 153 | + listI.add(resList.iterator()); | |
| 154 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 155 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\shiftuehiclemanth.xls", | |
| 156 | + path+"export\\班次车辆人员月报表" + sdfSimple.format(sdfMonth.parse(startDate)) + ".xls"); | |
| 157 | + } catch (Exception e) { | |
| 158 | + e.printStackTrace(); | |
| 159 | + } | |
| 160 | + | |
| 161 | + } | |
| 162 | + | |
| 163 | + //路单报表 | |
| 164 | + @Override | |
| 165 | + public void singledata(String startDate,String endDate,String lpName, List<Singledata> list) { | |
| 166 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 167 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 168 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 169 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 170 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 171 | + ReportUtils ee = new ReportUtils(); | |
| 172 | + | |
| 173 | + for(Singledata l : list){ | |
| 174 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 175 | + m.put("rQ",l.getrQ()); | |
| 176 | + m.put("gS", l.getgS()); | |
| 177 | + m.put("xL",l.getxL() ); | |
| 178 | + m.put("clzbh", l.getClzbh()); | |
| 179 | + m.put("jsy", l.getJsy()); | |
| 180 | + m.put("jName", l.getjName()); | |
| 181 | + m.put("sgh", l.getSgh()); | |
| 182 | + m.put("sName", l.getsName()); | |
| 183 | + m.put("jhlc", l.getJhlc()); | |
| 184 | + m.put("emptMileage", l.getEmptMileage()); | |
| 185 | + m.put("hyl", l.getHyl()); | |
| 186 | + m.put("jzl", l.getJzl()); | |
| 187 | + m.put("unyyyl",l.getUnyyyl()); | |
| 188 | + m.put("jhjl", l.getJhjl()); | |
| 189 | + resList.add(m); | |
| 190 | + } | |
| 191 | + | |
| 192 | + try { | |
| 193 | + listI.add(resList.iterator()); | |
| 194 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 195 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\singledata.xls", | |
| 196 | + path+"export\\路单日报表" + sdfSimple.format(sdfMonth.parse(startDate)) + ".xls"); | |
| 197 | + } catch (Exception e) { | |
| 198 | + e.printStackTrace(); | |
| 199 | + } | |
| 200 | + | |
| 201 | + | |
| 202 | + } | |
| 203 | + | |
| 204 | + | |
| 205 | + //车辆加注 | |
| 206 | + @Override | |
| 207 | + public void vehicleloading(String date, List<Vehicleloading> list) { | |
| 208 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 209 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 210 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 211 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 212 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 213 | + ReportUtils ee = new ReportUtils(); | |
| 214 | + | |
| 215 | + for(Vehicleloading l : list){ | |
| 216 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 217 | + m.put("rQ", l.getrQ()); | |
| 218 | + m.put("gS", l.getgS()); | |
| 219 | + m.put("xL", l.getxL()); | |
| 220 | + m.put("clzbh", l.getClzbh()); | |
| 221 | + m.put("hyl", l.getHyl()); | |
| 222 | + m.put("jzl", l.getJzl()); | |
| 223 | + m.put("ls", l.getLs()); | |
| 224 | + m.put("jhlc", l.getJhlc()); | |
| 225 | + m.put("unyyyl", l.getUnyyyl()); | |
| 226 | + m.put("jhbc", l.getJhbc()); | |
| 227 | + m.put("sjbc", l.getSjbc()); | |
| 228 | + resList.add(m); | |
| 229 | + } | |
| 230 | + | |
| 231 | + try { | |
| 232 | + listI.add(resList.iterator()); | |
| 233 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 234 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\vehicleloading.xls", | |
| 235 | + path+"export\\车辆加注" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | |
| 236 | + } catch (Exception e) { | |
| 237 | + e.printStackTrace(); | |
| 238 | + } | |
| 239 | + } | |
| 240 | + | |
| 241 | + //运营服务阶段报表 | |
| 242 | + @Override | |
| 243 | + public void operationservice(String startDate,String endDate,String lpName,List<Operationservice> list) { | |
| 244 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 245 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 246 | + | |
| 247 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 248 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 249 | + ReportUtils ee = new ReportUtils(); | |
| 250 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 251 | + for(Operationservice l : list){ | |
| 252 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 253 | + m.put("xlName", l.getXlName()); | |
| 254 | + m.put("jzl", l.getJzl()); | |
| 255 | + m.put("xhl", l.getXhl()); | |
| 256 | + m.put("xsgl", l.getXsgl()); | |
| 257 | + m.put("emptMileage", l.getEmptMileage()); | |
| 258 | + m.put("sjbc", l.getSjbc()); | |
| 259 | + resList.add(m); | |
| 260 | + } | |
| 261 | + | |
| 262 | + try { | |
| 263 | + listI.add(resList.iterator()); | |
| 264 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 265 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\operationservice.xls", | |
| 266 | + path+"export\\运营服务阶段报表" + sdfSimple.format(sdfMonth.parse(startDate)) + ".xls"); | |
| 267 | + } catch (Exception e) { | |
| 268 | + e.printStackTrace(); | |
| 269 | + } | |
| 270 | + } | |
| 271 | + | |
| 272 | + | |
| 273 | +} | ... | ... |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
src/main/resources/static/pages/forms/mould/list.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/waybillday.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/waybillday.html
| ... | ... | @@ -118,9 +118,11 @@ |
| 118 | 118 | } |
| 119 | 119 | }); |
| 120 | 120 | |
| 121 | + var line; | |
| 122 | + var date; | |
| 121 | 123 | $("#query").on("click",function(){ |
| 122 | - var line = $("#line").val(); | |
| 123 | - var date = $("#date").val(); | |
| 124 | + line = $("#line").val(); | |
| 125 | + date = $("#date").val(); | |
| 124 | 126 | $post('/mcy_forms/waybillday',{line:line,date:date},function(result){ |
| 125 | 127 | $.each(result, function(i, obj) { |
| 126 | 128 | obj.requestType = reqCodeMap[obj.requestType]; |
| ... | ... | @@ -132,18 +134,11 @@ |
| 132 | 134 | }); |
| 133 | 135 | }); |
| 134 | 136 | |
| 135 | - //导出 | |
| 136 | -// $("#export").on("click",function(){ | |
| 137 | -// $get('/mcy_forms/waybilldayExcel',{line:line,date:date,type:'export'},function(result){ | |
| 138 | -// window.open("/downloadFile/download?fileName=行车路单日报表"+moment(date).format("YYYYMMDD")); | |
| 139 | -// }); | |
| 140 | -// }); | |
| 141 | 137 | $("#export").on("click",function(){ |
| 142 | - | |
| 143 | - $post('/mcy_forms/waybilldayExcel',{line:line,date:date},function(result){ | |
| 144 | - window.open("/downloadFile/download?fileName="+line); | |
| 138 | + $post('/mcy_export/waybilldayExport',{line:line,date:date,type:'export'},function(result){ | |
| 139 | + window.open("/downloadFile/download?fileName=行车路单日报表"+moment(date).format("YYYYMMDD")); | |
| 145 | 140 | }); |
| 146 | - }); | |
| 141 | + }); | |
| 147 | 142 | }); |
| 148 | 143 | </script> |
| 149 | 144 | <script type="text/html" id="waybillday"> | ... | ... |
src/main/resources/static/pages/oil/jyszAdd.html
| ... | ... | @@ -21,7 +21,10 @@ |
| 21 | 21 | <label class="col-md-3 control-label">公司</label> |
| 22 | 22 | <div class="col-md-9"> |
| 23 | 23 | <select class="form-control input-medium " name="gsdm"> |
| 24 | - <option value="77">闵行公交</option> | |
| 24 | + <option value="22">金高公交</option> | |
| 25 | + <option value="05">杨高公交</option> | |
| 26 | + <option value="55">上南公交</option> | |
| 27 | + <option value="26">南汇公交</option> | |
| 25 | 28 | </select> |
| 26 | 29 | </div> |
| 27 | 30 | </div> | ... | ... |
src/main/resources/static/pages/oil/list.html
| ... | ... | @@ -42,7 +42,7 @@ |
| 42 | 42 | </a></li> |
| 43 | 43 | <li class="divider"></li> |
| 44 | 44 | <li><a href="javascript:;" data-action="3" |
| 45 | - class="tool-action"> <i class="fa fa-file-excel-o"></i> | |
| 45 | + class="tool-action" id="export"> <i class="fa fa-file-excel-o"></i> | |
| 46 | 46 | 导出Excel |
| 47 | 47 | </a></li> |
| 48 | 48 | </ul> |
| ... | ... | @@ -57,30 +57,30 @@ |
| 57 | 57 | <thead> |
| 58 | 58 | <tr role="row" class="filter"> |
| 59 | 59 | <td colspan="3"> |
| 60 | -<!-- 公司: --> | |
| 61 | -<!-- <select name="ssgsdm"> --> | |
| 62 | -<!-- <option value="">请选择...</option> --> | |
| 63 | -<!-- <option value="1">可用</option> --> | |
| 64 | -<!-- <option value="0">禁用</option> --> | |
| 65 | -<!-- </select> --> | |
| 60 | + <!-- 公司: | |
| 61 | + <select name="ssgsdm" id="ssgsdm"> | |
| 62 | + <option value="">请选择...</option> | |
| 63 | + <option value="1">可用</option> | |
| 64 | + <option value="0">禁用</option> | |
| 65 | + </select> --> | |
| 66 | 66 | </td> |
| 67 | - | |
| 67 | + <td > | |
| 68 | 68 | <!-- <select name="fgsdm"> --> |
| 69 | 69 | <!-- <option value="">请选择...</option> --> |
| 70 | 70 | <!-- <option value="1">可用</option> --> |
| 71 | 71 | <!-- <option value="0">禁用</option> --> |
| 72 | 72 | <!-- </select> --> |
| 73 | - <td> | |
| 73 | + | |
| 74 | 74 | 日期: |
| 75 | 75 | </td> |
| 76 | - <td colspan="2"> | |
| 77 | - <input type="text" style="width: 80px" name="rq" id="rq"/> | |
| 76 | + <td colspan="2"> | |
| 77 | + <input type="text" style="width: 80px" name="rq" id="rq"/> | |
| 78 | 78 | </td> |
| 79 | 79 | <td colspan="2"> |
| 80 | 80 | 线路: |
| 81 | 81 | </td> |
| 82 | 82 | <td colspan="3"> |
| 83 | - <select class="form-control" name="xlbm" id="xlbm" style="width: 120px;"></select> | |
| 83 | + <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select> | |
| 84 | 84 | |
| 85 | 85 | </td> |
| 86 | 86 | <td colspan="2"> |
| ... | ... | @@ -405,9 +405,20 @@ $(function(){ |
| 405 | 405 | return; |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | - | |
| 409 | - page = num - 1; | |
| 410 | - jsDoQuery(null, false); | |
| 408 | + var cells = $('tr.filter')[0].cells | |
| 409 | + ,params = {} | |
| 410 | + ,name; | |
| 411 | + $.each(cells, function(i, cell){ | |
| 412 | + var items = $('input,select', cell); | |
| 413 | + for(var j = 0, item; item = items[j++];){ | |
| 414 | + name = $(item).attr('name'); | |
| 415 | + if(name){ | |
| 416 | + params[name] = $(item).val(); | |
| 417 | + } | |
| 418 | + } | |
| 419 | + }); | |
| 420 | + page = num - 1; | |
| 421 | + jsDoQuery(params, true); | |
| 411 | 422 | } |
| 412 | 423 | }); |
| 413 | 424 | } |
| ... | ... | @@ -505,6 +516,33 @@ $(function(){ |
| 505 | 516 | } |
| 506 | 517 | }) |
| 507 | 518 | |
| 519 | + | |
| 520 | +//导出 | |
| 521 | + | |
| 522 | + $("#export").on("click",function(){ | |
| 523 | + if($("#rq").val()!=""){ | |
| 524 | + var cells = $('tr.filter')[0].cells | |
| 525 | + ,params = {} | |
| 526 | + ,name; | |
| 527 | + $.each(cells, function(i, cell){ | |
| 528 | + var items = $('input,select', cell); | |
| 529 | + for(var j = 0, item; item = items[j++];){ | |
| 530 | + name = $(item).attr('name'); | |
| 531 | + if(name){ | |
| 532 | + params[name] = $(item).val(); | |
| 533 | + } | |
| 534 | + } | |
| 535 | + }); | |
| 536 | + console.log(params); | |
| 537 | + $post('/ylb/listExport',params,function(result){ | |
| 538 | + console.log(result); | |
| 539 | + window.open("/downloadFile/download?fileName=进出场存油量"+moment($("#rq").val()).format("YYYYMMDD")); | |
| 540 | + }); | |
| 541 | + }else{ | |
| 542 | + layer.msg('请选择日期.'); | |
| 543 | + } | |
| 544 | + }); | |
| 545 | + | |
| 508 | 546 | }); |
| 509 | 547 | //改变状态 |
| 510 | 548 | function startOptJzylLink(id){ |
| ... | ... | @@ -526,5 +564,8 @@ function startOptJzylLink(id){ |
| 526 | 564 | .on('save', function(e, params) { |
| 527 | 565 | $('#'+id).text(params.newValue); |
| 528 | 566 | }); |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 529 | 570 | } |
| 530 | 571 | </script> |
| 531 | 572 | \ No newline at end of file | ... | ... |