Commit 44ead61d59dc59aed4f9e10e47aa77f366bc0fcb
Merge branch 'minhang' into pudong
Showing
11 changed files
with
117 additions
and
35 deletions
src/main/java/com/bsth/controller/oil/DlbController.java
| @@ -148,12 +148,12 @@ public class DlbController extends BaseController<Dlb, Integer>{ | @@ -148,12 +148,12 @@ public class DlbController extends BaseController<Dlb, Integer>{ | ||
| 148 | m.put("nbbm", y.getNbbm()); | 148 | m.put("nbbm", y.getNbbm()); |
| 149 | m.put("jsy", y.getJsy()); | 149 | m.put("jsy", y.getJsy()); |
| 150 | m.put("name", y.getName()); | 150 | m.put("name", y.getName()); |
| 151 | - m.put("cdl", y.getCdl()); | ||
| 152 | - m.put("czcd", y.getCzcd()+"%"); | ||
| 153 | - m.put("jzcd", y.getJzcd()+"%"); | ||
| 154 | - m.put("czlc", y.getCzlc()); | ||
| 155 | - m.put("jzlc", y.getJzlc()); | ||
| 156 | - m.put("hd", y.getHd()); | 151 | + m.put("cdl", y.getCdl()<=0?"0":y.getCdl()); |
| 152 | + m.put("czcd", y.getCzcd()<=0?"0":y.getCzcd()+"%"); | ||
| 153 | + m.put("jzcd", y.getJzcd()<=0?"0":y.getJzcd()+"%"); | ||
| 154 | + m.put("czlc", y.getCzlc()<=0?"0":y.getCzlc()); | ||
| 155 | + m.put("jzlc", y.getJzlc()<=0?"0":y.getJzlc()); | ||
| 156 | + m.put("hd", y.getHd()<=0?"0":y.getHd()); | ||
| 157 | String shyy ="无"; | 157 | String shyy ="无"; |
| 158 | if(y.getShyy()!=null){ | 158 | if(y.getShyy()!=null){ |
| 159 | if(shyy.equals("1")){shyy="票务用油";} | 159 | if(shyy.equals("1")){shyy="票务用油";} |
| @@ -166,22 +166,23 @@ public class DlbController extends BaseController<Dlb, Integer>{ | @@ -166,22 +166,23 @@ public class DlbController extends BaseController<Dlb, Integer>{ | ||
| 166 | else if(shyy.equals("8")){shyy="车间(小修)";} | 166 | else if(shyy.equals("8")){shyy="车间(小修)";} |
| 167 | else{shyy ="无";} | 167 | else{shyy ="无";} |
| 168 | } | 168 | } |
| 169 | - m.put("ns", y.getNs()); | 169 | + m.put("ns", y.getNs()<=0?"0":y.getNs()); |
| 170 | m.put("shyy", shyy); | 170 | m.put("shyy", shyy); |
| 171 | - m.put("sh", y.getSh()); | ||
| 172 | - m.put("zlc", y.getZlc()); | 171 | + m.put("sh", y.getSh()<=0?"0":y.getSh()); |
| 172 | + m.put("zlc", y.getZlc()<=0?"0":y.getZlc()); | ||
| 173 | m.put("rdlx", ""); | 173 | m.put("rdlx", ""); |
| 174 | m.put("bglyh", y.getBglyh()); | 174 | m.put("bglyh", y.getBglyh()); |
| 175 | resList.add(m); | 175 | resList.add(m); |
| 176 | } | 176 | } |
| 177 | try { | 177 | try { |
| 178 | + map.put("sheetName", map.get("rq")); | ||
| 178 | listI.add(resList.iterator()); | 179 | listI.add(resList.iterator()); |
| 179 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 180 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 180 | ee.excelReplace(listI, new Object[] { map }, path+"mould/listDl.xls", | 181 | ee.excelReplace(listI, new Object[] { map }, path+"mould/listDl.xls", |
| 181 | path+"export/"+map.get("rq").toString()+ "进出场存电量.xls"); | 182 | path+"export/"+map.get("rq").toString()+ "进出场存电量.xls"); |
| 182 | } catch (Exception e) { | 183 | } catch (Exception e) { |
| 183 | e.printStackTrace(); | 184 | e.printStackTrace(); |
| 184 | - } | 185 | + } |
| 185 | 186 | ||
| 186 | return resList; | 187 | return resList; |
| 187 | 188 |
src/main/java/com/bsth/controller/oil/YlbController.java
| @@ -236,19 +236,19 @@ public class YlbController extends BaseController<Ylb, Integer>{ | @@ -236,19 +236,19 @@ public class YlbController extends BaseController<Ylb, Integer>{ | ||
| 236 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | 236 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 237 | for (Ylb y : ylb) { | 237 | for (Ylb y : ylb) { |
| 238 | Map<String, Object> m = new HashMap<String, Object>(); | 238 | Map<String, Object> m = new HashMap<String, Object>(); |
| 239 | - m.put("rq", y.getRq()); | 239 | + m.put("rq", sdfMonth.format(y.getRq())); |
| 240 | m.put("gsname",y.getGsname() ); | 240 | m.put("gsname",y.getGsname() ); |
| 241 | m.put("fgsname", y.getFgsname()); | 241 | m.put("fgsname", y.getFgsname()); |
| 242 | m.put("xlname", y.getXlname()==null?"":y.getXlname()); | 242 | m.put("xlname", y.getXlname()==null?"":y.getXlname()); |
| 243 | m.put("nbbm", y.getNbbm()); | 243 | m.put("nbbm", y.getNbbm()); |
| 244 | m.put("jsy", y.getJsy()); | 244 | m.put("jsy", y.getJsy()); |
| 245 | m.put("name", y.getName()); | 245 | m.put("name", y.getName()); |
| 246 | - m.put("jzl", y.getJzl()); | ||
| 247 | - m.put("czlc", y.getCzlc()); | ||
| 248 | - m.put("jzlc", y.getJzlc()); | ||
| 249 | - m.put("czyl", y.getCzyl()); | ||
| 250 | - m.put("jzyl", y.getJzyl()); | ||
| 251 | - m.put("yh", y.getYh()); | 246 | + m.put("jzl", y.getJzl()<=0?"0":y.getJzl()); |
| 247 | + m.put("czlc", y.getCzlc()<=0?"0":y.getCzlc()); | ||
| 248 | + m.put("jzlc", y.getJzlc()<=0?"0":y.getJzlc()); | ||
| 249 | + m.put("czyl", y.getCzyl()<=0?"0":y.getCzyl()); | ||
| 250 | + m.put("jzyl", y.getJzyl()<=0?"0":y.getJzyl()); | ||
| 251 | + m.put("yh", y.getYh()<=0?"0":y.getYh()); | ||
| 252 | String rylx=""; | 252 | String rylx=""; |
| 253 | if(y.getRylx()!=null){ | 253 | if(y.getRylx()!=null){ |
| 254 | if(y.getRylx().equals("0")){rylx="0号柴油";} | 254 | if(y.getRylx().equals("0")){rylx="0号柴油";} |
| @@ -270,12 +270,13 @@ public class YlbController extends BaseController<Ylb, Integer>{ | @@ -270,12 +270,13 @@ public class YlbController extends BaseController<Ylb, Integer>{ | ||
| 270 | else{shyy ="无";} | 270 | else{shyy ="无";} |
| 271 | } | 271 | } |
| 272 | m.put("shyy", shyy); | 272 | m.put("shyy", shyy); |
| 273 | - m.put("sh", y.getSh()); | ||
| 274 | - m.put("zlc", y.getZlc()); | 273 | + m.put("sh", y.getSh()<=0?"0":y.getSh()); |
| 274 | + m.put("zlc", y.getZlc()<=0?"0":y.getZlc()); | ||
| 275 | m.put("bglyh", y.getBglyh()); | 275 | m.put("bglyh", y.getBglyh()); |
| 276 | resList.add(m); | 276 | resList.add(m); |
| 277 | } | 277 | } |
| 278 | try { | 278 | try { |
| 279 | + map.put("sheetName", map.get("rq")); | ||
| 279 | listI.add(resList.iterator()); | 280 | listI.add(resList.iterator()); |
| 280 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 281 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 281 | ee.excelReplace(listI, new Object[] { map }, path+"mould/list.xls", | 282 | ee.excelReplace(listI, new Object[] { map }, path+"mould/list.xls", |
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| @@ -309,6 +309,12 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -309,6 +309,12 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 309 | @RequestParam String code,@RequestParam String xlName, @RequestParam String type) { | 309 | @RequestParam String code,@RequestParam String xlName, @RequestParam String type) { |
| 310 | return scheduleRealInfoService.account(line, date, code, xlName, type); | 310 | return scheduleRealInfoService.account(line, date, code, xlName, type); |
| 311 | } | 311 | } |
| 312 | + | ||
| 313 | + @RequestMapping(value = "/accountPx") | ||
| 314 | + public List<Map<String,Object>> accountPx(@RequestParam String line, @RequestParam String date, | ||
| 315 | + @RequestParam String code,@RequestParam String xlName, @RequestParam String px) { | ||
| 316 | + return scheduleRealInfoService.accountPx(line, date, code, xlName, px); | ||
| 317 | + } | ||
| 312 | 318 | ||
| 313 | @RequestMapping(value = "/correctForm") | 319 | @RequestMapping(value = "/correctForm") |
| 314 | public List<ScheduleRealInfo> correctForm(@RequestParam String line, @RequestParam String startDate, | 320 | public List<ScheduleRealInfo> correctForm(@RequestParam String line, @RequestParam String startDate, |
src/main/java/com/bsth/entity/oil/Dlb.java
| @@ -332,7 +332,7 @@ public class Dlb { | @@ -332,7 +332,7 @@ public class Dlb { | ||
| 332 | 332 | ||
| 333 | public String getBglyh() { | 333 | public String getBglyh() { |
| 334 | if(this.getZlc()==0){ | 334 | if(this.getZlc()==0){ |
| 335 | - return "0.00"; | 335 | + return "0"; |
| 336 | }else{ | 336 | }else{ |
| 337 | DecimalFormat df = new DecimalFormat("0.00"); | 337 | DecimalFormat df = new DecimalFormat("0.00"); |
| 338 | return df.format(this.getHd()/this.getZlc()*100); | 338 | return df.format(this.getHd()/this.getZlc()*100); |
src/main/java/com/bsth/entity/oil/Ylb.java
| @@ -278,7 +278,7 @@ public class Ylb { | @@ -278,7 +278,7 @@ public class Ylb { | ||
| 278 | 278 | ||
| 279 | public String getBglyh() { | 279 | public String getBglyh() { |
| 280 | if(this.getZlc()==0){ | 280 | if(this.getZlc()==0){ |
| 281 | - return "0.00"; | 281 | + return "0"; |
| 282 | }else{ | 282 | }else{ |
| 283 | DecimalFormat df = new DecimalFormat("0.00"); | 283 | DecimalFormat df = new DecimalFormat("0.00"); |
| 284 | return df.format(this.getYh()/this.getZlc()*100); | 284 | return df.format(this.getYh()/this.getZlc()*100); |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -506,7 +506,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -506,7 +506,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 506 | long l=Math.round(nextJzyl); | 506 | long l=Math.round(nextJzyl); |
| 507 | double ylxs=l*100/100; | 507 | double ylxs=l*100/100; |
| 508 | // nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); | 508 | // nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); |
| 509 | - yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl)); | 509 | + yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); |
| 510 | t.setYh(yh); | 510 | t.setYh(yh); |
| 511 | t.setJzyl(ylxs); | 511 | t.setJzyl(ylxs); |
| 512 | nextJzyl=ylxs; | 512 | nextJzyl=ylxs; |
| @@ -531,7 +531,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -531,7 +531,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 531 | ylxs=l*100/100; | 531 | ylxs=l*100/100; |
| 532 | 532 | ||
| 533 | } | 533 | } |
| 534 | - yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl)); | 534 | + yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); |
| 535 | // nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); | 535 | // nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); |
| 536 | 536 | ||
| 537 | t.setYh(yh); | 537 | t.setYh(yh); |
| @@ -1218,8 +1218,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1218,8 +1218,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1218 | t.setShyy(shyy); | 1218 | t.setShyy(shyy); |
| 1219 | } | 1219 | } |
| 1220 | czyl=t.getCzyl(); | 1220 | czyl=t.getCzyl(); |
| 1221 | -// Double jcyl = t.getCzyl(); | ||
| 1222 | - zyl = jzl; | 1221 | + Double jcyl = t.getCzyl(); |
| 1222 | + zyl = Arith.sub(Arith.add(jcyl, jzl), yl); | ||
| 1223 | Double yh = 0.0; | 1223 | Double yh = 0.0; |
| 1224 | if (zlc > 0 && t.getZlc() > 0) { | 1224 | if (zlc > 0 && t.getZlc() > 0) { |
| 1225 | yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | 1225 | yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); |
| @@ -1229,7 +1229,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1229,7 +1229,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1229 | long l=Math.round(nextJzyl); | 1229 | long l=Math.round(nextJzyl); |
| 1230 | double ylxs=l*100/100; | 1230 | double ylxs=l*100/100; |
| 1231 | // nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); | 1231 | // nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); |
| 1232 | - yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl)); | 1232 | + yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); |
| 1233 | t.setYh(yh); | 1233 | t.setYh(yh); |
| 1234 | t.setJzyl(ylxs); | 1234 | t.setJzyl(ylxs); |
| 1235 | nextJzyl=ylxs; | 1235 | nextJzyl=ylxs; |
| @@ -1252,12 +1252,12 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1252,12 +1252,12 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1252 | long l=0l; | 1252 | long l=0l; |
| 1253 | double ylxs=0.0; | 1253 | double ylxs=0.0; |
| 1254 | if(i==iterator2.size()-1){ | 1254 | if(i==iterator2.size()-1){ |
| 1255 | - ylxs=czyl; | 1255 | + ylxs=yl; |
| 1256 | }else{ | 1256 | }else{ |
| 1257 | l=Math.round(nextJzyl); | 1257 | l=Math.round(nextJzyl); |
| 1258 | ylxs=l*100/100; | 1258 | ylxs=l*100/100; |
| 1259 | } | 1259 | } |
| 1260 | - yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl)); | 1260 | + yh=Arith.add(yh, Arith.sub(nextJzyl,ylxs)); |
| 1261 | t.setYh(yh); | 1261 | t.setYh(yh); |
| 1262 | t.setJzyl(ylxs); | 1262 | t.setJzyl(ylxs); |
| 1263 | nextJzyl=ylxs; | 1263 | nextJzyl=ylxs; |
| @@ -1269,7 +1269,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1269,7 +1269,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1269 | } | 1269 | } |
| 1270 | } | 1270 | } |
| 1271 | repository.save(t); | 1271 | repository.save(t); |
| 1272 | - /*for (int z = 0; z < cylList.size(); z++) { | 1272 | + for (int z = 0; z < cylList.size(); z++) { |
| 1273 | Cyl cyl = cylList.get(z); | 1273 | Cyl cyl = cylList.get(z); |
| 1274 | if (t.getNbbm().equals(cyl.getNbbm())) { | 1274 | if (t.getNbbm().equals(cyl.getNbbm())) { |
| 1275 | cyl.setCyl(t.getJzyl()); | 1275 | cyl.setCyl(t.getJzyl()); |
| @@ -1277,7 +1277,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1277,7 +1277,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1277 | break; | 1277 | break; |
| 1278 | } | 1278 | } |
| 1279 | cylRepository.save(cyl); | 1279 | cylRepository.save(cyl); |
| 1280 | - }*/ | 1280 | + } |
| 1281 | } | 1281 | } |
| 1282 | newMap.put("status", ResponseCode.SUCCESS); | 1282 | newMap.put("status", ResponseCode.SUCCESS); |
| 1283 | } | 1283 | } |
| @@ -1289,6 +1289,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1289,6 +1289,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1289 | return newMap; | 1289 | return newMap; |
| 1290 | } | 1290 | } |
| 1291 | 1291 | ||
| 1292 | + | ||
| 1292 | @Override | 1293 | @Override |
| 1293 | public String checkJsy(Map<String, Object> map) { | 1294 | public String checkJsy(Map<String, Object> map) { |
| 1294 | // TODO Auto-generated method stub | 1295 | // TODO Auto-generated method stub |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| @@ -101,6 +101,8 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | @@ -101,6 +101,8 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | ||
| 101 | List<Map<String,String>> findLpName(String lpName); | 101 | List<Map<String,String>> findLpName(String lpName); |
| 102 | 102 | ||
| 103 | List<Map<String,Object>> account(String line,String date,String code,String xlName, String type); | 103 | List<Map<String,Object>> account(String line,String date,String code,String xlName, String type); |
| 104 | + List<Map<String,Object>> accountPx(String line,String date,String code,String xlName, String px); | ||
| 105 | + | ||
| 104 | 106 | ||
| 105 | List<ScheduleRealInfo> correctForm(String line,String startDate,String endDate,String lpName,String code, String type); | 107 | List<ScheduleRealInfo> correctForm(String line,String startDate,String endDate,String lpName,String code, String type); |
| 106 | 108 |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -1811,6 +1811,46 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1811,6 +1811,46 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1811 | 1811 | ||
| 1812 | 1812 | ||
| 1813 | @Override | 1813 | @Override |
| 1814 | + public List<Map<String, Object>> accountPx(String line, String date, | ||
| 1815 | + String code, String xlName, String px) { | ||
| 1816 | +// List<Object[]> lsitObj = scheduleRealInfoRepository.accountPx(line, date, code,px); | ||
| 1817 | + List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); | ||
| 1818 | + String sql= "SELECT c.company,r.request_code,FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d %T') as date," | ||
| 1819 | + + "c.inside_code FROM bsth_v_report_80 r LEFT JOIN bsth_c_cars c " | ||
| 1820 | + + "ON c.equipment_code = r.device_id where " | ||
| 1821 | + + "FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d') = '"+date +"'" | ||
| 1822 | + + "and r.line_id = "+line+" and c.inside_code like '%"+code+"%'" | ||
| 1823 | + + " order by c.inside_code "+px; | ||
| 1824 | + Map<String, Object> map; | ||
| 1825 | + List<Object[]> lsitObj = jdbcTemplate.query(sql, | ||
| 1826 | + new RowMapper<Object[]>() { | ||
| 1827 | + @Override | ||
| 1828 | + public Object[] mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 1829 | + Object[] t = new Object[4]; | ||
| 1830 | + t[0]=rs.getString("company"); | ||
| 1831 | + t[1]=rs.getString("request_code"); | ||
| 1832 | + t[2]=rs.getString("date"); | ||
| 1833 | + t[3]=rs.getString("inside_code"); | ||
| 1834 | + return t; | ||
| 1835 | + } | ||
| 1836 | + }); | ||
| 1837 | + int i = 1; | ||
| 1838 | + for (Object[] obj : lsitObj) { | ||
| 1839 | + if (obj != null) { | ||
| 1840 | + map = new HashMap<String, Object>(); | ||
| 1841 | + map.put("num", i++); | ||
| 1842 | + map.put("xlName", xlName); | ||
| 1843 | + map.put("clZbh", obj[3]); | ||
| 1844 | + map.put("company", obj[0]); | ||
| 1845 | + map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[1] + "")).toUpperCase()); | ||
| 1846 | + map.put("requestTime", obj[2]); | ||
| 1847 | + listMap.add(map); | ||
| 1848 | + } | ||
| 1849 | + } | ||
| 1850 | + | ||
| 1851 | + return listMap; | ||
| 1852 | + } | ||
| 1853 | + @Override | ||
| 1814 | public List<Map<String, Object>> account(String line, String date, | 1854 | public List<Map<String, Object>> account(String line, String date, |
| 1815 | String code, String xlName, String type) { | 1855 | String code, String xlName, String type) { |
| 1816 | List<Object[]> lsitObj = scheduleRealInfoRepository.account(line, date, code); | 1856 | List<Object[]> lsitObj = scheduleRealInfoRepository.account(line, date, code); |
src/main/java/com/bsth/util/ReportUtils.java
| @@ -47,6 +47,10 @@ public class ReportUtils { | @@ -47,6 +47,10 @@ public class ReportUtils { | ||
| 47 | POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream( | 47 | POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream( |
| 48 | sourcePath)); | 48 | sourcePath)); |
| 49 | HSSFWorkbook wb = new HSSFWorkbook(fs); | 49 | HSSFWorkbook wb = new HSSFWorkbook(fs); |
| 50 | + Map<String, Object> m = (Map<String, Object>)tArray[0]; | ||
| 51 | + if(m.containsKey("sheetName") && m.get("sheetName")!=null | ||
| 52 | + && m.get("sheetName").toString().trim().length()!=0) | ||
| 53 | + wb.setSheetName(0, m.get("sheetName").toString()); | ||
| 50 | HSSFSheet sheet = wb.getSheetAt(0); | 54 | HSSFSheet sheet = wb.getSheetAt(0); |
| 51 | HSSFRow row; | 55 | HSSFRow row; |
| 52 | HSSFCell cell = null; | 56 | HSSFCell cell = null; |
src/main/resources/static/pages/forms/mould/list.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/account.html
| @@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
| 55 | <tr> | 55 | <tr> |
| 56 | <th>序号</th> | 56 | <th>序号</th> |
| 57 | <th>线路</th> | 57 | <th>线路</th> |
| 58 | - <th>车辆</th> | 58 | + <th class="nbbmPx">车辆</th> |
| 59 | <th>所属公司</th> | 59 | <th>所属公司</th> |
| 60 | <th>请求类型</th> | 60 | <th>请求类型</th> |
| 61 | <th>请求时间</th> | 61 | <th>请求时间</th> |
| @@ -140,10 +140,37 @@ | @@ -140,10 +140,37 @@ | ||
| 140 | } | 140 | } |
| 141 | }); | 141 | }); |
| 142 | } | 142 | } |
| 143 | - var line = $("#line").val(); | ||
| 144 | - var xlName = $("#select2-line-container").html(); | ||
| 145 | - var date = $("#date").val(); | ||
| 146 | - var code = $("#code").val(); | 143 | + var line = $("#line").val(); |
| 144 | + var xlName = $("#select2-line-container").html(); | ||
| 145 | + var date = $("#date").val(); | ||
| 146 | + var code = $("#code").val(); | ||
| 147 | + var px="desc"; | ||
| 148 | + $(".nbbmPx").on("click",function(){ | ||
| 149 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | ||
| 150 | + layer.msg("请选择时间"); | ||
| 151 | + return; | ||
| 152 | + } | ||
| 153 | + if(px=="desc"){ | ||
| 154 | + px="asc"; | ||
| 155 | + }else{ | ||
| 156 | + px="desc"; | ||
| 157 | + } | ||
| 158 | + line = $("#line").val(); | ||
| 159 | + xlName = $("#select2-line-container").html(); | ||
| 160 | + date = $("#date").val(); | ||
| 161 | + code = $("#code").val(); | ||
| 162 | + | ||
| 163 | + $get('/realSchedule/accountPx',{line:line,date:date,code:code,xlName:xlName,px:px},function(result){ | ||
| 164 | + $.each(result, function(i, obj) { | ||
| 165 | + obj.requestType = reqCodeMap[obj.requestType]; | ||
| 166 | + }); | ||
| 167 | + // 把数据填充到模版中 | ||
| 168 | + var tbodyHtml = template('list_account',{list:result}); | ||
| 169 | + // 把渲染好的模版html文本追加到表格中 | ||
| 170 | + $('#forms tbody').html(tbodyHtml); | ||
| 171 | + }); | ||
| 172 | + }) | ||
| 173 | + | ||
| 147 | $("#query").on("click",function(){ | 174 | $("#query").on("click",function(){ |
| 148 | if($("#date").val() == null || $("#date").val().trim().length == 0){ | 175 | if($("#date").val() == null || $("#date").val().trim().length == 0){ |
| 149 | layer.msg("请选择时间"); | 176 | layer.msg("请选择时间"); |