Commit 2279afad69c9e25b5eac054ff054ced1541d3487

Authored by yiming
1 parent 20290a20

路单审计报新增小计、车长

src/main/java/com/bsth/service/calc/impl/CalcWaybillAuditServiceImpl.java
@@ -107,7 +107,20 @@ public class CalcWaybillAuditServiceImpl implements CalcWaybillAuditService { @@ -107,7 +107,20 @@ public class CalcWaybillAuditServiceImpl implements CalcWaybillAuditService {
107 String clzbh=v.get(0).getNbbm(); 107 String clzbh=v.get(0).getNbbm();
108 resMap.put("plate", BasicData.nbbmCompanyPlateMap.get(clzbh)!=null?BasicData.nbbmCompanyPlateMap.get(clzbh):""); 108 resMap.put("plate", BasicData.nbbmCompanyPlateMap.get(clzbh)!=null?BasicData.nbbmCompanyPlateMap.get(clzbh):"");
109 Cars car=BasicData.nbbm2CarMap.get(clzbh); 109 Cars car=BasicData.nbbm2CarMap.get(clzbh);
110 - resMap.put("carClass",car!=null&&car.getCarClass()!=null? car.getCarClass():""); 110 + String carClass=car!=null&&car.getCarClass()!=null? car.getCarClass():"";
  111 + resMap.put("carClass",carClass);
  112 + String carLength="";
  113 + if(!"".equals(carClass) && carClass.length()>6){
  114 + int i=Integer.parseInt(carClass.substring(4,5));
  115 + if(i==1){
  116 + carLength=">10";
  117 + }else if(i>1&&i<=7){
  118 + carLength="<8";
  119 + }else if(i>7){
  120 + carLength="8~10";
  121 + }
  122 + }
  123 + resMap.put("carLength",carLength);
111 resMap.put("sfdc",car!=null&&car.getSfdc()!=null? (car.getSfdc()==true?"是":"否"):""); 124 resMap.put("sfdc",car!=null&&car.getSfdc()!=null? (car.getSfdc()==true?"是":"否"):"");
112 resMap.put("sfmix",car!=null&&car.getSfmix()!=null? (car.getSfmix()==true?"是":"否"):""); 125 resMap.put("sfmix",car!=null&&car.getSfmix()!=null? (car.getSfmix()==true?"是":"否"):"");
113 resMap.put("yylc", sum.get("yylc")); 126 resMap.put("yylc", sum.get("yylc"));
@@ -130,6 +143,64 @@ public class CalcWaybillAuditServiceImpl implements CalcWaybillAuditService { @@ -130,6 +143,64 @@ public class CalcWaybillAuditServiceImpl implements CalcWaybillAuditService {
130 143
131 Collections.sort(lMap, new AccountXlbm()); 144 Collections.sort(lMap, new AccountXlbm());
132 if (type != null && type.length() != 0 && type.equals("export")) { 145 if (type != null && type.length() != 0 && type.equals("export")) {
  146 + List<Map<String, Object>> export = new ArrayList<>();
  147 + double yylc=0;
  148 + double in=0;
  149 + double out=0;
  150 + double kslc=0;
  151 + double zkslc=0;
  152 + double zlc=0;
  153 + String lineName=null;
  154 + Map<String, Object> map;
  155 + for (int i = 0; i < lMap.size(); i++) {
  156 + map=lMap.get(i);
  157 + if(lineName!=null && !lineName.equals(map.get("lineName"))){//不同线路
  158 + Map<String, Object> xj=new HashMap<>();
  159 + xj.put("lineName","小计");
  160 + xj.put("plate","");
  161 + xj.put("carClass","");
  162 + xj.put("carLength","");
  163 + xj.put("sfdc","");
  164 + xj.put("sfmix","");
  165 + xj.put("yylc",yylc);
  166 + xj.put("in",in);
  167 + xj.put("out",out);
  168 + xj.put("kslc",kslc);
  169 + xj.put("zkslc",zkslc);
  170 + xj.put("zlc",zlc);
  171 + export.add(xj);
  172 + yylc=0;
  173 + in=0;
  174 + out=0;
  175 + kslc=0;
  176 + zkslc=0;
  177 + zlc=0;
  178 + }
  179 + lineName=(String) map.get("lineName");
  180 + yylc=Arith.add(yylc,map.get("yylc"));
  181 + in=Arith.add(in,map.get("in"));
  182 + out=Arith.add(out,map.get("out"));
  183 + kslc=Arith.add(kslc,map.get("kslc"));
  184 + zkslc=Arith.add(zkslc,map.get("zkslc"));
  185 + zlc=Arith.add(zlc,map.get("zlc"));
  186 + export.add(map);
  187 + if(i==lMap.size()-1){//最后一个
  188 + Map<String, Object> xj=new HashMap<>();
  189 + xj.put("lineName","小计");
  190 + xj.put("plate","");
  191 + xj.put("carClass","");
  192 + xj.put("carLength","");
  193 + xj.put("sfdc","");
  194 + xj.put("sfmix","");
  195 + xj.put("yylc",yylc);
  196 + xj.put("in",in);
  197 + xj.put("out",out);
  198 + xj.put("kslc",kslc);
  199 + xj.put("zkslc",zkslc);
  200 + xj.put("zlc",zlc);
  201 + export.add(xj);
  202 + }
  203 + }
133 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), 204 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
134 sdfSimple = new SimpleDateFormat("yyyyMMdd"); 205 sdfSimple = new SimpleDateFormat("yyyyMMdd");
135 List<Iterator<?>> listI = new ArrayList<>(); 206 List<Iterator<?>> listI = new ArrayList<>();
@@ -144,7 +215,7 @@ public class CalcWaybillAuditServiceImpl implements CalcWaybillAuditService { @@ -144,7 +215,7 @@ public class CalcWaybillAuditServiceImpl implements CalcWaybillAuditService {
144 dateTime = sdfSimple.format(sdfMonth.parse(date)) 215 dateTime = sdfSimple.format(sdfMonth.parse(date))
145 + "-" + sdfSimple.format(sdfMonth.parse(date2)); 216 + "-" + sdfSimple.format(sdfMonth.parse(date2));
146 } 217 }
147 - listI.add(lMap.iterator()); 218 + listI.add(export.iterator());
148 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; 219 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
149 ee.excelReplace(listI, new Object[]{m}, path + "mould/auditReport.xls", 220 ee.excelReplace(listI, new Object[]{m}, path + "mould/auditReport.xls",
150 path + "export/" + dateTime + "-" + xlName + "-路单审计.xls"); 221 path + "export/" + dateTime + "-" + xlName + "-路单审计.xls");
src/main/resources/static/pages/forms/mould/auditReport.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/auditReport.html
@@ -81,6 +81,7 @@ @@ -81,6 +81,7 @@
81 <td rowspan="4"><label>线路</label></td> 81 <td rowspan="4"><label>线路</label></td>
82 <td rowspan="3"><label>车牌号</label></td> 82 <td rowspan="3"><label>车牌号</label></td>
83 <td rowspan="3"><label>车型类别</label></td> 83 <td rowspan="3"><label>车型类别</label></td>
  84 + <td rowspan="3"><label>车长</label></td>
84 <td rowspan="3"><label>电车</label></td> 85 <td rowspan="3"><label>电车</label></td>
85 <td rowspan="3"><label>混合电车</label></td> 86 <td rowspan="3"><label>混合电车</label></td>
86 <td rowspan="3"><label>营运里程</label></td> 87 <td rowspan="3"><label>营运里程</label></td>
@@ -357,6 +358,7 @@ @@ -357,6 +358,7 @@
357 <td>{{obj.lineName}}</td> 358 <td>{{obj.lineName}}</td>
358 <td>{{obj.plate}}</td> 359 <td>{{obj.plate}}</td>
359 <td>{{obj.carClass}}</td> 360 <td>{{obj.carClass}}</td>
  361 + <td>{{obj.carLength}}</td>
360 <td>{{obj.sfdc}}</td> 362 <td>{{obj.sfdc}}</td>
361 <td>{{obj.sfmix}}</td> 363 <td>{{obj.sfmix}}</td>
362 <td>{{obj.yylc}}</td> 364 <td>{{obj.yylc}}</td>