Commit ba0cb3dfed02fdf507ac229e5644fc281da81f3b
1 parent
077cb3e6
新增售票员统计导出
Showing
1 changed file
with
130 additions
and
0 deletions
src/main/java/com/bsth/controller/forms/ExportController.java
| ... | ... | @@ -171,6 +171,51 @@ public class ExportController { |
| 171 | 171 | |
| 172 | 172 | return resList; |
| 173 | 173 | } |
| 174 | + | |
| 175 | + // 班次车辆人员月统计 | |
| 176 | + @RequestMapping(value = "/shiftuehiclemanthExport2", method = RequestMethod.GET) | |
| 177 | + public List<Map<String, Object>> shiftuehiclemanthExport2(@RequestParam Map<String, Object> map) { | |
| 178 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 179 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 180 | + ReportUtils ee = new ReportUtils(); | |
| 181 | + List<Shiftuehiclemanth> shiftuehiclemanth = formsService.shiftuehiclemanth2(map); | |
| 182 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 183 | + int i = 1; | |
| 184 | + for (Shiftuehiclemanth l : shiftuehiclemanth) { | |
| 185 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 186 | + m.put("i", i); | |
| 187 | + m.put("jName", l.getjName()); | |
| 188 | + m.put("jhlc", l.getJhlc()); | |
| 189 | + m.put("emptMileage", l.getEmptMileage()); | |
| 190 | + m.put("remMileage", l.getRemMileage()); | |
| 191 | + m.put("addMileage", l.getAddMileage()); | |
| 192 | + m.put("totalm", l.getTotalm()); | |
| 193 | + m.put("cjbc", l.getCjbc()); | |
| 194 | + m.put("ljbc", l.getLjbc()); | |
| 195 | + m.put("sjbc", l.getSjbc()); | |
| 196 | + resList.add(m); | |
| 197 | + i++; | |
| 198 | + } | |
| 199 | + | |
| 200 | + try { | |
| 201 | + String mouldurl = null; | |
| 202 | + if(map.get("empnames").equals("驾驶员")){ | |
| 203 | + mouldurl="mould/shiftuehiclemanth.xls"; | |
| 204 | + }else if(map.get("empnames").equals("售票员")){ | |
| 205 | + mouldurl="mould/shiftuehiclemanthspy.xls"; | |
| 206 | + }else if(map.get("empnames").equals("车辆自编号")){ | |
| 207 | + mouldurl="mould/shiftuehiclemanthclzbh.xls"; | |
| 208 | + } | |
| 209 | + listI.add(resList.iterator()); | |
| 210 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 211 | + ee.excelReplace(listI, new Object[] { map }, path +mouldurl, | |
| 212 | + path + "export/班次车辆人员月报表" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 213 | + } catch (Exception e) { | |
| 214 | + e.printStackTrace(); | |
| 215 | + } | |
| 216 | + | |
| 217 | + return resList; | |
| 218 | + } | |
| 174 | 219 | |
| 175 | 220 | // 路单数据报表 |
| 176 | 221 | @RequestMapping(value = "/singledataExport", method = RequestMethod.GET) |
| ... | ... | @@ -214,6 +259,49 @@ public class ExportController { |
| 214 | 259 | |
| 215 | 260 | return resList; |
| 216 | 261 | } |
| 262 | + | |
| 263 | + // 路单数据报表 | |
| 264 | + @RequestMapping(value = "/singledataExport2", method = RequestMethod.GET) | |
| 265 | + public List<Map<String, Object>> singledataExport2(@RequestParam Map<String, Object> map) { | |
| 266 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 267 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 268 | + ReportUtils ee = new ReportUtils(); | |
| 269 | + List<Singledata> singledata = formsService.singledata2(map); | |
| 270 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 271 | + int i = 1; | |
| 272 | + for (Singledata l : singledata) { | |
| 273 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 274 | + m.put("i", i); | |
| 275 | + m.put("rQ", l.getrQ()); | |
| 276 | + m.put("gS", l.getgS()); | |
| 277 | + m.put("xL", l.getXlmc()); | |
| 278 | + m.put("clzbh", l.getClzbh()); | |
| 279 | + m.put("jsy", l.getJsy()); | |
| 280 | + m.put("jName", l.getjName()); | |
| 281 | + m.put("sgh", l.getSgh()); | |
| 282 | + m.put("sName", l.getsName()); | |
| 283 | + m.put("jhlc", l.getJhlc()); | |
| 284 | + m.put("emptMileage", l.getEmptMileage()); | |
| 285 | + m.put("hyl", l.getHyl()); | |
| 286 | + m.put("jzl", l.getJzl()); | |
| 287 | + m.put("unyyyl", l.getUnyyyl()); | |
| 288 | + m.put("jhjl", l.getJhjl()); | |
| 289 | + resList.add(m); | |
| 290 | + | |
| 291 | + i++; | |
| 292 | + } | |
| 293 | + | |
| 294 | + try { | |
| 295 | + listI.add(resList.iterator()); | |
| 296 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 297 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls", | |
| 298 | + path + "export/路单数据" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 299 | + } catch (Exception e) { | |
| 300 | + e.printStackTrace(); | |
| 301 | + } | |
| 302 | + | |
| 303 | + return resList; | |
| 304 | + } | |
| 217 | 305 | @RequestMapping(value = "/singledataExportTj", method = RequestMethod.GET) |
| 218 | 306 | public List<Map<String, Object>> singledataExportTj(@RequestParam Map<String, Object> map) { |
| 219 | 307 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| ... | ... | @@ -255,6 +343,48 @@ public class ExportController { |
| 255 | 343 | |
| 256 | 344 | return resList; |
| 257 | 345 | } |
| 346 | + | |
| 347 | + @RequestMapping(value = "/singledataExportTj2", method = RequestMethod.GET) | |
| 348 | + public List<Map<String, Object>> singledataExportTj2(@RequestParam Map<String, Object> map) { | |
| 349 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 350 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 351 | + ReportUtils ee = new ReportUtils(); | |
| 352 | + List<Singledata> singledata = formsService.singledatatj2(map); | |
| 353 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 354 | + int i = 1; | |
| 355 | + for (Singledata l : singledata) { | |
| 356 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 357 | + m.put("i", i); | |
| 358 | + m.put("rQ", l.getrQ()); | |
| 359 | + m.put("gS", l.getgS()); | |
| 360 | + m.put("xL", l.getXlmc()); | |
| 361 | + m.put("clzbh", l.getClzbh()); | |
| 362 | + m.put("jsy", l.getJsy()); | |
| 363 | + m.put("jName", l.getjName()); | |
| 364 | + m.put("sgh", l.getSgh()); | |
| 365 | + m.put("sName", l.getsName()); | |
| 366 | + m.put("jhlc", l.getJhlc()); | |
| 367 | + m.put("emptMileage", l.getEmptMileage()); | |
| 368 | + m.put("hyl", l.getHyl()); | |
| 369 | + m.put("jzl", l.getJzl()); | |
| 370 | + m.put("unyyyl", l.getUnyyyl()); | |
| 371 | + m.put("jhjl", l.getJhjl()); | |
| 372 | + resList.add(m); | |
| 373 | + | |
| 374 | + i++; | |
| 375 | + } | |
| 376 | + | |
| 377 | + try { | |
| 378 | + listI.add(resList.iterator()); | |
| 379 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 380 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls", | |
| 381 | + path + "export/路单数据" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 382 | + } catch (Exception e) { | |
| 383 | + e.printStackTrace(); | |
| 384 | + } | |
| 385 | + | |
| 386 | + return resList; | |
| 387 | + } | |
| 258 | 388 | // 车辆加注 |
| 259 | 389 | @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.GET) |
| 260 | 390 | public List<Map<String, Object>> vehicleloadingExport(@RequestParam Map<String, Object> map) { | ... | ... |