Commit 86055dd9efcf04419221e2d5e0fbce8633977a0a
1 parent
f44ae6c9
LGF 报表
Showing
12 changed files
with
2161 additions
and
0 deletions
src/main/java/com/bsth/controller/schedule/PeopleCarPlanController.java
0 → 100644
| 1 | +package com.bsth.controller.schedule; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | +import java.util.Map; | |
| 5 | + | |
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 7 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 8 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 9 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 10 | +import org.springframework.web.bind.annotation.RestController; | |
| 11 | + | |
| 12 | +import com.bsth.service.realcontrol.ScheduleRealInfoService; | |
| 13 | +import com.bsth.service.schedule.PeopleCarPlanService; | |
| 14 | + | |
| 15 | +@RestController | |
| 16 | +@RequestMapping("pcpc") | |
| 17 | +public class PeopleCarPlanController { | |
| 18 | + | |
| 19 | + @Autowired | |
| 20 | + private PeopleCarPlanService peopleCarPlanService; | |
| 21 | + | |
| 22 | + @RequestMapping(value = "/queryPeopleCar", method = RequestMethod.GET) | |
| 23 | + public List<Map<String,Object>> queryPeopleCar(@RequestParam String line, @RequestParam String date, @RequestParam String type){ | |
| 24 | + return peopleCarPlanService.queryPeopleCar(line, date, type); | |
| 25 | + } | |
| 26 | + | |
| 27 | + @RequestMapping(value="/workDaily", method = RequestMethod.GET) | |
| 28 | + public List<Map<String,Object>> workDaily(@RequestParam String line, @RequestParam String date, @RequestParam String type){ | |
| 29 | + return peopleCarPlanService.workDaily(line, date, type); | |
| 30 | + } | |
| 31 | + | |
| 32 | + @RequestMapping(value="/scheduleAnaly", method = RequestMethod.GET) | |
| 33 | + public Map<String, Object> scheduleAnaly(@RequestParam String page, @RequestParam String line, @RequestParam String startDate, @RequestParam String endDate, @RequestParam String model, @RequestParam String type){ | |
| 34 | + return peopleCarPlanService.scheduleAnaly(page, line, startDate, endDate, model, type); | |
| 35 | + } | |
| 36 | + | |
| 37 | + @RequestMapping(value="/getModel", method = RequestMethod.GET) | |
| 38 | + public List<Map<String,Object>> getModel(@RequestParam String line, @RequestParam String startDate, @RequestParam String endDate){ | |
| 39 | + return peopleCarPlanService.getModel(line, startDate, endDate); | |
| 40 | + } | |
| 41 | + | |
| 42 | + @RequestMapping(value="/firstAndLastBus", method = RequestMethod.GET) | |
| 43 | + public List<Map<String,Object>> firstAndLastBus(@RequestParam String line, @RequestParam String date, @RequestParam String type){ | |
| 44 | + return peopleCarPlanService.firstAndLastBus(line, date, type); | |
| 45 | + } | |
| 46 | + | |
| 47 | + @RequestMapping(value="/commandState", method = RequestMethod.GET) | |
| 48 | + public List<Map<String,Object>> commandState(@RequestParam String line, @RequestParam String date, @RequestParam String code){ | |
| 49 | + return peopleCarPlanService.commandState(line, date, code); | |
| 50 | + } | |
| 51 | + | |
| 52 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/PeopleCarPlanService.java
0 → 100644
| 1 | +package com.bsth.service.schedule; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | +import java.util.Map; | |
| 5 | + | |
| 6 | +public interface PeopleCarPlanService { | |
| 7 | + | |
| 8 | + List<Map<String, Object>> queryPeopleCar(String line, String date, String type); | |
| 9 | + | |
| 10 | + List<Map<String, Object>> workDaily(String line, String date, String type); | |
| 11 | + | |
| 12 | + Map<String, Object> scheduleAnaly(String page, String line, String startDate, String endDate, String model, String type); | |
| 13 | + | |
| 14 | + List<Map<String, Object>> getModel(String line, String startDate, String endDate); | |
| 15 | + | |
| 16 | + List<Map<String, Object>> firstAndLastBus(String line, String date, String type); | |
| 17 | + | |
| 18 | + List<Map<String, Object>> commandState(String line, String date, String code); | |
| 19 | +} | ... | ... |
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule; | |
| 2 | + | |
| 3 | +import java.math.BigDecimal; | |
| 4 | +import java.sql.Connection; | |
| 5 | +import java.sql.PreparedStatement; | |
| 6 | +import java.sql.ResultSet; | |
| 7 | +import java.sql.SQLException; | |
| 8 | +import java.text.DecimalFormat; | |
| 9 | +import java.text.ParseException; | |
| 10 | +import java.text.SimpleDateFormat; | |
| 11 | +import java.util.ArrayList; | |
| 12 | +import java.util.Collections; | |
| 13 | +import java.util.Date; | |
| 14 | +import java.util.HashMap; | |
| 15 | +import java.util.HashSet; | |
| 16 | +import java.util.Iterator; | |
| 17 | +import java.util.List; | |
| 18 | +import java.util.Map; | |
| 19 | +import java.util.Set; | |
| 20 | + | |
| 21 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 22 | +import org.springframework.stereotype.Service; | |
| 23 | + | |
| 24 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 25 | +import com.bsth.entity.schedule.SchedulePlanInfo; | |
| 26 | +import com.bsth.entity.schedule.TTInfoDetail; | |
| 27 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | |
| 28 | +import com.bsth.util.ReportUtils; | |
| 29 | +import com.bsth.util.db.DBUtils_MS; | |
| 30 | + | |
| 31 | +@Service | |
| 32 | +public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | |
| 33 | + | |
| 34 | + @Autowired | |
| 35 | + private ScheduleRealInfoRepository scheduleRealInfoRepository; | |
| 36 | + | |
| 37 | + @Override | |
| 38 | + public List<Map<String, Object>> queryPeopleCar(String line, String date, String type) { | |
| 39 | + Map<String, List<SchedulePlanInfo>> keyMap = new HashMap<String, List<SchedulePlanInfo>>(); | |
| 40 | + Map<String, List<Map<String, Object>>> temp = new HashMap<String, List<Map<String, Object>>>(); | |
| 41 | + List<SchedulePlanInfo> list = new ArrayList<SchedulePlanInfo>(); | |
| 42 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 43 | + List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>(); | |
| 44 | + | |
| 45 | + if(date.length() == 0){ | |
| 46 | + date = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 47 | + } | |
| 48 | + | |
| 49 | + try { | |
| 50 | + Connection conn = null; | |
| 51 | + PreparedStatement ps = null; | |
| 52 | + ResultSet rs = null; | |
| 53 | + String sql = "select * from bsth_c_s_sp_info where DATE_FORMAT(schedule_date,'%Y-%m-%d') = ?"; | |
| 54 | + if(line.length() != 0){ | |
| 55 | + sql += "and xl_bm = ?"; | |
| 56 | + } | |
| 57 | + conn = DBUtils_MS.getConnection(); | |
| 58 | + ps = conn.prepareStatement(sql); | |
| 59 | + ps.setString(1, date); | |
| 60 | + if(line.length() != 0){ | |
| 61 | + ps.setString(2, line); | |
| 62 | + } | |
| 63 | + rs = ps.executeQuery(); | |
| 64 | + while(rs.next()){ | |
| 65 | + SchedulePlanInfo schedule = new SchedulePlanInfo(); | |
| 66 | + schedule.setXlName(rs.getString("xl_name")); | |
| 67 | + schedule.setLpName(rs.getString("lp_name")); | |
| 68 | + schedule.setClZbh(rs.getString("cl_zbh")); | |
| 69 | + schedule.setjName(rs.getString("j_name")); | |
| 70 | + schedule.setsName(rs.getString("s_name")); | |
| 71 | + schedule.setJhlc(rs.getDouble("jhlc")); | |
| 72 | + list.add(schedule); | |
| 73 | + } | |
| 74 | + DBUtils_MS.close(rs, ps, conn); | |
| 75 | + } catch (SQLException e) { | |
| 76 | + // TODO Auto-generated catch block | |
| 77 | + e.printStackTrace(); | |
| 78 | + } | |
| 79 | + | |
| 80 | + //分组计算路程公里 | |
| 81 | + for(SchedulePlanInfo schedule : list){ | |
| 82 | + String key = schedule.getXlName() + "/" + schedule.getLpName() + "/" + | |
| 83 | + schedule.getClZbh() + "/" + schedule.getjName() + "/" + schedule.getsName(); | |
| 84 | + if(!keyMap.containsKey(key)) | |
| 85 | + keyMap.put(key, new ArrayList<SchedulePlanInfo>()); | |
| 86 | + keyMap.get(key).add(schedule); | |
| 87 | + } | |
| 88 | + for(String key : keyMap.keySet()){ | |
| 89 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | |
| 90 | + BigDecimal jhlc = new BigDecimal(0); | |
| 91 | + for(SchedulePlanInfo schedule : keyMap.get(key)){ | |
| 92 | + if(schedule.getJhlc() != null) | |
| 93 | + jhlc = jhlc.add(new BigDecimal(schedule.getJhlc())); | |
| 94 | + } | |
| 95 | + String[] split = key.split("/"); | |
| 96 | + tempMap.put("date", date); | |
| 97 | + tempMap.put("line", split[0]); | |
| 98 | + tempMap.put("lp", split[1]); | |
| 99 | + tempMap.put("clzbh", split[2]); | |
| 100 | + tempMap.put("jName", split[3]); | |
| 101 | + tempMap.put("sName", split[4]); | |
| 102 | + if(split[4].equals("null")) | |
| 103 | + tempMap.put("sName", "/"); | |
| 104 | + tempMap.put("jhlc", jhlc.setScale(2, BigDecimal.ROUND_UP)); | |
| 105 | + mapList.add(tempMap); | |
| 106 | + } | |
| 107 | + | |
| 108 | + for(Map<String, Object> m : mapList){ | |
| 109 | + String key = m.get("line").toString(); | |
| 110 | + if(!temp.containsKey(key)) | |
| 111 | + temp.put(key, new ArrayList<Map<String, Object>>()); | |
| 112 | + temp.get(key).add(m); | |
| 113 | + } | |
| 114 | + for(String key : temp.keySet()){ | |
| 115 | + Map<Integer, List<Map<String, Object>>> tempList = new HashMap<Integer, List<Map<String,Object>>>(); | |
| 116 | + List<Integer> keyList = new ArrayList<Integer>(); | |
| 117 | + for(Map<String, Object> m : temp.get(key)){ | |
| 118 | + int i = Integer.valueOf(m.get("lp").toString()); | |
| 119 | + if(!tempList.containsKey(i)) | |
| 120 | + tempList.put(i, new ArrayList<Map<String, Object>>()); | |
| 121 | + tempList.get(i).add(m); | |
| 122 | + keyList.add(i); | |
| 123 | + } | |
| 124 | + Collections.sort(keyList); | |
| 125 | + for(Integer i : keyList){ | |
| 126 | + for(Map<String, Object> m : tempList.get(i)){ | |
| 127 | + resList.add(m); | |
| 128 | + } | |
| 129 | + } | |
| 130 | + } | |
| 131 | + | |
| 132 | + if(type.equals("export")){ | |
| 133 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 134 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 135 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 136 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 137 | + ReportUtils ee = new ReportUtils(); | |
| 138 | + try { | |
| 139 | + listI.add(resList.iterator()); | |
| 140 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 141 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\peoCarPlan.xls", | |
| 142 | + path+"export\\计划车辆班次人员" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | |
| 143 | + } catch (Exception e) { | |
| 144 | + // TODO: handle exception | |
| 145 | + e.printStackTrace(); | |
| 146 | + } | |
| 147 | + } | |
| 148 | + | |
| 149 | + return resList; | |
| 150 | + } | |
| 151 | + | |
| 152 | + @Override | |
| 153 | + public List<Map<String, Object>> workDaily(String line, String date, String type) { | |
| 154 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 155 | + DecimalFormat df = new DecimalFormat("###0.##"); | |
| 156 | + if(date.length() == 0){ | |
| 157 | + date = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 158 | + } | |
| 159 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | |
| 160 | + if(line.length() != 0) | |
| 161 | + list = scheduleRealInfoRepository.scheduleDaily(line, date); | |
| 162 | + else | |
| 163 | + list = scheduleRealInfoRepository.findByDate(date); | |
| 164 | + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | |
| 165 | + for(ScheduleRealInfo schedule : list){ | |
| 166 | + String key = schedule.getXlName(); | |
| 167 | + if(!keyMap.containsKey(key)){ | |
| 168 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | |
| 169 | + } | |
| 170 | + keyMap.get(key).add(schedule); | |
| 171 | + } | |
| 172 | + | |
| 173 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-ddHH:mm"); | |
| 174 | + Long zgfBegin = 0l; | |
| 175 | + Long zgfEnd = 0l; | |
| 176 | + Long wgfBegin = 0l; | |
| 177 | + Long wgfEnd = 0l; | |
| 178 | + try { | |
| 179 | + //早晚高峰时段 | |
| 180 | + zgfBegin = sdf.parse(date + "07:30").getTime(); | |
| 181 | + zgfEnd = sdf.parse(date + "09:30").getTime(); | |
| 182 | + wgfBegin = sdf.parse(date + "16:30").getTime(); | |
| 183 | + wgfEnd = sdf.parse(date + "18:30").getTime(); | |
| 184 | + } catch (ParseException e) { | |
| 185 | + // TODO Auto-generated catch block | |
| 186 | + e.printStackTrace(); | |
| 187 | + } | |
| 188 | + for(String key : keyMap.keySet()){ | |
| 189 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | |
| 190 | + Map<String, List <ScheduleRealInfo>> listMap = new HashMap<String, List <ScheduleRealInfo>>(); | |
| 191 | + int jhbc = 0; | |
| 192 | + int dftz = 0; | |
| 193 | + int jhcc = 0; | |
| 194 | + int sjcc = 0; | |
| 195 | + int upfk = 0; | |
| 196 | + int updk = 0; | |
| 197 | + int dnfk = 0; | |
| 198 | + int dndk = 0; | |
| 199 | + int upfm = 0; | |
| 200 | + int updm = 0; | |
| 201 | + int dnfm = 0; | |
| 202 | + int dndm = 0; | |
| 203 | + int jhsb = 0; | |
| 204 | + int sjsb = 0; | |
| 205 | + int jhmb = 0; | |
| 206 | + int sjmb = 0; | |
| 207 | + int jhzgf = 0; | |
| 208 | + int sjzgf = 0; | |
| 209 | + int jhwgf = 0; | |
| 210 | + int sjwgf = 0; | |
| 211 | + for(ScheduleRealInfo schedule : keyMap.get(key)){ | |
| 212 | + schedule.setFcsjAll(schedule.getFcsj()); | |
| 213 | + | |
| 214 | + //早晚高峰时段执行率 | |
| 215 | + if(schedule.getFcsjT() >= zgfBegin && schedule.getFcsjT() <= zgfEnd){ | |
| 216 | + jhzgf++; | |
| 217 | + if(schedule.getFcsjActual() != null) | |
| 218 | + sjzgf++; | |
| 219 | + } | |
| 220 | + if(schedule.getFcsjT() >= wgfBegin && schedule.getFcsjT() <= wgfEnd){ | |
| 221 | + jhwgf++; | |
| 222 | + if(schedule.getFcsjActual() != null) | |
| 223 | + sjwgf++; | |
| 224 | + } | |
| 225 | + | |
| 226 | + //班次数和出场数 | |
| 227 | + jhbc++; | |
| 228 | + if(schedule.getBcType().equals("out")) | |
| 229 | + jhcc++; | |
| 230 | + | |
| 231 | + //发出时间快慢 | |
| 232 | + if(schedule.getFcsjActual() != null){ | |
| 233 | + if(schedule.getBcType().equals("out")) | |
| 234 | + sjcc++; | |
| 235 | + schedule.setFcsjActualAll(schedule.getFcsjActual()); | |
| 236 | + if(schedule.getFcsjActualTime() - schedule.getFcsjT() < -60000){ | |
| 237 | + if(schedule.getXlDir().equals("0")) | |
| 238 | + upfk++; | |
| 239 | + else if (schedule.getXlDir().equals("1")) | |
| 240 | + dnfk++; | |
| 241 | + } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 180000){ | |
| 242 | + if(schedule.getXlDir().equals("0")) | |
| 243 | + upfm++; | |
| 244 | + else if (schedule.getXlDir().equals("1")) | |
| 245 | + dnfm++; | |
| 246 | + } | |
| 247 | + } | |
| 248 | + //到站时间快慢 | |
| 249 | + if(schedule.getZdsjActual() != null && schedule.getBcsj() != null){ | |
| 250 | + schedule.setZdsjActualAll(schedule.getZdsjActual()); | |
| 251 | + schedule.setDfsjAll(schedule.getDfsj()); | |
| 252 | + schedule.calcEndTime(); | |
| 253 | + if(schedule.getZdsjActualTime() - schedule.getZdsjT() < -60000){ | |
| 254 | + if(schedule.getXlDir().equals("0")) | |
| 255 | + updk++; | |
| 256 | + else if (schedule.getXlDir().equals("1")) | |
| 257 | + dndk++; | |
| 258 | + } else if(schedule.getZdsjActualTime() - schedule.getZdsjT() > 180000){ | |
| 259 | + if(schedule.getXlDir().equals("0")) | |
| 260 | + updm++; | |
| 261 | + else if (schedule.getXlDir().equals("1")) | |
| 262 | + dndm++; | |
| 263 | + } | |
| 264 | + } | |
| 265 | + | |
| 266 | + //待发调整 | |
| 267 | + if(schedule.getDfsj() != null){ | |
| 268 | + if(!schedule.getDfsj().equals(schedule.getFcsj())){ | |
| 269 | + dftz++; | |
| 270 | + } | |
| 271 | + } | |
| 272 | + | |
| 273 | + if(schedule.getBcType().equals("normal")){ | |
| 274 | + String clZbh = schedule.getClZbh(); | |
| 275 | + if(!listMap.containsKey(clZbh)) | |
| 276 | + listMap.put(clZbh, new ArrayList<ScheduleRealInfo>()); | |
| 277 | + listMap.get(clZbh).add(schedule); | |
| 278 | + } | |
| 279 | + } | |
| 280 | + | |
| 281 | + //求首末班准点率 | |
| 282 | + for(String clZbh : listMap.keySet()){ | |
| 283 | + Map<Integer, ScheduleRealInfo> temp = new HashMap<Integer, ScheduleRealInfo>(); | |
| 284 | + List <ScheduleRealInfo> tempList = new ArrayList<ScheduleRealInfo>(); | |
| 285 | + List<Integer> sort = new ArrayList<Integer>(); | |
| 286 | + for(ScheduleRealInfo schedule : listMap.get(clZbh)){ | |
| 287 | + String[] split = schedule.getFcsj().split(":"); | |
| 288 | + int min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 289 | + temp.put(min, schedule); | |
| 290 | + sort.add(min); | |
| 291 | + } | |
| 292 | + Collections.sort(sort); | |
| 293 | + for(Integer i : sort){ | |
| 294 | + tempList.add(temp.get(i)); | |
| 295 | + } | |
| 296 | + ScheduleRealInfo shouban = tempList.get(0); | |
| 297 | + ScheduleRealInfo moban = tempList.get(tempList.size() - 1); | |
| 298 | + if(shouban.getFcsjActual() != null){ | |
| 299 | + jhsb++; | |
| 300 | + if(shouban.getFcsjActualTime() - shouban.getFcsjT() >= -60000 && shouban.getFcsjActualTime() - shouban.getFcsjT() <= 180000) | |
| 301 | + sjsb++; | |
| 302 | + } | |
| 303 | + if(moban.getFcsjActual() != null){ | |
| 304 | + jhmb++; | |
| 305 | + if(moban.getFcsjActualTime() - moban.getFcsjT() >= -60000 && moban.getFcsjActualTime() - moban.getFcsjT() <= 180000) | |
| 306 | + sjmb++; | |
| 307 | + } | |
| 308 | + | |
| 309 | + } | |
| 310 | + | |
| 311 | + tempMap.put("date", date); | |
| 312 | + tempMap.put("line", key); | |
| 313 | + tempMap.put("jhbc", jhbc); | |
| 314 | + tempMap.put("dftz", dftz); | |
| 315 | + tempMap.put("dftzl", df.format(((float)dftz/jhbc)*100) + "%"); | |
| 316 | + tempMap.put("ccl", df.format(((float)sjcc/jhcc)*100) + "%"); | |
| 317 | + tempMap.put("upfk", upfk); | |
| 318 | + tempMap.put("updk", updk); | |
| 319 | + tempMap.put("dnfk", dnfk); | |
| 320 | + tempMap.put("dndk", dndk); | |
| 321 | + tempMap.put("upfm", upfm); | |
| 322 | + tempMap.put("updm", updm); | |
| 323 | + tempMap.put("dnfm", dnfm); | |
| 324 | + tempMap.put("dndm", dndm); | |
| 325 | + tempMap.put("wdzs", (upfk + updk + dnfk + dndk) + "/" + (upfm + updm + dnfm + dndm)); | |
| 326 | + tempMap.put("smbzdl", (jhsb==0?"100%":df.format(((float)sjsb/jhsb)*100)+"%")+"/"+(jhmb==0?"100%":df.format(((float)sjmb/jhmb)*100)+"%")); | |
| 327 | + tempMap.put("gfbczxl", (jhzgf==0?"0%":df.format(((float)sjzgf/jhzgf)*100)+"%")+"/"+(jhwgf==0?"0%":df.format(((float)sjwgf/jhwgf)*100)+"%")); | |
| 328 | + resList.add(tempMap); | |
| 329 | + } | |
| 330 | + | |
| 331 | + if(type.equals("export")){ | |
| 332 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 333 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 334 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 335 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 336 | + ReportUtils ee = new ReportUtils(); | |
| 337 | + try { | |
| 338 | + listI.add(resList.iterator()); | |
| 339 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 340 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\workDaily.xls", | |
| 341 | + path+"export\\营运服务日报表" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | |
| 342 | + } catch (Exception e) { | |
| 343 | + // TODO: handle exception | |
| 344 | + e.printStackTrace(); | |
| 345 | + } | |
| 346 | + } | |
| 347 | + | |
| 348 | + return resList; | |
| 349 | + } | |
| 350 | + | |
| 351 | + @Override | |
| 352 | + public Map<String, Object> scheduleAnaly(String page, String line, String startDate, String endDate, String model, String type) { | |
| 353 | + DecimalFormat df = new DecimalFormat("00"); | |
| 354 | + List<TTInfoDetail> ttList = new ArrayList<TTInfoDetail>(); | |
| 355 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | |
| 356 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 357 | + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); | |
| 358 | + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | |
| 359 | + Map<String, Object> modelMap = new HashMap<String, Object>(); | |
| 360 | + | |
| 361 | + if(startDate.length() == 0){ | |
| 362 | + startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 363 | + } | |
| 364 | + if(endDate.length() == 0){ | |
| 365 | + endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 366 | + } | |
| 367 | + try { | |
| 368 | + Connection conn = null; | |
| 369 | + PreparedStatement ps = null; | |
| 370 | + ResultSet rs = null; | |
| 371 | + String sql = "select * from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= ? and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= ?"; | |
| 372 | + if(line.length() != 0){ | |
| 373 | + sql += "and xl_bm = ?"; | |
| 374 | + } | |
| 375 | + conn = DBUtils_MS.getConnection(); | |
| 376 | + ps = conn.prepareStatement(sql); | |
| 377 | + ps.setString(1, startDate); | |
| 378 | + ps.setString(2, endDate); | |
| 379 | + if(line.length() != 0){ | |
| 380 | + ps.setString(3, line); | |
| 381 | + } | |
| 382 | + rs = ps.executeQuery(); | |
| 383 | + while(rs.next()){ | |
| 384 | + ScheduleRealInfo schedule = new ScheduleRealInfo(); | |
| 385 | + schedule.setXlName(rs.getString("xl_name")); | |
| 386 | + schedule.setBcType(rs.getString("bc_type")); | |
| 387 | + schedule.setBcs(rs.getInt("bcs")); | |
| 388 | + schedule.setFcsj(rs.getString("fcsj")); | |
| 389 | + schedule.setFcsjActual(rs.getString("fcsj_actual")); | |
| 390 | + schedule.setZdsj(rs.getString("zdsj")); | |
| 391 | + schedule.setZdsjActual(rs.getString("zdsj_actual")); | |
| 392 | + schedule.setBcsj(rs.getInt("bcsj")); | |
| 393 | + schedule.setQdzName(rs.getString("qdz_name")); | |
| 394 | + if(schedule.getBcType().equals("normal")) | |
| 395 | + list.add(schedule); | |
| 396 | + } | |
| 397 | + if(model.length() != 0){ | |
| 398 | + sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = ?"; | |
| 399 | + ps = conn.prepareStatement(sql); | |
| 400 | + ps.setString(1, model); | |
| 401 | + rs = ps.executeQuery(); | |
| 402 | + while(rs.next()){ | |
| 403 | + TTInfoDetail ttInfo = new TTInfoDetail(); | |
| 404 | + ttInfo.setBcType(rs.getString("bc_type")); | |
| 405 | + ttInfo.setBcs(rs.getInt("bcs")); | |
| 406 | + ttInfo.setFcsj(rs.getString("fcsj")); | |
| 407 | + ttInfo.setBcsj(rs.getInt("bcsj")); | |
| 408 | + if(ttInfo.getBcType().equals("normal")) | |
| 409 | + ttList.add(ttInfo); | |
| 410 | + } | |
| 411 | + } | |
| 412 | + DBUtils_MS.close(rs, ps, conn); | |
| 413 | + } catch (SQLException e) { | |
| 414 | + // TODO Auto-generated catch block | |
| 415 | + e.printStackTrace(); | |
| 416 | + } | |
| 417 | + | |
| 418 | + //分组计算 同时判断是否所选时刻信息 | |
| 419 | + for(ScheduleRealInfo schedule : list){ | |
| 420 | + if(model.length() != 0){ | |
| 421 | + for(TTInfoDetail tt : ttList){ | |
| 422 | + if(tt.getBcs() == schedule.getBcs() && tt.getFcsj().equals(schedule.getFcsj()) | |
| 423 | + && tt.getBcsj() == schedule.getBcsj()){ | |
| 424 | + String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj(); | |
| 425 | + if(!keyMap.containsKey(key)) | |
| 426 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | |
| 427 | + keyMap.get(key).add(schedule); | |
| 428 | + continue; | |
| 429 | + } | |
| 430 | + } | |
| 431 | + } else { | |
| 432 | + String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj(); | |
| 433 | + if(!keyMap.containsKey(key)) | |
| 434 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | |
| 435 | + keyMap.get(key).add(schedule); | |
| 436 | + } | |
| 437 | + } | |
| 438 | + for(String key : keyMap.keySet()){ | |
| 439 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | |
| 440 | + List<Integer> fcsj = new ArrayList<Integer>(); | |
| 441 | + List<Integer> yssj = new ArrayList<Integer>(); | |
| 442 | + int jhbc = 0; | |
| 443 | + int sjbc = 0; | |
| 444 | + for(ScheduleRealInfo schedule : keyMap.get(key)){ | |
| 445 | + tempMap.put("bcsj", schedule.getBcsj()); | |
| 446 | + jhbc++; | |
| 447 | + if(schedule.getZdsjActual() != null && schedule.getFcsjActual() != null){ | |
| 448 | + sjbc++; | |
| 449 | + String[] fcsj_ = schedule.getFcsjActual().split(":"); | |
| 450 | + String[] zdsj_ = schedule.getZdsjActual().split(":"); | |
| 451 | + int fcsj_m = (Integer.valueOf(fcsj_[0]) * 60) + Integer.valueOf(fcsj_[1]); | |
| 452 | + int zdsj_m = (Integer.valueOf(zdsj_[0]) * 60) + Integer.valueOf(zdsj_[1]); | |
| 453 | + fcsj.add(fcsj_m); | |
| 454 | + yssj.add(zdsj_m - fcsj_m); | |
| 455 | + } | |
| 456 | + } | |
| 457 | + int zzfc = 0; | |
| 458 | + int zwfc = 0; | |
| 459 | + int pjfc = 0; | |
| 460 | + int fcSum = 0; | |
| 461 | + int zkys = 0; | |
| 462 | + int zmys = 0; | |
| 463 | + int pjys = 0; | |
| 464 | + int ysSum = 0; | |
| 465 | + for(int i : fcsj){ | |
| 466 | + fcSum += i; | |
| 467 | + if(zzfc == 0 || zzfc > i) | |
| 468 | + zzfc = i; | |
| 469 | + if(zwfc == 0 || zwfc < i) | |
| 470 | + zwfc = i; | |
| 471 | + } | |
| 472 | + for(int i : yssj){ | |
| 473 | + ysSum += i; | |
| 474 | + if(zkys == 0 || zkys > i) | |
| 475 | + zkys = i; | |
| 476 | + if(zmys == 0 || zmys < i) | |
| 477 | + zmys = i; | |
| 478 | + } | |
| 479 | + if(fcsj.size() != 0){ | |
| 480 | + pjfc = fcSum / fcsj.size(); | |
| 481 | + tempMap.put("zzfc", df.format(zzfc/60)+":"+df.format(zzfc%60)); | |
| 482 | + tempMap.put("zwfc", df.format(zwfc/60)+":"+df.format(zwfc%60)); | |
| 483 | + tempMap.put("pjfc", df.format(pjfc/60)+":"+df.format(pjfc%60)); | |
| 484 | + } else { | |
| 485 | + tempMap.put("zzfc", "/"); | |
| 486 | + tempMap.put("zwfc", "/"); | |
| 487 | + tempMap.put("pjfc", "/"); | |
| 488 | + } | |
| 489 | + if(yssj.size() != 0){ | |
| 490 | + pjys = ysSum / yssj.size(); | |
| 491 | + tempMap.put("zkys", zkys); | |
| 492 | + tempMap.put("zmys", zmys); | |
| 493 | + tempMap.put("pjys", pjys); | |
| 494 | + } else { | |
| 495 | + tempMap.put("zkys", "/"); | |
| 496 | + tempMap.put("zmys", "/"); | |
| 497 | + tempMap.put("pjys", "/"); | |
| 498 | + } | |
| 499 | + String[] split = key.split("/"); | |
| 500 | + tempMap.put("line", split[0]); | |
| 501 | + tempMap.put("qdz", split[1]); | |
| 502 | + tempMap.put("jhfc", split[2]); | |
| 503 | + tempMap.put("jhbc", jhbc); | |
| 504 | + tempMap.put("sjbc", sjbc); | |
| 505 | + tempList.add(tempMap); | |
| 506 | + } | |
| 507 | + | |
| 508 | + //排序 | |
| 509 | + Map<String, List<Map<String, Object>>> listMap = new HashMap<String, List<Map<String, Object>>>(); | |
| 510 | + Map<String, List<Map<String, Object>>> listMap2 = new HashMap<String, List<Map<String, Object>>>(); | |
| 511 | + for(Map<String, Object> m : tempList){ | |
| 512 | + String key = m.get("line").toString() + m.get("qdz"); | |
| 513 | + if(!listMap.containsKey(key)) | |
| 514 | + listMap.put(key, new ArrayList<Map<String, Object>>()); | |
| 515 | + listMap.get(key).add(m); | |
| 516 | + } | |
| 517 | + for(String key : listMap.keySet()){ | |
| 518 | + Map<Integer, Map<String, Object>> tempMap = new HashMap<Integer, Map<String,Object>>(); | |
| 519 | + List<Integer> keyList = new ArrayList<Integer>(); | |
| 520 | + for(Map<String, Object> m : listMap.get(key)){ | |
| 521 | + String[] split = m.get("jhfc").toString().split(":"); | |
| 522 | + int jhfc = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 523 | + tempMap.put(jhfc, m); | |
| 524 | + keyList.add(jhfc); | |
| 525 | + } | |
| 526 | + Collections.sort(keyList); | |
| 527 | + for(Integer Int : keyList){ | |
| 528 | + Map<String, Object> map = tempMap.get(Int); | |
| 529 | + String str = map.get("line").toString(); | |
| 530 | + if(!listMap2.containsKey(str)) | |
| 531 | + listMap2.put(str, new ArrayList<Map<String, Object>>()); | |
| 532 | + listMap2.get(str).add(map); | |
| 533 | + } | |
| 534 | + } | |
| 535 | + for(String str : listMap2.keySet()){ | |
| 536 | + for(Map<String, Object> map : listMap2.get(str)){ | |
| 537 | + resList.add(map); | |
| 538 | + } | |
| 539 | + } | |
| 540 | + | |
| 541 | + //分页 | |
| 542 | + if(page.length() != 0 && type.equals("query")){ | |
| 543 | + int currPage = Integer.valueOf(page); | |
| 544 | + modelMap.put("totalPage", resList.size()%10>0?(resList.size()/10 + 1):resList.size()/10); | |
| 545 | + modelMap.put("dataList", resList.subList(currPage*10,((currPage+1)*10)>=resList.size()?resList.size():(currPage+1)*10)); | |
| 546 | + } | |
| 547 | + | |
| 548 | + //导出 | |
| 549 | + if(type.equals("export")){ | |
| 550 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 551 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 552 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 553 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 554 | + ReportUtils ee = new ReportUtils(); | |
| 555 | + try { | |
| 556 | + listI.add(resList.iterator()); | |
| 557 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 558 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\scheduleAnaly.xls", | |
| 559 | + path+"export\\时刻表分析" + sdfSimple.format(sdfMonth.parse(startDate)) + "-" + sdfSimple.format(sdfMonth.parse(endDate)) + ".xls"); | |
| 560 | + } catch (Exception e) { | |
| 561 | + // TODO: handle exception | |
| 562 | + e.printStackTrace(); | |
| 563 | + } | |
| 564 | + } | |
| 565 | + | |
| 566 | + return modelMap; | |
| 567 | + } | |
| 568 | + | |
| 569 | + @Override | |
| 570 | + public List<Map<String, Object>> getModel(String line, String startDate, String endDate) { | |
| 571 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 572 | + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); | |
| 573 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 574 | + SimpleDateFormat sdfEE = new SimpleDateFormat("EEEE"); | |
| 575 | + | |
| 576 | + if(startDate.length() == 0){ | |
| 577 | + startDate = sdf.format(new Date()); | |
| 578 | + } | |
| 579 | + if(endDate.length() == 0){ | |
| 580 | + endDate = sdf.format(new Date()); | |
| 581 | + } | |
| 582 | + try { | |
| 583 | + Connection conn = null; | |
| 584 | + PreparedStatement ps = null; | |
| 585 | + ResultSet rs = null; | |
| 586 | + String sql = "select tt.id, tt.name, qyrq, tt.rule_days, tt.special_days from bsth_c_s_ttinfo tt left join bsth_c_line cl on cl.id = tt.xl where tt.is_cancel = 0 and tt.is_enable_dis_template = 1"; | |
| 587 | + if(line.length() != 0){ | |
| 588 | + sql += " and cl.line_code = ?"; | |
| 589 | + } | |
| 590 | + sql += " order by tt.create_date desc"; | |
| 591 | + conn = DBUtils_MS.getConnection(); | |
| 592 | + ps = conn.prepareStatement(sql); | |
| 593 | + if(line.length() != 0){ | |
| 594 | + ps.setString(1, line); | |
| 595 | + } | |
| 596 | + rs = ps.executeQuery(); | |
| 597 | + while(rs.next()){ | |
| 598 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 599 | + map.put("id", rs.getString("id")); | |
| 600 | + map.put("name", rs.getString("name")); | |
| 601 | + map.put("qyrq", rs.getString("qyrq")); | |
| 602 | + map.put("ruleDays", rs.getString("rule_days")); | |
| 603 | + map.put("specialDays", rs.getString("special_days")); | |
| 604 | + list.add(map); | |
| 605 | + } | |
| 606 | + DBUtils_MS.close(rs, ps, conn); | |
| 607 | + } catch (SQLException e) { | |
| 608 | + // TODO Auto-generated catch block | |
| 609 | + e.printStackTrace(); | |
| 610 | + } | |
| 611 | + | |
| 612 | + Date date1 = null; | |
| 613 | + Date date2 = null; | |
| 614 | + try { | |
| 615 | + date1 = sdf.parse(startDate); | |
| 616 | + date2 = sdf.parse(endDate); | |
| 617 | + } catch (ParseException e) { | |
| 618 | + // TODO Auto-generated catch block | |
| 619 | + e.printStackTrace(); | |
| 620 | + } | |
| 621 | + | |
| 622 | + Set<Integer> ruleDays1 = new HashSet<Integer>(); | |
| 623 | + List<String> specialDays1 = new ArrayList<String>(); | |
| 624 | + for(int i = 0; ; i++){ | |
| 625 | + Date tempDate = new Date(date1.getTime() + i*1000*60*60*24); | |
| 626 | + if(tempDate.getTime() > date2.getTime()) | |
| 627 | + break; | |
| 628 | + String week = sdfEE.format(tempDate); | |
| 629 | + if(week.equals("星期一")) | |
| 630 | + ruleDays1.add(0); | |
| 631 | + else if(week.equals("星期二")) | |
| 632 | + ruleDays1.add(1); | |
| 633 | + else if(week.equals("星期三")) | |
| 634 | + ruleDays1.add(2); | |
| 635 | + else if(week.equals("星期四")) | |
| 636 | + ruleDays1.add(3); | |
| 637 | + else if(week.equals("星期五")) | |
| 638 | + ruleDays1.add(4); | |
| 639 | + else if(week.equals("星期六")) | |
| 640 | + ruleDays1.add(5); | |
| 641 | + else if(week.equals("星期日")) | |
| 642 | + ruleDays1.add(6); | |
| 643 | + specialDays1.add(sdf.format(tempDate)); | |
| 644 | + } | |
| 645 | + for(Map<String, Object> map : list){ | |
| 646 | + String[] ruleDays = map.get("ruleDays").toString().split(","); | |
| 647 | + String[] specialDays = map.get("specialDays").toString().split(","); | |
| 648 | + boolean flag = false; | |
| 649 | + DO:{ | |
| 650 | + try { | |
| 651 | + long qyrq = sdf.parse(map.get("qyrq").toString()).getTime(); | |
| 652 | + if(qyrq > date2.getTime()) | |
| 653 | + break; | |
| 654 | + } catch (ParseException e) { | |
| 655 | + // TODO Auto-generated catch block | |
| 656 | + e.printStackTrace(); | |
| 657 | + } | |
| 658 | + for(int i = 0; i < ruleDays.length; i++){ | |
| 659 | + if(ruleDays[i].equals("1")){ | |
| 660 | + if(ruleDays1.contains(i)){ | |
| 661 | + flag = true; | |
| 662 | + break DO; | |
| 663 | + } | |
| 664 | + } | |
| 665 | + } | |
| 666 | + for(int i = 0; i < specialDays.length; i++){ | |
| 667 | + for(int j = 0; j < specialDays1.size(); j++){ | |
| 668 | + if(specialDays[i].equals(specialDays1.get(j))){ | |
| 669 | + flag = true; | |
| 670 | + break DO; | |
| 671 | + } | |
| 672 | + } | |
| 673 | + } | |
| 674 | + } | |
| 675 | + if(flag) | |
| 676 | + resList.add(map); | |
| 677 | + } | |
| 678 | + | |
| 679 | + return resList; | |
| 680 | + } | |
| 681 | + | |
| 682 | + @Override | |
| 683 | + public List<Map<String, Object>> firstAndLastBus(String line, String date, String type) { | |
| 684 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | |
| 685 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 686 | + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | |
| 687 | + | |
| 688 | + if(date.length() == 0) | |
| 689 | + date = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 690 | + if(line.length() != 0) | |
| 691 | + list = scheduleRealInfoRepository.scheduleDaily(line, date); | |
| 692 | + else | |
| 693 | + list = scheduleRealInfoRepository.findByDate(date); | |
| 694 | + | |
| 695 | + for(ScheduleRealInfo schedule : list){ | |
| 696 | + if(!schedule.getBcType().equals("normal")) | |
| 697 | + continue; | |
| 698 | + String key = schedule.getXlName(); | |
| 699 | + if(!keyMap.containsKey(key)) | |
| 700 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | |
| 701 | + keyMap.get(key).add(schedule); | |
| 702 | + } | |
| 703 | + for(String key : keyMap.keySet()){ | |
| 704 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | |
| 705 | + Map<Long, ScheduleRealInfo> temp0 = new HashMap<Long, ScheduleRealInfo>(); | |
| 706 | + List<Long> longList0 = new ArrayList<Long>(); | |
| 707 | + Map<Long, ScheduleRealInfo> temp1 = new HashMap<Long, ScheduleRealInfo>(); | |
| 708 | + List<Long> longList1 = new ArrayList<Long>(); | |
| 709 | + for(ScheduleRealInfo schedule : keyMap.get(key)){ | |
| 710 | + String[] split = schedule.getFcsj().split(":"); | |
| 711 | + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 712 | + schedule.setFcsjT(min); | |
| 713 | + if(schedule.getXlDir().equals("0")){ | |
| 714 | + temp0.put(min, schedule); | |
| 715 | + longList0.add(min); | |
| 716 | + } else { | |
| 717 | + temp1.put(min, schedule); | |
| 718 | + longList1.add(min); | |
| 719 | + } | |
| 720 | + } | |
| 721 | + Collections.sort(longList0); | |
| 722 | + Collections.sort(longList1); | |
| 723 | + ScheduleRealInfo shouban0 = temp0.get(longList0.get(0)); | |
| 724 | + ScheduleRealInfo moban0 = temp0.get(longList0.get(longList0.size() - 1)); | |
| 725 | + ScheduleRealInfo shouban1 = temp1.get(longList1.get(0)); | |
| 726 | + ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1)); | |
| 727 | + tempMap.put("date", date); | |
| 728 | + tempMap.put("line", key); | |
| 729 | + tempMap.put("qdzFirst0", shouban0.getQdzName()); | |
| 730 | + tempMap.put("jhfcFirst0", shouban0.getFcsj()); | |
| 731 | + tempMap.put("qdzLast0", moban0.getQdzName()); | |
| 732 | + tempMap.put("jhfcLast0", moban0.getFcsj()); | |
| 733 | + tempMap.put("qdzFirst1", shouban1.getQdzName()); | |
| 734 | + tempMap.put("jhfcFirst1", shouban1.getFcsj()); | |
| 735 | + tempMap.put("qdzLast1", moban1.getQdzName()); | |
| 736 | + tempMap.put("jhfcLast1", moban1.getFcsj()); | |
| 737 | + if(shouban0.getFcsjActual() != null){ | |
| 738 | + String[] split = shouban0.getFcsjActual().split(":"); | |
| 739 | + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 740 | + long delay = shouban0.getFcsjT() - min; | |
| 741 | + tempMap.put("sjfcFirst0", shouban0.getFcsjActual()); | |
| 742 | + if(delay > 0) | |
| 743 | + tempMap.put("delayFirst0", "+" + delay); | |
| 744 | + else | |
| 745 | + tempMap.put("delayFirst0", delay); | |
| 746 | + } else { | |
| 747 | + tempMap.put("sjfcFirst0", "/"); | |
| 748 | + tempMap.put("delayFirst0", "/"); | |
| 749 | + } | |
| 750 | + if(moban0.getZdsjActual() != null){ | |
| 751 | + String[] split = moban0.getFcsjActual().split(":"); | |
| 752 | + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 753 | + long delay = moban0.getFcsjT() - min; | |
| 754 | + tempMap.put("sjfcLast0", moban0.getFcsjActual()); | |
| 755 | + if(delay > 0) | |
| 756 | + tempMap.put("delayLast0", "+" + delay); | |
| 757 | + else | |
| 758 | + tempMap.put("delayLast0", delay); | |
| 759 | + } else { | |
| 760 | + tempMap.put("sjfcLast0", "/"); | |
| 761 | + tempMap.put("delayLast0", "/"); | |
| 762 | + } | |
| 763 | + if(shouban1.getFcsjActual() != null){ | |
| 764 | + String[] split = shouban1.getFcsjActual().split(":"); | |
| 765 | + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 766 | + long delay = shouban1.getFcsjT() - min; | |
| 767 | + tempMap.put("sjfcFirst1", shouban1.getFcsjActual()); | |
| 768 | + if(delay > 0) | |
| 769 | + tempMap.put("delayFirst1", "+" + delay); | |
| 770 | + else | |
| 771 | + tempMap.put("delayFirst1", delay); | |
| 772 | + } else { | |
| 773 | + tempMap.put("sjfcFirst1", "/"); | |
| 774 | + tempMap.put("delayFirst1", "/"); | |
| 775 | + } | |
| 776 | + if(moban1.getZdsjActual() != null){ | |
| 777 | + String[] split = moban1.getFcsjActual().split(":"); | |
| 778 | + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | |
| 779 | + long delay = moban1.getFcsjT() - min; | |
| 780 | + tempMap.put("sjfcLast1", moban1.getFcsjActual()); | |
| 781 | + if(delay > 0) | |
| 782 | + tempMap.put("delayLast1", "+" + delay); | |
| 783 | + else | |
| 784 | + tempMap.put("delayLast1", delay); | |
| 785 | + } else { | |
| 786 | + tempMap.put("sjfcLast1", "/"); | |
| 787 | + tempMap.put("delayLast1", "/"); | |
| 788 | + } | |
| 789 | + resList.add(tempMap); | |
| 790 | + } | |
| 791 | + | |
| 792 | + if(type.equals("export")){ | |
| 793 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 794 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 795 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 796 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 797 | + ReportUtils ee = new ReportUtils(); | |
| 798 | + try { | |
| 799 | + listI.add(resList.iterator()); | |
| 800 | + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; | |
| 801 | + ee.excelReplace(listI, new Object[] { map }, path+"mould\\firstAndLastBus.xls", | |
| 802 | + path+"export\\线路首末班" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | |
| 803 | + } catch (Exception e) { | |
| 804 | + // TODO: handle exception | |
| 805 | + e.printStackTrace(); | |
| 806 | + } | |
| 807 | + } | |
| 808 | + | |
| 809 | + return resList; | |
| 810 | + } | |
| 811 | + | |
| 812 | + @Override | |
| 813 | + public List<Map<String, Object>> commandState(String line, String date, String code) { | |
| 814 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 815 | + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); | |
| 816 | + Map<String, List<Map<String, Object>>> keyMap = new HashMap<String, List<Map<String, Object>>>(); | |
| 817 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss"); | |
| 818 | + | |
| 819 | + if(date.length() == 0) | |
| 820 | + date = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 821 | + | |
| 822 | + try { | |
| 823 | + Connection conn = null; | |
| 824 | + PreparedStatement ps = null; | |
| 825 | + ResultSet rs = null; | |
| 826 | + String sql = "select r.id, r.schedule_date_str, r.xl_name, r.cl_zbh, r.j_gh, r.j_name, r.fcsj, d.timestamp, d.reply46, d.reply47, d.reply46time, d.reply47time " + | |
| 827 | + "FROM bsth_c_s_sp_info_real as r left join bsth_v_directive_60 as d on r.id = d.sch and d.is_dispatch = 1 where DATE_FORMAT(schedule_date,'%Y-%m-%d') = ?"; | |
| 828 | + if(line.length() != 0){ | |
| 829 | + sql += " and xl_bm = ?"; | |
| 830 | + } | |
| 831 | + if(code.length() != 0){ | |
| 832 | + sql += " and cl_zbh = ?"; | |
| 833 | + } | |
| 834 | + sql += " union " + | |
| 835 | + "select r.id, r.schedule_date_str, r.xl_name, r.cl_zbh, r.j_gh, r.j_name, r.fcsj, d.timestamp, d.reply46, d.reply47, d.reply46time, d.reply47time " + | |
| 836 | + "FROM bsth_c_s_sp_info_real as r right join bsth_v_directive_60 as d on r.id = d.sch where d.is_dispatch = 1 and DATE_FORMAT(schedule_date,'%Y-%m-%d') = ?"; | |
| 837 | + if(line.length() != 0){ | |
| 838 | + sql += " and xl_bm = ?"; | |
| 839 | + } | |
| 840 | + if(code.length() != 0){ | |
| 841 | + sql += " and cl_zbh = ?"; | |
| 842 | + } | |
| 843 | + sql += " order by fcsj"; | |
| 844 | + conn = DBUtils_MS.getConnection(); | |
| 845 | + ps = conn.prepareStatement(sql); | |
| 846 | + int i = 1; | |
| 847 | + ps.setString(i++, date); | |
| 848 | + if(line.length() != 0){ | |
| 849 | + ps.setString(i++, line); | |
| 850 | + } | |
| 851 | + if(code.length() != 0){ | |
| 852 | + ps.setString(i++, code); | |
| 853 | + } | |
| 854 | + ps.setString(i++, date); | |
| 855 | + if(line.length() != 0){ | |
| 856 | + ps.setString(i++, line); | |
| 857 | + } | |
| 858 | + if(code.length() != 0){ | |
| 859 | + ps.setString(i++, code); | |
| 860 | + } | |
| 861 | + rs = ps.executeQuery(); | |
| 862 | + while(rs.next()){ | |
| 863 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 864 | + map.put("id", rs.getString("id")); | |
| 865 | + map.put("date", rs.getString("schedule_date_str")); | |
| 866 | + map.put("line", rs.getString("xl_name")); | |
| 867 | + map.put("clZbh", rs.getString("cl_zbh")); | |
| 868 | + map.put("jGh", rs.getString("j_gh")); | |
| 869 | + map.put("jName", rs.getString("j_name")); | |
| 870 | + map.put("fcsj", rs.getString("fcsj")); | |
| 871 | + map.put("timestamp", rs.getString("timestamp")); | |
| 872 | + map.put("reply46", rs.getString("reply46")); | |
| 873 | + map.put("reply47", rs.getString("reply47")); | |
| 874 | + map.put("reply46time", rs.getString("reply46time")); | |
| 875 | + map.put("reply47time", rs.getString("reply47time")); | |
| 876 | + list.add(map); | |
| 877 | + } | |
| 878 | + DBUtils_MS.close(rs, ps, conn); | |
| 879 | + } catch (SQLException e) { | |
| 880 | + // TODO Auto-generated catch block | |
| 881 | + e.printStackTrace(); | |
| 882 | + } | |
| 883 | + | |
| 884 | + for(Map<String, Object> map : list){ | |
| 885 | + String key = map.get("line") + "/" + map.get("clZbh") + "/" + map.get("jGh") + "/" + map.get("jName"); | |
| 886 | + if(!keyMap.containsKey(key)) | |
| 887 | + keyMap.put(key, new ArrayList<Map<String, Object>>()); | |
| 888 | + keyMap.get(key).add(map); | |
| 889 | + } | |
| 890 | + for(String key : keyMap.keySet()){ | |
| 891 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | |
| 892 | + Set<String> tempSet = new HashSet<String>(); | |
| 893 | + int sjf = 0; | |
| 894 | + int wqr = 0; | |
| 895 | + for(Map<String, Object> map : keyMap.get(key)){ | |
| 896 | + tempSet.add(map.get("id").toString()); | |
| 897 | + if(map.get("timestamp") != null){ | |
| 898 | + sjf++; | |
| 899 | + if(map.get("reply47").toString().equals("-1")) | |
| 900 | + wqr++; | |
| 901 | + map.put("time", sdf.format(new Date(Long.valueOf(map.get("timestamp").toString())))); | |
| 902 | + } else | |
| 903 | + map.put("time", "/"); | |
| 904 | + | |
| 905 | + if(map.get("reply46time") != null) | |
| 906 | + map.put("time46", sdf.format(new Date(Long.valueOf(map.get("reply46time").toString())))); | |
| 907 | + else | |
| 908 | + map.put("time46", "/"); | |
| 909 | + | |
| 910 | + if(map.get("reply47time") != null) | |
| 911 | + map.put("time47", sdf.format(new Date(Long.valueOf(map.get("reply47time").toString())))); | |
| 912 | + else | |
| 913 | + map.put("time47", "/"); | |
| 914 | + | |
| 915 | + } | |
| 916 | + String[] split = key.split("/"); | |
| 917 | + tempMap.put("date", date); | |
| 918 | + tempMap.put("line", split[0]); | |
| 919 | + tempMap.put("clZbh", split[1]); | |
| 920 | + tempMap.put("jsy", split[2] + "/" + split[3]); | |
| 921 | + tempMap.put("jhf", tempSet.size()); | |
| 922 | + tempMap.put("sjf", sjf); | |
| 923 | + tempMap.put("wqr", wqr); | |
| 924 | + tempMap.put("workList", keyMap.get(key)); | |
| 925 | + resList.add(tempMap); | |
| 926 | + } | |
| 927 | + | |
| 928 | + return resList; | |
| 929 | + } | |
| 930 | + | |
| 931 | +} | ... | ... |
src/main/resources/static/pages/forms/mould/firstAndLastBus.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/peoCarPlan.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/scheduleAnaly.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/workDaily.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/commandState.html
0 → 100644
| 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 | + | |
| 15 | + .table > tbody + tbody { | |
| 16 | + border-top: 1px solid; } | |
| 17 | +</style> | |
| 18 | + | |
| 19 | +<div class="page-head"> | |
| 20 | + <div class="page-title"> | |
| 21 | + <h1>指令状态分析</h1> | |
| 22 | + </div> | |
| 23 | +</div> | |
| 24 | + | |
| 25 | +<div class="row"> | |
| 26 | + <div class="col-md-12"> | |
| 27 | + <div class="portlet light porttlet-fit bordered"> | |
| 28 | + <div class="portlet-title"> | |
| 29 | + <form id="history" class="form-inline" action=""> | |
| 30 | + <div style="display: inline-block;"> | |
| 31 | + <span class="item-label" style="width: 80px;">线路: </span> | |
| 32 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | |
| 35 | + <span class="item-label" style="width: 80px;">时间: </span> | |
| 36 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | |
| 37 | + </div> | |
| 38 | + <div style="display: inline-block;margin-left: 15px"> | |
| 39 | + <span class="item-label" style="width: 140px;">内部编码: </span> | |
| 40 | + <select class="form-control" name="code" id="code" style="width: 180px;"></select> | |
| 41 | + </div> | |
| 42 | + <div class="form-group"> | |
| 43 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | |
| 44 | +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | |
| 45 | + </div> | |
| 46 | + </form> | |
| 47 | + </div> | |
| 48 | + <div class="portlet-body"> | |
| 49 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 50 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | |
| 51 | + <thead> | |
| 52 | + <tr class="hidden"> | |
| 53 | + <th>日期</th> | |
| 54 | + <th>线路</th> | |
| 55 | + <th>车辆</th> | |
| 56 | + <th>人员</th> | |
| 57 | + <th>应发</th> | |
| 58 | + <th>实发</th> | |
| 59 | + <th>未确认</th> | |
| 60 | + </tr> | |
| 61 | + </thead> | |
| 62 | + <tbody> | |
| 63 | + | |
| 64 | + </tbody> | |
| 65 | + </table> | |
| 66 | + <div id="works_hidden" class="hidden"> | |
| 67 | + <span class="item-label" style="width: 80px;">明细: </span> | |
| 68 | + <span class="item-label" style="width: 80px;margin-left: 60px;">日期 </span> | |
| 69 | + <span class="item-label" style="width: 80px;" id="date1"></span> | |
| 70 | + <span class="item-label" style="width: 80px;margin-left: 60px;">线路 </span> | |
| 71 | + <span class="item-label" style="width: 80px;" id="line1"></span> | |
| 72 | + <span class="item-label" style="width: 80px;margin-left: 60px;">车辆 </span> | |
| 73 | + <span class="item-label" style="width: 80px;" id="clZbh1"></span> | |
| 74 | + <span class="item-label" style="width: 80px;margin-left: 60px;">人员 </span> | |
| 75 | + <span class="item-label" style="width: 80px;" id="jsy1"></span> | |
| 76 | + </div> | |
| 77 | + <table class="table table-bordered table-hover table-checkable" id="works"> | |
| 78 | + <thead> | |
| 79 | + <tr class="hidden"> | |
| 80 | + <th>日期</th> | |
| 81 | + <th>线路</th> | |
| 82 | + <th>车辆</th> | |
| 83 | + <th>计划发车时间</th> | |
| 84 | + <th>发送时间</th> | |
| 85 | + <th>收到时间</th> | |
| 86 | + <th>确认时间</th> | |
| 87 | + </tr> | |
| 88 | + </thead> | |
| 89 | + <tbody> | |
| 90 | + | |
| 91 | + </tbody> | |
| 92 | + </table> | |
| 93 | + <div style="text-align: right;"> | |
| 94 | + <ul id="pagination" class="pagination"></ul> | |
| 95 | + </div> | |
| 96 | + </div> | |
| 97 | + </div> | |
| 98 | + </div> | |
| 99 | + </div> | |
| 100 | +</div> | |
| 101 | + | |
| 102 | +<script> | |
| 103 | + $(function(){ | |
| 104 | + var list; | |
| 105 | + | |
| 106 | + // 关闭左侧栏 | |
| 107 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 108 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 109 | + | |
| 110 | + $("#date").datetimepicker({ | |
| 111 | + format : 'YYYY-MM-DD', | |
| 112 | + locale : 'zh-cn' | |
| 113 | + }); | |
| 114 | + | |
| 115 | + var d = new Date(); | |
| 116 | + var year = d.getFullYear(); | |
| 117 | + var month = d.getMonth() + 1; | |
| 118 | + var day = d.getDate(); | |
| 119 | + if(month > 9){ | |
| 120 | + $("#date").val(year + "-" + month + "-" + day); | |
| 121 | + } else { | |
| 122 | + $("#date").val(year + "-0" + month + "-" + day); | |
| 123 | + } | |
| 124 | + | |
| 125 | + $('#line').select2({ | |
| 126 | + ajax: { | |
| 127 | + url: '/realSchedule/findLine', | |
| 128 | + type: 'post', | |
| 129 | + dataType: 'json', | |
| 130 | + delay: 150, | |
| 131 | + data: function(params){ | |
| 132 | + return{line: params.term}; | |
| 133 | + }, | |
| 134 | + processResults: function (data) { | |
| 135 | + return { | |
| 136 | + results: data | |
| 137 | + }; | |
| 138 | + }, | |
| 139 | + cache: true | |
| 140 | + }, | |
| 141 | + templateResult: function(repo){ | |
| 142 | + if (repo.loading) return repo.text; | |
| 143 | + var h = '<span>'+repo.text+'</span>'; | |
| 144 | + return h; | |
| 145 | + }, | |
| 146 | + escapeMarkup: function (markup) { return markup; }, | |
| 147 | + minimumInputLength: 1, | |
| 148 | + templateSelection: function(repo){ | |
| 149 | + return repo.text; | |
| 150 | + }, | |
| 151 | + language: { | |
| 152 | + noResults: function(){ | |
| 153 | + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 154 | + }, | |
| 155 | + inputTooShort : function(e) { | |
| 156 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 157 | + }, | |
| 158 | + searching : function() { | |
| 159 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 160 | + } | |
| 161 | + } | |
| 162 | + }); | |
| 163 | + $('#code').select2({ | |
| 164 | + ajax: { | |
| 165 | + url: '/realSchedule/sreachVehic', | |
| 166 | + dataType: 'json', | |
| 167 | + delay: 150, | |
| 168 | + data: function(params){ | |
| 169 | + return{nbbm: params.term}; | |
| 170 | + }, | |
| 171 | + processResults: function (data) { | |
| 172 | + return { | |
| 173 | + results: data | |
| 174 | + }; | |
| 175 | + }, | |
| 176 | + cache: true | |
| 177 | + }, | |
| 178 | + templateResult: function(repo){ | |
| 179 | + if (repo.loading) return repo.text; | |
| 180 | + var h = '<span>'+repo.text+'</span>'; | |
| 181 | + h += (repo.lineName?' <span class="select2-desc">'+repo.lineName+'</span>':''); | |
| 182 | + return h; | |
| 183 | + }, | |
| 184 | + escapeMarkup: function (markup) { return markup; }, | |
| 185 | + minimumInputLength: 1, | |
| 186 | + templateSelection: function(repo){ | |
| 187 | + return repo.text; | |
| 188 | + }, | |
| 189 | + language: { | |
| 190 | + noResults: function(){ | |
| 191 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | |
| 192 | + }, | |
| 193 | + inputTooShort : function(e) { | |
| 194 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | |
| 195 | + }, | |
| 196 | + searching : function() { | |
| 197 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | |
| 198 | + } | |
| 199 | + } | |
| 200 | + }); | |
| 201 | + | |
| 202 | + | |
| 203 | + $("#query").on("click",jsDoQuery); | |
| 204 | + | |
| 205 | + function jsDoQuery(pagination){ | |
| 206 | + var params = {}; | |
| 207 | + params['line'] = $("#line").val(); | |
| 208 | + params['date'] = $("#date").val(); | |
| 209 | + params['code'] = $("#code").val(); | |
| 210 | + $("#forms .hidden").removeClass("hidden"); | |
| 211 | + $get('/pcpc/commandState', params, function(result){ | |
| 212 | + // 把数据填充到模版中 | |
| 213 | + var tbodyHtml = template('list_commandState',{list:result}); | |
| 214 | + list = result; | |
| 215 | + // 把渲染好的模版html文本追加到表格中 | |
| 216 | + $('#forms tbody').html(tbodyHtml); | |
| 217 | + | |
| 218 | + }); | |
| 219 | + } | |
| 220 | + | |
| 221 | + $("#export").on("click",function(){ | |
| 222 | + $('#forms').tableExport({ type: 'excel', escape: 'false',filename:'(2016-02-29_2016-03-06)'}); | |
| 223 | + }); | |
| 224 | + | |
| 225 | + $("#forms tbody").on("click","a",function(){ | |
| 226 | + var jsy = $(this).html(); | |
| 227 | + $.each(list, function(i, g){ | |
| 228 | + if(jsy == g.jsy){ | |
| 229 | + $("#date1").html(g.date); | |
| 230 | + $("#line1").html(g.line); | |
| 231 | + $("#clZbh1").html(g.clZbh); | |
| 232 | + $("#jsy1").html(g.jsy); | |
| 233 | + $("#works_hidden").removeClass("hidden"); | |
| 234 | + $("#works .hidden").removeClass("hidden"); | |
| 235 | + // 把数据填充到模版中 | |
| 236 | + var tbodyHtml = template('list_workList',{list:g.workList}); | |
| 237 | + // 把渲染好的模版html文本追加到表格中 | |
| 238 | + $('#works tbody').html(tbodyHtml); | |
| 239 | + } | |
| 240 | + }); | |
| 241 | + }); | |
| 242 | + | |
| 243 | + | |
| 244 | + }); | |
| 245 | + | |
| 246 | + | |
| 247 | +</script> | |
| 248 | +<script type="text/html" id="list_commandState"> | |
| 249 | + {{each list as obj i}} | |
| 250 | + <tr> | |
| 251 | + <td>{{obj.date}}</td> | |
| 252 | + <td>{{obj.line}}</td> | |
| 253 | + <td>{{obj.clZbh}}</td> | |
| 254 | + <td><a id="jsy">{{obj.jsy}}</a></td> | |
| 255 | + <td>{{obj.jhf}}</td> | |
| 256 | + <td>{{obj.sjf}}</td> | |
| 257 | + <td>{{obj.wqr}}</td> | |
| 258 | + </tr> | |
| 259 | + {{/each}} | |
| 260 | + {{if list.length == 0}} | |
| 261 | + <tr> | |
| 262 | + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> | |
| 263 | + </tr> | |
| 264 | + {{/if}} | |
| 265 | +</script> | |
| 266 | + | |
| 267 | +<script type="text/html" id="list_workList"> | |
| 268 | + {{each list as obj i}} | |
| 269 | + <tr> | |
| 270 | + <td>{{obj.date}}</td> | |
| 271 | + <td>{{obj.line}}</td> | |
| 272 | + <td>{{obj.clZbh}}</td> | |
| 273 | + <td>{{obj.fcsj}}</td> | |
| 274 | + <td>{{obj.time}}</td> | |
| 275 | + <td>{{obj.time46}}</td> | |
| 276 | + <td>{{obj.time47}}</td> | |
| 277 | + </tr> | |
| 278 | + {{/each}} | |
| 279 | + {{if list.length == 0}} | |
| 280 | + <tr> | |
| 281 | + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> | |
| 282 | + </tr> | |
| 283 | + {{/if}} | |
| 284 | +</script> | |
| 0 | 285 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
0 → 100644
| 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 | + | |
| 15 | + .table > tbody + tbody { | |
| 16 | + border-top: 1px solid; } | |
| 17 | +</style> | |
| 18 | + | |
| 19 | +<div class="page-head"> | |
| 20 | + <div class="page-title"> | |
| 21 | + <h1>线路首末班查询</h1> | |
| 22 | + </div> | |
| 23 | +</div> | |
| 24 | + | |
| 25 | +<div class="row"> | |
| 26 | + <div class="col-md-12"> | |
| 27 | + <div class="portlet light porttlet-fit bordered"> | |
| 28 | + <div class="portlet-title"> | |
| 29 | + <form id="history" class="form-inline" action=""> | |
| 30 | + <div style="display: inline-block;"> | |
| 31 | + <span class="item-label" style="width: 80px;">线路: </span> | |
| 32 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | |
| 35 | + <span class="item-label" style="width: 80px;">时间: </span> | |
| 36 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | |
| 37 | + </div> | |
| 38 | + <div class="form-group"> | |
| 39 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | |
| 40 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 41 | + </div> | |
| 42 | + </form> | |
| 43 | + </div> | |
| 44 | + <div class="portlet-body"> | |
| 45 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 46 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | |
| 47 | + <thead> | |
| 48 | + <tr class="hidden"> | |
| 49 | + <th width="100px" rowspan="2">日期</th> | |
| 50 | + <th width="100px" rowspan="2">线路</th> | |
| 51 | + <th colspan="4">上行首发</th> | |
| 52 | + <th colspan="4">上行末发</th> | |
| 53 | + <th colspan="4">下行首发</th> | |
| 54 | + <th colspan="4">下行末发</th> | |
| 55 | + </tr> | |
| 56 | + <tr class="hidden"> | |
| 57 | + <th width="100px">站点</th> | |
| 58 | + <th>计发</th> | |
| 59 | + <th>实发</th> | |
| 60 | + <th>快慢</th> | |
| 61 | + <th width="100px">站点</th> | |
| 62 | + <th>计发</th> | |
| 63 | + <th>实发</th> | |
| 64 | + <th>快慢</th> | |
| 65 | + <th width="100px">站点</th> | |
| 66 | + <th>计发</th> | |
| 67 | + <th>实发</th> | |
| 68 | + <th>快慢</th> | |
| 69 | + <th width="100px">站点</th> | |
| 70 | + <th>计发</th> | |
| 71 | + <th>实发</th> | |
| 72 | + <th>快慢</th> | |
| 73 | + </tr> | |
| 74 | + </thead> | |
| 75 | + <tbody> | |
| 76 | + | |
| 77 | + </tbody> | |
| 78 | + </table> | |
| 79 | + <div style="text-align: right;"> | |
| 80 | + <ul id="pagination" class="pagination"></ul> | |
| 81 | + </div> | |
| 82 | + </div> | |
| 83 | + </div> | |
| 84 | + </div> | |
| 85 | + </div> | |
| 86 | +</div> | |
| 87 | + | |
| 88 | +<script> | |
| 89 | + $(function(){ | |
| 90 | + | |
| 91 | + // 关闭左侧栏 | |
| 92 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 93 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 94 | + | |
| 95 | + $("#date").datetimepicker({ | |
| 96 | + format : 'YYYY-MM-DD', | |
| 97 | + locale : 'zh-cn' | |
| 98 | + }); | |
| 99 | + | |
| 100 | + var d = new Date(); | |
| 101 | + var year = d.getFullYear(); | |
| 102 | + var month = d.getMonth() + 1; | |
| 103 | + var day = d.getDate(); | |
| 104 | + if(month > 9){ | |
| 105 | + $("#date").val(year + "-" + month + "-" + day); | |
| 106 | + } else { | |
| 107 | + $("#date").val(year + "-0" + month + "-" + day); | |
| 108 | + } | |
| 109 | + | |
| 110 | + $('#line').select2({ | |
| 111 | + ajax: { | |
| 112 | + url: '/realSchedule/findLine', | |
| 113 | + type: 'post', | |
| 114 | + dataType: 'json', | |
| 115 | + delay: 150, | |
| 116 | + data: function(params){ | |
| 117 | + return{line: params.term}; | |
| 118 | + }, | |
| 119 | + processResults: function (data) { | |
| 120 | + return { | |
| 121 | + results: data | |
| 122 | + }; | |
| 123 | + }, | |
| 124 | + cache: true | |
| 125 | + }, | |
| 126 | + templateResult: function(repo){ | |
| 127 | + if (repo.loading) return repo.text; | |
| 128 | + var h = '<span>'+repo.text+'</span>'; | |
| 129 | + return h; | |
| 130 | + }, | |
| 131 | + escapeMarkup: function (markup) { return markup; }, | |
| 132 | + minimumInputLength: 1, | |
| 133 | + templateSelection: function(repo){ | |
| 134 | + return repo.text; | |
| 135 | + }, | |
| 136 | + language: { | |
| 137 | + noResults: function(){ | |
| 138 | + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 139 | + }, | |
| 140 | + inputTooShort : function(e) { | |
| 141 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 142 | + }, | |
| 143 | + searching : function() { | |
| 144 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 145 | + } | |
| 146 | + } | |
| 147 | + }); | |
| 148 | + | |
| 149 | + $("#query").on("click",jsDoQuery); | |
| 150 | + | |
| 151 | + var line = $("#line").val(); | |
| 152 | + var date = $("#date").val(); | |
| 153 | + function jsDoQuery(pagination){ | |
| 154 | + var params = {}; | |
| 155 | + line = $("#line").val(); | |
| 156 | + date = $("#date").val(); | |
| 157 | + params['line'] = line; | |
| 158 | + params['date'] = date; | |
| 159 | + params['type'] = "query"; | |
| 160 | + $(".hidden").removeClass("hidden"); | |
| 161 | + $get('/pcpc/firstAndLastBus', params, function(result){ | |
| 162 | + // 把数据填充到模版中 | |
| 163 | + var tbodyHtml = template('list_firstAndLastBus',{list:result}); | |
| 164 | + // 把渲染好的模版html文本追加到表格中 | |
| 165 | + $('#forms tbody').html(tbodyHtml); | |
| 166 | + | |
| 167 | + }); | |
| 168 | + } | |
| 169 | + | |
| 170 | + $("#export").on("click",function(){ | |
| 171 | + $get('/pcpc/firstAndLastBus',{line:line,date:date,type:'export'},function(result){ | |
| 172 | + window.open("/downloadFile/download?fileName=线路首末班"+moment(date).format("YYYYMMDD")); | |
| 173 | + }); | |
| 174 | + }); | |
| 175 | + | |
| 176 | + | |
| 177 | + }); | |
| 178 | + | |
| 179 | +</script> | |
| 180 | +<script type="text/html" id="list_firstAndLastBus"> | |
| 181 | + {{each list as obj i}} | |
| 182 | + <tr> | |
| 183 | + <td>{{obj.date}}</td> | |
| 184 | + <td>{{obj.line}}</td> | |
| 185 | + <td>{{obj.qdzFirst0}}</td> | |
| 186 | + <td>{{obj.jhfcFirst0}}</td> | |
| 187 | + <td>{{obj.sjfcFirst0}}</td> | |
| 188 | + <td>{{obj.delayFirst0}}</td> | |
| 189 | + <td>{{obj.qdzLast0}}</td> | |
| 190 | + <td>{{obj.jhfcLast0}}</td> | |
| 191 | + <td>{{obj.sjfcLast0}}</td> | |
| 192 | + <td>{{obj.delayLast0}}</td> | |
| 193 | + <td>{{obj.qdzFirst1}}</td> | |
| 194 | + <td>{{obj.jhfcFirst1}}</td> | |
| 195 | + <td>{{obj.sjfcFirst1}}</td> | |
| 196 | + <td>{{obj.delayFirst1}}</td> | |
| 197 | + <td>{{obj.qdzLast1}}</td> | |
| 198 | + <td>{{obj.jhfcLast1}}</td> | |
| 199 | + <td>{{obj.sjfcLast1}}</td> | |
| 200 | + <td>{{obj.delayLast1}}</td> | |
| 201 | + </tr> | |
| 202 | + {{/each}} | |
| 203 | + {{if list.length == 0}} | |
| 204 | + <tr> | |
| 205 | + <td colspan="18"><h6 class="muted">没有找到相关数据</h6></td> | |
| 206 | + </tr> | |
| 207 | + {{/if}} | |
| 208 | +</script> | |
| 0 | 209 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
0 → 100644
| 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 | + | |
| 15 | + .table > tbody + tbody { | |
| 16 | + border-top: 1px solid; } | |
| 17 | +</style> | |
| 18 | + | |
| 19 | +<div class="page-head"> | |
| 20 | + <div class="page-title"> | |
| 21 | + <h1>计划车辆班次人员</h1> | |
| 22 | + </div> | |
| 23 | +</div> | |
| 24 | + | |
| 25 | +<div class="row"> | |
| 26 | + <div class="col-md-12"> | |
| 27 | + <div class="portlet light porttlet-fit bordered"> | |
| 28 | + <div class="portlet-title"> | |
| 29 | + <form id="history" class="form-inline" action=""> | |
| 30 | + <div style="display: inline-block;"> | |
| 31 | + <span class="item-label" style="width: 80px;">线路: </span> | |
| 32 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | |
| 35 | + <span class="item-label" style="width: 80px;">时间: </span> | |
| 36 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | |
| 37 | + </div> | |
| 38 | + <div class="form-group"> | |
| 39 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | |
| 40 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 41 | + </div> | |
| 42 | + </form> | |
| 43 | + </div> | |
| 44 | + <div class="portlet-body"> | |
| 45 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 46 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | |
| 47 | + <thead> | |
| 48 | + <tr class="hidden"> | |
| 49 | + <th>日期</th> | |
| 50 | + <th>线路</th> | |
| 51 | + <th>路牌</th> | |
| 52 | + <th>车辆</th> | |
| 53 | + <th>驾驶员</th> | |
| 54 | + <th>售票员</th> | |
| 55 | + <th>计划里程</th> | |
| 56 | + </tr> | |
| 57 | + </thead> | |
| 58 | + <tbody> | |
| 59 | + | |
| 60 | + </tbody> | |
| 61 | + </table> | |
| 62 | + <div style="text-align: right;"> | |
| 63 | + <ul id="pagination" class="pagination"></ul> | |
| 64 | + </div> | |
| 65 | + </div> | |
| 66 | + </div> | |
| 67 | + </div> | |
| 68 | + </div> | |
| 69 | +</div> | |
| 70 | + | |
| 71 | +<script> | |
| 72 | + $(function(){ | |
| 73 | + | |
| 74 | + // 关闭左侧栏 | |
| 75 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 76 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 77 | + | |
| 78 | + $("#date").datetimepicker({ | |
| 79 | + format : 'YYYY-MM-DD', | |
| 80 | + locale : 'zh-cn' | |
| 81 | + }); | |
| 82 | + | |
| 83 | + var d = new Date(); | |
| 84 | + var year = d.getFullYear(); | |
| 85 | + var month = d.getMonth() + 1; | |
| 86 | + var day = d.getDate(); | |
| 87 | + if(month > 9){ | |
| 88 | + $("#date").val(year + "-" + month + "-" + day); | |
| 89 | + } else { | |
| 90 | + $("#date").val(year + "-0" + month + "-" + day); | |
| 91 | + } | |
| 92 | + | |
| 93 | + $('#line').select2({ | |
| 94 | + ajax: { | |
| 95 | + url: '/realSchedule/findLine', | |
| 96 | + type: 'post', | |
| 97 | + dataType: 'json', | |
| 98 | + delay: 150, | |
| 99 | + data: function(params){ | |
| 100 | + return{line: params.term}; | |
| 101 | + }, | |
| 102 | + processResults: function (data) { | |
| 103 | + return { | |
| 104 | + results: data | |
| 105 | + }; | |
| 106 | + }, | |
| 107 | + cache: true | |
| 108 | + }, | |
| 109 | + templateResult: function(repo){ | |
| 110 | + if (repo.loading) return repo.text; | |
| 111 | + var h = '<span>'+repo.text+'</span>'; | |
| 112 | + return h; | |
| 113 | + }, | |
| 114 | + escapeMarkup: function (markup) { return markup; }, | |
| 115 | + minimumInputLength: 1, | |
| 116 | + templateSelection: function(repo){ | |
| 117 | + return repo.text; | |
| 118 | + }, | |
| 119 | + language: { | |
| 120 | + noResults: function(){ | |
| 121 | + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 122 | + }, | |
| 123 | + inputTooShort : function(e) { | |
| 124 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 125 | + }, | |
| 126 | + searching : function() { | |
| 127 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 128 | + } | |
| 129 | + } | |
| 130 | + }); | |
| 131 | + | |
| 132 | + | |
| 133 | + $("#query").on("click",jsDoQuery); | |
| 134 | + | |
| 135 | + var line = $("#line").val(); | |
| 136 | + var date = $("#date").val(); | |
| 137 | + function jsDoQuery(pagination){ | |
| 138 | + var params = {}; | |
| 139 | + line = $("#line").val(); | |
| 140 | + date = $("#date").val(); | |
| 141 | + params['line'] = line; | |
| 142 | + params['date'] = date; | |
| 143 | + params['type'] = "query"; | |
| 144 | + $(".hidden").removeClass("hidden"); | |
| 145 | + $get('/pcpc/queryPeopleCar', params, function(result){ | |
| 146 | + // 把数据填充到模版中 | |
| 147 | + var tbodyHtml = template('list_queryPeopleCar',{list:result}); | |
| 148 | + // 把渲染好的模版html文本追加到表格中 | |
| 149 | + $('#forms tbody').html(tbodyHtml); | |
| 150 | + | |
| 151 | + }); | |
| 152 | + } | |
| 153 | + | |
| 154 | + $("#export").on("click",function(){ | |
| 155 | + $get('/pcpc/queryPeopleCar',{line:line,date:date,type:'export'},function(result){ | |
| 156 | + window.open("/downloadFile/download?fileName=计划车辆班次人员"+moment(date).format("YYYYMMDD")); | |
| 157 | + }); | |
| 158 | + }); | |
| 159 | + | |
| 160 | + | |
| 161 | + }); | |
| 162 | + | |
| 163 | +</script> | |
| 164 | +<script type="text/html" id="list_queryPeopleCar"> | |
| 165 | + {{each list as obj i}} | |
| 166 | + <tr> | |
| 167 | + <td>{{obj.date}}</td> | |
| 168 | + <td>{{obj.line}}</td> | |
| 169 | + <td>{{obj.lp}}</td> | |
| 170 | + <td>{{obj.clzbh}}</td> | |
| 171 | + <td>{{obj.jName}}</td> | |
| 172 | + <td>{{obj.sName}}</td> | |
| 173 | + <td>{{obj.jhlc}}</td> | |
| 174 | + </tr> | |
| 175 | + {{/each}} | |
| 176 | + {{if list.length == 0}} | |
| 177 | + <tr> | |
| 178 | + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> | |
| 179 | + </tr> | |
| 180 | + {{/if}} | |
| 181 | +</script> | |
| 0 | 182 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
0 → 100644
| 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 | + | |
| 15 | + .table > tbody + tbody { | |
| 16 | + border-top: 1px solid; } | |
| 17 | +</style> | |
| 18 | + | |
| 19 | +<div class="page-head"> | |
| 20 | + <div class="page-title"> | |
| 21 | + <h1>时刻表分析</h1> | |
| 22 | + </div> | |
| 23 | +</div> | |
| 24 | + | |
| 25 | +<div class="row"> | |
| 26 | + <div class="col-md-12"> | |
| 27 | + <div class="portlet light porttlet-fit bordered"> | |
| 28 | + <div class="portlet-title"> | |
| 29 | + <form id="history" class="form-inline" action=""> | |
| 30 | + <div style="display: inline-block;"> | |
| 31 | + <span class="item-label" style="width: 80px;">线路: </span> | |
| 32 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | |
| 35 | + <span class="item-label" style="width: 80px;">开始时间: </span> | |
| 36 | + <input class="form-control" type="text" id="startDate" style="width: 180px;"/> | |
| 37 | + </div> | |
| 38 | + <div style="display: inline-block;margin-left: 15px;"> | |
| 39 | + <span class="item-label" style="width: 80px;">结束时间: </span> | |
| 40 | + <input class="form-control" type="text" id="endDate" style="width: 180px;"/> | |
| 41 | + </div> | |
| 42 | + <div style="display: inline-block;"> | |
| 43 | + <span class="item-label" style="width: 80px;">模板类型: </span> | |
| 44 | + <select class="form-control" name="model" id="model" style="width: 180px;"> | |
| 45 | + <option value="">请选择...</option> | |
| 46 | + </select> | |
| 47 | + </div> | |
| 48 | + <div class="form-group"> | |
| 49 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | |
| 50 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 51 | + </div> | |
| 52 | + </form> | |
| 53 | + </div> | |
| 54 | + <div class="portlet-body"> | |
| 55 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 56 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | |
| 57 | + <thead> | |
| 58 | + <tr class="hidden"> | |
| 59 | + <th width="10%">线路</th> | |
| 60 | + <th width="10%">起点站名</th> | |
| 61 | + <th width="8%">计发时间</th> | |
| 62 | + <th width="8%">计划运送时间(分)</th> | |
| 63 | + <th width="8%">计划完成次数</th> | |
| 64 | + <th width="8%">完成次数</th> | |
| 65 | + <th width="8%">最早发车时间</th> | |
| 66 | + <th width="8%">最晚发车时间</th> | |
| 67 | + <th width="8%">平均发车时间</th> | |
| 68 | + <th width="8%">最慢运送时间(分)</th> | |
| 69 | + <th width="8%">最快运送时间(分)</th> | |
| 70 | + <th width="8%">平均运送时间(分)</th> | |
| 71 | + </tr> | |
| 72 | + </thead> | |
| 73 | + <tbody> | |
| 74 | + | |
| 75 | + </tbody> | |
| 76 | + </table> | |
| 77 | + <div style="text-align: right;"> | |
| 78 | + <ul id="pagination" class="pagination"></ul> | |
| 79 | + </div> | |
| 80 | + </div> | |
| 81 | + </div> | |
| 82 | + </div> | |
| 83 | + </div> | |
| 84 | +</div> | |
| 85 | + | |
| 86 | +<script> | |
| 87 | + $(function(){ | |
| 88 | + var page = 0, initPagination; | |
| 89 | + | |
| 90 | + // 关闭左侧栏 | |
| 91 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 92 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 93 | + | |
| 94 | + $("#startDate").datetimepicker({ | |
| 95 | + format : 'YYYY-MM-DD', | |
| 96 | + locale : 'zh-cn' | |
| 97 | + }); | |
| 98 | + | |
| 99 | + $("#endDate").datetimepicker({ | |
| 100 | + format : 'YYYY-MM-DD', | |
| 101 | + locale : 'zh-cn' | |
| 102 | + }); | |
| 103 | + | |
| 104 | + var d = new Date(); | |
| 105 | + var year = d.getFullYear(); | |
| 106 | + var month = d.getMonth() + 1; | |
| 107 | + var day = d.getDate(); | |
| 108 | + if(month > 9){ | |
| 109 | + $("#startDate").val(year + "-" + month + "-" + day); | |
| 110 | + $("#endDate").val(year + "-" + month + "-" + day); | |
| 111 | + } else { | |
| 112 | + $("#startDate").val(year + "-0" + month + "-" + day); | |
| 113 | + $("#endDate").val(year + "-0" + month + "-" + day); | |
| 114 | + } | |
| 115 | + | |
| 116 | + $('#line').select2({ | |
| 117 | + ajax: { | |
| 118 | + url: '/realSchedule/findLine', | |
| 119 | + type: 'post', | |
| 120 | + dataType: 'json', | |
| 121 | + delay: 150, | |
| 122 | + data: function(params){ | |
| 123 | + return{line: params.term}; | |
| 124 | + }, | |
| 125 | + processResults: function (data) { | |
| 126 | + return { | |
| 127 | + results: data | |
| 128 | + }; | |
| 129 | + }, | |
| 130 | + cache: true | |
| 131 | + }, | |
| 132 | + templateResult: function(repo){ | |
| 133 | + if (repo.loading) return repo.text; | |
| 134 | + var h = '<span>'+repo.text+'</span>'; | |
| 135 | + return h; | |
| 136 | + }, | |
| 137 | + escapeMarkup: function (markup) { return markup; }, | |
| 138 | + minimumInputLength: 1, | |
| 139 | + templateSelection: function(repo){ | |
| 140 | + return repo.text; | |
| 141 | + }, | |
| 142 | + language: { | |
| 143 | + noResults: function(){ | |
| 144 | + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 145 | + }, | |
| 146 | + inputTooShort : function(e) { | |
| 147 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 148 | + }, | |
| 149 | + searching : function() { | |
| 150 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 151 | + } | |
| 152 | + } | |
| 153 | + }); | |
| 154 | + | |
| 155 | + $("#query").on("click", function(){ | |
| 156 | + page = 0; | |
| 157 | + jsDoQuery(true); | |
| 158 | + }); | |
| 159 | + | |
| 160 | + var line = $("#line").val(); | |
| 161 | + var startDate = $("#startDate").val(); | |
| 162 | + var endDate = $("#endDate").val(); | |
| 163 | + var model = $("#model").val(); | |
| 164 | + function jsDoQuery(pagination){ | |
| 165 | + var params = {}; | |
| 166 | + line = $("#line").val(); | |
| 167 | + startDate = $("#startDate").val(); | |
| 168 | + endDate = $("#endDate").val(); | |
| 169 | + model = $("#model").val(); | |
| 170 | + params['page'] = page; | |
| 171 | + params['line'] = line; | |
| 172 | + params['startDate'] = startDate; | |
| 173 | + params['endDate'] = endDate; | |
| 174 | + params['model'] = model; | |
| 175 | + params['type'] = "query"; | |
| 176 | + $(".hidden").removeClass("hidden"); | |
| 177 | + $get('/pcpc/scheduleAnaly', params, function(result){ | |
| 178 | + // 把数据填充到模版中 | |
| 179 | + var tbodyHtml = template('list_scheduleAnaly',{list:result.dataList}); | |
| 180 | + // 把渲染好的模版html文本追加到表格中 | |
| 181 | + $('#forms tbody').html(tbodyHtml); | |
| 182 | + | |
| 183 | + if(pagination && result.dataList.length > 0){ | |
| 184 | + //重新分页 | |
| 185 | + initPagination = true; | |
| 186 | + showPagination(result); | |
| 187 | + } | |
| 188 | + }); | |
| 189 | + } | |
| 190 | + | |
| 191 | + $("#export").on("click",function(){ | |
| 192 | + $get('/pcpc/scheduleAnaly',{page:'',line:line,startDate:startDate,endDate:endDate,model:model,type:'export'},function(result){ | |
| 193 | + window.open("/downloadFile/download?fileName=时刻表分析"+moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD")); | |
| 194 | + }); | |
| 195 | + }); | |
| 196 | + | |
| 197 | + | |
| 198 | + $("#line").on("change", function(){ | |
| 199 | + line = $("#line").val(); | |
| 200 | + updateModel(); | |
| 201 | + }); | |
| 202 | + $('#startDate').on("blur", function(){ | |
| 203 | + startDate = $("#startDate").val(); | |
| 204 | + endDate = $("#endDate").val(); | |
| 205 | + updateModel(); | |
| 206 | + }); | |
| 207 | + $('#endDate').on("blur", function(){ | |
| 208 | + startDate = $("#startDate").val(); | |
| 209 | + endDate = $("#endDate").val(); | |
| 210 | + updateModel(); | |
| 211 | + }); | |
| 212 | + | |
| 213 | + var flag = 0; | |
| 214 | + function updateModel(){ | |
| 215 | + if(flag == 1) | |
| 216 | + return; | |
| 217 | + flag = 1; | |
| 218 | + var treeData = []; | |
| 219 | + var params = {}; | |
| 220 | + params['line'] = line; | |
| 221 | + params['startDate'] = startDate; | |
| 222 | + params['endDate'] = endDate; | |
| 223 | + $get('/pcpc/getModel', params, function(result){ | |
| 224 | + treeData = createTreeData(result); | |
| 225 | + var options = '<option value="">请选择...</option>'; | |
| 226 | + var size = 0; | |
| 227 | + $.each(treeData, function(i, g){ | |
| 228 | + options += '<option value="'+g.id+'">'+g.name+'</option>'; | |
| 229 | + size++; | |
| 230 | + }); | |
| 231 | + $('#model').html(options)/* .select2() */; | |
| 232 | + flag = 0; | |
| 233 | + }); | |
| 234 | + } | |
| 235 | + updateModel(); | |
| 236 | + | |
| 237 | + | |
| 238 | + function showPagination(data){ | |
| 239 | + //分页 | |
| 240 | + $('#pagination').jqPaginator({ | |
| 241 | + totalPages: data.totalPage, | |
| 242 | + visiblePages: 6, | |
| 243 | + currentPage: page + 1, | |
| 244 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | |
| 245 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | |
| 246 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | |
| 247 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | |
| 248 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | |
| 249 | + onPageChange: function (num, type) { | |
| 250 | + if(initPagination){ | |
| 251 | + initPagination = false; | |
| 252 | + return; | |
| 253 | + } | |
| 254 | + page = num - 1; | |
| 255 | + jsDoQuery(false); | |
| 256 | + } | |
| 257 | + }); | |
| 258 | + } | |
| 259 | + | |
| 260 | + | |
| 261 | + }); | |
| 262 | + | |
| 263 | +</script> | |
| 264 | +<script type="text/html" id="list_scheduleAnaly"> | |
| 265 | + {{each list as obj i}} | |
| 266 | + <tr> | |
| 267 | + <td>{{obj.line}}</td> | |
| 268 | + <td>{{obj.qdz}}</td> | |
| 269 | + <td>{{obj.jhfc}}</td> | |
| 270 | + <td>{{obj.bcsj}}</td> | |
| 271 | + <td>{{obj.jhbc}}</td> | |
| 272 | + <td>{{obj.sjbc}}</td> | |
| 273 | + <td>{{obj.zzfc}}</td> | |
| 274 | + <td>{{obj.zwfc}}</td> | |
| 275 | + <td>{{obj.pjfc}}</td> | |
| 276 | + <td>{{obj.zmys}}</td> | |
| 277 | + <td>{{obj.zkys}}</td> | |
| 278 | + <td>{{obj.pjys}}</td> | |
| 279 | + </tr> | |
| 280 | + {{/each}} | |
| 281 | + {{if list.length == 0}} | |
| 282 | + <tr> | |
| 283 | + <td colspan="12"><h6 class="muted">没有找到相关数据</h6></td> | |
| 284 | + </tr> | |
| 285 | + {{/if}} | |
| 286 | +</script> | |
| 0 | 287 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forms/statement/workDaily.html
0 → 100644
| 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 | + | |
| 15 | + .table > tbody + tbody { | |
| 16 | + border-top: 1px solid; } | |
| 17 | +</style> | |
| 18 | + | |
| 19 | +<div class="page-head"> | |
| 20 | + <div class="page-title"> | |
| 21 | + <h1>营运服务日报表</h1> | |
| 22 | + </div> | |
| 23 | +</div> | |
| 24 | + | |
| 25 | +<div class="row"> | |
| 26 | + <div class="col-md-12"> | |
| 27 | + <div class="portlet light porttlet-fit bordered"> | |
| 28 | + <div class="portlet-title"> | |
| 29 | + <form id="history" class="form-inline" action=""> | |
| 30 | + <div style="display: inline-block;"> | |
| 31 | + <span class="item-label" style="width: 80px;">线路: </span> | |
| 32 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | |
| 35 | + <span class="item-label" style="width: 80px;">时间: </span> | |
| 36 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | |
| 37 | + </div> | |
| 38 | + <div class="form-group"> | |
| 39 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | |
| 40 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 41 | + </div> | |
| 42 | + </form> | |
| 43 | + </div> | |
| 44 | + <div class="portlet-body"> | |
| 45 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 46 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | |
| 47 | + <thead> | |
| 48 | + <tr class="hidden"> | |
| 49 | + <th width="80px">日期</th> | |
| 50 | + <th width="100px">线路</th> | |
| 51 | + <th>计划班次</th> | |
| 52 | + <th>待发调整</th> | |
| 53 | + <th>待发调整比率</th> | |
| 54 | + <th>出场率</th> | |
| 55 | + <th width="46px">上行发快</th> | |
| 56 | + <th width="46px">上行到快</th> | |
| 57 | + <th width="46px">下行发快</th> | |
| 58 | + <th width="46px">下行到快</th> | |
| 59 | + <th width="46px">上行发慢</th> | |
| 60 | + <th width="46px">上行到慢</th> | |
| 61 | + <th width="46px">下行发慢</th> | |
| 62 | + <th width="46px">下行到慢</th> | |
| 63 | + <th>误点总数(快/慢)</th> | |
| 64 | + <th>首末班准点率</th> | |
| 65 | + <th>高峰班次执行率(早/晚)</th> | |
| 66 | + </tr> | |
| 67 | + </thead> | |
| 68 | + <tbody> | |
| 69 | + | |
| 70 | + </tbody> | |
| 71 | + </table> | |
| 72 | + <div style="text-align: right;"> | |
| 73 | + <ul id="pagination" class="pagination"></ul> | |
| 74 | + </div> | |
| 75 | + </div> | |
| 76 | + </div> | |
| 77 | + </div> | |
| 78 | + </div> | |
| 79 | +</div> | |
| 80 | + | |
| 81 | +<script> | |
| 82 | + $(function(){ | |
| 83 | + | |
| 84 | + // 关闭左侧栏 | |
| 85 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 86 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 87 | + | |
| 88 | + $("#date").datetimepicker({ | |
| 89 | + format : 'YYYY-MM-DD', | |
| 90 | + locale : 'zh-cn' | |
| 91 | + }); | |
| 92 | + | |
| 93 | + var d = new Date(); | |
| 94 | + var year = d.getFullYear(); | |
| 95 | + var month = d.getMonth() + 1; | |
| 96 | + var day = d.getDate(); | |
| 97 | + if(month > 9){ | |
| 98 | + $("#date").val(year + "-" + month + "-" + day); | |
| 99 | + } else { | |
| 100 | + $("#date").val(year + "-0" + month + "-" + day); | |
| 101 | + } | |
| 102 | + | |
| 103 | + $('#line').select2({ | |
| 104 | + ajax: { | |
| 105 | + url: '/realSchedule/findLine', | |
| 106 | + type: 'post', | |
| 107 | + dataType: 'json', | |
| 108 | + delay: 150, | |
| 109 | + data: function(params){ | |
| 110 | + return{line: params.term}; | |
| 111 | + }, | |
| 112 | + processResults: function (data) { | |
| 113 | + return { | |
| 114 | + results: data | |
| 115 | + }; | |
| 116 | + }, | |
| 117 | + cache: true | |
| 118 | + }, | |
| 119 | + templateResult: function(repo){ | |
| 120 | + if (repo.loading) return repo.text; | |
| 121 | + var h = '<span>'+repo.text+'</span>'; | |
| 122 | + return h; | |
| 123 | + }, | |
| 124 | + escapeMarkup: function (markup) { return markup; }, | |
| 125 | + minimumInputLength: 1, | |
| 126 | + templateSelection: function(repo){ | |
| 127 | + return repo.text; | |
| 128 | + }, | |
| 129 | + language: { | |
| 130 | + noResults: function(){ | |
| 131 | + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 132 | + }, | |
| 133 | + inputTooShort : function(e) { | |
| 134 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 135 | + }, | |
| 136 | + searching : function() { | |
| 137 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 138 | + } | |
| 139 | + } | |
| 140 | + }); | |
| 141 | + | |
| 142 | + $("#query").on("click",jsDoQuery); | |
| 143 | + | |
| 144 | + var line = $("#line").val(); | |
| 145 | + var date = $("#date").val(); | |
| 146 | + function jsDoQuery(pagination){ | |
| 147 | + var params = {}; | |
| 148 | + line = $("#line").val(); | |
| 149 | + date = $("#date").val(); | |
| 150 | + params['line'] = line; | |
| 151 | + params['date'] = date; | |
| 152 | + params['type'] = "query"; | |
| 153 | + $(".hidden").removeClass("hidden"); | |
| 154 | + $get('/pcpc/workDaily', params, function(result){ | |
| 155 | + // 把数据填充到模版中 | |
| 156 | + var tbodyHtml = template('list_workDaily',{list:result}); | |
| 157 | + // 把渲染好的模版html文本追加到表格中 | |
| 158 | + $('#forms tbody').html(tbodyHtml); | |
| 159 | + | |
| 160 | + }); | |
| 161 | + } | |
| 162 | + | |
| 163 | + $("#export").on("click",function(){ | |
| 164 | + $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ | |
| 165 | + window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD")); | |
| 166 | + }); | |
| 167 | + }); | |
| 168 | + | |
| 169 | + | |
| 170 | + }); | |
| 171 | + | |
| 172 | +</script> | |
| 173 | +<script type="text/html" id="list_workDaily"> | |
| 174 | + {{each list as obj i}} | |
| 175 | + <tr> | |
| 176 | + <td>{{obj.date}}</td> | |
| 177 | + <td>{{obj.line}}</td> | |
| 178 | + <td>{{obj.jhbc}}</td> | |
| 179 | + <td>{{obj.dftz}}</td> | |
| 180 | + <td>{{obj.dftzl}}</td> | |
| 181 | + <td>{{obj.ccl}}</td> | |
| 182 | + <td>{{obj.upfk}}</td> | |
| 183 | + <td>{{obj.updk}}</td> | |
| 184 | + <td>{{obj.dnfk}}</td> | |
| 185 | + <td>{{obj.dndk}}</td> | |
| 186 | + <td>{{obj.upfm}}</td> | |
| 187 | + <td>{{obj.updm}}</td> | |
| 188 | + <td>{{obj.dnfm}}</td> | |
| 189 | + <td>{{obj.dndm}}</td> | |
| 190 | + <td>{{obj.wdzs}}</td> | |
| 191 | + <td>{{obj.smbzdl}}</td> | |
| 192 | + <td>{{obj.gfbczxl}}</td> | |
| 193 | + </tr> | |
| 194 | + {{/each}} | |
| 195 | + {{if list.length == 0}} | |
| 196 | + <tr> | |
| 197 | + <td colspan="17"><h6 class="muted">没有找到相关数据</h6></td> | |
| 198 | + </tr> | |
| 199 | + {{/if}} | |
| 200 | +</script> | |
| 0 | 201 | \ No newline at end of file | ... | ... |