Commit 8b6a0247172874bc3fdec7824b83a9c3607e58fe
Merge branch 'minhang' of
http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing
21 changed files
with
1075 additions
and
584 deletions
src/main/java/com/bsth/controller/oil/YlbController.java
| ... | ... | @@ -209,8 +209,8 @@ public class YlbController extends BaseController<Ylb, Integer>{ |
| 209 | 209 | return maps; |
| 210 | 210 | } |
| 211 | 211 | @RequestMapping(value="/oilListMonth") |
| 212 | - public List<Ylb> oilListMonth(@RequestParam String line,@RequestParam String date){ | |
| 213 | - return yblService.oilListMonth(line, date); | |
| 212 | + public List<Ylb> oilListMonth(@RequestParam String line,@RequestParam String date,@RequestParam String type){ | |
| 213 | + return yblService.oilListMonth(line, date, type); | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | @RequestMapping(value = "/checkJsy",method = RequestMethod.GET) | ... | ... |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| 1 | 1 | package com.bsth.service.forms.impl; |
| 2 | 2 | |
| 3 | +import java.math.BigDecimal; | |
| 3 | 4 | import java.sql.ResultSet; |
| 4 | 5 | import java.sql.SQLException; |
| 5 | 6 | import java.text.DecimalFormat; |
| ... | ... | @@ -151,6 +152,40 @@ public class FormsServiceImpl implements FormsService { |
| 151 | 152 | w.setSh(String.valueOf(sh)); |
| 152 | 153 | |
| 153 | 154 | } |
| 155 | + | |
| 156 | + Waybillday way = new Waybillday(); | |
| 157 | + way.setNbbm("汇总合计"); | |
| 158 | + BigDecimal ksgl = new BigDecimal("0.0"); | |
| 159 | + BigDecimal jzl_ = new BigDecimal("0.0"); | |
| 160 | + BigDecimal sh_ = new BigDecimal("0.0"); | |
| 161 | + BigDecimal lc_ = new BigDecimal("0.0"); | |
| 162 | + BigDecimal yh_ = new BigDecimal("0.0"); | |
| 163 | + for(Waybillday w : list){ | |
| 164 | + if(w.getJzl1() != null && w.getJzl1().trim().length() != 0){ | |
| 165 | + ksgl = ksgl.add(new BigDecimal(w.getJzl1().trim())); | |
| 166 | + } | |
| 167 | + if(w.getJzl() != null && w.getJzl().trim().length() != 0){ | |
| 168 | + jzl_ = jzl_.add(new BigDecimal(w.getJzl().trim())); | |
| 169 | + } | |
| 170 | + if(w.getSh() != null && w.getSh().trim().length() != 0){ | |
| 171 | + sh_ = sh_.add(new BigDecimal(w.getSh().trim())); | |
| 172 | + } | |
| 173 | + if(w.getZlc() != null && w.getZlc().trim().length() != 0){ | |
| 174 | + lc_ = lc_.add(new BigDecimal(w.getZlc().trim())); | |
| 175 | + } | |
| 176 | + if(w.getYh() != null && w.getYh().trim().length() != 0){ | |
| 177 | + yh_ = yh_.add(new BigDecimal(w.getYh().trim())); | |
| 178 | + } | |
| 179 | + } | |
| 180 | + way.setJzl1(ksgl.toString()); | |
| 181 | + way.setJzl(jzl_.toString()); | |
| 182 | + way.setjName(""); | |
| 183 | + way.setSh(sh_.toString()); | |
| 184 | + way.setZlc(lc_.toString()); | |
| 185 | + way.setYh(yh_.toString()); | |
| 186 | + if(list.size() > 0) | |
| 187 | + list.add(way); | |
| 188 | + | |
| 154 | 189 | return list; |
| 155 | 190 | } |
| 156 | 191 | |
| ... | ... | @@ -315,6 +350,34 @@ public class FormsServiceImpl implements FormsService { |
| 315 | 350 | |
| 316 | 351 | } |
| 317 | 352 | |
| 353 | + Shiftuehiclemanth shif = new Shiftuehiclemanth(); | |
| 354 | + shif.setjName("汇总合计"); | |
| 355 | + BigDecimal yylc = new BigDecimal("0.0"); | |
| 356 | + BigDecimal kslc = new BigDecimal("0.0"); | |
| 357 | + BigDecimal cjlc = new BigDecimal("0.0"); | |
| 358 | + BigDecimal zjlc = new BigDecimal("0.0"); | |
| 359 | + BigDecimal zlc = new BigDecimal("0.0"); | |
| 360 | + int cjbc = 0, zjbc = 0, sjbc = 0; | |
| 361 | + for(Shiftuehiclemanth s : list){ | |
| 362 | + yylc = yylc.add(new BigDecimal(s.getJhlc())); | |
| 363 | + kslc = kslc.add(new BigDecimal(s.getEmptMileage())); | |
| 364 | + cjlc = cjlc.add(new BigDecimal(s.getRemMileage())); | |
| 365 | + zjlc = zjlc.add(new BigDecimal(s.getAddMileage())); | |
| 366 | + zlc = zlc.add(new BigDecimal(s.getTotalm())); | |
| 367 | + cjbc += Integer.valueOf(s.getCjbc()); | |
| 368 | + zjbc += Integer.valueOf(s.getLjbc()); | |
| 369 | + sjbc += Integer.valueOf(s.getSjbc()); | |
| 370 | + } | |
| 371 | + shif.setJhlc(yylc.toString()); | |
| 372 | + shif.setEmptMileage(kslc.toString()); | |
| 373 | + shif.setRemMileage(cjlc.toString()); | |
| 374 | + shif.setAddMileage(zjlc.toString()); | |
| 375 | + shif.setTotalm(zlc.toString()); | |
| 376 | + shif.setCjbc("" + cjbc); | |
| 377 | + shif.setLjbc("" + zjbc); | |
| 378 | + shif.setSjbc("" + sjbc); | |
| 379 | + if(list.size() > 0) | |
| 380 | + list.add(shif); | |
| 318 | 381 | |
| 319 | 382 | return list; |
| 320 | 383 | } |
| ... | ... | @@ -403,7 +466,47 @@ public class FormsServiceImpl implements FormsService { |
| 403 | 466 | d.setLjbc(String.valueOf(ljbc));//增加班次 |
| 404 | 467 | d.setAddMileage(String.valueOf(zjgl));//增加公里 |
| 405 | 468 | d.setSjjhbc(String.valueOf(sjbc));//实际计划班次 |
| 406 | - } | |
| 469 | + } | |
| 470 | + | |
| 471 | + Shifday shif = new Shifday(); | |
| 472 | + shif.setjName("汇总合计"); | |
| 473 | + BigDecimal jhlc = new BigDecimal("0.0"); | |
| 474 | + BigDecimal sjlc = new BigDecimal("0.0"); | |
| 475 | + BigDecimal yylc = new BigDecimal("0.0"); | |
| 476 | + BigDecimal kslc = new BigDecimal("0.0"); | |
| 477 | + BigDecimal cjlc = new BigDecimal("0.0"); | |
| 478 | + BigDecimal zjlc = new BigDecimal("0.0"); | |
| 479 | + BigDecimal zlc = new BigDecimal("0.0"); | |
| 480 | + int jhbc = 0, sjjhbc = 0, cjbc = 0, zjbc = 0, sjbc = 0; | |
| 481 | + for(Shifday s : list){ | |
| 482 | + jhlc = jhlc.add(new BigDecimal(s.getJhlc())); | |
| 483 | + sjlc = sjlc.add(new BigDecimal(s.getSjjhlc())); | |
| 484 | + yylc = yylc.add(new BigDecimal(s.getYygl())); | |
| 485 | + kslc = kslc.add(new BigDecimal(s.getEmptMileage())); | |
| 486 | + cjlc = cjlc.add(new BigDecimal(s.getRemMileage())); | |
| 487 | + zjlc = zjlc.add(new BigDecimal(s.getAddMileage())); | |
| 488 | + zlc = zlc.add(new BigDecimal(s.getTotalm())); | |
| 489 | + jhbc += Integer.valueOf(s.getJhbc()); | |
| 490 | + sjjhbc += Integer.valueOf(s.getSjjhbc()); | |
| 491 | + cjbc += Integer.valueOf(s.getCjbc()); | |
| 492 | + zjbc += Integer.valueOf(s.getLjbc()); | |
| 493 | + sjbc += Integer.valueOf(s.getSjbc()); | |
| 494 | + } | |
| 495 | + shif.setJhlc(jhlc.toString()); | |
| 496 | + shif.setSjjhlc(sjlc.toString()); | |
| 497 | + shif.setYygl(yylc.toString()); | |
| 498 | + shif.setEmptMileage(kslc.toString()); | |
| 499 | + shif.setRemMileage(cjlc.toString()); | |
| 500 | + shif.setAddMileage(zjlc.toString()); | |
| 501 | + shif.setTotalm(zlc.toString()); | |
| 502 | + shif.setJhbc("" + jhbc); | |
| 503 | + shif.setSjjhbc("" + sjjhbc); | |
| 504 | + shif.setCjbc("" + cjbc); | |
| 505 | + shif.setLjbc("" + zjbc); | |
| 506 | + shif.setSjbc("" + sjbc); | |
| 507 | + if(list.size() > 0) | |
| 508 | + list.add(shif); | |
| 509 | + | |
| 407 | 510 | return list; |
| 408 | 511 | } |
| 409 | 512 | ... | ... |
src/main/java/com/bsth/service/oil/YlbService.java
| ... | ... | @@ -19,7 +19,7 @@ public interface YlbService extends BaseService<Ylb, Integer>{ |
| 19 | 19 | |
| 20 | 20 | Map<String, Object> sumYlb(Map<String, Object> map); |
| 21 | 21 | String checkJsy(Map<String, Object> map); |
| 22 | - List<Ylb> oilListMonth(String line,String date); | |
| 22 | + List<Ylb> oilListMonth(String line,String date,String type); | |
| 23 | 23 | List<Ylb> listYlb(Map<String, Object> map); |
| 24 | 24 | StringBuffer checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm,int lx); |
| 25 | 25 | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -45,6 +45,7 @@ import com.bsth.service.oil.YlbService; |
| 45 | 45 | import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| 46 | 46 | import com.bsth.util.Arith; |
| 47 | 47 | import com.bsth.util.BatchSaveUtils; |
| 48 | +import com.bsth.util.ReportUtils; | |
| 48 | 49 | import com.github.abel533.echarts.code.Y; |
| 49 | 50 | |
| 50 | 51 | @Service |
| ... | ... | @@ -949,7 +950,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 949 | 950 | |
| 950 | 951 | |
| 951 | 952 | @Override |
| 952 | - public List<Ylb> oilListMonth(String line, String date) { | |
| 953 | + public List<Ylb> oilListMonth(String line, String date, String type) { | |
| 953 | 954 | String date2=date.substring(0, 8)+"01"; |
| 954 | 955 | String lineStr=""; |
| 955 | 956 | if(line !=null && !line.equals("")){ |
| ... | ... | @@ -979,6 +980,34 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 979 | 980 | return s; |
| 980 | 981 | } |
| 981 | 982 | }); |
| 983 | + | |
| 984 | + if(type != null && type.equals("export")){ | |
| 985 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 986 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 987 | + | |
| 988 | + List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>(); | |
| 989 | + for(Ylb ylb : list){ | |
| 990 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 991 | + m.put("nbbm", ylb.getNbbm()!=null?ylb.getNbbm():""); | |
| 992 | + m.put("rq", ylb.getRq()!=null?sdfMonth.format(ylb.getRq()):""); | |
| 993 | + m.put("jzyl", ylb.getJzyl()!=null?ylb.getJzyl():""); | |
| 994 | + mapList.add(m); | |
| 995 | + } | |
| 996 | + | |
| 997 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 998 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 999 | + ReportUtils ee = new ReportUtils(); | |
| 1000 | + try { | |
| 1001 | + listI.add(mapList.iterator()); | |
| 1002 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | |
| 1003 | + ee.excelReplace(listI, new Object[] { m }, path+"mould/oilListMonth.xls", | |
| 1004 | + path+"export/月存油报表" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | |
| 1005 | + } catch (Exception e) { | |
| 1006 | + // TODO: handle exception | |
| 1007 | + e.printStackTrace(); | |
| 1008 | + } | |
| 1009 | + } | |
| 1010 | + | |
| 982 | 1011 | return list; |
| 983 | 1012 | } |
| 984 | 1013 | ... | ... |
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
| ... | ... | @@ -516,6 +516,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 516 | 516 | String endDate = map.get("endDate").toString(); |
| 517 | 517 | String model = map.get("model").toString(); |
| 518 | 518 | String type = map.get("type").toString(); |
| 519 | + String bcType = map.get("bcType").toString(); | |
| 519 | 520 | |
| 520 | 521 | if(startDate.length() == 0){ |
| 521 | 522 | startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); |
| ... | ... | @@ -533,7 +534,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 533 | 534 | sql += " and gs_bm like '%"+company+"%' and fgs_bm like '%"+subCompany+"%'"; |
| 534 | 535 | // } |
| 535 | 536 | sql += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; |
| 536 | - | |
| 537 | + if(Integer.valueOf(bcType) == 1){ | |
| 538 | + sql += " and bc_type != 'region'"; | |
| 539 | + } else if(Integer.valueOf(bcType) == 2){ | |
| 540 | + sql += " and bc_type = 'region'"; | |
| 541 | + } | |
| 537 | 542 | list = jdbcTemplate.query(sql, |
| 538 | 543 | new RowMapper<ScheduleRealInfo>(){ |
| 539 | 544 | @Override |
| ... | ... | @@ -1180,8 +1185,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 1180 | 1185 | |
| 1181 | 1186 | @Override |
| 1182 | 1187 | public List<Map<String, Object>> firstAndLastBus(Map<String, Object> map) { |
| 1188 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 1189 | + NumberFormat nf = NumberFormat.getNumberInstance(); | |
| 1190 | + nf.setMinimumFractionDigits(2); | |
| 1191 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | |
| 1183 | 1192 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 1184 | - Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | |
| 1185 | 1193 | |
| 1186 | 1194 | String company = map.get("company").toString(); |
| 1187 | 1195 | String subCompany = map.get("subCompany").toString(); |
| ... | ... | @@ -1190,151 +1198,173 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 1190 | 1198 | String type = map.get("type").toString(); |
| 1191 | 1199 | |
| 1192 | 1200 | if(date.length() == 0) |
| 1193 | - date = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 1201 | + date = sdf.format(new Date()); | |
| 1194 | 1202 | |
| 1195 | - List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date); | |
| 1203 | + try { | |
| 1204 | + String sql = "select a.schedule_date_Str, a.real_exec_date, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, a.gs_name, a.fgs_name," | |
| 1205 | + + " b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b on a.xl_bm = b.line" | |
| 1206 | + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') = '"+date+"'" | |
| 1207 | + + " and fcsj_actual is not null and fcsj_actual != '' and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; | |
| 1208 | + if(line.length() != 0) | |
| 1209 | + sql += " and xl_bm = '"+line+"'"; | |
| 1210 | + if(company.length() != 0) | |
| 1211 | + sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; | |
| 1212 | + | |
| 1213 | + list = jdbcTemplate.query(sql, | |
| 1214 | + new RowMapper<ScheduleRealInfo>(){ | |
| 1215 | + @Override | |
| 1216 | + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 1217 | + ScheduleRealInfo schedule = new ScheduleRealInfo(); | |
| 1218 | + schedule.setScheduleDateStr(rs.getString("schedule_date_Str")); | |
| 1219 | + schedule.setRealExecDate(rs.getString("real_exec_date")); | |
| 1220 | + schedule.setXlName(rs.getString("xl_name")); | |
| 1221 | + schedule.setFcsj(rs.getString("fcsj")); | |
| 1222 | + schedule.setFcsjActual(rs.getString("fcsj_actual")); | |
| 1223 | + schedule.setZdsj(rs.getString("zdsj")); | |
| 1224 | + schedule.setZdsjActual(rs.getString("zdsj_actual")); | |
| 1225 | + schedule.setQdzName(rs.getString("qdz_name")); | |
| 1226 | + schedule.setZdzName(rs.getString("zdz_name")); | |
| 1227 | + schedule.setXlDir(rs.getString("xl_dir")); | |
| 1228 | + schedule.setStatus(rs.getInt("status")); | |
| 1229 | + schedule.setGsName(rs.getString("gs_name")); | |
| 1230 | + schedule.setFgsName(rs.getString("fgs_name")); | |
| 1231 | + | |
| 1232 | + int startOpt = 0; | |
| 1233 | + if(rs.getString("start_opt") != null && rs.getString("start_opt").trim().length() != 0){ | |
| 1234 | + String[] split = rs.getString("start_opt").split(":"); | |
| 1235 | + startOpt = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 1236 | + } | |
| 1237 | + | |
| 1238 | + if(schedule.getFcsjActual() != null && schedule.getFcsjActual().trim().length() == 0){ | |
| 1239 | + schedule.setFcsjActual(null); | |
| 1240 | + } | |
| 1241 | + if(schedule.getZdsjActual() != null && schedule.getZdsjActual().trim().length() == 0){ | |
| 1242 | + schedule.setZdsjActual(null); | |
| 1243 | + } | |
| 1244 | + if(schedule.getFcsj() != null){ | |
| 1245 | + String[] split = schedule.getFcsj().split(":"); | |
| 1246 | + int fcsj = Integer.valueOf(split[0]) * 60 + Integer.valueOf(split[1]); | |
| 1247 | + if(fcsj < startOpt) | |
| 1248 | + fcsj += 1440; | |
| 1249 | + schedule.setFcsjT((long)fcsj); | |
| 1250 | + } | |
| 1251 | + if(schedule.getFcsjActual() != null){ | |
| 1252 | + String[] split = schedule.getFcsjActual().split(":"); | |
| 1253 | + int fcsjA = Integer.valueOf(split[0]) * 60 + Integer.valueOf(split[1]); | |
| 1254 | + if(fcsjA < startOpt || !schedule.getRealExecDate().equals(schedule.getScheduleDateStr())) | |
| 1255 | + fcsjA += 1440; | |
| 1256 | + schedule.setFcsjActualTime((long)fcsjA); | |
| 1257 | + } | |
| 1258 | + | |
| 1259 | + return schedule; | |
| 1260 | + } | |
| 1261 | + }); | |
| 1262 | + | |
| 1263 | + } catch (Exception e) { | |
| 1264 | + // TODO: handle exception | |
| 1265 | + e.printStackTrace(); | |
| 1266 | + } | |
| 1196 | 1267 | |
| 1197 | - for(ScheduleRealInfo schedule : list){ | |
| 1198 | - if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out") || schedule.getBcType().equals("ldks")) | |
| 1199 | - continue; | |
| 1200 | - if(schedule.getStatus() == -1){ | |
| 1201 | - continue; | |
| 1202 | - } | |
| 1203 | - String key = schedule.getXlName(); | |
| 1204 | - if(key == null || key.trim().length() == 0) | |
| 1205 | - continue; | |
| 1206 | - if(!keyMap.containsKey(key)) | |
| 1207 | - keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | |
| 1208 | - keyMap.get(key).add(schedule); | |
| 1268 | + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | |
| 1269 | + String companyName = "", subCompanyName = ""; | |
| 1270 | + | |
| 1271 | + for(ScheduleRealInfo s : list){ | |
| 1272 | + String xlName = s.getXlName(); | |
| 1273 | + if(!keyMap.containsKey(xlName)) | |
| 1274 | + keyMap.put(xlName, new ArrayList<ScheduleRealInfo>()); | |
| 1275 | + keyMap.get(xlName).add(s); | |
| 1276 | + if(companyName.length()==0&&s.getGsName()!=null&&s.getGsName().trim().length()!=0) | |
| 1277 | + companyName = s.getGsName(); | |
| 1278 | + if(subCompanyName.length()==0&&s.getFgsName()!=null&&s.getFgsName().trim().length()!=0) | |
| 1279 | + subCompanyName = s.getFgsName(); | |
| 1209 | 1280 | } |
| 1210 | - for(String key : keyMap.keySet()){ | |
| 1281 | + | |
| 1282 | + for(String xlName : keyMap.keySet()){ | |
| 1211 | 1283 | Map<String, Object> tempMap = new HashMap<String, Object>(); |
| 1212 | - Map<Long, ScheduleRealInfo> temp0 = new HashMap<Long, ScheduleRealInfo>(); | |
| 1213 | - List<Long> longList0 = new ArrayList<Long>(); | |
| 1214 | - Map<Long, ScheduleRealInfo> temp1 = new HashMap<Long, ScheduleRealInfo>(); | |
| 1215 | - List<Long> longList1 = new ArrayList<Long>(); | |
| 1216 | - String companyName = "", subCompanyName = ""; | |
| 1217 | - for(ScheduleRealInfo schedule : keyMap.get(key)){ | |
| 1218 | - if(schedule.getFcsjActual() == null || schedule.getFcsjActual().trim().length() == 0){ | |
| 1219 | - continue; | |
| 1220 | - } | |
| 1221 | - if(schedule.getGsName() != null && companyName.length() == 0) | |
| 1222 | - companyName = schedule.getGsName(); | |
| 1223 | - if(schedule.getFgsName() != null && subCompanyName.length() == 0) | |
| 1224 | - subCompanyName = schedule.getFgsName(); | |
| 1225 | - String[] split = schedule.getFcsj().split(":"); | |
| 1226 | - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 1227 | - schedule.setFcsjT(min); | |
| 1228 | - if(schedule.getXlDir().equals("0")){ | |
| 1229 | - temp0.put(min, schedule); | |
| 1230 | - longList0.add(min); | |
| 1231 | - } else { | |
| 1232 | - temp1.put(min, schedule); | |
| 1233 | - longList1.add(min); | |
| 1284 | + tempMap.put("date", date.substring(5)); | |
| 1285 | + tempMap.put("line", xlName); | |
| 1286 | + List<Long> up1 = new ArrayList<Long>(); | |
| 1287 | + List<Long> up2 = new ArrayList<Long>();; | |
| 1288 | + List<Long> dn1 = new ArrayList<Long>(); | |
| 1289 | + List<Long> dn2 = new ArrayList<Long>(); | |
| 1290 | + Map<Long, ScheduleRealInfo> up1Map = new HashMap<Long, ScheduleRealInfo>(); | |
| 1291 | + Map<Long, ScheduleRealInfo> up2Map = new HashMap<Long, ScheduleRealInfo>(); | |
| 1292 | + Map<Long, ScheduleRealInfo> dn1Map = new HashMap<Long, ScheduleRealInfo>(); | |
| 1293 | + Map<Long, ScheduleRealInfo> dn2Map = new HashMap<Long, ScheduleRealInfo>(); | |
| 1294 | + for(ScheduleRealInfo s : keyMap.get(xlName)){ | |
| 1295 | + if(s.getXlDir().equals("0")){ | |
| 1296 | + up1.add(s.getFcsjT()); | |
| 1297 | + up2.add(s.getFcsjActualTime()); | |
| 1298 | + up1Map.put(s.getFcsjT(), s); | |
| 1299 | + up2Map.put(s.getFcsjActualTime(), s); | |
| 1300 | + } else if(s.getXlDir().equals("1")){ | |
| 1301 | + dn1.add(s.getFcsjT()); | |
| 1302 | + dn2.add(s.getFcsjActualTime()); | |
| 1303 | + dn1Map.put(s.getFcsjT(), s); | |
| 1304 | + dn2Map.put(s.getFcsjActualTime(), s); | |
| 1234 | 1305 | } |
| 1235 | 1306 | } |
| 1236 | - | |
| 1237 | - if(longList0.size() == 0 && longList1.size() == 0){ | |
| 1238 | - continue; | |
| 1239 | - } | |
| 1240 | - | |
| 1241 | - if(longList0.size() != 0){ | |
| 1242 | - Collections.sort(longList0); | |
| 1243 | - ScheduleRealInfo shouban0 = temp0.get(longList0.get(0)); | |
| 1244 | - ScheduleRealInfo moban0 = temp0.get(longList0.get(longList0.size() - 1)); | |
| 1245 | - tempMap.put("qdzFirst0", shouban0.getQdzName()); | |
| 1246 | - tempMap.put("jhfcFirst0", shouban0.getFcsj()); | |
| 1247 | - tempMap.put("qdzLast0", moban0.getQdzName()); | |
| 1248 | - tempMap.put("jhfcLast0", moban0.getFcsj()); | |
| 1249 | - if(shouban0.getFcsjActual() != null){ | |
| 1250 | - String[] split = shouban0.getFcsjActual().split(":"); | |
| 1251 | - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 1252 | - long delay = shouban0.getFcsjT() - min; | |
| 1253 | - tempMap.put("sjfcFirst0", shouban0.getFcsjActual()); | |
| 1254 | - if(delay > 0) | |
| 1255 | - tempMap.put("delayFirst0", "+" + delay); | |
| 1256 | - else | |
| 1257 | - tempMap.put("delayFirst0", delay); | |
| 1258 | - } else { | |
| 1259 | - tempMap.put("sjfcFirst0", "/"); | |
| 1260 | - tempMap.put("delayFirst0", "/"); | |
| 1261 | - } | |
| 1262 | - if(moban0.getFcsjActual() != null){ | |
| 1263 | - String[] split = moban0.getFcsjActual().split(":"); | |
| 1264 | - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 1265 | - long delay = moban0.getFcsjT() - min; | |
| 1266 | - tempMap.put("sjfcLast0", moban0.getFcsjActual()); | |
| 1267 | - if(delay > 0) | |
| 1268 | - tempMap.put("delayLast0", "+" + delay); | |
| 1269 | - else | |
| 1270 | - tempMap.put("delayLast0", delay); | |
| 1271 | - } else { | |
| 1272 | - tempMap.put("sjfcLast0", "/"); | |
| 1273 | - tempMap.put("delayLast0", "/"); | |
| 1274 | - } | |
| 1275 | - }else{ | |
| 1307 | + if(up1.size() > 0 && up2.size() > 0){ | |
| 1308 | + Collections.sort(up1); | |
| 1309 | + Collections.sort(up2); | |
| 1310 | + ScheduleRealInfo s1 = up1Map.get(up1.get(0)); | |
| 1311 | + ScheduleRealInfo s2 = up2Map.get(up2.get(0)); | |
| 1312 | + ScheduleRealInfo s3 = up1Map.get(up1.get(up1.size()-1)); | |
| 1313 | + ScheduleRealInfo s4 = up2Map.get(up2.get(up2.size()-1)); | |
| 1314 | + long delayFirst0 = up1.get(0) - up2.get(0); | |
| 1315 | + long delayLast0 = up1.get(up1.size()-1) - up2.get(up2.size()-1); | |
| 1316 | + tempMap.put("qdzFirst0", s1.getQdzName()); | |
| 1317 | + tempMap.put("jhfcFirst0", s1.getFcsj()); | |
| 1318 | + tempMap.put("sjfcFirst0", s2.getFcsjActual()); | |
| 1319 | + tempMap.put("delayFirst0", delayFirst0>0?"+"+delayFirst0:delayFirst0); | |
| 1320 | + tempMap.put("qdzLast0", s3.getQdzName()); | |
| 1321 | + tempMap.put("jhfcLast0", s3.getFcsj()); | |
| 1322 | + tempMap.put("sjfcLast0", s4.getFcsjActual()); | |
| 1323 | + tempMap.put("delayLast0", delayLast0>0?"+"+delayLast0:delayLast0); | |
| 1324 | + } else { | |
| 1276 | 1325 | tempMap.put("qdzFirst0", "--"); |
| 1277 | 1326 | tempMap.put("jhfcFirst0", "/"); |
| 1278 | - tempMap.put("qdzLast0", "--"); | |
| 1279 | - tempMap.put("jhfcLast0", "/"); | |
| 1280 | 1327 | tempMap.put("sjfcFirst0", "/"); |
| 1281 | 1328 | tempMap.put("delayFirst0", "/"); |
| 1329 | + tempMap.put("qdzLast0", "--"); | |
| 1330 | + tempMap.put("jhfcLast0", "/"); | |
| 1282 | 1331 | tempMap.put("sjfcLast0", "/"); |
| 1283 | 1332 | tempMap.put("delayLast0", "/"); |
| 1284 | 1333 | } |
| 1285 | - | |
| 1286 | - if(longList1.size() != 0){ | |
| 1287 | - Collections.sort(longList1); | |
| 1288 | - ScheduleRealInfo shouban1 = temp1.get(longList1.get(0)); | |
| 1289 | - ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1)); | |
| 1290 | - tempMap.put("qdzFirst1", shouban1.getQdzName()); | |
| 1291 | - tempMap.put("jhfcFirst1", shouban1.getFcsj()); | |
| 1292 | - tempMap.put("qdzLast1", moban1.getQdzName()); | |
| 1293 | - tempMap.put("jhfcLast1", moban1.getFcsj()); | |
| 1294 | - if(shouban1.getFcsjActual() != null){ | |
| 1295 | - String[] split = shouban1.getFcsjActual().split(":"); | |
| 1296 | - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 1297 | - long delay = shouban1.getFcsjT() - min; | |
| 1298 | - tempMap.put("sjfcFirst1", shouban1.getFcsjActual()); | |
| 1299 | - if(delay > 0) | |
| 1300 | - tempMap.put("delayFirst1", "+" + delay); | |
| 1301 | - else | |
| 1302 | - tempMap.put("delayFirst1", delay); | |
| 1303 | - } else { | |
| 1304 | - tempMap.put("sjfcFirst1", "/"); | |
| 1305 | - tempMap.put("delayFirst1", "/"); | |
| 1306 | - } | |
| 1307 | - if(moban1.getFcsjActual() != null){ | |
| 1308 | - String[] split = moban1.getFcsjActual().split(":"); | |
| 1309 | - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 1310 | - long delay = moban1.getFcsjT() - min; | |
| 1311 | - tempMap.put("sjfcLast1", moban1.getFcsjActual()); | |
| 1312 | - if(delay > 0) | |
| 1313 | - tempMap.put("delayLast1", "+" + delay); | |
| 1314 | - else | |
| 1315 | - tempMap.put("delayLast1", delay); | |
| 1316 | - } else { | |
| 1317 | - tempMap.put("sjfcLast1", "/"); | |
| 1318 | - tempMap.put("delayLast1", "/"); | |
| 1319 | - } | |
| 1320 | - }else{ | |
| 1334 | + if(dn1.size() > 0 && dn2.size() > 0){ | |
| 1335 | + Collections.sort(dn1); | |
| 1336 | + Collections.sort(dn2); | |
| 1337 | + ScheduleRealInfo s1 = dn1Map.get(dn1.get(0)); | |
| 1338 | + ScheduleRealInfo s2 = dn2Map.get(dn2.get(0)); | |
| 1339 | + ScheduleRealInfo s3 = dn1Map.get(dn1.get(dn1.size()-1)); | |
| 1340 | + ScheduleRealInfo s4 = dn2Map.get(dn2.get(dn2.size()-1)); | |
| 1341 | + long delayFirst1 = dn1.get(0) - dn2.get(0); | |
| 1342 | + long delayLast1 = dn1.get(dn1.size()-1) - dn2.get(dn2.size()-1); | |
| 1343 | + tempMap.put("qdzFirst1", s1.getQdzName()); | |
| 1344 | + tempMap.put("jhfcFirst1", s1.getFcsj()); | |
| 1345 | + tempMap.put("sjfcFirst1", s2.getFcsjActual()); | |
| 1346 | + tempMap.put("delayFirst1", delayFirst1>0?"+"+delayFirst1:delayFirst1); | |
| 1347 | + tempMap.put("qdzLast1", s3.getQdzName()); | |
| 1348 | + tempMap.put("jhfcLast1", s3.getFcsj()); | |
| 1349 | + tempMap.put("sjfcLast1", s4.getFcsjActual()); | |
| 1350 | + tempMap.put("delayLast1", delayLast1>0?"+"+delayLast1:delayLast1); | |
| 1351 | + } else { | |
| 1321 | 1352 | tempMap.put("qdzFirst1", "--"); |
| 1322 | 1353 | tempMap.put("jhfcFirst1", "/"); |
| 1323 | - tempMap.put("qdzLast1", "--"); | |
| 1324 | - tempMap.put("jhfcLast1", "/"); | |
| 1325 | 1354 | tempMap.put("sjfcFirst1", "/"); |
| 1326 | 1355 | tempMap.put("delayFirst1", "/"); |
| 1356 | + tempMap.put("qdzLast1", "--"); | |
| 1357 | + tempMap.put("jhfcLast1", "/"); | |
| 1327 | 1358 | tempMap.put("sjfcLast1", "/"); |
| 1328 | 1359 | tempMap.put("delayLast1", "/"); |
| 1329 | 1360 | } |
| 1330 | - | |
| 1331 | - tempMap.put("date", date); | |
| 1332 | 1361 | tempMap.put("company", companyName); |
| 1333 | 1362 | tempMap.put("subCompany", subCompanyName); |
| 1334 | - tempMap.put("line", key); | |
| 1363 | + tempMap.put("date", date); | |
| 1364 | + tempMap.put("line", xlName); | |
| 1335 | 1365 | resList.add(tempMap); |
| 1336 | 1366 | } |
| 1337 | - | |
| 1367 | + | |
| 1338 | 1368 | if(type.equals("export")){ |
| 1339 | 1369 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 1340 | 1370 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| ... | ... | @@ -1357,164 +1387,248 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 1357 | 1387 | |
| 1358 | 1388 | @Override |
| 1359 | 1389 | public List<Map<String, Object>> firstAndLastBus_sum(Map<String, Object> map) { |
| 1390 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 1360 | 1391 | NumberFormat nf = NumberFormat.getNumberInstance(); |
| 1361 | 1392 | nf.setMinimumFractionDigits(2); |
| 1393 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | |
| 1362 | 1394 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 1363 | - Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | |
| 1364 | 1395 | |
| 1365 | 1396 | String company = map.get("company").toString(); |
| 1366 | 1397 | String subCompany = map.get("subCompany").toString(); |
| 1367 | 1398 | String line = map.get("line").toString(); |
| 1368 | - String date = map.get("date").toString(); | |
| 1399 | +// String date = map.get("date").toString(); | |
| 1400 | + String startDate = map.get("startDate").toString(); | |
| 1401 | + String endDate = map.get("endDate").toString(); | |
| 1369 | 1402 | String type = map.get("type").toString(); |
| 1370 | 1403 | |
| 1371 | - if(date.length() == 0) | |
| 1372 | - date = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 1373 | - | |
| 1374 | - List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date); | |
| 1404 | + if(startDate.length() == 0) | |
| 1405 | + startDate = sdf.format(new Date()); | |
| 1406 | + if(endDate.length() == 0) | |
| 1407 | + endDate = sdf.format(new Date()); | |
| 1375 | 1408 | |
| 1376 | - for(ScheduleRealInfo schedule : list){ | |
| 1377 | - if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out") || schedule.getBcType().equals("ldks")) | |
| 1378 | - continue; | |
| 1379 | - if(schedule.getStatus() == -1){ | |
| 1380 | - continue; | |
| 1381 | - } | |
| 1382 | - String key = schedule.getXlName(); | |
| 1383 | - if(key == null || key.trim().length() == 0) | |
| 1384 | - continue; | |
| 1385 | - if(!keyMap.containsKey(key)) | |
| 1386 | - keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | |
| 1387 | - keyMap.get(key).add(schedule); | |
| 1409 | + String dates = ""; | |
| 1410 | + if(startDate.equals(endDate)){ | |
| 1411 | + String[] split = startDate.split("-"); | |
| 1412 | + dates = split[0]+"年"+split[1]+"月"+split[2]+"日"; | |
| 1413 | + } else { | |
| 1414 | + String[] split1 = startDate.split("-"); | |
| 1415 | + String[] split2 = endDate.split("-"); | |
| 1416 | + dates = split1[0]+"年"+split1[1]+"月"+split1[2]+"日--" | |
| 1417 | + +split2[0]+"年"+split2[1]+"月"+split2[2]+"日"; | |
| 1388 | 1418 | } |
| 1389 | - for(String key : keyMap.keySet()){ | |
| 1390 | - Map<String, Object> tempMap = new HashMap<String, Object>(); | |
| 1391 | - Map<String, Object> m = new HashMap<String, Object>(); | |
| 1392 | - Map<Long, ScheduleRealInfo> temp0 = new HashMap<Long, ScheduleRealInfo>(); | |
| 1393 | - List<Long> longList0 = new ArrayList<Long>(); | |
| 1394 | - Map<Long, ScheduleRealInfo> temp1 = new HashMap<Long, ScheduleRealInfo>(); | |
| 1395 | - List<Long> longList1 = new ArrayList<Long>(); | |
| 1396 | - String companyName = "", subCompanyName = ""; | |
| 1397 | - for(ScheduleRealInfo schedule : keyMap.get(key)){ | |
| 1398 | - if(schedule.getFcsjActual() == null || schedule.getFcsjActual().trim().length() == 0){ | |
| 1399 | - continue; | |
| 1400 | - } | |
| 1401 | - if(schedule.getGsName() != null && companyName.length() == 0) | |
| 1402 | - companyName = schedule.getGsName(); | |
| 1403 | - if(schedule.getFgsName() != null && subCompanyName.length() == 0) | |
| 1404 | - subCompanyName = schedule.getFgsName(); | |
| 1405 | - String[] split = schedule.getFcsj().split(":"); | |
| 1406 | - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 1407 | - schedule.setFcsjT(min); | |
| 1408 | - if(schedule.getXlDir().equals("0")){ | |
| 1409 | - temp0.put(min, schedule); | |
| 1410 | - longList0.add(min); | |
| 1411 | - } else { | |
| 1412 | - temp1.put(min, schedule); | |
| 1413 | - longList1.add(min); | |
| 1419 | + | |
| 1420 | + try { | |
| 1421 | + String sql = "select a.schedule_date_Str, a.real_exec_date, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, a.gs_name, a.fgs_name," | |
| 1422 | + + " b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b on a.xl_bm = b.line" | |
| 1423 | + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"' and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"'" | |
| 1424 | + + " and fcsj_actual is not null and fcsj_actual != '' and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; | |
| 1425 | + if(line.length() != 0) | |
| 1426 | + sql += " and xl_bm = '"+line+"'"; | |
| 1427 | + if(company.length() != 0) | |
| 1428 | + sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; | |
| 1429 | + | |
| 1430 | + list = jdbcTemplate.query(sql, | |
| 1431 | + new RowMapper<ScheduleRealInfo>(){ | |
| 1432 | + @Override | |
| 1433 | + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 1434 | + ScheduleRealInfo schedule = new ScheduleRealInfo(); | |
| 1435 | + schedule.setScheduleDateStr(rs.getString("schedule_date_Str")); | |
| 1436 | + schedule.setRealExecDate(rs.getString("real_exec_date")); | |
| 1437 | + schedule.setXlName(rs.getString("xl_name")); | |
| 1438 | + schedule.setFcsj(rs.getString("fcsj")); | |
| 1439 | + schedule.setFcsjActual(rs.getString("fcsj_actual")); | |
| 1440 | + schedule.setZdsj(rs.getString("zdsj")); | |
| 1441 | + schedule.setZdsjActual(rs.getString("zdsj_actual")); | |
| 1442 | + schedule.setQdzName(rs.getString("qdz_name")); | |
| 1443 | + schedule.setZdzName(rs.getString("zdz_name")); | |
| 1444 | + schedule.setXlDir(rs.getString("xl_dir")); | |
| 1445 | + schedule.setStatus(rs.getInt("status")); | |
| 1446 | + schedule.setGsName(rs.getString("gs_name")); | |
| 1447 | + schedule.setFgsName(rs.getString("fgs_name")); | |
| 1448 | + | |
| 1449 | + int startOpt = 0; | |
| 1450 | + if(rs.getString("start_opt") != null && rs.getString("start_opt").trim().length() != 0){ | |
| 1451 | + String[] split = rs.getString("start_opt").split(":"); | |
| 1452 | + startOpt = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 1453 | + } | |
| 1454 | + | |
| 1455 | + if(schedule.getFcsjActual() != null && schedule.getFcsjActual().trim().length() == 0){ | |
| 1456 | + schedule.setFcsjActual(null); | |
| 1457 | + } | |
| 1458 | + if(schedule.getZdsjActual() != null && schedule.getZdsjActual().trim().length() == 0){ | |
| 1459 | + schedule.setZdsjActual(null); | |
| 1460 | + } | |
| 1461 | + if(schedule.getFcsj() != null){ | |
| 1462 | + String[] split = schedule.getFcsj().split(":"); | |
| 1463 | + int fcsj = Integer.valueOf(split[0]) * 60 + Integer.valueOf(split[1]); | |
| 1464 | + if(fcsj < startOpt) | |
| 1465 | + fcsj += 1440; | |
| 1466 | + schedule.setFcsjT((long)fcsj); | |
| 1467 | + } | |
| 1468 | + if(schedule.getFcsjActual() != null){ | |
| 1469 | + String[] split = schedule.getFcsjActual().split(":"); | |
| 1470 | + int fcsjA = Integer.valueOf(split[0]) * 60 + Integer.valueOf(split[1]); | |
| 1471 | + if(fcsjA < startOpt || !schedule.getRealExecDate().equals(schedule.getScheduleDateStr())) | |
| 1472 | + fcsjA += 1440; | |
| 1473 | + schedule.setFcsjActualTime((long)fcsjA); | |
| 1474 | + } | |
| 1475 | + | |
| 1476 | + return schedule; | |
| 1414 | 1477 | } |
| 1415 | - } | |
| 1478 | + }); | |
| 1416 | 1479 | |
| 1417 | - if(longList0.size() == 0 && longList1.size() == 0){ | |
| 1418 | - continue; | |
| 1480 | + } catch (Exception e) { | |
| 1481 | + // TODO: handle exception | |
| 1482 | + e.printStackTrace(); | |
| 1483 | + } | |
| 1484 | + | |
| 1485 | + Map<String, Map<String, List<ScheduleRealInfo>>> keyMap = new HashMap<String, Map<String,List<ScheduleRealInfo>>>(); | |
| 1486 | + String companyName = "", subCompanyName = ""; | |
| 1487 | + | |
| 1488 | + for(ScheduleRealInfo s : list){ | |
| 1489 | + String xlName = s.getXlName(); | |
| 1490 | + String date = s.getScheduleDateStr(); | |
| 1491 | + if(!keyMap.containsKey(xlName)) | |
| 1492 | + keyMap.put(xlName, new HashMap<String, List<ScheduleRealInfo>>()); | |
| 1493 | + if(!keyMap.get(xlName).containsKey(date)) | |
| 1494 | + keyMap.get(xlName).put(date, new ArrayList<ScheduleRealInfo>()); | |
| 1495 | + keyMap.get(xlName).get(date).add(s); | |
| 1496 | + if(companyName.length()==0&&s.getGsName()!=null&&s.getGsName().trim().length()!=0) | |
| 1497 | + companyName = s.getGsName(); | |
| 1498 | + if(subCompanyName.length()==0&&s.getFgsName()!=null&&s.getFgsName().trim().length()!=0) | |
| 1499 | + subCompanyName = s.getFgsName(); | |
| 1500 | + } | |
| 1501 | + | |
| 1502 | + for(String xlName : keyMap.keySet()){ | |
| 1503 | + List<Map<String, Object>> tempList = new ArrayList<Map<String,Object>>(); | |
| 1504 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | |
| 1505 | + Map<Long, String> dateMap = new HashMap<Long, String>(); | |
| 1506 | + List<Long> Longs = new ArrayList<Long>(); | |
| 1507 | + int jhbc = 0, sjbc = 0; | |
| 1508 | + for(String date : keyMap.get(xlName).keySet()){ | |
| 1509 | + String[] split = date.split("-"); | |
| 1510 | + long l = Long.valueOf(split[0])*10000 + Long.valueOf(split[1])*100 + Long.valueOf(split[2]); | |
| 1511 | + dateMap.put(l, date); | |
| 1512 | + Longs.add(l); | |
| 1419 | 1513 | } |
| 1420 | - int jhbc = 0; | |
| 1421 | - int sjbc = 0; | |
| 1422 | - | |
| 1423 | - if(longList0.size() != 0){ | |
| 1424 | - Collections.sort(longList0); | |
| 1425 | - ScheduleRealInfo shouban0 = temp0.get(longList0.get(0)); | |
| 1426 | - ScheduleRealInfo moban0 = temp0.get(longList0.get(longList0.size() - 1)); | |
| 1427 | - if(shouban0.getFcsjActual() != null){ | |
| 1428 | - jhbc++; | |
| 1429 | - String[] split = shouban0.getFcsjActual().split(":"); | |
| 1430 | - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 1431 | - long delay = shouban0.getFcsjT() - min; | |
| 1432 | - if(delay >= -3 && delay <= 1){ | |
| 1433 | - sjbc++; | |
| 1514 | + Collections.sort(Longs); | |
| 1515 | + for(long l : Longs){ | |
| 1516 | + String date = dateMap.get(l); | |
| 1517 | + Map<String, Object> temp = new HashMap<String, Object>(); | |
| 1518 | + temp.put("date", date.substring(5)); | |
| 1519 | + temp.put("line", xlName); | |
| 1520 | + List<Long> up1 = new ArrayList<Long>(); | |
| 1521 | + List<Long> up2 = new ArrayList<Long>();; | |
| 1522 | + List<Long> dn1 = new ArrayList<Long>(); | |
| 1523 | + List<Long> dn2 = new ArrayList<Long>(); | |
| 1524 | + Map<Long, ScheduleRealInfo> up1Map = new HashMap<Long, ScheduleRealInfo>(); | |
| 1525 | + Map<Long, ScheduleRealInfo> up2Map = new HashMap<Long, ScheduleRealInfo>(); | |
| 1526 | + Map<Long, ScheduleRealInfo> dn1Map = new HashMap<Long, ScheduleRealInfo>(); | |
| 1527 | + Map<Long, ScheduleRealInfo> dn2Map = new HashMap<Long, ScheduleRealInfo>(); | |
| 1528 | + for(ScheduleRealInfo s : keyMap.get(xlName).get(date)){ | |
| 1529 | + if(s.getXlDir().equals("0")){ | |
| 1530 | + up1.add(s.getFcsjT()); | |
| 1531 | + up2.add(s.getFcsjActualTime()); | |
| 1532 | + up1Map.put(s.getFcsjT(), s); | |
| 1533 | + up2Map.put(s.getFcsjActualTime(), s); | |
| 1534 | + } else if(s.getXlDir().equals("1")){ | |
| 1535 | + dn1.add(s.getFcsjT()); | |
| 1536 | + dn2.add(s.getFcsjActualTime()); | |
| 1537 | + dn1Map.put(s.getFcsjT(), s); | |
| 1538 | + dn2Map.put(s.getFcsjActualTime(), s); | |
| 1434 | 1539 | } |
| 1435 | - m.put("qdzFirst0", shouban0.getQdzName()); | |
| 1436 | - m.put("jhfcFirst0", shouban0.getFcsj()); | |
| 1437 | - m.put("sjfcFirst0", shouban0.getFcsjActual()); | |
| 1438 | - m.put("delayFirst0", delay>0?"+"+delay:delay); | |
| 1439 | 1540 | } |
| 1440 | - | |
| 1441 | - if(moban0.getFcsjActual() != null){ | |
| 1442 | - jhbc++; | |
| 1443 | - String[] split = moban0.getFcsjActual().split(":"); | |
| 1444 | - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 1445 | - long delay = moban0.getFcsjT() - min; | |
| 1446 | - if(delay >= -3 && delay <= 1){ | |
| 1541 | + if(up1.size() > 0 && up2.size() > 0){ | |
| 1542 | + Collections.sort(up1); | |
| 1543 | + Collections.sort(up2); | |
| 1544 | + ScheduleRealInfo s1 = up1Map.get(up1.get(0)); | |
| 1545 | + ScheduleRealInfo s2 = up2Map.get(up2.get(0)); | |
| 1546 | + ScheduleRealInfo s3 = up1Map.get(up1.get(up1.size()-1)); | |
| 1547 | + ScheduleRealInfo s4 = up2Map.get(up2.get(up2.size()-1)); | |
| 1548 | + long delayFirst0 = up1.get(0) - up2.get(0); | |
| 1549 | + long delayLast0 = up1.get(up1.size()-1) - up2.get(up2.size()-1); | |
| 1550 | + temp.put("qdzFirst0", s1.getQdzName()); | |
| 1551 | + temp.put("jhfcFirst0", s1.getFcsj()); | |
| 1552 | + temp.put("sjfcFirst0", s2.getFcsjActual()); | |
| 1553 | + temp.put("delayFirst0", delayFirst0>0?"+"+delayFirst0:delayFirst0); | |
| 1554 | + temp.put("qdzLast0", s3.getQdzName()); | |
| 1555 | + temp.put("jhfcLast0", s3.getFcsj()); | |
| 1556 | + temp.put("sjfcLast0", s4.getFcsjActual()); | |
| 1557 | + temp.put("delayLast0", delayLast0>0?"+"+delayLast0:delayLast0); | |
| 1558 | + jhbc += 2; | |
| 1559 | + if(delayFirst0 <= 1l && delayFirst0 >= -3l) | |
| 1447 | 1560 | sjbc++; |
| 1448 | - } | |
| 1449 | - m.put("qdzLast0", moban0.getQdzName()); | |
| 1450 | - m.put("jhfcLast0", moban0.getFcsj()); | |
| 1451 | - m.put("sjfcLast0", moban0.getFcsjActual()); | |
| 1452 | - m.put("delayLast0", delay>0?"+"+delay:delay); | |
| 1453 | - } | |
| 1454 | - } else { | |
| 1455 | - m.put("qdzFirst0", "--"); | |
| 1456 | - m.put("jhfcFirst0", "/"); | |
| 1457 | - m.put("sjfcFirst0", "/"); | |
| 1458 | - m.put("delayFirst0", "/"); | |
| 1459 | - m.put("qdzLast0", "--"); | |
| 1460 | - m.put("jhfcLast0", "/"); | |
| 1461 | - m.put("sjfcLast0", "/"); | |
| 1462 | - m.put("delayLast0", "/"); | |
| 1463 | - } | |
| 1464 | - | |
| 1465 | - if(longList1.size() != 0){ | |
| 1466 | - Collections.sort(longList1); | |
| 1467 | - ScheduleRealInfo shouban1 = temp1.get(longList1.get(0)); | |
| 1468 | - ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1)); | |
| 1469 | - if(shouban1.getFcsjActual() != null){ | |
| 1470 | - jhbc++; | |
| 1471 | - String[] split = shouban1.getFcsjActual().split(":"); | |
| 1472 | - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 1473 | - long delay = shouban1.getFcsjT() - min; | |
| 1474 | - if(delay >= -3 && delay <= 1){ | |
| 1561 | + if(delayLast0 <= 1l && delayLast0 >= -3l) | |
| 1475 | 1562 | sjbc++; |
| 1476 | - } | |
| 1477 | - m.put("qdzFirst1", shouban1.getQdzName()); | |
| 1478 | - m.put("jhfcFirst1", shouban1.getFcsj()); | |
| 1479 | - m.put("sjfcFirst1", shouban1.getFcsjActual()); | |
| 1480 | - m.put("delayFirst1", delay>0?"+"+delay:delay); | |
| 1563 | + } else { | |
| 1564 | + temp.put("qdzFirst0", "--"); | |
| 1565 | + temp.put("jhfcFirst0", "/"); | |
| 1566 | + temp.put("sjfcFirst0", "/"); | |
| 1567 | + temp.put("delayFirst0", "/"); | |
| 1568 | + temp.put("qdzLast0", "--"); | |
| 1569 | + temp.put("jhfcLast0", "/"); | |
| 1570 | + temp.put("sjfcLast0", "/"); | |
| 1571 | + temp.put("delayLast0", "/"); | |
| 1481 | 1572 | } |
| 1482 | - | |
| 1483 | - if(moban1.getFcsjActual() != null){ | |
| 1484 | - jhbc++; | |
| 1485 | - String[] split = moban1.getFcsjActual().split(":"); | |
| 1486 | - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 1487 | - long delay = moban1.getFcsjT() - min; | |
| 1488 | - if(delay >= -3 && delay <= 1){ | |
| 1573 | + if(dn1.size() > 0 && dn2.size() > 0){ | |
| 1574 | + Collections.sort(dn1); | |
| 1575 | + Collections.sort(dn2); | |
| 1576 | + ScheduleRealInfo s1 = dn1Map.get(dn1.get(0)); | |
| 1577 | + ScheduleRealInfo s2 = dn2Map.get(dn2.get(0)); | |
| 1578 | + ScheduleRealInfo s3 = dn1Map.get(dn1.get(dn1.size()-1)); | |
| 1579 | + ScheduleRealInfo s4 = dn2Map.get(dn2.get(dn2.size()-1)); | |
| 1580 | + long delayFirst1 = dn1.get(0) - dn2.get(0); | |
| 1581 | + long delayLast1 = dn1.get(dn1.size()-1) - dn2.get(dn2.size()-1); | |
| 1582 | + temp.put("qdzFirst1", s1.getQdzName()); | |
| 1583 | + temp.put("jhfcFirst1", s1.getFcsj()); | |
| 1584 | + temp.put("sjfcFirst1", s2.getFcsjActual()); | |
| 1585 | + temp.put("delayFirst1", delayFirst1>0?"+"+delayFirst1:delayFirst1); | |
| 1586 | + temp.put("qdzLast1", s3.getQdzName()); | |
| 1587 | + temp.put("jhfcLast1", s3.getFcsj()); | |
| 1588 | + temp.put("sjfcLast1", s4.getFcsjActual()); | |
| 1589 | + temp.put("delayLast1", delayLast1>0?"+"+delayLast1:delayLast1); | |
| 1590 | + jhbc += 2; | |
| 1591 | + if(delayFirst1 <= 1l && delayFirst1 >= -3l) | |
| 1489 | 1592 | sjbc++; |
| 1490 | - } | |
| 1491 | - m.put("qdzLast1", moban1.getQdzName()); | |
| 1492 | - m.put("jhfcLast1", moban1.getFcsj()); | |
| 1493 | - m.put("sjfcLast1", moban1.getFcsjActual()); | |
| 1494 | - m.put("delayLast1", delay>0?"+"+delay:delay); | |
| 1593 | + if(delayLast1 <= 1l && delayLast1 >= -3l) | |
| 1594 | + sjbc++; | |
| 1595 | + } else { | |
| 1596 | + temp.put("qdzFirst1", "--"); | |
| 1597 | + temp.put("jhfcFirst1", "/"); | |
| 1598 | + temp.put("sjfcFirst1", "/"); | |
| 1599 | + temp.put("delayFirst1", "/"); | |
| 1600 | + temp.put("qdzLast1", "--"); | |
| 1601 | + temp.put("jhfcLast1", "/"); | |
| 1602 | + temp.put("sjfcLast1", "/"); | |
| 1603 | + temp.put("delayLast1", "/"); | |
| 1495 | 1604 | } |
| 1496 | - } else { | |
| 1497 | - m.put("qdzFirst1", "--"); | |
| 1498 | - m.put("jhfcFirst1", "/"); | |
| 1499 | - m.put("sjfcFirst1", "/"); | |
| 1500 | - m.put("delayFirst1", "/"); | |
| 1501 | - m.put("qdzLast1", "--"); | |
| 1502 | - m.put("jhfcLast1", "/"); | |
| 1503 | - m.put("sjfcLast1", "/"); | |
| 1504 | - m.put("delayLast1", "/"); | |
| 1605 | + tempList.add(temp); | |
| 1505 | 1606 | } |
| 1506 | - | |
| 1507 | - m.put("line", key); | |
| 1508 | - tempMap.put("map", m); | |
| 1607 | + tempMap.put("map", tempList); | |
| 1608 | + tempMap.put("company", companyName); | |
| 1609 | + tempMap.put("subCompany", subCompanyName); | |
| 1610 | + tempMap.put("date", dates); | |
| 1611 | + tempMap.put("line", xlName); | |
| 1509 | 1612 | tempMap.put("jhbc", jhbc); |
| 1510 | 1613 | tempMap.put("sjbc", sjbc); |
| 1511 | 1614 | tempMap.put("zdl", nf.format((float) sjbc / jhbc *100) + "%"); |
| 1512 | - tempMap.put("date", date); | |
| 1513 | - tempMap.put("company", companyName); | |
| 1514 | - tempMap.put("subCompany", subCompanyName); | |
| 1515 | - tempMap.put("line", key); | |
| 1516 | 1615 | resList.add(tempMap); |
| 1517 | 1616 | } |
| 1617 | + | |
| 1618 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | |
| 1619 | + if(resList.size() > 0){ | |
| 1620 | + tempMap.put("date", "合计汇总"); | |
| 1621 | + int jhbc = 0, sjbc = 0; | |
| 1622 | + for(Map<String, Object> m : resList){ | |
| 1623 | + jhbc += Integer.valueOf(m.get("jhbc").toString()); | |
| 1624 | + sjbc += Integer.valueOf(m.get("sjbc").toString()); | |
| 1625 | + } | |
| 1626 | + tempMap.put("jhbc", jhbc); | |
| 1627 | + tempMap.put("sjbc", sjbc); | |
| 1628 | + tempMap.put("zdl", nf.format((float) sjbc / jhbc *100) + "%"); | |
| 1629 | + if(!type.equals("export")) | |
| 1630 | + resList.add(tempMap); | |
| 1631 | + } | |
| 1518 | 1632 | |
| 1519 | 1633 | if(type.equals("export")){ |
| 1520 | 1634 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| ... | ... | @@ -1525,8 +1639,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 1525 | 1639 | try { |
| 1526 | 1640 | listI.add(resList.iterator()); |
| 1527 | 1641 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 1528 | - ee.excelReplace(listI, new Object[] { m }, path+"mould/firstAndLastBus_sum.xls", | |
| 1529 | - path+"export/线路首末班准点率" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | |
| 1642 | + ee.excelReplace(listI, new Object[] { tempMap }, path+"mould/firstAndLastBus_sum.xls", | |
| 1643 | + path+"export/线路首末班准点率" + sdfSimple.format(sdfMonth.parse(startDate)) + | |
| 1644 | + (startDate.equals(endDate)?"":"-"+sdfSimple.format(sdfMonth.parse(endDate))) + ".xls"); | |
| 1530 | 1645 | } catch (Exception e) { |
| 1531 | 1646 | // TODO: handle exception |
| 1532 | 1647 | e.printStackTrace(); | ... | ... |
src/main/resources/static/pages/base/timesmodel/editlp.html
0 → 100644
| 1 | +<!-- 修改路牌名称 --> | |
| 2 | +<div class="modal fade" id="editlp_mobal" tabindex="-1" role="basic" aria-hidden="true"> | |
| 3 | + <div class="modal-dialog"> | |
| 4 | + <div class="modal-content"> | |
| 5 | + <div class="modal-header"> | |
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | |
| 7 | + <h4 class="modal-title">修改路牌名称</h4> | |
| 8 | + </div> | |
| 9 | + <div class="modal-body"> | |
| 10 | + <form class="form-horizontal" action="/" method="post" id="editlpForm" role="form"> | |
| 11 | + <!-- alert-danger 组件START --> | |
| 12 | + <div class="alert alert-danger display-hide" id="editlpAlert"> | |
| 13 | + <button class="close" data-close="alert"></button> | |
| 14 | + 您的输入有误,请检查下面的输入项 | |
| 15 | + </div> | |
| 16 | + <div class="portlet-body"> | |
| 17 | + <div class="table-container" style="margin-top: 10px"> | |
| 18 | + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_bctz"> | |
| 19 | + <thead> | |
| 20 | + <tr role="row" class="heading"> | |
| 21 | + <th width="50%">当前路牌名称</th> | |
| 22 | + <th width="50%" style="text-align: center;max-width: 50px;min-width: 40px;padding-left: 0;padding-right: 0;">修改路牌名称</th> | |
| 23 | + </tr> | |
| 24 | + </thead> | |
| 25 | + <tbody></tbody> | |
| 26 | + </table> | |
| 27 | + </div> | |
| 28 | + </div> | |
| 29 | + </form> | |
| 30 | + </div> | |
| 31 | + <div class="modal-footer"> | |
| 32 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 33 | + <button type="button" class="btn btn-primary" id="editlpnext">确定</button> | |
| 34 | + </div> | |
| 35 | + </div> | |
| 36 | + </div> | |
| 37 | +</div> | |
| 38 | +<script type="text/html" id="editlp_temp"> | |
| 39 | +{{each list as obj i }} | |
| 40 | + <tr role="row" class="filter"> | |
| 41 | + <td> | |
| 42 | + <input type="text" readonly class="form-control form-filter input-sm" name="lpname_{{i+1}}" value="{{obj.lpName}}"> | |
| 43 | + </td> | |
| 44 | + <td> | |
| 45 | + <input type="text" class="form-control form-filter input-sm" name="{{i+1}}" value="{{obj.lpName}}" required> | |
| 46 | + </td> | |
| 47 | + </tr> | |
| 48 | +{{/each}} | |
| 49 | +{{if list.length == 0}} | |
| 50 | + <tr> | |
| 51 | + <td colspan=3><h6 class="muted">没有找到相关数据</h6></td> | |
| 52 | + </tr> | |
| 53 | + {{/if}} | |
| 54 | +</script> | |
| 55 | +<script type="text/javascript"> | |
| 56 | +$('#editlp_mobal').on('editlpMobal.show', function(e,obj,bf){ | |
| 57 | + var lpArray = obj.configuration.taskTypes; | |
| 58 | + setTimeout(function(){ | |
| 59 | + // 加载延迟200毫秒显示mobal | |
| 60 | + $('#editlp_mobal').modal({show : true,backdrop: 'static', keyboard: false}); | |
| 61 | + },200); | |
| 62 | + // 当模态框对用户可见时触发(将等待 CSS 过渡效果完成)。 | |
| 63 | + $('#editlp_mobal').on('show.bs.modal', function () { | |
| 64 | + // 把数据填充到模版中 | |
| 65 | + var tbodyHtml = template('editlp_temp',{list:lpArray}); | |
| 66 | + // 把渲染好的模版html文本追加到表格中 | |
| 67 | + $('#datatable_bctz tbody').html(tbodyHtml); | |
| 68 | + }); | |
| 69 | + // 获取表单元素 | |
| 70 | + var form = $('#editlpForm'); | |
| 71 | + // 错误提示元素 | |
| 72 | + var editlpAlert = $('#editlpAlert', form); | |
| 73 | + // 下一步点击事件 | |
| 74 | + $('#editlpnext').on('click', function() { | |
| 75 | + form.submit();// 表单提交 | |
| 76 | + }); | |
| 77 | + // 表单验证 | |
| 78 | + form.validate({ | |
| 79 | + errorElement : 'span', | |
| 80 | + errorClass : 'help-block help-block-error', | |
| 81 | + focusInvalid : false, | |
| 82 | + rules : { | |
| 83 | + }, | |
| 84 | + invalidHandler : function(event, validator) { | |
| 85 | + editlpAlert.show(); | |
| 86 | + App.scrollTo(editlpAlert, -200); | |
| 87 | + }, | |
| 88 | + highlight : function(element) { | |
| 89 | + $(element).closest('.form-group').addClass('has-error'); | |
| 90 | + }, | |
| 91 | + unhighlight : function(element) { | |
| 92 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 93 | + }, | |
| 94 | + success : function(label) { | |
| 95 | + label.closest('.form-group').removeClass('has-error'); | |
| 96 | + }, | |
| 97 | + submitHandler : function(f) { | |
| 98 | + // 1、 获取表单内容,并序列化 | |
| 99 | + var params = form.serializeJSON(); | |
| 100 | + var data = obj.getDataArray(); | |
| 101 | + // 2、 调整路牌对应的班次总数 | |
| 102 | + updFormParams(params,data); | |
| 103 | + // 删除图形. | |
| 104 | + $('svg.svg-chart').remove(); | |
| 105 | + // 重新创建图形. | |
| 106 | + var graph_ = d3.select('#ganttSvg').relationshipGraph(obj.configuration); | |
| 107 | + // 根据数据重新渲染图形. | |
| 108 | + obj.data(data); | |
| 109 | + // 记录早操.并保存历史班次数据 | |
| 110 | + obj.addHistory(); | |
| 111 | + // 隐藏错误提示 | |
| 112 | + editlpAlert.hide(); | |
| 113 | + // 隐藏 reladplus_mobal 弹出层 | |
| 114 | + $('#editlp_mobal').modal('hide'); | |
| 115 | + layer.msg('修改路牌名称成功!'); | |
| 116 | + } | |
| 117 | + }); | |
| 118 | + function updFormParams(p,data) { | |
| 119 | + for(var i= 0;i<lpArray.length;i++) { | |
| 120 | + if(p[i+1] != undefined) { | |
| 121 | + if(lpArray[i].lpName != p[i+1]) { | |
| 122 | + for(var d = 0 ; d< data.length;d++) { | |
| 123 | + if(data[d].lpName == lpArray[i].lpName) { | |
| 124 | + data[d].lpName = p[i+1]; | |
| 125 | + } | |
| 126 | + | |
| 127 | + } | |
| 128 | + lpArray[i].lpName = p[i+1]; | |
| 129 | + obj.configuration.lpNameA[i] = p[i+1]; | |
| 130 | + } | |
| 131 | + } | |
| 132 | + } | |
| 133 | + } | |
| 134 | +}); | |
| 135 | +</script> | |
| 0 | 136 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
| ... | ... | @@ -403,11 +403,12 @@ var BaseFun = function() { |
| 403 | 403 | } |
| 404 | 404 | //debugger; |
| 405 | 405 | var jar3 = baseF.dqbcsAndgs(bxrcgs,jar,dataMap,cara.length); |
| 406 | - //return {'json':jar3,'bxrcgs':bxrcgs}; | |
| 406 | + // return {'json':jar3,'bxrcgs':bxrcgs}; | |
| 407 | 407 | /*var jar4 = baseF.tzsmbcsj01( |
| 408 | 408 | baseF.setbcsAndfcno(baseF.tzsmbcsj01(baseF.setbcsAndfcno(baseF.tzsztest(cara,jar3,dataMap)),dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap)), |
| 409 | 409 | dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap);*/ |
| 410 | 410 | var rsjar = baseF.tzsztest(cara,jar3,dataMap); |
| 411 | + // return {'json':rsjar,'bxrcgs':bxrcgs}; | |
| 411 | 412 | return {'json':baseF.addjcclcbc01(cara,rsjar,dataMap,saa,map),'bxrcgs':bxrcgs}; |
| 412 | 413 | }, |
| 413 | 414 | |
| ... | ... | @@ -433,7 +434,6 @@ var BaseFun = function() { |
| 433 | 434 | // lpbc_.sort(function(a,b){return a.fcno-b.fcno}); |
| 434 | 435 | var tt = baseF.addjclbbc01(lpbc_,dataMap,saa[0].lbsj,map); |
| 435 | 436 | bcs = baseF.updfcno01(tt,bcs); |
| 436 | - // debugger; | |
| 437 | 437 | resultJA = resultJA.concat(tt); |
| 438 | 438 | } |
| 439 | 439 | return resultJA; |
| ... | ... | @@ -779,7 +779,11 @@ var BaseFun = function() { |
| 779 | 779 | sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - ar[r].bcsj); |
| 780 | 780 | ar[r].fcsj = baseF.getTimeStr(sgbcfcsj);*/ |
| 781 | 781 | }else if(dxmin >= v1 && dxmin < 180) { |
| 782 | - dxmin = v1; | |
| 782 | + if(r==ar.length-2 || baseF.issmbcsjArr(ar[r+1].fcsj,dataMap.smbcsjArr)) { | |
| 783 | + dxmin = dxmin; | |
| 784 | + }else { | |
| 785 | + dxmin = v1; | |
| 786 | + } | |
| 783 | 787 | } |
| 784 | 788 | if(ar[r].STOPTIME >0) { |
| 785 | 789 | dqbcddsj.setMinutes(dqbcddsj.getMinutes() + dxmin); |
| ... | ... | @@ -802,6 +806,7 @@ var BaseFun = function() { |
| 802 | 806 | if(bcArr.length<=0) |
| 803 | 807 | return; |
| 804 | 808 | var dirA = dataMap.dira; |
| 809 | + var clzs = parseInt(dataMap.map.clzs); | |
| 805 | 810 | for(var d = 0 ; d < dirA.length; d++) { |
| 806 | 811 | var fxdm = dirA[d],fxbc = new Array(); |
| 807 | 812 | var cctag = baseF.dirDmToIndex(fxdm); |
| ... | ... | @@ -827,6 +832,10 @@ var BaseFun = function() { |
| 827 | 832 | var _fcjx = parseInt(Math.ceil(zzsj/bcCount)); |
| 828 | 833 | var fcnosj = new Date(kssj); |
| 829 | 834 | for(var l = 0 ; l< len_ ; l++) { |
| 835 | + // 每个路牌的末班车发车时间不准动. | |
| 836 | + if(baseF.iszhclzsbc(fxbc, sjdbcArr[l].fcno , clzs)) { | |
| 837 | + continue; | |
| 838 | + } | |
| 830 | 839 | sjdbcArr[l].fcsj = baseF.getTimeStr(fcnosj); |
| 831 | 840 | var _xxsj = baseF.getxssj(dataMap.zgfsjd, |
| 832 | 841 | dataMap.wgfsjd,fcnosj,dataMap.pcxssjArr, |
| ... | ... | @@ -845,6 +854,16 @@ var BaseFun = function() { |
| 845 | 854 | } |
| 846 | 855 | }, |
| 847 | 856 | |
| 857 | + iszhclzsbc : function(dirA , fcno , clzs) { | |
| 858 | + var flag = false; | |
| 859 | + for(var a =1 ; a < clzs ; a++) { | |
| 860 | + if(fcno == dirA[dirA.length-a].fcno) { | |
| 861 | + flag = true; | |
| 862 | + } | |
| 863 | + } | |
| 864 | + return flag; | |
| 865 | + }, | |
| 866 | + | |
| 848 | 867 | /** |
| 849 | 868 | * @description : (TODO) 添加进出场班次、早晚例保班次. |
| 850 | 869 | * |
| ... | ... | @@ -1896,14 +1915,13 @@ var BaseFun = function() { |
| 1896 | 1915 | getsxAndxxbc : function(json,dataMap) { |
| 1897 | 1916 | var upArray = new Array(),downArray = new Array(),qt = new Array(); |
| 1898 | 1917 | for(var j = 0 ; j< json.length ; j++) { |
| 1899 | - //json[j].fcint = baseF.getDateTime(json[j].fcsj).getTime(); | |
| 1900 | 1918 | if(json[j].bcType== dataMap.bcTypeArr.normal || |
| 1901 | 1919 | json[j].bcType== dataMap.bcTypeArr.region || |
| 1902 | 1920 | json[j].bcType== dataMap.bcTypeArr.major || |
| 1903 | 1921 | json[j].bcType== dataMap.bcTypeArr.venting) { |
| 1904 | - if(json[j].xlDir == 'relationshipGraph-up') | |
| 1922 | + if(json[j].xlDir == dataMap.dira[0]) | |
| 1905 | 1923 | upArray.push(json[j]); |
| 1906 | - else if(json[j].xlDir == 'relationshipGraph-down') | |
| 1924 | + else if(json[j].xlDir == dataMap.dira[1]) | |
| 1907 | 1925 | downArray.push(json[j]); |
| 1908 | 1926 | }else if(json[j].bcType == dataMap.bcTypeArr.cf) { |
| 1909 | 1927 | qt.push(json[j]); | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
| ... | ... | @@ -1288,34 +1288,44 @@ var RelationshipGraph = function () { |
| 1288 | 1288 | } |
| 1289 | 1289 | } |
| 1290 | 1290 | }, { |
| 1291 | + /** | |
| 1292 | + * 均匀发车间隙 | |
| 1293 | + * | |
| 1294 | + */ | |
| 1291 | 1295 | key : 'updownread01', |
| 1292 | 1296 | value : function updownread01() { |
| 1293 | - // 1、获取所有班次数. | |
| 1294 | 1297 | var list = $_GlobalGraph.getDataArray(); |
| 1295 | 1298 | var dataMap = $_GlobalGraph.configuration.dataMap; |
| 1296 | - var rsmap = BaseFun.getsxAndxxbc(list,dataMap); | |
| 1297 | 1299 | var cara = $_GlobalGraph.configuration.taskTypes; |
| 1298 | - var jar01 = rsmap.qt.concat(rsmap.sxbc).concat(rsmap.xxbc); | |
| 1299 | - BaseFun.jhfcjx01(jar01,dataMap); | |
| 1300 | - var jar = BaseFun.tzsmbcsj01( | |
| 1301 | - BaseFun.setbcsAndfcno(BaseFun.tzsmbcsj01(BaseFun.setbcsAndfcno(BaseFun.tzsztest(cara,jar01,dataMap)),dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,dataMap.lbsj,dataMap)), | |
| 1302 | - dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,dataMap.lbsj,dataMap); | |
| 1303 | - var resultJA = new Array(); | |
| 1304 | - for(var m = 0 ; m < cara.length; m++) { | |
| 1305 | - // 获取路牌编号. | |
| 1306 | - var lpNo_ = cara[m].lpNo; | |
| 1307 | - // 定义路牌下的所有班次. | |
| 1308 | - var lpbc_ = new Array(); | |
| 1309 | - // 遍历班次数. | |
| 1310 | - for(var x =0 ; x <jar.length; x++) { | |
| 1311 | - // 判断当期遍历的班次是否属于当前的路牌. | |
| 1312 | - if(jar[x].lpNo == lpNo_) | |
| 1313 | - lpbc_.push(jar[x]); | |
| 1314 | - } | |
| 1315 | - // 按照发车序号顺序排序. | |
| 1316 | - lpbc_.sort(function(a,b){return a.fcno-b.fcno}); | |
| 1317 | - resultJA = resultJA.concat(BaseFun.addjclbbc01(lpbc_,dataMap,dataMap.lbsj,dataMap.map)); | |
| 1318 | - } | |
| 1300 | + var bxrcgs = $_GlobalGraph.configuration.bxrcgs; | |
| 1301 | + var resultJA = new Array(); | |
| 1302 | + if(list.length !=0 && dataMap!=null && dataMap!='' && cara.length !=0) { | |
| 1303 | + var rsmap = BaseFun.getsxAndxxbc(list,dataMap); | |
| 1304 | + var jar01 = rsmap.qt.concat(rsmap.sxbc).concat(rsmap.xxbc); | |
| 1305 | + BaseFun.jhfcjx01(jar01,dataMap); | |
| 1306 | + var jar = BaseFun.tzsmbcsj01( | |
| 1307 | + BaseFun.setbcsAndfcno(BaseFun.tzsmbcsj01(BaseFun.setbcsAndfcno(BaseFun.tzsztest(cara,jar01,dataMap)),dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,dataMap.lbsj,dataMap)), | |
| 1308 | + dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,dataMap.lbsj,dataMap); | |
| 1309 | + for(var r = 0 ; r < bxrcgs.length; r++) { | |
| 1310 | + var lpNo = bxrcgs[r].lpNo; | |
| 1311 | + var gsv = 0 , bczs = 0; | |
| 1312 | + for(var g = 0 ; g< jar.length; g++) { | |
| 1313 | + if(jar[g].lpNo == lpNo) { | |
| 1314 | + gsv = gsv + jar[g].bcsj + jar[g].STOPTIME; | |
| 1315 | + bczs++; | |
| 1316 | + } | |
| 1317 | + } | |
| 1318 | + bxrcgs[r].sjgsV = gsv; | |
| 1319 | + bxrcgs[r].bczs = bczs; | |
| 1320 | + } | |
| 1321 | + var jar3 = BaseFun.dqbcsAndgs(bxrcgs,jar,dataMap,cara.length); | |
| 1322 | + var rsjar = BaseFun.tzsztest(cara,jar3,dataMap); | |
| 1323 | + resultJA = BaseFun.addjcclcbc01(cara,rsjar,dataMap,$_GlobalGraph.configuration.stopAraay,dataMap.map); | |
| 1324 | + } else { | |
| 1325 | + resultJA = list; | |
| 1326 | + error.show('参数异常!','【 list:' + list + ' , dataMap:' | |
| 1327 | + + dataMap + ' , cara:' + cara + ' , bxrcgs:' + bxrcgs + '】'); | |
| 1328 | + } | |
| 1319 | 1329 | // 删除图形. |
| 1320 | 1330 | $('svg.svg-chart').remove(); |
| 1321 | 1331 | // 重新创建图形. | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/gantt.js
| ... | ... | @@ -528,8 +528,15 @@ |
| 528 | 528 | }else { |
| 529 | 529 | data = graph.getDataArray(); |
| 530 | 530 | } |
| 531 | + var rsjar = BaseFun.tzsztest(graph.configuration.taskTypes,data,graph.configuration.dataMap); | |
| 532 | + /*var resultJA = BaseFun.addjcclcbc01(graph.configuration.taskTypes,rsjar, | |
| 533 | + graph.configuration.dataMap,graph.configuration.stopAraay,data, | |
| 534 | + graph.configuration.dataMap.map);*/ | |
| 531 | 535 | // 获取图形数据.重新绘制. |
| 532 | - graph.data(data); | |
| 536 | + graph.data(BaseFun.addjcclcbc01(graph.configuration.taskTypes,rsjar, | |
| 537 | + graph.configuration.dataMap, | |
| 538 | + graph.configuration.stopAraay, | |
| 539 | + graph.configuration.dataMap.map)); | |
| 533 | 540 | // 记录当前操作. |
| 534 | 541 | graph.addHistory(); |
| 535 | 542 | stateSuccess('删除'); | ... | ... |
src/main/resources/static/pages/base/timesmodel/tepms/bctype_temp.html
| ... | ... | @@ -538,10 +538,10 @@ |
| 538 | 538 | </select> |
| 539 | 539 | </div> |
| 540 | 540 | <div class="margin-top-10"> |
| 541 | - <input type="number" class="form-control" placeholder="请输入分配人次数" id="state_tagsinput_rcsvalue"> | |
| 541 | + <input type="number" class="form-control" placeholder="请输入分配人次数" id="state_tagsinput_rcsvalue" min="1"> | |
| 542 | 542 | </div> |
| 543 | 543 | <div class="margin-top-10"> |
| 544 | - <input type="number" class="form-control" placeholder="请输入分配车辆数" id="state_tagsinput_clsvalue"> | |
| 544 | + <input type="number" class="form-control" placeholder="请输入分配车辆数" id="state_tagsinput_clsvalue" min="1"> | |
| 545 | 545 | </div> |
| 546 | 546 | <div class="margin-top-10"> |
| 547 | 547 | <a href="javascript:;" class="btn red" id="state_tagsinput_add">添加</a> | ... | ... |
src/main/resources/static/pages/forms/mould/firstAndLastBus_sum.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/oilListMonth.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
| ... | ... | @@ -7,7 +7,8 @@ |
| 7 | 7 | .table-bordered > tbody > tr > td, |
| 8 | 8 | .table-bordered > tfoot > tr > th, |
| 9 | 9 | .table-bordered > tfoot > tr > td { |
| 10 | - border: 1px solid; } | |
| 10 | + border: 1px solid; | |
| 11 | + text-align: center; } | |
| 11 | 12 | .table-bordered > thead > tr > th, |
| 12 | 13 | .table-bordered > thead > tr > td { |
| 13 | 14 | border-bottom-width: 2px; } |
| ... | ... | @@ -250,7 +251,7 @@ |
| 250 | 251 | <td>{{obj.company}}</td> |
| 251 | 252 | <td>{{obj.subCompany}}</td> |
| 252 | 253 | <td>{{obj.line}}</td> |
| 253 | - {{if obj.delayFirst0 != '/' && obj.delayFirst0 != '0'}} | |
| 254 | + {{if obj.delayFirst0 != '/' && (obj.delayFirst0 > 1 || obj.delayFirst0 < -2)}} | |
| 254 | 255 | <td style="background-color: #FF9999">{{obj.qdzFirst0}}</td> |
| 255 | 256 | <td style="background-color: #FF9999">{{obj.jhfcFirst0}}</td> |
| 256 | 257 | <td style="background-color: #FF9999">{{obj.sjfcFirst0}}</td> |
| ... | ... | @@ -261,7 +262,7 @@ |
| 261 | 262 | <td>{{obj.sjfcFirst0}}</td> |
| 262 | 263 | <td>{{obj.delayFirst0}}</td> |
| 263 | 264 | {{/if}} |
| 264 | - {{if obj.delayLast0 != '/' && obj.delayLast0 != '0'}} | |
| 265 | + {{if obj.delayLast0 != '/' && (obj.delayLast0 > 1 || obj.delayLast0 < -2)}} | |
| 265 | 266 | <td style="background-color: #FF9999">{{obj.qdzLast0}}</td> |
| 266 | 267 | <td style="background-color: #FF9999">{{obj.jhfcLast0}}</td> |
| 267 | 268 | <td style="background-color: #FF9999">{{obj.sjfcLast0}}</td> |
| ... | ... | @@ -272,7 +273,7 @@ |
| 272 | 273 | <td>{{obj.sjfcLast0}}</td> |
| 273 | 274 | <td>{{obj.delayLast0}}</td> |
| 274 | 275 | {{/if}} |
| 275 | - {{if obj.delayFirst1 != '/' && obj.delayFirst1 != '0'}} | |
| 276 | + {{if obj.delayFirst1 != '/' && (obj.delayFirst1 > 1 || obj.delayFirst1 < -2)}} | |
| 276 | 277 | <td style="background-color: #FF9999">{{obj.qdzFirst1}}</td> |
| 277 | 278 | <td style="background-color: #FF9999">{{obj.jhfcFirst1}}</td> |
| 278 | 279 | <td style="background-color: #FF9999">{{obj.sjfcFirst1}}</td> |
| ... | ... | @@ -283,7 +284,7 @@ |
| 283 | 284 | <td>{{obj.sjfcFirst1}}</td> |
| 284 | 285 | <td>{{obj.delayFirst1}}</td> |
| 285 | 286 | {{/if}} |
| 286 | - {{if obj.delayLast1 != '/' && obj.delayLast1 != '0'}} | |
| 287 | + {{if obj.delayLast1 != '/' && (obj.delayLast1 > 1 || obj.delayLast1 < -2)}} | |
| 287 | 288 | <td style="background-color: #FF9999">{{obj.qdzLast1}}</td> |
| 288 | 289 | <td style="background-color: #FF9999">{{obj.jhfcLast1}}</td> |
| 289 | 290 | <td style="background-color: #FF9999">{{obj.sjfcLast1}}</td> | ... | ... |
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html
| ... | ... | @@ -7,7 +7,8 @@ |
| 7 | 7 | .table-bordered > tbody > tr > td, |
| 8 | 8 | .table-bordered > tfoot > tr > th, |
| 9 | 9 | .table-bordered > tfoot > tr > td { |
| 10 | - border: 1px solid; } | |
| 10 | + border: 1px solid; | |
| 11 | + text-align: center; } | |
| 11 | 12 | .table-bordered > thead > tr > th, |
| 12 | 13 | .table-bordered > thead > tr > td { |
| 13 | 14 | border-bottom-width: 2px; } |
| ... | ... | @@ -27,11 +28,11 @@ |
| 27 | 28 | <div class="portlet light porttlet-fit bordered"> |
| 28 | 29 | <div class="portlet-title"> |
| 29 | 30 | <form id="history" class="form-inline" action=""> |
| 30 | - <div style="display: inline-block;margin-left: 10px;" id="company1"> | |
| 31 | + <div style="display: inline-block;margin-left: 28px;" id="company1"> | |
| 31 | 32 | <span class="item-label" style="width: 80px;">公司: </span> |
| 32 | 33 | <select class="form-control" name="company" id="company" style="width: 160px;"></select> |
| 33 | 34 | </div> |
| 34 | - <div style="display: inline-block;margin-left: 10px;" id="subCompany1"> | |
| 35 | + <div style="display: inline-block;margin-left: 24px;" id="subCompany1"> | |
| 35 | 36 | <span class="item-label" style="width: 80px;">分公司: </span> |
| 36 | 37 | <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select> |
| 37 | 38 | </div> |
| ... | ... | @@ -39,11 +40,16 @@ |
| 39 | 40 | <span class="item-label" style="width: 80px;">线路: </span> |
| 40 | 41 | <select class="form-control" name="line" id="line" style="width: 160px;"></select> |
| 41 | 42 | </div> |
| 43 | + <div style="margin-top: 10px"></div> | |
| 44 | + <div style="display: inline-block;margin-left: 0px;"> | |
| 45 | + <span class="item-label" style="width: 80px;">开始时间: </span> | |
| 46 | + <input class="form-control" type="text" id="startDate" style="width: 160px;"/> | |
| 47 | + </div> | |
| 42 | 48 | <div style="display: inline-block;margin-left: 10px;"> |
| 43 | - <span class="item-label" style="width: 80px;">时间: </span> | |
| 44 | - <input class="form-control" type="text" id="date" style="width: 160px;"/> | |
| 49 | + <span class="item-label" style="width: 80px;">结束时间: </span> | |
| 50 | + <input class="form-control" type="text" id="endDate" style="width: 160px;"/> | |
| 45 | 51 | </div> |
| 46 | - <div class="form-group"> | |
| 52 | + <div class="form-group" style="margin-left: 10px;"> | |
| 47 | 53 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 48 | 54 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| 49 | 55 | </div> |
| ... | ... | @@ -54,7 +60,7 @@ |
| 54 | 60 | <table class="table table-bordered table-hover table-checkable" id="forms"> |
| 55 | 61 | <thead> |
| 56 | 62 | <tr class="hidden"> |
| 57 | - <th>日期</th> | |
| 63 | + <th width="240px">日期</th> | |
| 58 | 64 | <th>公司</th> |
| 59 | 65 | <th>分公司</th> |
| 60 | 66 | <th>线路</th> |
| ... | ... | @@ -73,6 +79,7 @@ |
| 73 | 79 | <thead> |
| 74 | 80 | <tr class="hidden"> |
| 75 | 81 | <th style="display: none;"></th> |
| 82 | + <th rowspan="2">日期</th> | |
| 76 | 83 | <th rowspan="2">线路</th> |
| 77 | 84 | <th colspan="4">上行首发</th> |
| 78 | 85 | <th colspan="4">上行末发</th> |
| ... | ... | @@ -116,12 +123,12 @@ |
| 116 | 123 | // 关闭左侧栏 |
| 117 | 124 | if (!$('body').hasClass('page-sidebar-closed')) |
| 118 | 125 | $('.menu-toggler.sidebar-toggler').click(); |
| 119 | - | |
| 120 | - $("#date").datetimepicker({ | |
| 126 | + | |
| 127 | + $("#startDate,#endDate").datetimepicker({ | |
| 121 | 128 | format : 'YYYY-MM-DD', |
| 122 | 129 | locale : 'zh-cn' |
| 123 | 130 | }); |
| 124 | - | |
| 131 | + | |
| 125 | 132 | var d = new Date(); |
| 126 | 133 | var year = d.getFullYear(); |
| 127 | 134 | var month = d.getMonth() + 1; |
| ... | ... | @@ -130,7 +137,7 @@ |
| 130 | 137 | month = "0" + month; |
| 131 | 138 | if(day < 10) |
| 132 | 139 | day = "0" + day; |
| 133 | - $("#date").val(year + "-" + month + "-" + day); | |
| 140 | + $("#startDate,#endDate").val(year + "-" + month + "-" + day); | |
| 134 | 141 | |
| 135 | 142 | var fage=false; |
| 136 | 143 | var xlList; |
| ... | ... | @@ -216,9 +223,14 @@ |
| 216 | 223 | var company = $("#company").val(); |
| 217 | 224 | var subCompany = $("#subCompany").val(); |
| 218 | 225 | var line = $("#line").val(); |
| 219 | - var date = $("#date").val(); | |
| 226 | + var startDate = $("#startDate").val(); | |
| 227 | + var endDate = $("#endDate").val(); | |
| 220 | 228 | function jsDoQuery(pagination){ |
| 221 | - if($("#date").val() == null || $("#date").val().trim().length == 0){ | |
| 229 | + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){ | |
| 230 | + layer.msg("请选择时间!"); | |
| 231 | + return; | |
| 232 | + } | |
| 233 | + if($("#endDate").val() == null || $("#endDate").val().trim().length == 0){ | |
| 222 | 234 | layer.msg("请选择时间!"); |
| 223 | 235 | return; |
| 224 | 236 | } |
| ... | ... | @@ -226,14 +238,15 @@ |
| 226 | 238 | company = $("#company").val(); |
| 227 | 239 | subCompany = $("#subCompany").val(); |
| 228 | 240 | line = $("#line").val(); |
| 229 | - date = $("#date").val(); | |
| 241 | + startDate = $("#startDate").val(); | |
| 242 | + endDate = $("#endDate").val(); | |
| 230 | 243 | if(line == " ") |
| 231 | 244 | line = ""; |
| 232 | 245 | params['company'] = company; |
| 233 | 246 | params['subCompany'] = subCompany; |
| 234 | 247 | params['line'] = line; |
| 235 | - params['line'] = line; | |
| 236 | - params['date'] = date; | |
| 248 | + params['startDate'] = startDate; | |
| 249 | + params['endDate'] = endDate; | |
| 237 | 250 | params['type'] = "query"; |
| 238 | 251 | $("#forms .hidden").removeClass("hidden"); |
| 239 | 252 | $("#map tr").addClass("hidden"); |
| ... | ... | @@ -253,19 +266,15 @@ |
| 253 | 266 | } |
| 254 | 267 | |
| 255 | 268 | $("#export").on("click",function(){ |
| 256 | - if($("#date").val() == null || $("#date").val().trim().length == 0){ | |
| 257 | - layer.msg("请选择时间!"); | |
| 258 | - return; | |
| 259 | - } | |
| 260 | 269 | var params = {}; |
| 261 | 270 | params['company'] = company; |
| 262 | 271 | params['subCompany'] = subCompany; |
| 263 | 272 | params['line'] = line; |
| 264 | - params['line'] = line; | |
| 265 | - params['date'] = date; | |
| 273 | + params['startDate'] = startDate; | |
| 274 | + params['endDate'] = endDate; | |
| 266 | 275 | params['type'] = "export"; |
| 267 | 276 | $get('/pcpc/firstAndLastBus_sum', params, function(result){ |
| 268 | - window.open("/downloadFile/download?fileName=线路首末班准点率"+moment(date).format("YYYYMMDD")); | |
| 277 | + window.open("/downloadFile/download?fileName=线路首末班准点率"+moment(startDate).format("YYYYMMDD")+(startDate==endDate?"":("-"+moment(endDate).format("YYYYMMDD")))); | |
| 269 | 278 | }); |
| 270 | 279 | }); |
| 271 | 280 | |
| ... | ... | @@ -276,13 +285,20 @@ |
| 276 | 285 | <script type="text/html" id="list_firstAndLastBus"> |
| 277 | 286 | {{each list as obj i}} |
| 278 | 287 | <tr> |
| 279 | - <td>{{obj.date}}</td> | |
| 280 | - <td>{{obj.company}}</td> | |
| 281 | - <td>{{obj.subCompany}}</td> | |
| 282 | - <td>{{obj.line}}</td> | |
| 283 | - <td>{{obj.jhbc}}</td> | |
| 284 | - <td>{{obj.sjbc}}</td> | |
| 285 | - <td><a id='delay'>{{obj.zdl}}</a></td> | |
| 288 | + {{if obj.date != '合计汇总'}} | |
| 289 | + <td>{{obj.date}}</td> | |
| 290 | + <td>{{obj.company}}</td> | |
| 291 | + <td>{{obj.subCompany}}</td> | |
| 292 | + <td>{{obj.line}}</td> | |
| 293 | + <td>{{obj.jhbc}}</td> | |
| 294 | + <td>{{obj.sjbc}}</td> | |
| 295 | + <td><a id='delay'>{{obj.zdl}}</a></td> | |
| 296 | + {{else}} | |
| 297 | + <td colspan='4'>{{obj.date}}</td> | |
| 298 | + <td>{{obj.jhbc}}</td> | |
| 299 | + <td>{{obj.sjbc}}</td> | |
| 300 | + <td>{{obj.zdl}}</td> | |
| 301 | + {{/if}} | |
| 286 | 302 | </tr> |
| 287 | 303 | {{/each}} |
| 288 | 304 | {{if list.length == 0}} |
| ... | ... | @@ -292,23 +308,26 @@ |
| 292 | 308 | {{/if}} |
| 293 | 309 | </script> |
| 294 | 310 | <script type="text/html" id="list_maps"> |
| 311 | + {{each list as obj i}} | |
| 295 | 312 | <tr> |
| 296 | - <td>{{list.line}}</td> | |
| 297 | - <td>{{list.qdzFirst0}}</td> | |
| 298 | - <td>{{list.jhfcFirst0}}</td> | |
| 299 | - <td>{{list.sjfcFirst0}}</td> | |
| 300 | - <td>{{list.delayFirst0}}</td> | |
| 301 | - <td>{{list.qdzLast0}}</td> | |
| 302 | - <td>{{list.jhfcLast0}}</td> | |
| 303 | - <td>{{list.sjfcLast0}}</td> | |
| 304 | - <td>{{list.delayLast0}}</td> | |
| 305 | - <td>{{list.qdzFirst1}}</td> | |
| 306 | - <td>{{list.jhfcFirst1}}</td> | |
| 307 | - <td>{{list.sjfcFirst1}}</td> | |
| 308 | - <td>{{list.delayFirst1}}</td> | |
| 309 | - <td>{{list.qdzLast1}}</td> | |
| 310 | - <td>{{list.jhfcLast1}}</td> | |
| 311 | - <td>{{list.sjfcLast1}}</td> | |
| 312 | - <td>{{list.delayLast1}}</td> | |
| 313 | + <td>{{obj.date}}</td> | |
| 314 | + <td>{{obj.line}}</td> | |
| 315 | + <td>{{obj.qdzFirst0}}</td> | |
| 316 | + <td>{{obj.jhfcFirst0}}</td> | |
| 317 | + <td>{{obj.sjfcFirst0}}</td> | |
| 318 | + <td>{{obj.delayFirst0}}</td> | |
| 319 | + <td>{{obj.qdzLast0}}</td> | |
| 320 | + <td>{{obj.jhfcLast0}}</td> | |
| 321 | + <td>{{obj.sjfcLast0}}</td> | |
| 322 | + <td>{{obj.delayLast0}}</td> | |
| 323 | + <td>{{obj.qdzFirst1}}</td> | |
| 324 | + <td>{{obj.jhfcFirst1}}</td> | |
| 325 | + <td>{{obj.sjfcFirst1}}</td> | |
| 326 | + <td>{{obj.delayFirst1}}</td> | |
| 327 | + <td>{{obj.qdzLast1}}</td> | |
| 328 | + <td>{{obj.jhfcLast1}}</td> | |
| 329 | + <td>{{obj.sjfcLast1}}</td> | |
| 330 | + <td>{{obj.delayLast1}}</td> | |
| 313 | 331 | </tr> |
| 332 | + {{/each}} | |
| 314 | 333 | </script> |
| 315 | 334 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forms/statement/historyMessage.html
| ... | ... | @@ -46,7 +46,7 @@ |
| 46 | 46 | </form> |
| 47 | 47 | </div> |
| 48 | 48 | <div class="portlet-body"> |
| 49 | - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 49 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;max-height: 520px;"> | |
| 50 | 50 | <table class="table table-bordered table-hover table-checkable" id="forms"> |
| 51 | 51 | <thead> |
| 52 | 52 | <tr class="hidden"> | ... | ... |
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
| ... | ... | @@ -7,7 +7,8 @@ |
| 7 | 7 | .table-bordered > tbody > tr > td, |
| 8 | 8 | .table-bordered > tfoot > tr > th, |
| 9 | 9 | .table-bordered > tfoot > tr > td { |
| 10 | - border: 1px solid; } | |
| 10 | + border: 1px solid; | |
| 11 | + text-align: center; } | |
| 11 | 12 | .table-bordered > thead > tr > th, |
| 12 | 13 | .table-bordered > thead > tr > td { |
| 13 | 14 | border-bottom-width: 2px; } |
| ... | ... | @@ -39,6 +40,14 @@ |
| 39 | 40 | <span class="item-label" style="width: 80px;">线路: </span> |
| 40 | 41 | <select class="form-control" name="line" id="line" style="width: 160px;"></select> |
| 41 | 42 | </div> |
| 43 | + <div style="display: inline-block;margin-left: 10px;"> | |
| 44 | + <span class="item-label" style="width: 80px;">班次类型: </span> | |
| 45 | + <select class="form-control" name="line" id="bcType" style="width: 160px;"> | |
| 46 | + <option value="0">全部班次</option> | |
| 47 | + <option value="1">全程</option> | |
| 48 | + <option value="2">区间</option> | |
| 49 | + </select> | |
| 50 | + </div> | |
| 42 | 51 | <div style="margin-top: 10px"></div> |
| 43 | 52 | <div style="display: inline-block;margin-left: 10px;"> |
| 44 | 53 | <span class="item-label" style="width: 80px;">开始时间: </span> |
| ... | ... | @@ -54,7 +63,7 @@ |
| 54 | 63 | <option value="">请选择...</option> |
| 55 | 64 | </select> |
| 56 | 65 | </div> |
| 57 | - <div class="form-group"> | |
| 66 | + <div class="form-group" style="margin-left: 10px"> | |
| 58 | 67 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 59 | 68 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| 60 | 69 | </div> |
| ... | ... | @@ -202,6 +211,7 @@ |
| 202 | 211 | var startDate = $("#startDate").val(); |
| 203 | 212 | var endDate = $("#endDate").val(); |
| 204 | 213 | var model = $("#model").val(); |
| 214 | + var bcType = $('#bcType').val(); | |
| 205 | 215 | var company = $("#company").val(); |
| 206 | 216 | var subCompany = $("#subCompany").val(); |
| 207 | 217 | function jsDoQuery(pagination){ |
| ... | ... | @@ -218,6 +228,7 @@ |
| 218 | 228 | startDate = $("#startDate").val(); |
| 219 | 229 | endDate = $("#endDate").val(); |
| 220 | 230 | model = $("#model").val(); |
| 231 | + bcType = $("#bcType").val(); | |
| 221 | 232 | company = $("#company").val(); |
| 222 | 233 | subCompany = $("#subCompany").val(); |
| 223 | 234 | params['page'] = page; |
| ... | ... | @@ -225,6 +236,7 @@ |
| 225 | 236 | params['startDate'] = startDate; |
| 226 | 237 | params['endDate'] = endDate; |
| 227 | 238 | params['model'] = model; |
| 239 | + params['bcType'] = bcType; | |
| 228 | 240 | params['company'] = company; |
| 229 | 241 | params['subCompany'] = subCompany; |
| 230 | 242 | params['type'] = "query"; |
| ... | ... | @@ -274,12 +286,7 @@ |
| 274 | 286 | line = ""; |
| 275 | 287 | updateModel(); |
| 276 | 288 | }); |
| 277 | - $('#startDate').on("blur", function(){ | |
| 278 | - startDate = $("#startDate").val(); | |
| 279 | - endDate = $("#endDate").val(); | |
| 280 | - updateModel(); | |
| 281 | - }); | |
| 282 | - $('#endDate').on("blur", function(){ | |
| 289 | + $('#startDate, #endDate').on("blur", function(){ | |
| 283 | 290 | startDate = $("#startDate").val(); |
| 284 | 291 | endDate = $("#endDate").val(); |
| 285 | 292 | updateModel(); | ... | ... |
src/main/resources/static/pages/forms/statement/scheduleDaily.html
| ... | ... | @@ -7,7 +7,8 @@ |
| 7 | 7 | .table-bordered > tbody > tr > td, |
| 8 | 8 | .table-bordered > tfoot > tr > th, |
| 9 | 9 | .table-bordered > tfoot > tr > td { |
| 10 | - border: 1px solid; } | |
| 10 | + border: 1px solid; | |
| 11 | + text-align: center; } | |
| 11 | 12 | .table-bordered > thead > tr > th, |
| 12 | 13 | .table-bordered > thead > tr > td { |
| 13 | 14 | border-bottom-width: 2px; } |
| ... | ... | @@ -19,7 +20,7 @@ |
| 19 | 20 | |
| 20 | 21 | width: 5px; |
| 21 | 22 | word-wrap: break-word; |
| 22 | -letter-spacing: 20px; | |
| 23 | +/* letter-spacing: 20px; */ | |
| 23 | 24 | } |
| 24 | 25 | |
| 25 | 26 | #forms tr> td >label{ | ... | ... |
src/main/resources/static/pages/forms/statement/waybill.html
| ... | ... | @@ -55,7 +55,7 @@ |
| 55 | 55 | <div class="portlet-body"> |
| 56 | 56 | <div class="row"> |
| 57 | 57 | <div class="col-md-3"> |
| 58 | - <div class="" style="margin-top: 10px;overflow:auto;height: 860px"> | |
| 58 | + <div class="" style="margin-top: 10px;overflow:auto;height: 520px"> | |
| 59 | 59 | <table class="table table-bordered table-hover table-checkable pre-scrollable" id="info"> |
| 60 | 60 | <thead> |
| 61 | 61 | <tr class="hidden"> |
| ... | ... | @@ -71,7 +71,7 @@ |
| 71 | 71 | </div> |
| 72 | 72 | </div> |
| 73 | 73 | <div class="col-md-9" id="printArea"> |
| 74 | - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 74 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;height: 520px"> | |
| 75 | 75 | <table class="table table-bordered table-checkable" id="forms"> |
| 76 | 76 | <tbody class="ludan_1"> |
| 77 | 77 | |
| ... | ... | @@ -264,6 +264,7 @@ |
| 264 | 264 | jName = params[0].split("\\")[0]; |
| 265 | 265 | jGh = params[0].split("\\")[1]; |
| 266 | 266 | var id = params[3]; |
| 267 | + var obj = $(this); | |
| 267 | 268 | $get('/realSchedule/MapById',{id:id},function(result){ |
| 268 | 269 | result.scheduleDate = moment(result.scheduleDate).format("YYYY/MM/DD"); |
| 269 | 270 | var ludan_1 = template('ludan_1',result); |
| ... | ... | @@ -279,8 +280,11 @@ |
| 279 | 280 | $get('/realSchedule/findKMBC',{jGh:jGh,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){ |
| 280 | 281 | var ludan_3 = template('ludan_3',result); |
| 281 | 282 | $('#forms .ludan_3').html(ludan_3); |
| 283 | + $("#info tbody tr").css('background-color', ''); | |
| 284 | + obj.css('background-color', '#99CCFF'); | |
| 282 | 285 | }); |
| 283 | 286 | |
| 287 | + | |
| 284 | 288 | }); |
| 285 | 289 | |
| 286 | 290 | $("#export").on("click",function(){ | ... | ... |
src/main/resources/static/pages/mforms/shifdays/shifday.html
| ... | ... | @@ -104,6 +104,16 @@ $(function(){ |
| 104 | 104 | format : 'YYYY-MM-DD', |
| 105 | 105 | locale : 'zh-cn' |
| 106 | 106 | }); |
| 107 | + var d = new Date(); | |
| 108 | + var year = d.getFullYear(); | |
| 109 | + var month = d.getMonth() + 1; | |
| 110 | + var day = d.getDate(); | |
| 111 | + if(month < 10) | |
| 112 | + month = "0" + month; | |
| 113 | + if(day < 10) | |
| 114 | + day = "0" + day; | |
| 115 | + $("#date").val(year + "-" + month + "-" + day); | |
| 116 | + | |
| 107 | 117 | var fage=false; |
| 108 | 118 | var obj = []; |
| 109 | 119 | var xlList; |
| ... | ... | @@ -227,10 +237,14 @@ $(function(){ |
| 227 | 237 | <script type="text/html" id="shifday"> |
| 228 | 238 | {{each list as obj i}} |
| 229 | 239 | <tr> |
| 230 | - <td>{{obj.jName}}</td> | |
| 231 | - <td>{{obj.sName}}</td> | |
| 232 | - <td>{{obj.lpName}}</td> | |
| 233 | - <td>{{obj.carPlate}}</td> | |
| 240 | + {{if obj.jName == '汇总合计'}} | |
| 241 | + <td colspan='4'>{{obj.jName}}</td> | |
| 242 | + {{else}} | |
| 243 | + <td>{{obj.jName}}</td> | |
| 244 | + <td>{{obj.sName}}</td> | |
| 245 | + <td>{{obj.lpName}}</td> | |
| 246 | + <td>{{obj.carPlate}}</td> | |
| 247 | + {{/if}} | |
| 234 | 248 | <td>{{obj.jhlc}}</td> |
| 235 | 249 | <td>{{obj.sjjhlc}}</td> |
| 236 | 250 | <td>{{obj.yygl}}</td> | ... | ... |
src/main/resources/static/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html
| 1 | -<style type="text/css"> | |
| 2 | - .table-bordered { | |
| 3 | - border: 1px solid; } | |
| 4 | - .table-bordered > thead > tr > th, | |
| 5 | - .table-bordered > thead > tr > td, | |
| 6 | - .table-bordered > tbody > tr > th, | |
| 7 | - .table-bordered > tbody > tr > td, | |
| 8 | - .table-bordered > tfoot > tr > th, | |
| 9 | - .table-bordered > tfoot > tr > td { | |
| 10 | - border: 1px solid; } | |
| 11 | - .table-bordered > thead > tr > th, | |
| 12 | - .table-bordered > thead > tr > td { | |
| 13 | - border-bottom-width: 2px; | |
| 14 | - text-align: center; } | |
| 15 | - | |
| 16 | - .table > tbody + tbody { | |
| 17 | - border-top: 1px solid; } | |
| 18 | -</style> | |
| 19 | - | |
| 20 | -<div class="page-head"> | |
| 21 | - <div class="page-title"> | |
| 22 | - <h1>班次车辆人员月报表</h1> | |
| 23 | - </div> | |
| 24 | -</div> | |
| 1 | +<style type="text/css"> | |
| 2 | + .table-bordered { | |
| 3 | + border: 1px solid; } | |
| 4 | + .table-bordered > thead > tr > th, | |
| 5 | + .table-bordered > thead > tr > td, | |
| 6 | + .table-bordered > tbody > tr > th, | |
| 7 | + .table-bordered > tbody > tr > td, | |
| 8 | + .table-bordered > tfoot > tr > th, | |
| 9 | + .table-bordered > tfoot > tr > td { | |
| 10 | + border: 1px solid; | |
| 11 | + text-align: center; } | |
| 12 | + .table-bordered > thead > tr > th, | |
| 13 | + .table-bordered > thead > tr > td { | |
| 14 | + border-bottom-width: 2px; | |
| 15 | + text-align: center; } | |
| 16 | + | |
| 17 | + .table > tbody + tbody { | |
| 18 | + border-top: 1px solid; } | |
| 19 | +</style> | |
| 20 | + | |
| 21 | +<div class="page-head"> | |
| 22 | + <div class="page-title"> | |
| 23 | + <h1>班次车辆人员月报表</h1> | |
| 24 | + </div> | |
| 25 | +</div> | |
| 25 | 26 | |
| 26 | 27 | <div class="row"> |
| 27 | 28 | <div class="col-md-12"> |
| 28 | 29 | <div class="portlet light porttlet-fit bordered"> |
| 29 | 30 | <div class="portlet-title"> |
| 30 | - <form class="form-inline" action=""> | |
| 31 | - <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_manth"> | |
| 32 | - <span class="item-label" style="width: 80px;">公司: </span> | |
| 33 | - <select class="form-control" name="company" id="gsdmManth" style="width: 140px;"></select> | |
| 34 | - </div> | |
| 35 | - <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_manth"> | |
| 36 | - <span class="item-label" style="width: 80px;">分公司: </span> | |
| 37 | - <select class="form-control" name="subCompany" id="fgsdmManth" style="width: 140px;"></select> | |
| 31 | + <form class="form-inline" action=""> | |
| 32 | + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_manth"> | |
| 33 | + <span class="item-label" style="width: 80px;">公司: </span> | |
| 34 | + <select class="form-control" name="company" id="gsdmManth" style="width: 140px;"></select> | |
| 35 | + </div> | |
| 36 | + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_manth"> | |
| 37 | + <span class="item-label" style="width: 80px;">分公司: </span> | |
| 38 | + <select class="form-control" name="subCompany" id="fgsdmManth" style="width: 140px;"></select> | |
| 38 | 39 | </div> |
| 39 | - <div style="display: inline-block;margin-left: 10px"> | |
| 40 | - <span class="item-label" style="width: 150px;">线路: </span> | |
| 41 | - <select class="form-control" name="line" id="line" style="width: 136px;"></select> | |
| 42 | - </div> | |
| 43 | - <div style="margin-top: 10px"> | |
| 44 | - | |
| 45 | - </div> | |
| 46 | - <div style="display: inline-block;margin-left: 5px;"> | |
| 47 | - <span class="item-label" style="width: 80px;">开始时间: </span> | |
| 48 | - <input class="form-control" type="text" id="startDate" style="width: 140px;"/> | |
| 49 | - </div> | |
| 50 | - <div style="display: inline-block;margin-left: 10px;"> | |
| 51 | - <span class="item-label" style="width: 80px;">结束时间: </span> | |
| 52 | - <input class="form-control" type="text" id="endDate" style="width: 140px;"/> | |
| 53 | - </div> | |
| 54 | - <div style="display: inline-block;margin-left: 10px"> | |
| 55 | - <span class="item-label" style="width: 80px;">统计: </span> | |
| 56 | - <select class="form-control" style="width: 136px;" id='empnames'> | |
| 57 | - <option value="驾驶员">驾驶员</option> | |
| 58 | - <option value="售票员">售票员</option> | |
| 59 | - <option value="车辆自编号">车辆自编号</option> | |
| 60 | - </select> | |
| 61 | - </div> | |
| 62 | - <div class="form-group"> | |
| 63 | - <input class="btn btn-default" type="button" id="query" value="筛选"/> | |
| 64 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 40 | + <div style="display: inline-block;margin-left: 10px"> | |
| 41 | + <span class="item-label" style="width: 150px;">线路: </span> | |
| 42 | + <select class="form-control" name="line" id="line" style="width: 136px;"></select> | |
| 43 | + </div> | |
| 44 | + <div style="margin-top: 10px"> | |
| 45 | + | |
| 46 | + </div> | |
| 47 | + <div style="display: inline-block;margin-left: 5px;"> | |
| 48 | + <span class="item-label" style="width: 80px;">开始时间: </span> | |
| 49 | + <input class="form-control" type="text" id="startDate" style="width: 140px;"/> | |
| 50 | + </div> | |
| 51 | + <div style="display: inline-block;margin-left: 10px;"> | |
| 52 | + <span class="item-label" style="width: 80px;">结束时间: </span> | |
| 53 | + <input class="form-control" type="text" id="endDate" style="width: 140px;"/> | |
| 54 | + </div> | |
| 55 | + <div style="display: inline-block;margin-left: 10px"> | |
| 56 | + <span class="item-label" style="width: 80px;">统计: </span> | |
| 57 | + <select class="form-control" style="width: 136px;" id='empnames'> | |
| 58 | + <option value="驾驶员">驾驶员</option> | |
| 59 | + <option value="售票员">售票员</option> | |
| 60 | + <option value="车辆自编号">车辆自编号</option> | |
| 61 | + </select> | |
| 62 | + </div> | |
| 63 | + <div class="form-group"> | |
| 64 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | |
| 65 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 65 | 66 | </div> |
| 66 | 67 | </form> |
| 67 | 68 | </div> |
| 68 | 69 | <div class="portlet-body"> |
| 69 | - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 70 | - <table class="table table-bordered table-hover table-checkable" id="forms"> | |
| 71 | - <thead> | |
| 72 | - <tr> | |
| 73 | - <th>序号</th> | |
| 74 | - <th id='empname'>驾驶员</th> | |
| 75 | - <th>运营里程</th> | |
| 76 | - <th>空驶里程</th> | |
| 77 | - <th>抽减里程</th> | |
| 78 | - <th>增加里程</th> | |
| 79 | - <th>总里程</th> | |
| 80 | - <th>抽减班次</th> | |
| 81 | - <th>增加班次</th> | |
| 82 | - <th>实际班次</th> | |
| 83 | - </tr> | |
| 84 | - </thead> | |
| 85 | - <tbody> | |
| 86 | - | |
| 87 | - </tbody> | |
| 88 | - </table> | |
| 70 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 71 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | |
| 72 | + <thead> | |
| 73 | + <tr> | |
| 74 | + <th>序号</th> | |
| 75 | + <th id='empname'>驾驶员</th> | |
| 76 | + <th>运营里程</th> | |
| 77 | + <th>空驶里程</th> | |
| 78 | + <th>抽减里程</th> | |
| 79 | + <th>增加里程</th> | |
| 80 | + <th>总里程</th> | |
| 81 | + <th>抽减班次</th> | |
| 82 | + <th>增加班次</th> | |
| 83 | + <th>实际班次</th> | |
| 84 | + </tr> | |
| 85 | + </thead> | |
| 86 | + <tbody> | |
| 87 | + | |
| 88 | + </tbody> | |
| 89 | + </table> | |
| 89 | 90 | </div> |
| 90 | 91 | </div> |
| 91 | 92 | </div> |
| ... | ... | @@ -96,156 +97,165 @@ |
| 96 | 97 | $(function(){ |
| 97 | 98 | // 关闭左侧栏 |
| 98 | 99 | if (!$('body').hasClass('page-sidebar-closed')) |
| 99 | - $('.menu-toggler.sidebar-toggler').click(); | |
| 100 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 100 | 101 | |
| 101 | 102 | $("#startDate,#endDate").datetimepicker({ |
| 102 | 103 | format : 'YYYY-MM-DD', |
| 103 | 104 | locale : 'zh-cn' |
| 104 | - }); | |
| 105 | - var fage=false; | |
| 106 | - var obj = []; | |
| 107 | - var xlList; | |
| 108 | - $.get('/report/lineList',function(result){ | |
| 109 | - xlList=result; | |
| 110 | - $.get('/user/companyData', function(result){ | |
| 111 | - | |
| 112 | - obj = result; | |
| 113 | - var options = ''; | |
| 114 | - for(var i = 0; i < obj.length; i++){ | |
| 115 | - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 116 | - } | |
| 117 | - | |
| 118 | - if(obj.length ==0){ | |
| 119 | - $("#gsdmDiv_manth").css('display','none'); | |
| 120 | - $('#fgsdmDiv_manth').css('display','none'); | |
| 121 | - }else if(obj.length ==1){ | |
| 122 | - $("#gsdmDiv_manth").css('display','none'); | |
| 123 | - if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 124 | - $('#fgsdmDiv_manth').css('display','none'); | |
| 125 | - } | |
| 126 | - $('#gsdmManth').html(options); | |
| 127 | - updateCompany(); | |
| 128 | - }); | |
| 129 | - }) | |
| 130 | - $("#gsdmManth").on("change",updateCompany); | |
| 131 | - function updateCompany(){ | |
| 132 | - var company = $('#gsdmManth').val(); | |
| 133 | - var options = ''; | |
| 134 | - for(var i = 0; i < obj.length; i++){ | |
| 135 | - if(obj[i].companyCode == company){ | |
| 136 | - var children = obj[i].children; | |
| 137 | - for(var j = 0; j < children.length; j++){ | |
| 138 | - options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 139 | - } | |
| 140 | - } | |
| 141 | - } | |
| 142 | - $('#fgsdmManth').html(options); | |
| 143 | - initXl(); | |
| 144 | - } | |
| 145 | - $("#fgsdmManth").on("change",initXl); | |
| 146 | - function initXl(){ | |
| 147 | - var data=[]; | |
| 148 | - if(fage){ | |
| 149 | - $("#line").select2("destroy").html(''); | |
| 150 | - } | |
| 151 | - var fgs=$('#fgsdmManth').val(); | |
| 152 | - var gs=$('#gsdmManth').val(); | |
| 153 | - for(var i=0;i<xlList.length;i++){ | |
| 154 | - if(gs!=""){ | |
| 155 | - if(fgs!=""){ | |
| 156 | - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | |
| 157 | - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 158 | - } | |
| 159 | - }else{ | |
| 160 | - if(xlList[i]["gsbm"]==gs){ | |
| 161 | - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 162 | - } | |
| 163 | - } | |
| 164 | - } | |
| 165 | - } | |
| 166 | - initPinYinSelect2('#line',data,''); | |
| 167 | - fage=true; | |
| 168 | - } | |
| 169 | - $("#query").on("click",function(){ | |
| 170 | - if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){ | |
| 171 | - layer.msg("请选择时间范围!"); | |
| 172 | - return; | |
| 173 | - } | |
| 174 | - if($("#endDate").val() == null || $("#endDate").val().trim().length == 0){ | |
| 175 | - layer.msg("请选择时间范围!"); | |
| 176 | - return; | |
| 177 | - } | |
| 178 | - $("#empname").html($("#empnames").val()) | |
| 179 | - var params={}; | |
| 180 | - params.empnames=$("#empnames").val(); | |
| 181 | - params.line = $("#line").val(); | |
| 182 | - params.startDate = $("#startDate").val(); | |
| 183 | - params.endDate = $("#endDate").val(); | |
| 184 | - params.lpName = $("#lpName").val(); | |
| 185 | - params.gsdmManth= $("#gsdmManth").val(); | |
| 186 | - params.fgsdmManth= $("#fgsdmManth").val(); | |
| 187 | - $get("/mcy_forms/shiftuehiclemanth",params,function(result){ | |
| 188 | - $("#sDate").text(startDate); | |
| 189 | - $("#eDate").text(endDate); | |
| 190 | - var temp = {}; | |
| 191 | - var today_account = 0; | |
| 192 | - temp["line"] = $("#line").text(); | |
| 193 | - $.each(result, function(i, obj) { | |
| 194 | - if(moment(obj.schedule_date_str).format("YYYY-MM-DD") == moment(obj.startDate).format("YYYY-MM-DD")){ | |
| 195 | - today_account++; | |
| 196 | - } | |
| 197 | - obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss"); | |
| 198 | - }); | |
| 199 | - | |
| 200 | - var list_shiftuehiclemanth = template('list_shiftuehiclemanth',{list:result}); | |
| 201 | - // 把渲染好的模版html文本追加到表格中 | |
| 202 | - $('#forms tbody').html(list_shiftuehiclemanth); | |
| 203 | - | |
| 204 | - }); | |
| 205 | - }); | |
| 206 | - | |
| 207 | - $("#export").on("click",function(){ | |
| 208 | - var params={}; | |
| 209 | - params.empnames=$("#empnames").val(); | |
| 210 | - params.line = $("#line").val(); | |
| 211 | - params.startDate = $("#startDate").val(); | |
| 212 | - params.endDate = $("#endDate").val(); | |
| 213 | - params.lpName = $("#lpName").val(); | |
| 214 | - params.gsdmManth= $("#gsdmManth").val(); | |
| 215 | - params.fgsdmManth= $("#fgsdmManth").val(); | |
| 216 | - params.type='export'; | |
| 217 | - $get('/mcy_export/shiftuehiclemanthExport',params,function(result){ | |
| 218 | - window.open("/downloadFile/download?fileName=班次车辆人员月报表"+moment($("#startDate").val()).format("YYYYMMDD")); | |
| 219 | - }); | |
| 220 | - }); | |
| 105 | + }); | |
| 106 | + var d = new Date(); | |
| 107 | + var year = d.getFullYear(); | |
| 108 | + var month = d.getMonth() + 1; | |
| 109 | + var day = d.getDate(); | |
| 110 | + if(month < 10) | |
| 111 | + month = "0" + month; | |
| 112 | + if(day < 10) | |
| 113 | + day = "0" + day; | |
| 114 | + $("#startDate,#endDate").val(year + "-" + month + "-" + day); | |
| 115 | + | |
| 116 | + var fage=false; | |
| 117 | + var obj = []; | |
| 118 | + var xlList; | |
| 119 | + $.get('/report/lineList',function(result){ | |
| 120 | + xlList=result; | |
| 121 | + $.get('/user/companyData', function(result){ | |
| 122 | + obj = result; | |
| 123 | + var options = ''; | |
| 124 | + for(var i = 0; i < obj.length; i++){ | |
| 125 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 126 | + } | |
| 127 | + | |
| 128 | + if(obj.length ==0){ | |
| 129 | + $("#gsdmDiv_manth").css('display','none'); | |
| 130 | + $('#fgsdmDiv_manth').css('display','none'); | |
| 131 | + }else if(obj.length ==1){ | |
| 132 | + $("#gsdmDiv_manth").css('display','none'); | |
| 133 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 134 | + $('#fgsdmDiv_manth').css('display','none'); | |
| 135 | + } | |
| 136 | + $('#gsdmManth').html(options); | |
| 137 | + updateCompany(); | |
| 138 | + }); | |
| 139 | + }) | |
| 140 | + $("#gsdmManth").on("change",updateCompany); | |
| 141 | + function updateCompany(){ | |
| 142 | + var company = $('#gsdmManth').val(); | |
| 143 | + var options = ''; | |
| 144 | + for(var i = 0; i < obj.length; i++){ | |
| 145 | + if(obj[i].companyCode == company){ | |
| 146 | + var children = obj[i].children; | |
| 147 | + for(var j = 0; j < children.length; j++){ | |
| 148 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 149 | + } | |
| 150 | + } | |
| 151 | + } | |
| 152 | + $('#fgsdmManth').html(options); | |
| 153 | + initXl(); | |
| 154 | + } | |
| 155 | + $("#fgsdmManth").on("change",initXl); | |
| 156 | + function initXl(){ | |
| 157 | + var data=[]; | |
| 158 | + if(fage){ | |
| 159 | + $("#line").select2("destroy").html(''); | |
| 160 | + } | |
| 161 | + var fgs=$('#fgsdmManth').val(); | |
| 162 | + var gs=$('#gsdmManth').val(); | |
| 163 | + for(var i=0;i<xlList.length;i++){ | |
| 164 | + if(gs!=""){ | |
| 165 | + if(fgs!=""){ | |
| 166 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | |
| 167 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 168 | + } | |
| 169 | + }else{ | |
| 170 | + if(xlList[i]["gsbm"]==gs){ | |
| 171 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 172 | + } | |
| 173 | + } | |
| 174 | + } | |
| 175 | + } | |
| 176 | + initPinYinSelect2('#line',data,''); | |
| 177 | + fage=true; | |
| 178 | + } | |
| 179 | + $("#query").on("click",function(){ | |
| 180 | + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){ | |
| 181 | + layer.msg("请选择时间范围!"); | |
| 182 | + return; | |
| 183 | + } | |
| 184 | + if($("#endDate").val() == null || $("#endDate").val().trim().length == 0){ | |
| 185 | + layer.msg("请选择时间范围!"); | |
| 186 | + return; | |
| 187 | + } | |
| 188 | + $("#empname").html($("#empnames").val()) | |
| 189 | + var params={}; | |
| 190 | + params.empnames=$("#empnames").val(); | |
| 191 | + params.line = $("#line").val(); | |
| 192 | + params.startDate = $("#startDate").val(); | |
| 193 | + params.endDate = $("#endDate").val(); | |
| 194 | + params.lpName = $("#lpName").val(); | |
| 195 | + params.gsdmManth= $("#gsdmManth").val(); | |
| 196 | + params.fgsdmManth= $("#fgsdmManth").val(); | |
| 197 | + $get("/mcy_forms/shiftuehiclemanth",params,function(result){ | |
| 198 | + $("#sDate").text(startDate); | |
| 199 | + $("#eDate").text(endDate); | |
| 200 | + var temp = {}; | |
| 201 | + var today_account = 0; | |
| 202 | + temp["line"] = $("#line").text(); | |
| 203 | + $.each(result, function(i, obj) { | |
| 204 | + if(moment(obj.schedule_date_str).format("YYYY-MM-DD") == moment(obj.startDate).format("YYYY-MM-DD")){ | |
| 205 | + today_account++; | |
| 206 | + } | |
| 207 | + obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss"); | |
| 208 | + }); | |
| 209 | + | |
| 210 | + var list_shiftuehiclemanth = template('list_shiftuehiclemanth',{list:result}); | |
| 211 | + // 把渲染好的模版html文本追加到表格中 | |
| 212 | + $('#forms tbody').html(list_shiftuehiclemanth); | |
| 213 | + | |
| 214 | + }); | |
| 215 | + }); | |
| 216 | + | |
| 217 | + $("#export").on("click",function(){ | |
| 218 | + var params={}; | |
| 219 | + params.empnames=$("#empnames").val(); | |
| 220 | + params.line = $("#line").val(); | |
| 221 | + params.startDate = $("#startDate").val(); | |
| 222 | + params.endDate = $("#endDate").val(); | |
| 223 | + params.lpName = $("#lpName").val(); | |
| 224 | + params.gsdmManth= $("#gsdmManth").val(); | |
| 225 | + params.fgsdmManth= $("#fgsdmManth").val(); | |
| 226 | + params.type='export'; | |
| 227 | + $get('/mcy_export/shiftuehiclemanthExport',params,function(result){ | |
| 228 | + window.open("/downloadFile/download?fileName=班次车辆人员月报表"+moment($("#startDate").val()).format("YYYYMMDD")); | |
| 229 | + }); | |
| 230 | + }); | |
| 221 | 231 | |
| 222 | - }); | |
| 223 | - | |
| 224 | -// $("#empnames").change(function(){ | |
| 225 | -// $("#empname").html($("#empnames").val()) | |
| 226 | -// // $("#query").click(); | |
| 227 | - | |
| 228 | -// }); | |
| 232 | + }); | |
| 233 | + | |
| 234 | +// $("#empnames").change(function(){ | |
| 235 | +// $("#empname").html($("#empnames").val()) | |
| 236 | +// // $("#query").click(); | |
| 237 | + | |
| 238 | +// }); | |
| 229 | 239 | |
| 230 | 240 | </script> |
| 231 | 241 | <script type="text/html" id="list_shiftuehiclemanth"> |
| 232 | 242 | {{each list as obj i}} |
| 233 | - <tr> | |
| 243 | + <tr> | |
| 234 | 244 | <td>{{i+1}}</td> |
| 235 | - <td>{{obj.jName}}</td> | |
| 236 | - <td>{{obj.jhlc}}</td> | |
| 237 | - <td>{{obj.emptMileage}}</td> | |
| 238 | - <td>{{obj.remMileage}}</td> | |
| 239 | - <td>{{obj.addMileage}}</td> | |
| 240 | - <td>{{obj.totalm}}</td> | |
| 241 | - <td>{{obj.cjbc}}</td> | |
| 242 | - <td>{{obj.ljbc}}</td> | |
| 245 | + <td>{{obj.jName}}</td> | |
| 246 | + <td>{{obj.jhlc}}</td> | |
| 247 | + <td>{{obj.emptMileage}}</td> | |
| 248 | + <td>{{obj.remMileage}}</td> | |
| 249 | + <td>{{obj.addMileage}}</td> | |
| 250 | + <td>{{obj.totalm}}</td> | |
| 251 | + <td>{{obj.cjbc}}</td> | |
| 252 | + <td>{{obj.ljbc}}</td> | |
| 243 | 253 | <td>{{obj.sjbc}}</td> |
| 244 | 254 | </tr> |
| 245 | - {{/each}} | |
| 246 | - {{if list.length == 0}} | |
| 247 | - <tr> | |
| 248 | - <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td> | |
| 249 | - </tr> | |
| 255 | + {{/each}} | |
| 256 | + {{if list.length == 0}} | |
| 257 | + <tr> | |
| 258 | + <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td> | |
| 259 | + </tr> | |
| 250 | 260 | {{/if}} |
| 251 | 261 | </script> |
| 252 | 262 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/report/oil/oilListMonth.html
| ... | ... | @@ -37,7 +37,7 @@ |
| 37 | 37 | </div> |
| 38 | 38 | <div class="form-group"> |
| 39 | 39 | <input class="btn btn-default" type="button" id="query" value="查询"/> |
| 40 | -<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | |
| 40 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 41 | 41 | </div> |
| 42 | 42 | </form> |
| 43 | 43 | </div> |
| ... | ... | @@ -115,18 +115,36 @@ |
| 115 | 115 | initPinYinSelect2('#line',data,''); |
| 116 | 116 | |
| 117 | 117 | }) |
| 118 | + | |
| 118 | 119 | //查询 |
| 119 | 120 | $("#query").on('click',function(){ |
| 121 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | |
| 122 | + layer.msg("请选择日期!"); | |
| 123 | + return; | |
| 124 | + } | |
| 120 | 125 | var line = $("#line").val(); |
| 121 | 126 | var date = $("#date").val(); |
| 122 | - $get('/ylb/oilListMonth',{line:line,date:date},function(result){ | |
| 123 | - $.each(result, function(i, obj) { | |
| 124 | - obj.rq = moment(obj.rq).format("DD"); | |
| 125 | - }); | |
| 127 | + $get('/ylb/oilListMonth',{line:line,date:date,type:'query'},function(result){ | |
| 128 | +// $.each(result, function(i, obj) { | |
| 129 | +// obj.rq = moment(obj.rq).format("DD"); | |
| 130 | +// }); | |
| 126 | 131 | var oilListMonth = template('oilListMonth',{list:result}); |
| 127 | 132 | $('#forms tbody').html(oilListMonth); |
| 128 | 133 | }); |
| 129 | 134 | }); |
| 135 | + | |
| 136 | + //导出 | |
| 137 | + $("#export").on("click",function(){ | |
| 138 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | |
| 139 | + layer.msg("请选择日期!"); | |
| 140 | + return; | |
| 141 | + } | |
| 142 | + var line = $("#line").val(); | |
| 143 | + var date = $("#date").val(); | |
| 144 | + $get('/ylb/oilListMonth', {line:line,date:date,type:'export'}, function(result){ | |
| 145 | + window.open("/downloadFile/download?fileName=月存油报表"+moment(date).format("YYYYMMDD")); | |
| 146 | + }); | |
| 147 | + }); | |
| 130 | 148 | }); |
| 131 | 149 | </script> |
| 132 | 150 | <script type="text/html" id="oilListMonth"> | ... | ... |