Commit 79ba6eda818f73fc472eb8b8fe1542b6dce44a91

Authored by 娄高锋
1 parent cb8fc807

时刻表分析导出优化

src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
... ... @@ -101,12 +101,17 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer
101 101  
102 102 public Map<String, Object> autoGenerate(String date, String line) throws Exception {
103 103 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  104 + List<String> dateList = new ArrayList<String>();
104 105 if(date == null || date.trim().length() == 0){
105 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 112 } else {
109 113 date = date.trim();
  114 + dateList.add(date);
110 115 }
111 116 if(line == null || line.trim().length() == 0){
112 117 line = "";
... ... @@ -115,26 +120,28 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
115 120 }
116 121  
117 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 147 return m;
... ...
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
... ... @@ -867,13 +867,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
867 867  
868 868 //导出
869 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 870 String lineName = "";
878 871 if(map.containsKey("lineName"))
879 872 lineName = map.get("lineName").toString();
... ...
src/main/java/com/bsth/util/ReportUtils.java
... ... @@ -603,7 +603,7 @@ public class ReportUtils {
603 603 for (Iterator<Cell> cellIt = fromRow.cellIterator(); cellIt.hasNext();) {
604 604 HSSFCell tmpCell = (HSSFCell) cellIt.next();
605 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