Commit 79ba6eda818f73fc472eb8b8fe1542b6dce44a91
1 parent
cb8fc807
时刻表分析导出优化
Showing
4 changed files
with
30 additions
and
30 deletions
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
| @@ -101,12 +101,17 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -101,12 +101,17 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 101 | 101 | ||
| 102 | public Map<String, Object> autoGenerate(String date, String line) throws Exception { | 102 | public Map<String, Object> autoGenerate(String date, String line) throws Exception { |
| 103 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 103 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 104 | + List<String> dateList = new ArrayList<String>(); | ||
| 104 | if(date == null || date.trim().length() == 0){ | 105 | if(date == null || date.trim().length() == 0){ |
| 105 | Date d = new Date(); | 106 | Date d = new Date(); |
| 106 | - d.setTime(d.getTime() - (4 * 1000 * 60 * 60 * 24)); | ||
| 107 | - date = sdf.format(d); | 107 | + d.setTime(d.getTime() - (4l * 1000 * 60 * 60 * 24)); |
| 108 | + for(long i = 0; i < 3; i++){ | ||
| 109 | + d.setTime(d.getTime() + (i * 1000 * 60 * 60 * 24)); | ||
| 110 | + dateList.add(sdf.format(d)); | ||
| 111 | + } | ||
| 108 | } else { | 112 | } else { |
| 109 | date = date.trim(); | 113 | date = date.trim(); |
| 114 | + dateList.add(date); | ||
| 110 | } | 115 | } |
| 111 | if(line == null || line.trim().length() == 0){ | 116 | if(line == null || line.trim().length() == 0){ |
| 112 | line = ""; | 117 | line = ""; |
| @@ -115,26 +120,28 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -115,26 +120,28 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 115 | } | 120 | } |
| 116 | 121 | ||
| 117 | Map<String, Object> m = new HashMap<String, Object>(); | 122 | Map<String, Object> m = new HashMap<String, Object>(); |
| 118 | - try { | ||
| 119 | - Map<String, Object> generateNew = generateNew(date, line); | ||
| 120 | - m.put("generateNew", generateNew); | ||
| 121 | - } catch (Exception e) { | ||
| 122 | - // TODO: handle exception | ||
| 123 | - logger.info("重新统计保存失败!"); | ||
| 124 | - } | ||
| 125 | - try { | ||
| 126 | - Map<String, Object> calcLineMileage = calcLineMileage(date, line); | ||
| 127 | - m.put("lineMileage", calcLineMileage); | ||
| 128 | - } catch (Exception e) { | ||
| 129 | - // TODO: handle exception | ||
| 130 | - logger.info("线路公里审计保存失败!"); | ||
| 131 | - } | ||
| 132 | - try { | ||
| 133 | - Map<String, Object> calcBusMileage = calcBusMileage(date, line); | ||
| 134 | - m.put("busMileage", calcBusMileage); | ||
| 135 | - } catch (Exception e) { | ||
| 136 | - // TODO: handle exception | ||
| 137 | - logger.info("路单数据审计保存失败!"); | 123 | + for(String d : dateList){ |
| 124 | + try { | ||
| 125 | + Map<String, Object> generateNew = generateNew(d, line); | ||
| 126 | + m.put("generateNew", generateNew); | ||
| 127 | + } catch (Exception e) { | ||
| 128 | + // TODO: handle exception | ||
| 129 | + logger.info("重新统计保存失败!"); | ||
| 130 | + } | ||
| 131 | + try { | ||
| 132 | + Map<String, Object> calcLineMileage = calcLineMileage(d, line); | ||
| 133 | + m.put("lineMileage", calcLineMileage); | ||
| 134 | + } catch (Exception e) { | ||
| 135 | + // TODO: handle exception | ||
| 136 | + logger.info("线路公里审计保存失败!"); | ||
| 137 | + } | ||
| 138 | + try { | ||
| 139 | + Map<String, Object> calcBusMileage = calcBusMileage(d, line); | ||
| 140 | + m.put("busMileage", calcBusMileage); | ||
| 141 | + } catch (Exception e) { | ||
| 142 | + // TODO: handle exception | ||
| 143 | + logger.info("路单数据审计保存失败!"); | ||
| 144 | + } | ||
| 138 | } | 145 | } |
| 139 | 146 | ||
| 140 | return m; | 147 | return m; |
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
| @@ -867,13 +867,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -867,13 +867,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 867 | 867 | ||
| 868 | //导出 | 868 | //导出 |
| 869 | if(type.equals("export")){ | 869 | if(type.equals("export")){ |
| 870 | - for(Map<String, Object> m : resList){ | ||
| 871 | - if(m.get("lp") != null){ | ||
| 872 | - if(m.get("lp").toString().contains("+") || m.get("lp").toString().contains("-")){ | ||
| 873 | - m.put("lp", "\'" + m.get("lp").toString().trim()); | ||
| 874 | - } | ||
| 875 | - } | ||
| 876 | - } | ||
| 877 | String lineName = ""; | 870 | String lineName = ""; |
| 878 | if(map.containsKey("lineName")) | 871 | if(map.containsKey("lineName")) |
| 879 | lineName = map.get("lineName").toString(); | 872 | lineName = map.get("lineName").toString(); |
src/main/java/com/bsth/util/ReportUtils.java
| @@ -603,7 +603,7 @@ public class ReportUtils { | @@ -603,7 +603,7 @@ public class ReportUtils { | ||
| 603 | for (Iterator<Cell> cellIt = fromRow.cellIterator(); cellIt.hasNext();) { | 603 | for (Iterator<Cell> cellIt = fromRow.cellIterator(); cellIt.hasNext();) { |
| 604 | HSSFCell tmpCell = (HSSFCell) cellIt.next(); | 604 | HSSFCell tmpCell = (HSSFCell) cellIt.next(); |
| 605 | HSSFCell newCell = toRow.createCell(tmpCell.getColumnIndex(), 0); | 605 | HSSFCell newCell = toRow.createCell(tmpCell.getColumnIndex(), 0); |
| 606 | - copyCell(wb, tmpCell, newCell, copyValueFlag, style); | 606 | + copyCell(wb, tmpCell, newCell, copyValueFlag, tmpCell.getCellStyle()); |
| 607 | } | 607 | } |
| 608 | } | 608 | } |
| 609 | 609 |
src/main/resources/static/pages/forms/mould/scheduleAnaly.xls
No preview for this file type