Commit b948a08ac56df2f050a803b4b4331f5bcc392b68

Authored by 娄高锋
1 parent 2d6c1253

时刻表分析导出优化

src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
@@ -106,12 +106,17 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer @@ -106,12 +106,17 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer
106 106
107 public Map<String, Object> autoGenerate(String date, String line) throws Exception { 107 public Map<String, Object> autoGenerate(String date, String line) throws Exception {
108 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 108 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  109 + List<String> dateList = new ArrayList<String>();
109 if(date == null || date.trim().length() == 0){ 110 if(date == null || date.trim().length() == 0){
110 Date d = new Date(); 111 Date d = new Date();
111 - d.setTime(d.getTime() - (4 * 1000 * 60 * 60 * 24));  
112 - date = sdf.format(d); 112 + d.setTime(d.getTime() - (4l * 1000 * 60 * 60 * 24));
  113 + for(long i = 0; i < 3; i++){
  114 + d.setTime(d.getTime() + (i * 1000 * 60 * 60 * 24));
  115 + dateList.add(sdf.format(d));
  116 + }
113 } else { 117 } else {
114 date = date.trim(); 118 date = date.trim();
  119 + dateList.add(date);
115 } 120 }
116 if(line == null || line.trim().length() == 0){ 121 if(line == null || line.trim().length() == 0){
117 line = ""; 122 line = "";
@@ -120,26 +125,28 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -120,26 +125,28 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
120 } 125 }
121 126
122 Map<String, Object> m = new HashMap<String, Object>(); 127 Map<String, Object> m = new HashMap<String, Object>();
123 - try {  
124 - Map<String, Object> generateNew = generateNew(date, line);  
125 - m.put("generateNew", generateNew);  
126 - } catch (Exception e) {  
127 - // TODO: handle exception  
128 - logger.info("重新统计保存失败!");  
129 - }  
130 - try {  
131 - Map<String, Object> calcLineMileage = calcLineMileage(date, line);  
132 - m.put("lineMileage", calcLineMileage);  
133 - } catch (Exception e) {  
134 - // TODO: handle exception  
135 - logger.info("线路公里审计保存失败!");  
136 - }  
137 - try {  
138 - Map<String, Object> calcBusMileage = calcBusMileage(date, line);  
139 - m.put("busMileage", calcBusMileage);  
140 - } catch (Exception e) {  
141 - // TODO: handle exception  
142 - logger.info("路单数据审计保存失败!"); 128 + for(String d : dateList){
  129 + try {
  130 + Map<String, Object> generateNew = generateNew(d, line);
  131 + m.put("generateNew", generateNew);
  132 + } catch (Exception e) {
  133 + // TODO: handle exception
  134 + logger.info("重新统计保存失败!");
  135 + }
  136 + try {
  137 + Map<String, Object> calcLineMileage = calcLineMileage(d, line);
  138 + m.put("lineMileage", calcLineMileage);
  139 + } catch (Exception e) {
  140 + // TODO: handle exception
  141 + logger.info("线路公里审计保存失败!");
  142 + }
  143 + try {
  144 + Map<String, Object> calcBusMileage = calcBusMileage(d, line);
  145 + m.put("busMileage", calcBusMileage);
  146 + } catch (Exception e) {
  147 + // TODO: handle exception
  148 + logger.info("路单数据审计保存失败!");
  149 + }
143 } 150 }
144 151
145 return m; 152 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