Commit 59b6e7d404d6d20d9a04bdeae3d73c6704f11600
Merge branch 'pudong' of http://222.66.0.204:8090//panzhaov5/bsth_control into pudong
Showing
45 changed files
with
2153 additions
and
299 deletions
src/main/java/com/bsth/controller/BusIntervalController.java
| ... | ... | @@ -58,4 +58,9 @@ public class BusIntervalController { |
| 58 | 58 | return busIntervalService.exportWaybillMore(map); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | + @RequestMapping(value = "/onTime", method = RequestMethod.GET) | |
| 62 | + public List<Map<String,Object>> onTime(@RequestParam Map<String, Object> map){ | |
| 63 | + return busIntervalService.onTime(map); | |
| 64 | + } | |
| 65 | + | |
| 61 | 66 | } | ... | ... |
src/main/java/com/bsth/controller/PersonnelController.java
| ... | ... | @@ -36,7 +36,6 @@ public class PersonnelController extends BaseController<Personnel, Integer> { |
| 36 | 36 | |
| 37 | 37 | @RequestMapping(value = "/all_py", method = RequestMethod.GET) |
| 38 | 38 | public List<PersionPinYin> findAll_PY(){ |
| 39 | - persionPinYinBuffer.refresh(); | |
| 40 | 39 | return persionPinYinBuffer.getAll(); |
| 41 | 40 | } |
| 42 | 41 | ... | ... |
src/main/java/com/bsth/controller/forms/ExportController.java
| ... | ... | @@ -171,6 +171,51 @@ public class ExportController { |
| 171 | 171 | |
| 172 | 172 | return resList; |
| 173 | 173 | } |
| 174 | + | |
| 175 | + // 班次车辆人员月统计 | |
| 176 | + @RequestMapping(value = "/shiftuehiclemanthExport2", method = RequestMethod.GET) | |
| 177 | + public List<Map<String, Object>> shiftuehiclemanthExport2(@RequestParam Map<String, Object> map) { | |
| 178 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 179 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 180 | + ReportUtils ee = new ReportUtils(); | |
| 181 | + List<Shiftuehiclemanth> shiftuehiclemanth = formsService.shiftuehiclemanth2(map); | |
| 182 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 183 | + int i = 1; | |
| 184 | + for (Shiftuehiclemanth l : shiftuehiclemanth) { | |
| 185 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 186 | + m.put("i", i); | |
| 187 | + m.put("jName", l.getjName()); | |
| 188 | + m.put("jhlc", l.getJhlc()); | |
| 189 | + m.put("emptMileage", l.getEmptMileage()); | |
| 190 | + m.put("remMileage", l.getRemMileage()); | |
| 191 | + m.put("addMileage", l.getAddMileage()); | |
| 192 | + m.put("totalm", l.getTotalm()); | |
| 193 | + m.put("cjbc", l.getCjbc()); | |
| 194 | + m.put("ljbc", l.getLjbc()); | |
| 195 | + m.put("sjbc", l.getSjbc()); | |
| 196 | + resList.add(m); | |
| 197 | + i++; | |
| 198 | + } | |
| 199 | + | |
| 200 | + try { | |
| 201 | + String mouldurl = null; | |
| 202 | + if(map.get("empnames").equals("驾驶员")){ | |
| 203 | + mouldurl="mould/shiftuehiclemanth.xls"; | |
| 204 | + }else if(map.get("empnames").equals("售票员")){ | |
| 205 | + mouldurl="mould/shiftuehiclemanthspy.xls"; | |
| 206 | + }else if(map.get("empnames").equals("车辆自编号")){ | |
| 207 | + mouldurl="mould/shiftuehiclemanthclzbh.xls"; | |
| 208 | + } | |
| 209 | + listI.add(resList.iterator()); | |
| 210 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 211 | + ee.excelReplace(listI, new Object[] { map }, path +mouldurl, | |
| 212 | + path + "export/班次车辆人员月报表" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 213 | + } catch (Exception e) { | |
| 214 | + e.printStackTrace(); | |
| 215 | + } | |
| 216 | + | |
| 217 | + return resList; | |
| 218 | + } | |
| 174 | 219 | |
| 175 | 220 | // 路单数据报表 |
| 176 | 221 | @RequestMapping(value = "/singledataExport", method = RequestMethod.GET) |
| ... | ... | @@ -214,6 +259,49 @@ public class ExportController { |
| 214 | 259 | |
| 215 | 260 | return resList; |
| 216 | 261 | } |
| 262 | + | |
| 263 | + // 路单数据报表 | |
| 264 | + @RequestMapping(value = "/singledataExport2", method = RequestMethod.GET) | |
| 265 | + public List<Map<String, Object>> singledataExport2(@RequestParam Map<String, Object> map) { | |
| 266 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 267 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 268 | + ReportUtils ee = new ReportUtils(); | |
| 269 | + List<Singledata> singledata = formsService.singledata2(map); | |
| 270 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 271 | + int i = 1; | |
| 272 | + for (Singledata l : singledata) { | |
| 273 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 274 | + m.put("i", i); | |
| 275 | + m.put("rQ", l.getrQ()); | |
| 276 | + m.put("gS", l.getgS()); | |
| 277 | + m.put("xL", l.getXlmc()); | |
| 278 | + m.put("clzbh", l.getClzbh()); | |
| 279 | + m.put("jsy", l.getJsy()); | |
| 280 | + m.put("jName", l.getjName()); | |
| 281 | + m.put("sgh", l.getSgh()); | |
| 282 | + m.put("sName", l.getsName()); | |
| 283 | + m.put("jhlc", l.getJhlc()); | |
| 284 | + m.put("emptMileage", l.getEmptMileage()); | |
| 285 | + m.put("hyl", l.getHyl()); | |
| 286 | + m.put("jzl", l.getJzl()); | |
| 287 | + m.put("unyyyl", l.getUnyyyl()); | |
| 288 | + m.put("jhjl", l.getJhjl()); | |
| 289 | + resList.add(m); | |
| 290 | + | |
| 291 | + i++; | |
| 292 | + } | |
| 293 | + | |
| 294 | + try { | |
| 295 | + listI.add(resList.iterator()); | |
| 296 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 297 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls", | |
| 298 | + path + "export/路单数据" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 299 | + } catch (Exception e) { | |
| 300 | + e.printStackTrace(); | |
| 301 | + } | |
| 302 | + | |
| 303 | + return resList; | |
| 304 | + } | |
| 217 | 305 | @RequestMapping(value = "/singledataExportTj", method = RequestMethod.GET) |
| 218 | 306 | public List<Map<String, Object>> singledataExportTj(@RequestParam Map<String, Object> map) { |
| 219 | 307 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| ... | ... | @@ -255,6 +343,48 @@ public class ExportController { |
| 255 | 343 | |
| 256 | 344 | return resList; |
| 257 | 345 | } |
| 346 | + | |
| 347 | + @RequestMapping(value = "/singledataExportTj2", method = RequestMethod.GET) | |
| 348 | + public List<Map<String, Object>> singledataExportTj2(@RequestParam Map<String, Object> map) { | |
| 349 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 350 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 351 | + ReportUtils ee = new ReportUtils(); | |
| 352 | + List<Singledata> singledata = formsService.singledatatj2(map); | |
| 353 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 354 | + int i = 1; | |
| 355 | + for (Singledata l : singledata) { | |
| 356 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 357 | + m.put("i", i); | |
| 358 | + m.put("rQ", l.getrQ()); | |
| 359 | + m.put("gS", l.getgS()); | |
| 360 | + m.put("xL", l.getXlmc()); | |
| 361 | + m.put("clzbh", l.getClzbh()); | |
| 362 | + m.put("jsy", l.getJsy()); | |
| 363 | + m.put("jName", l.getjName()); | |
| 364 | + m.put("sgh", l.getSgh()); | |
| 365 | + m.put("sName", l.getsName()); | |
| 366 | + m.put("jhlc", l.getJhlc()); | |
| 367 | + m.put("emptMileage", l.getEmptMileage()); | |
| 368 | + m.put("hyl", l.getHyl()); | |
| 369 | + m.put("jzl", l.getJzl()); | |
| 370 | + m.put("unyyyl", l.getUnyyyl()); | |
| 371 | + m.put("jhjl", l.getJhjl()); | |
| 372 | + resList.add(m); | |
| 373 | + | |
| 374 | + i++; | |
| 375 | + } | |
| 376 | + | |
| 377 | + try { | |
| 378 | + listI.add(resList.iterator()); | |
| 379 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 380 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls", | |
| 381 | + path + "export/路单数据" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 382 | + } catch (Exception e) { | |
| 383 | + e.printStackTrace(); | |
| 384 | + } | |
| 385 | + | |
| 386 | + return resList; | |
| 387 | + } | |
| 258 | 388 | // 车辆加注 |
| 259 | 389 | @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.GET) |
| 260 | 390 | public List<Map<String, Object>> vehicleloadingExport(@RequestParam Map<String, Object> map) { | ... | ... |
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
| ... | ... | @@ -57,6 +57,13 @@ public class MCY_FormsController { |
| 57 | 57 | |
| 58 | 58 | return formsService.shiftuehiclemanth(map); |
| 59 | 59 | } |
| 60 | + | |
| 61 | + // 班次车辆人员月报表 | |
| 62 | + @RequestMapping(value = "/shiftuehiclemanth2", method = RequestMethod.GET) | |
| 63 | + public List<Shiftuehiclemanth> shiftuehiclemanth2(@RequestParam Map<String, Object> map) { | |
| 64 | + | |
| 65 | + return formsService.shiftuehiclemanth2(map); | |
| 66 | + } | |
| 60 | 67 | |
| 61 | 68 | // 班次车辆人员日统计 |
| 62 | 69 | @RequestMapping(value = "/shifday", method = RequestMethod.GET) |
| ... | ... | @@ -80,6 +87,13 @@ public class MCY_FormsController { |
| 80 | 87 | } |
| 81 | 88 | |
| 82 | 89 | // 路单数据 |
| 90 | + @RequestMapping(value = "/singledata2", method = RequestMethod.GET) | |
| 91 | + public List<Singledata> singledata2(@RequestParam Map<String, Object> map) { | |
| 92 | + | |
| 93 | + return formsService.singledata2(map); | |
| 94 | + } | |
| 95 | + | |
| 96 | + // 路单数据 | |
| 83 | 97 | @RequestMapping(value = "/singledatanew", method = RequestMethod.GET) |
| 84 | 98 | public List<Singledata> singledatanew(@RequestParam Map<String, Object> map) { |
| 85 | 99 | |
| ... | ... | @@ -92,6 +106,12 @@ public class MCY_FormsController { |
| 92 | 106 | return formsService.singledatatj(map); |
| 93 | 107 | } |
| 94 | 108 | |
| 109 | + | |
| 110 | + @RequestMapping(value = "/singledatatj2", method = RequestMethod.GET) | |
| 111 | + public List<Singledata> singledatatj2(@RequestParam Map<String, Object> map) { | |
| 112 | + | |
| 113 | + return formsService.singledatatj2(map); | |
| 114 | + } | |
| 95 | 115 | // 车辆加注 |
| 96 | 116 | @RequestMapping(value = "/vehicleloading", method = RequestMethod.GET) |
| 97 | 117 | public List<Vehicleloading> vehicleloading(@RequestParam String line, @RequestParam String data) { | ... | ... |
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
| ... | ... | @@ -4,6 +4,8 @@ import com.alibaba.fastjson.serializer.PropertyFilter; |
| 4 | 4 | import com.bsth.common.ResponseCode; |
| 5 | 5 | import com.bsth.data.BasicData; |
| 6 | 6 | import com.bsth.data.Station2ParkBuffer; |
| 7 | +import com.bsth.data.pinyin.PersionPinYin; | |
| 8 | +import com.bsth.data.pinyin.PersionPinYinBuffer; | |
| 7 | 9 | import com.bsth.entity.Line; |
| 8 | 10 | import com.bsth.entity.realcontrol.StationToPark; |
| 9 | 11 | import com.google.common.base.Splitter; |
| ... | ... | @@ -33,6 +35,9 @@ public class BasicDataController { |
| 33 | 35 | |
| 34 | 36 | @Autowired |
| 35 | 37 | Station2ParkBuffer station2ParkBuffer; |
| 38 | + | |
| 39 | + @Autowired | |
| 40 | + PersionPinYinBuffer persionPinYinBuffer; | |
| 36 | 41 | |
| 37 | 42 | @RequestMapping("/cars") |
| 38 | 43 | public Iterable<String> findAllNbbm(Map<String, Object> map){ |
| ... | ... | @@ -69,6 +74,11 @@ public class BasicDataController { |
| 69 | 74 | rs.put("spy", JSON.parse(JSON.toJSONString(BasicData.spyMap.values(), filter)));*//* |
| 70 | 75 | return rs; |
| 71 | 76 | }*/ |
| 77 | + | |
| 78 | + @RequestMapping(value = "/all_personnel_py", method = RequestMethod.GET) | |
| 79 | + public List<PersionPinYin> findAll_PY(){ | |
| 80 | + return persionPinYinBuffer.getAll(); | |
| 81 | + } | |
| 72 | 82 | |
| 73 | 83 | @RequestMapping("/all_personnel") |
| 74 | 84 | public Map<String, String> all_personnel(){ | ... | ... |
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| ... | ... | @@ -553,7 +553,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 553 | 553 | |
| 554 | 554 | long t = System.currentTimeMillis(); |
| 555 | 555 | if(c != 1) |
| 556 | - t -= (ONE_DAY + (1000 * 60 * 60 * 2)); | |
| 556 | + t -= (ONE_DAY + (1000 * 60 * 60 * 6)); | |
| 557 | 557 | for(int i = 0; i < 3; i ++){ |
| 558 | 558 | rs.add(fmtyyyyMMdd.print(t)); |
| 559 | 559 | t -= ONE_DAY; | ... | ... |
src/main/java/com/bsth/controller/traffic/VehicleInoutStopController.java
| ... | ... | @@ -2,7 +2,10 @@ package com.bsth.controller.traffic; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.controller.BaseController; |
| 4 | 4 | import com.bsth.entity.traffic.VehicleInoutStop; |
| 5 | +import com.bsth.service.impl.TrafficManageServiceImpl; | |
| 5 | 6 | import com.bsth.service.traffic.VehicleInoutStopService; |
| 7 | +import org.slf4j.Logger; | |
| 8 | +import org.slf4j.LoggerFactory; | |
| 6 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | 10 | import org.springframework.data.domain.Page; |
| 8 | 11 | import org.springframework.data.domain.PageImpl; |
| ... | ... | @@ -21,6 +24,7 @@ import java.util.Map; |
| 21 | 24 | @RestController |
| 22 | 25 | @RequestMapping("vehicle_stop") |
| 23 | 26 | public class VehicleInoutStopController extends BaseController<VehicleInoutStop,Integer> { |
| 27 | + Logger logger = LoggerFactory.getLogger(TrafficManageServiceImpl.class); | |
| 24 | 28 | |
| 25 | 29 | @Autowired |
| 26 | 30 | VehicleInoutStopService vehicleInoutStopService; |
| ... | ... | @@ -36,11 +40,18 @@ public class VehicleInoutStopController extends BaseController<VehicleInoutStop, |
| 36 | 40 | public Page<Map<String, Object>> getVehicleInoutStopByParam(@RequestParam Map<String, Object> map, |
| 37 | 41 | @RequestParam(defaultValue = "0") int page, |
| 38 | 42 | @RequestParam(defaultValue = "10") int size) { |
| 39 | - map.put("page",page); | |
| 40 | - map.put("size",size); | |
| 41 | - long total = vehicleInoutStopService.getVehicleInoutStopCountByParam(map); | |
| 42 | - Page<Map<String, Object>> result = new PageImpl<>(vehicleInoutStopService.getVehicleInoutStopByParam(map), | |
| 43 | - new PageRequest(page, size, null),total); | |
| 43 | + Page<Map<String, Object>> result = null; | |
| 44 | + try { | |
| 45 | + map.put("page",page); | |
| 46 | + map.put("size",size); | |
| 47 | + long total = vehicleInoutStopService.getVehicleInoutStopCountByParam(map); | |
| 48 | + result = new PageImpl<>(vehicleInoutStopService.getVehicleInoutStopByParam(map), | |
| 49 | + new PageRequest(page, size, null),total); | |
| 50 | + }catch (Exception e){ | |
| 51 | + logger.error("车载上报停靠站查询出错:",e); | |
| 52 | + e.printStackTrace(); | |
| 53 | + } | |
| 54 | + | |
| 44 | 55 | return result; |
| 45 | 56 | } |
| 46 | 57 | } | ... | ... |
src/main/java/com/bsth/data/directive/GatewayHttpUtils.java
| ... | ... | @@ -46,6 +46,13 @@ public class GatewayHttpUtils { |
| 46 | 46 | |
| 47 | 47 | response = httpClient.execute(post); |
| 48 | 48 | |
| 49 | + int statusCode = response.getStatusLine().getStatusCode(); | |
| 50 | + if(statusCode != 200){ | |
| 51 | + post.abort(); | |
| 52 | + logger.error("http client status code: " + statusCode); | |
| 53 | + return code; | |
| 54 | + } | |
| 55 | + | |
| 49 | 56 | JSONObject json = JSONObject.parseObject(EntityUtils.toString(response.getEntity())); |
| 50 | 57 | if (null != json && json.getInteger("errCode") == 0) |
| 51 | 58 | code = 0; | ... | ... |
src/main/java/com/bsth/data/gpsdata_v2/handlers/OutStationProcess.java
| ... | ... | @@ -116,9 +116,9 @@ public class OutStationProcess { |
| 116 | 116 | LateAdjustHandle.remove(sch); |
| 117 | 117 | |
| 118 | 118 | //发车的时候,同步一下状态 |
| 119 | - if (!gps.isService() && !dayOfSchedule.emptyService(sch)) | |
| 119 | + /*if (!gps.isService() && !dayOfSchedule.emptyService(sch)) | |
| 120 | 120 | gpsStatusManager.changeServiceState(sch.getClZbh(), sch.getXlDir(), 0, "发车@系统"); |
| 121 | - | |
| 121 | +*/ | |
| 122 | 122 | logger.info("车辆:" + sch.getClZbh() + " 班次:" + sch.getDfsj() + "发车, 时间:" + sch.getFcsjActual()); |
| 123 | 123 | } |
| 124 | 124 | ... | ... |
src/main/java/com/bsth/data/safe_driv/SafeDrivCenter.java
| ... | ... | @@ -5,7 +5,6 @@ import org.joda.time.format.DateTimeFormat; |
| 5 | 5 | import org.joda.time.format.DateTimeFormatter; |
| 6 | 6 | import org.springframework.beans.BeansException; |
| 7 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | -import org.springframework.boot.CommandLineRunner; | |
| 9 | 8 | import org.springframework.context.ApplicationContext; |
| 10 | 9 | import org.springframework.context.ApplicationContextAware; |
| 11 | 10 | import org.springframework.stereotype.Component; |
| ... | ... | @@ -20,7 +19,7 @@ import java.util.Set; |
| 20 | 19 | * Created by panzhao on 2017/4/6. |
| 21 | 20 | */ |
| 22 | 21 | @Component |
| 23 | -public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware { | |
| 22 | +public class SafeDrivCenter implements ApplicationContextAware { | |
| 24 | 23 | |
| 25 | 24 | private static Set<SafeDriv> data; |
| 26 | 25 | |
| ... | ... | @@ -65,12 +64,6 @@ public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware |
| 65 | 64 | } |
| 66 | 65 | |
| 67 | 66 | @Override |
| 68 | - public void run(String... strings) throws Exception { | |
| 69 | - //定时加载安全驾驶数据 | |
| 70 | - //Application.mainServices.scheduleWithFixedDelay(safeDrivDataLoadThread, 80, 7, TimeUnit.SECONDS); | |
| 71 | - } | |
| 72 | - | |
| 73 | - @Override | |
| 74 | 67 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { |
| 75 | 68 | sendUtils = applicationContext.getBean(SendUtils.class); |
| 76 | 69 | } | ... | ... |
src/main/java/com/bsth/data/safe_driv/SafeDrivDataLoadThread.java
| ... | ... | @@ -2,6 +2,7 @@ package com.bsth.data.safe_driv; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSON; |
| 4 | 4 | import org.apache.http.HttpEntity; |
| 5 | +import org.apache.http.client.config.RequestConfig; | |
| 5 | 6 | import org.apache.http.client.methods.CloseableHttpResponse; |
| 6 | 7 | import org.apache.http.client.methods.HttpGet; |
| 7 | 8 | import org.apache.http.impl.client.CloseableHttpClient; |
| ... | ... | @@ -21,24 +22,43 @@ import java.util.List; |
| 21 | 22 | @Component |
| 22 | 23 | public class SafeDrivDataLoadThread extends Thread{ |
| 23 | 24 | |
| 24 | - private final static String url = "http://180.166.5.82:9007/bsth-safedriving/Crlcxb/realtimeInterface.do"; | |
| 25 | - | |
| 26 | 25 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 27 | 26 | |
| 27 | + static String url; | |
| 28 | + static CloseableHttpClient httpClient = null; | |
| 29 | + static HttpGet get; | |
| 30 | + static RequestConfig requestConfig; | |
| 31 | + static CloseableHttpResponse response; | |
| 32 | + static HttpEntity entity; | |
| 33 | + static BufferedReader br; | |
| 34 | + | |
| 35 | + static { | |
| 36 | + url = "http://180.166.5.82:9007/bsth-safedriving/Crlcxb/realtimeInterface.do"; | |
| 37 | + httpClient = HttpClients.createDefault(); | |
| 38 | + get = new HttpGet(url); | |
| 39 | + requestConfig = RequestConfig.custom() | |
| 40 | + .setConnectTimeout(2500).setConnectionRequestTimeout(2000) | |
| 41 | + .setSocketTimeout(2500).build(); | |
| 42 | + get.setConfig(requestConfig); | |
| 43 | + } | |
| 44 | + | |
| 28 | 45 | @Override |
| 29 | 46 | public void run() { |
| 30 | - List<SafeDriv> list = null; | |
| 31 | - CloseableHttpClient httpClient = null; | |
| 32 | - CloseableHttpResponse response = null; | |
| 47 | + List<SafeDriv> list; | |
| 33 | 48 | try { |
| 34 | - httpClient = HttpClients.createDefault(); | |
| 35 | - HttpGet get = new HttpGet(url); | |
| 36 | 49 | |
| 37 | 50 | response = httpClient.execute(get); |
| 38 | 51 | |
| 39 | - HttpEntity entity = response.getEntity(); | |
| 52 | + int statusCode = response.getStatusLine().getStatusCode(); | |
| 53 | + if(statusCode != 200){ | |
| 54 | + get.abort(); | |
| 55 | + logger.error("http client status code: " + statusCode); | |
| 56 | + return; | |
| 57 | + } | |
| 58 | + | |
| 59 | + entity = response.getEntity(); | |
| 40 | 60 | if (null != entity) { |
| 41 | - BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent())); | |
| 61 | + br = new BufferedReader(new InputStreamReader(entity.getContent())); | |
| 42 | 62 | StringBuffer stringBuffer = new StringBuffer(); |
| 43 | 63 | String str = ""; |
| 44 | 64 | while ((str = br.readLine()) != null) |
| ... | ... | @@ -46,47 +66,14 @@ public class SafeDrivDataLoadThread extends Thread{ |
| 46 | 66 | |
| 47 | 67 | |
| 48 | 68 | list = JSON.parseArray(stringBuffer.toString(), SafeDriv.class); |
| 49 | - /** | |
| 50 | - * 模拟数据 | |
| 51 | - | |
| 52 | - SafeDriv sd1 = new SafeDriv(); | |
| 53 | - sd1.setYczltype("1"); | |
| 54 | - sd1.setClzbh("W2B-001"); | |
| 55 | - sd1.setStartime("2017-04-07 08:00:00.0"); | |
| 56 | - | |
| 57 | - SafeDriv sd2 = new SafeDriv(); | |
| 58 | - sd2.setYczltype("2"); | |
| 59 | - sd2.setClzbh("W2B-002"); | |
| 60 | - sd2.setStartime("2017-04-07 08:02:00.0"); | |
| 61 | - | |
| 62 | - SafeDriv sd3 = new SafeDriv(); | |
| 63 | - sd3.setYczltype("3"); | |
| 64 | - sd3.setClzbh("W2B-003"); | |
| 65 | - sd3.setStartime("2017-04-07 08:03:00.0"); | |
| 66 | - | |
| 67 | - SafeDriv sd4 = new SafeDriv(); | |
| 68 | - sd4.setYczltype("4"); | |
| 69 | - sd4.setClzbh("W2B-004"); | |
| 70 | - sd4.setStartime("2017-04-07 08:04:00.0"); | |
| 71 | - | |
| 72 | - SafeDriv sd5 = new SafeDriv(); | |
| 73 | - sd5.setYczltype("5"); | |
| 74 | - sd5.setClzbh("W2B-005"); | |
| 75 | - sd5.setStartime("2017-04-07 08:05:00.0"); | |
| 76 | 69 | |
| 77 | - list.add(sd1); | |
| 78 | - list.add(sd2); | |
| 79 | - list.add(sd3); | |
| 80 | - list.add(sd4); | |
| 81 | - list.add(sd5); | |
| 82 | - */ | |
| 83 | 70 | for(SafeDriv sd : list){ |
| 84 | 71 | SafeDrivCenter.put(sd); |
| 85 | 72 | } |
| 86 | 73 | } |
| 87 | 74 | |
| 88 | - httpClient.close(); | |
| 89 | - response.close(); | |
| 75 | + if (null != response) | |
| 76 | + response.close(); | |
| 90 | 77 | } catch (Exception e) { |
| 91 | 78 | logger.error("安全驾驶接口报错了" , e.getMessage()); |
| 92 | 79 | } | ... | ... |
src/main/java/com/bsth/repository/LineRepository.java
| ... | ... | @@ -48,7 +48,7 @@ public interface LineRepository extends BaseRepository<Line, Integer> { |
| 48 | 48 | @Query(value = " SELECT l FROM Line l where l.company like ?1 and l.brancheCompany like ?2 and l.lineCode like ?3") |
| 49 | 49 | public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line); |
| 50 | 50 | |
| 51 | - @Query("SELECT L FROM Line L where L.destroy=0") | |
| 51 | + @Query("SELECT L FROM Line L where L.destroy=0 and L.remove !=1") | |
| 52 | 52 | List<Line> findAllService(); |
| 53 | 53 | |
| 54 | 54 | ... | ... |
src/main/java/com/bsth/service/BusIntervalService.java
src/main/java/com/bsth/service/forms/FormsService.java
| ... | ... | @@ -24,14 +24,19 @@ public interface FormsService { |
| 24 | 24 | public List<Linepasswengerflow> linepasswengerflow(Map<String, Object> map); |
| 25 | 25 | |
| 26 | 26 | public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map); |
| 27 | + public List<Shiftuehiclemanth> shiftuehiclemanth2(Map<String, Object> map); | |
| 27 | 28 | |
| 28 | 29 | public List<Changetochange> changetochange(Map<String, Object> map); |
| 29 | 30 | |
| 30 | 31 | public List<Shifday> shifday(Map<String, Object> map); |
| 31 | 32 | |
| 32 | 33 | public List<Singledata> singledata(Map<String, Object> map); |
| 34 | + public List<Singledata> singledata2(Map<String, Object> map); | |
| 35 | + | |
| 33 | 36 | public List<Singledata> singledatanew(Map<String, Object> map); |
| 34 | 37 | public List<Singledata> singledatatj(Map<String, Object> map); |
| 38 | + public List<Singledata> singledatatj2(Map<String, Object> map); | |
| 39 | + | |
| 35 | 40 | |
| 36 | 41 | public List<Vehicleloading> vehicleloading(String line,String data); |
| 37 | 42 | ... | ... |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| ... | ... | @@ -360,7 +360,7 @@ public class FormsServiceImpl implements FormsService { |
| 360 | 360 | int ljbc=culateMileageService.culateLjbc(list_s,""); |
| 361 | 361 | int sjbc=culateMileageService.culateSjbc(list_s, ""); |
| 362 | 362 | double cjgl=culateMileageService.culateLbgl(sList); |
| 363 | - double zjgl=culateMileageService.culateLjgl(list_s); | |
| 363 | +// double zjgl=culateMileageService.culateLjgl(list_s); | |
| 364 | 364 | d.setEmptMileage(String.valueOf(zksgl));//空驶公里 |
| 365 | 365 | d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 |
| 366 | 366 | d.setSjbc(String.valueOf(sjbc+ljbc)); |
| ... | ... | @@ -368,7 +368,7 @@ public class FormsServiceImpl implements FormsService { |
| 368 | 368 | d.setCjbc(String.valueOf(cjbc));//抽检班次 |
| 369 | 369 | d.setLjbc(String.valueOf(ljbc));//增加班次 |
| 370 | 370 | d.setRemMileage(String.valueOf(cjgl));//抽检里程 |
| 371 | - d.setAddMileage(String.valueOf(zjgl));//增加里程 | |
| 371 | + d.setAddMileage(String.valueOf(ljgl));//增加里程 | |
| 372 | 372 | |
| 373 | 373 | } |
| 374 | 374 | |
| ... | ... | @@ -403,6 +403,191 @@ public class FormsServiceImpl implements FormsService { |
| 403 | 403 | |
| 404 | 404 | return list; |
| 405 | 405 | } |
| 406 | + | |
| 407 | + | |
| 408 | + @Override | |
| 409 | + public List<Shiftuehiclemanth> shiftuehiclemanth2(Map<String, Object> map) { | |
| 410 | + final String empnames=map.get("empnames").toString(); | |
| 411 | + String gsdmManth=""; | |
| 412 | + String fgsdmManth=""; | |
| 413 | + if(map.containsKey("gsdmManth")){ | |
| 414 | + gsdmManth=map.get("gsdmManth").toString(); | |
| 415 | + } | |
| 416 | + if(map.containsKey("fgsdmManth")){ | |
| 417 | + fgsdmManth=map.get("fgsdmManth").toString(); | |
| 418 | + } | |
| 419 | + String sql ="select "; | |
| 420 | + if(empnames.equals("驾驶员")){ | |
| 421 | + sql += " r.j_name,r.j_gh "; | |
| 422 | + }else if(empnames.equals("售票员")){ | |
| 423 | + sql += " r.s_gh,r.s_name"; | |
| 424 | + }else{ | |
| 425 | + sql += " r.cl_zbh"; | |
| 426 | + } | |
| 427 | + sql += " from bsth_c_s_sp_info_real r where " | |
| 428 | + + " r.schedule_date_str >= '" + map.get("startDate").toString() + "' " | |
| 429 | + + " and r.schedule_date_str <='" + map.get("endDate").toString() + "' "; | |
| 430 | + if(map.get("line")!=null&&!map.get("line").equals("")){ | |
| 431 | + sql+=" and r.xl_bm='"+ map.get("line").toString() + "' "; | |
| 432 | + } | |
| 433 | + sql+=" and r.gs_bm like'%"+gsdmManth+"%' and r.fgs_bm like'%"+fgsdmManth+"%'"; | |
| 434 | + | |
| 435 | + if(empnames.equals("驾驶员")){ | |
| 436 | + sql += " GROUP BY " | |
| 437 | + + "r.j_name,r.j_gh"; | |
| 438 | + }else if(empnames.equals("售票员")){ | |
| 439 | + sql+="and r.s_name is not null AND r.s_name !='' GROUP BY r.s_gh,r.s_name"; | |
| 440 | + }else{ | |
| 441 | + sql += " GROUP BY r.cl_zbh"; | |
| 442 | + } | |
| 443 | + | |
| 444 | + List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() { | |
| 445 | + | |
| 446 | + @Override | |
| 447 | + public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 448 | + Shiftuehiclemanth shif = new Shiftuehiclemanth(); | |
| 449 | + if(empnames.equals("驾驶员")){ | |
| 450 | + shif.setjName(arg0.getString("j_name")+"/"+arg0.getString("j_gh")); | |
| 451 | + shif.setJgh(arg0.getString("j_gh")); | |
| 452 | + }else if(empnames.equals("售票员")){ | |
| 453 | + shif.setjName(arg0.getString("s_name")+"/"+arg0.getString("s_gh")); | |
| 454 | + shif.setSgh(arg0.getString("s_gh")==null ? "":arg0.getString("s_gh")); | |
| 455 | + }else if(empnames.equals("车辆自编号")){ | |
| 456 | + shif.setjName(arg0.getString("cl_zbh")); | |
| 457 | + } | |
| 458 | +// shif.setJgh(arg0.getString("j_gh")); | |
| 459 | +// shif.setZbh(arg0.getString("cl_zbh")); | |
| 460 | +// shif.setjName(arg0.getString("s_gh")==null ? "":arg0.getString("s_gh")); | |
| 461 | + return shif; | |
| 462 | + } | |
| 463 | + }); | |
| 464 | + | |
| 465 | + List<ScheduleRealInfo> sList; | |
| 466 | + List<ScheduleRealInfo> list_s; | |
| 467 | + List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineYbb(map.get("line").toString(), map.get("startDate").toString(), map.get("endDate").toString()); | |
| 468 | + for(int i=0;i<list.size();i++){ | |
| 469 | + sList =new ArrayList<ScheduleRealInfo>(); | |
| 470 | + list_s =new ArrayList<ScheduleRealInfo>(); | |
| 471 | + Shiftuehiclemanth d=list.get(i); | |
| 472 | + for (int j = 0; j < lists.size(); j++) { | |
| 473 | + ScheduleRealInfo s=lists.get(j); | |
| 474 | +// if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){ | |
| 475 | +// sList.add(s); | |
| 476 | +// } | |
| 477 | + if(empnames.equals("驾驶员")){ | |
| 478 | + if(d.getJgh().equals(s.getjGh())){ | |
| 479 | + sList.add(s); | |
| 480 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 481 | + if(cts != null && cts.size() > 0){ | |
| 482 | + list_s.add(s); | |
| 483 | + }else{ | |
| 484 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 485 | + list_s.add(s); | |
| 486 | + } | |
| 487 | + } | |
| 488 | + | |
| 489 | + } | |
| 490 | + }else if(empnames.equals("售票员")){ | |
| 491 | + String sgh=s.getsGh()==null?"":s.getsGh(); | |
| 492 | + if(d.getSgh().equals(sgh)){ | |
| 493 | + sList.add(s); | |
| 494 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 495 | + if(cts != null && cts.size() > 0){ | |
| 496 | + list_s.add(s); | |
| 497 | + }else{ | |
| 498 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 499 | + list_s.add(s); | |
| 500 | + } | |
| 501 | + } | |
| 502 | + } | |
| 503 | + }else if(empnames.equals("车辆自编号")){ | |
| 504 | + if(d.getjName().equals(s.getClZbh())){ | |
| 505 | + sList.add(s); | |
| 506 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 507 | + if(cts != null && cts.size() > 0){ | |
| 508 | + list_s.add(s); | |
| 509 | + }else{ | |
| 510 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 511 | + list_s.add(s); | |
| 512 | + } | |
| 513 | + } | |
| 514 | + } | |
| 515 | + } | |
| 516 | + | |
| 517 | + } | |
| 518 | + | |
| 519 | + if(empnames.equals("售票员")){ | |
| 520 | + double zksgl=culateMileageService.culateSjfyylc_spy(list_s); | |
| 521 | + double ljgl=culateMileageService.culateLjgl_spy(list_s); | |
| 522 | + double sjgl=culateMileageService.culateSjgl_spy(list_s); | |
| 523 | + double zyygl=Arith.add(ljgl, sjgl); | |
| 524 | + int cjbc=culateMileageService.culateLbbc(sList); | |
| 525 | + int ljbc=culateMileageService.culateLjbc(list_s,""); | |
| 526 | + int sjbc=culateMileageService.culateSjbc(list_s, ""); | |
| 527 | + double cjgl=culateMileageService.culateLbgl(sList); | |
| 528 | +// double zjgl=culateMileageService.culateLjgl(list_s); | |
| 529 | + d.setEmptMileage(String.valueOf(zksgl));//空驶公里 | |
| 530 | + d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 | |
| 531 | + d.setSjbc(String.valueOf(sjbc+ljbc)); | |
| 532 | + d.setJhlc(String.valueOf(zyygl));//运营里程 | |
| 533 | + d.setCjbc(String.valueOf(cjbc));//抽检班次 | |
| 534 | + d.setLjbc(String.valueOf(ljbc));//增加班次 | |
| 535 | + d.setRemMileage(String.valueOf(cjgl));//抽检里程 | |
| 536 | + d.setAddMileage(String.valueOf(ljgl));//增加里程 | |
| 537 | + }else{ | |
| 538 | + double ksgl=culateMileageService.culateKsgl(list_s); | |
| 539 | + double jccgl=culateMileageService.culateJccgl(list_s); | |
| 540 | + double zksgl=Arith.add(ksgl, jccgl); | |
| 541 | + double ljgl=culateMileageService.culateLjgl(list_s); | |
| 542 | + double sjgl=culateMileageService.culateSjgl(list_s); | |
| 543 | + double zyygl=Arith.add(ljgl, sjgl); | |
| 544 | + int cjbc=culateMileageService.culateLbbc(sList); | |
| 545 | + int ljbc=culateMileageService.culateLjbc(list_s,""); | |
| 546 | + int sjbc=culateMileageService.culateSjbc(list_s, ""); | |
| 547 | + double cjgl=culateMileageService.culateLbgl(sList); | |
| 548 | +// double zjgl=culateMileageService.culateLjgl(list_s); | |
| 549 | + d.setEmptMileage(String.valueOf(zksgl));//空驶公里 | |
| 550 | + d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 | |
| 551 | + d.setSjbc(String.valueOf(sjbc+ljbc)); | |
| 552 | + d.setJhlc(String.valueOf(zyygl));//运营里程 | |
| 553 | + d.setCjbc(String.valueOf(cjbc));//抽检班次 | |
| 554 | + d.setLjbc(String.valueOf(ljbc));//增加班次 | |
| 555 | + d.setRemMileage(String.valueOf(cjgl));//抽检里程 | |
| 556 | + d.setAddMileage(String.valueOf(ljgl));//增加里程 | |
| 557 | + } | |
| 558 | + } | |
| 559 | + | |
| 560 | + Shiftuehiclemanth shif = new Shiftuehiclemanth(); | |
| 561 | + shif.setjName("汇总合计"); | |
| 562 | + BigDecimal yylc = new BigDecimal("0.0"); | |
| 563 | + BigDecimal kslc = new BigDecimal("0.0"); | |
| 564 | + BigDecimal cjlc = new BigDecimal("0.0"); | |
| 565 | + BigDecimal zjlc = new BigDecimal("0.0"); | |
| 566 | + BigDecimal zlc = new BigDecimal("0.0"); | |
| 567 | + int cjbc = 0, zjbc = 0, sjbc = 0; | |
| 568 | + for(Shiftuehiclemanth s : list){ | |
| 569 | + yylc = yylc.add(new BigDecimal(s.getJhlc())); | |
| 570 | + kslc = kslc.add(new BigDecimal(s.getEmptMileage())); | |
| 571 | + cjlc = cjlc.add(new BigDecimal(s.getRemMileage())); | |
| 572 | + zjlc = zjlc.add(new BigDecimal(s.getAddMileage())); | |
| 573 | + zlc = zlc.add(new BigDecimal(s.getTotalm())); | |
| 574 | + cjbc += Integer.valueOf(s.getCjbc()); | |
| 575 | + zjbc += Integer.valueOf(s.getLjbc()); | |
| 576 | + sjbc += Integer.valueOf(s.getSjbc()); | |
| 577 | + } | |
| 578 | + shif.setJhlc(yylc.toString()); | |
| 579 | + shif.setEmptMileage(kslc.toString()); | |
| 580 | + shif.setRemMileage(cjlc.toString()); | |
| 581 | + shif.setAddMileage(zjlc.toString()); | |
| 582 | + shif.setTotalm(zlc.toString()); | |
| 583 | + shif.setCjbc("" + cjbc); | |
| 584 | + shif.setLjbc("" + zjbc); | |
| 585 | + shif.setSjbc("" + sjbc); | |
| 586 | + if(list.size() > 0) | |
| 587 | + list.add(shif); | |
| 588 | + | |
| 589 | + return list; | |
| 590 | + } | |
| 406 | 591 | |
| 407 | 592 | // 班次车辆人员日统计 |
| 408 | 593 | @Override |
| ... | ... | @@ -603,38 +788,290 @@ public class FormsServiceImpl implements FormsService { |
| 603 | 788 | sql += " and gs= '"+gs+"' and fgs= '"+fgs+"'"; |
| 604 | 789 | } |
| 605 | 790 | |
| 606 | - sql +=" order by rq"; | |
| 607 | - List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() { | |
| 608 | - | |
| 609 | - | |
| 610 | - @Override | |
| 611 | - public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 612 | - Changetochange chan = new Changetochange(); | |
| 613 | - chan.setRq(arg0.getString("rq")); | |
| 614 | - chan.setGs(BasicData.businessCodeNameMap.get(arg0.getString("gs"))); | |
| 615 | - chan.setFgs(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs")+"_"+arg0.getString("gs"))); | |
| 616 | - chan.setXl(BasicData.lineCode2NameMap.get(arg0.getString("xl"))); | |
| 617 | - chan.setLp(arg0.getString("lp")); | |
| 618 | - chan.setFssj(arg0.getString("fssj")); | |
| 619 | - chan.setXgsj(arg0.getString("xgsj")); | |
| 620 | - chan.setPcch(arg0.getString("pcch")); | |
| 621 | - chan.setPcry(arg0.getString("pcry")); | |
| 622 | - chan.setJhch(arg0.getString("jhch")); | |
| 623 | - chan.setJhgh(arg0.getString("jhgh")); | |
| 624 | - chan.setSjch(arg0.getString("sjch")); | |
| 625 | - chan.setSjgh(arg0.getString("sjgh")); | |
| 626 | - chan.setYy(arg0.getString("yy")); | |
| 627 | - chan.setXgr(arg0.getString("xgr")); | |
| 628 | - return chan; | |
| 629 | - } | |
| 630 | - }); | |
| 631 | - return list; | |
| 632 | - } | |
| 633 | - | |
| 634 | - | |
| 635 | - // 路单数据 | |
| 791 | + sql +=" order by rq"; | |
| 792 | + List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() { | |
| 793 | + | |
| 794 | + | |
| 795 | + @Override | |
| 796 | + public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 797 | + Changetochange chan = new Changetochange(); | |
| 798 | + chan.setRq(arg0.getString("rq")); | |
| 799 | + chan.setGs(BasicData.businessCodeNameMap.get(arg0.getString("gs"))); | |
| 800 | + chan.setFgs(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs")+"_"+arg0.getString("gs"))); | |
| 801 | + chan.setXl(BasicData.lineCode2NameMap.get(arg0.getString("xl"))); | |
| 802 | + chan.setLp(arg0.getString("lp")); | |
| 803 | + chan.setFssj(arg0.getString("fssj")); | |
| 804 | + chan.setXgsj(arg0.getString("xgsj")); | |
| 805 | + chan.setPcch(arg0.getString("pcch")); | |
| 806 | + chan.setPcry(arg0.getString("pcry")); | |
| 807 | + chan.setJhch(arg0.getString("jhch")); | |
| 808 | + chan.setJhgh(arg0.getString("jhgh")); | |
| 809 | + chan.setSjch(arg0.getString("sjch")); | |
| 810 | + chan.setSjgh(arg0.getString("sjgh")); | |
| 811 | + chan.setYy(arg0.getString("yy")); | |
| 812 | + chan.setXgr(arg0.getString("xgr")); | |
| 813 | + return chan; | |
| 814 | + } | |
| 815 | + }); | |
| 816 | + return list; | |
| 817 | + } | |
| 818 | + | |
| 819 | + | |
| 820 | + // 路单数据 | |
| 821 | + @Override | |
| 822 | + public List<Singledata> singledatatj(Map<String, Object> map) { | |
| 823 | + String gsdm=""; | |
| 824 | + if(map.get("gsdmSing")!=null){ | |
| 825 | + gsdm=map.get("gsdmSing").toString(); | |
| 826 | + } | |
| 827 | + String fgsdm=""; | |
| 828 | + if(map.get("fgsdmSing")!=null){ | |
| 829 | + fgsdm=map.get("fgsdmSing").toString(); | |
| 830 | + } | |
| 831 | + | |
| 832 | + String tjtype=map.get("tjtype").toString(); | |
| 833 | + String xlbm=map.get("line").toString().trim(); | |
| 834 | + startDate = map.get("startDate").toString(); | |
| 835 | + | |
| 836 | + List<ScheduleRealInfo> listReal=new ArrayList<ScheduleRealInfo>(); | |
| 837 | + if(xlbm.equals("")){ | |
| 838 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineByGs_(gsdm, fgsdm, startDate); | |
| 839 | + }else{ | |
| 840 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineQp(xlbm, startDate); | |
| 841 | + } | |
| 842 | + List<Singledata> list=new ArrayList<Singledata>(); | |
| 843 | + List<Singledata> list_=new ArrayList<Singledata>(); | |
| 844 | + if(tjtype.equals("jsy")){ | |
| 845 | + //油统计 | |
| 846 | + String sql="select r.j_gh, r.xl_bm,r.cl_zbh,r.j_name" | |
| 847 | + + " from bsth_c_s_sp_info_real r where " | |
| 848 | + + " r.schedule_date_str = '"+startDate+"'"; | |
| 849 | + if(xlbm.equals("")){ | |
| 850 | + sql +="and r.gs_bm='"+gsdm+"' " | |
| 851 | + + " and r.fgs_bm='"+fgsdm+"'"; | |
| 852 | + }else{ | |
| 853 | + sql += " and r.xl_bm = '"+xlbm+"'"; | |
| 854 | + } | |
| 855 | + sql += " group by r.j_gh,r.xl_bm,r.cl_zbh,r.j_name order by r.xl_bm,r.cl_zbh"; | |
| 856 | + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | |
| 857 | + @Override | |
| 858 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 859 | + Singledata sin = new Singledata(); | |
| 860 | + sin.setxL(arg0.getString("xl_bm")); | |
| 861 | + sin.setJsy(arg0.getString("j_gh")); | |
| 862 | + sin.setjName(arg0.getString("j_name")); | |
| 863 | + sin.setClzbh(arg0.getString("cl_zbh")); | |
| 864 | + return sin; | |
| 865 | + } | |
| 866 | + }); | |
| 867 | + String linesql=""; | |
| 868 | + if(!xlbm.equals("")){ | |
| 869 | + linesql +=" and xlbm ='"+xlbm+"' "; | |
| 870 | + } | |
| 871 | + String nysql="SELECT id,xlbm,nbbm, jsy,jzl as jzl,yh as yh,sh as sh FROM bsth_c_ylb " | |
| 872 | + + " WHERE rq = '"+startDate+"'" | |
| 873 | + + " AND ssgsdm = '"+gsdm+"' AND fgsdm = '"+fgsdm+"'" +linesql | |
| 874 | + + " union" | |
| 875 | + + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh FROM bsth_c_dlb" | |
| 876 | + + " WHERE rq = '"+startDate+"'" | |
| 877 | + + " AND ssgsdm = '"+gsdm+"' AND fgsdm = '"+fgsdm+"'"+linesql; | |
| 878 | + List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() { | |
| 879 | + @Override | |
| 880 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 881 | + Singledata sin = new Singledata(); | |
| 882 | + sin.setxL(arg0.getString("xlbm")); | |
| 883 | + sin.setJsy(arg0.getString("jsy")); | |
| 884 | + sin.setClzbh(arg0.getString("nbbm")); | |
| 885 | + sin.setJzl(arg0.getString("jzl")); | |
| 886 | + sin.setHyl(arg0.getString("yh")); | |
| 887 | + sin.setUnyyyl(arg0.getString("sh")); | |
| 888 | + return sin; | |
| 889 | + } | |
| 890 | + }); | |
| 891 | + //统计油,电表中手动添加的或者有加注没里程的数据 | |
| 892 | + for (int i = 0; i < listNy.size(); i++) { | |
| 893 | + Singledata sin_=listNy.get(i); | |
| 894 | + String jsy=sin_.getJsy(); | |
| 895 | + String line=sin_.getxL(); | |
| 896 | + String clzbh=sin_.getClzbh(); | |
| 897 | + boolean fages=true; | |
| 898 | + for (int j = 0; j < list.size(); j++) { | |
| 899 | + Singledata sin=list.get(j); | |
| 900 | + String jsy_=sin.getJsy(); | |
| 901 | + String line_=sin.getxL(); | |
| 902 | + String clzbh_=sin.getClzbh(); | |
| 903 | + if(jsy.equals(jsy_) | |
| 904 | + &&line.equals(line_) | |
| 905 | + &&clzbh.equals(clzbh_)){ | |
| 906 | + fages=false; | |
| 907 | + } | |
| 908 | + } | |
| 909 | + if(fages){ | |
| 910 | + Singledata s=new Singledata(); | |
| 911 | + s.setJsy(jsy); | |
| 912 | + s.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 913 | + s.setClzbh(clzbh); | |
| 914 | + s.setSgh(""); | |
| 915 | + s.setsName(""); | |
| 916 | + s.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 917 | + s.setxL(line); | |
| 918 | + s.setXlmc(BasicData.lineCode2NameMap.get(line)); | |
| 919 | + s.setJzl(sin_.getJzl()); | |
| 920 | + s.setHyl(sin_.getHyl()); | |
| 921 | + s.setUnyyyl(sin_.getUnyyyl()); | |
| 922 | + s.setJhlc("0.0"); | |
| 923 | + s.setEmptMileage("0.0"); | |
| 924 | + s.setJhjl("0.0"); | |
| 925 | + s.setrQ(startDate); | |
| 926 | + list_.add(s); | |
| 927 | + } | |
| 928 | + } | |
| 929 | + for (int i= 0; i < list.size(); i++) { | |
| 930 | + Singledata sin=list.get(i); | |
| 931 | + String jsy=sin.getJsy(); | |
| 932 | + String line=sin.getxL(); | |
| 933 | + String clzbh=sin.getClzbh(); | |
| 934 | + double jzl=0.0; | |
| 935 | + double yh=0.0; | |
| 936 | + double sh=0.0; | |
| 937 | + for (int j = 0; j < listNy.size(); j++) { | |
| 938 | + Singledata y=listNy.get(j); | |
| 939 | + if(y.getJsy().equals(jsy) | |
| 940 | + &&y.getClzbh().equals(clzbh) | |
| 941 | + &&y.getxL().equals(line)){ | |
| 942 | + jzl=Arith.add(jzl, y.getJzl()); | |
| 943 | + yh=Arith.add(yh, y.getHyl()); | |
| 944 | + sh=Arith.add(sh, y.getUnyyyl()); | |
| 945 | + } | |
| 946 | + } | |
| 947 | + sin.setHyl(String.valueOf(yh)); | |
| 948 | + sin.setJzl(String.valueOf(jzl)); | |
| 949 | + sin.setUnyyyl(String.valueOf(sh)); | |
| 950 | + | |
| 951 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 952 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 953 | + for (int j = 0; j < listReal.size(); j++) { | |
| 954 | + ScheduleRealInfo s=listReal.get(j); | |
| 955 | + if(s.getjGh().equals(jsy) | |
| 956 | + && s.getClZbh().equals(clzbh) | |
| 957 | + &&s.getXlBm().equals(line)){ | |
| 958 | + newList.add(s); | |
| 959 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 960 | + if(cts != null && cts.size() > 0){ | |
| 961 | + newList_.add(s); | |
| 962 | + }else{ | |
| 963 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 964 | + newList_.add(s); | |
| 965 | + } | |
| 966 | + } | |
| 967 | + } | |
| 968 | + } | |
| 969 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 970 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 971 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 972 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 973 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 974 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 975 | + | |
| 976 | + double zyygl=Arith.add(yygl, ljgl); | |
| 977 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 978 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 979 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 980 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 981 | + sin.setXlmc(BasicData.lineCode2NameMap.get(line)); | |
| 982 | + sin.setrQ(startDate); | |
| 983 | +// sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 984 | + sin.setSgh(""); | |
| 985 | + sin.setsName(""); | |
| 986 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 987 | + list_.add(sin); | |
| 988 | + | |
| 989 | + } | |
| 990 | + Collections.sort(list_,new SingledataByXlbm()); | |
| 991 | + }else{ | |
| 992 | + String sql="select r.s_gh,r.s_name, " | |
| 993 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm" | |
| 994 | + + " from bsth_c_s_sp_info_real r where " | |
| 995 | + + " r.schedule_date_str = '"+startDate+"'" | |
| 996 | + + " and r.s_gh !='' and r.s_gh is not null "; | |
| 997 | + if(xlbm.equals("")){ | |
| 998 | + sql +="and r.gs_bm='"+gsdm+"' " | |
| 999 | + + " and r.fgs_bm='"+fgsdm+"'"; | |
| 1000 | + }else{ | |
| 1001 | + sql += " and r.xl_bm = '"+xlbm+"'"; | |
| 1002 | + } | |
| 1003 | + sql += " group by r.s_gh,r.s_name," | |
| 1004 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | |
| 1005 | + | |
| 1006 | + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | |
| 1007 | + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 1008 | + @Override | |
| 1009 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 1010 | + Singledata sin = new Singledata(); | |
| 1011 | + sin.setrQ(startDate); | |
| 1012 | + sin.setxL(arg0.getString("xl_bm")); | |
| 1013 | + sin.setClzbh(arg0.getString("cl_zbh")); | |
| 1014 | + sin.setSgh(arg0.getString("s_gh")); | |
| 1015 | + sin.setsName(arg0.getString("s_name")); | |
| 1016 | + return sin; | |
| 1017 | + } | |
| 1018 | + }); | |
| 1019 | + | |
| 1020 | + for (int i = 0; i < list.size(); i++) { | |
| 1021 | + Singledata sin=list.get(i); | |
| 1022 | + String jsy=sin.getSgh(); | |
| 1023 | + String line=sin.getxL(); | |
| 1024 | + String clzbh=sin.getClzbh(); | |
| 1025 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 1026 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 1027 | + | |
| 1028 | + for (int j = 0; j < listReal.size(); j++) { | |
| 1029 | + ScheduleRealInfo s=listReal.get(j); | |
| 1030 | + if(s.getsGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 1031 | + &&s.getXlBm().equals(line)){ | |
| 1032 | + newList.add(s); | |
| 1033 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 1034 | + if(cts != null && cts.size() > 0){ | |
| 1035 | + newList_.add(s); | |
| 1036 | + }else{ | |
| 1037 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 1038 | + newList_.add(s); | |
| 1039 | + } | |
| 1040 | + } | |
| 1041 | + } | |
| 1042 | + } | |
| 1043 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 1044 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 1045 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 1046 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 1047 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 1048 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 1049 | + | |
| 1050 | + double zyygl=Arith.add(yygl, ljgl); | |
| 1051 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 1052 | + | |
| 1053 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 1054 | + | |
| 1055 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 1056 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 1057 | + sin.setXlmc(BasicData.lineCode2NameMap.get(line)); | |
| 1058 | + sin.setClzbh(clzbh); | |
| 1059 | + sin.setJsy(""); | |
| 1060 | + sin.setjName(""); | |
| 1061 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 1062 | + sin.setHyl(""); | |
| 1063 | + sin.setJzl(""); | |
| 1064 | + sin.setUnyyyl(""); | |
| 1065 | + list_.add(sin); | |
| 1066 | + } | |
| 1067 | + Collections.sort(list_,new SingledataByXlbm()); | |
| 1068 | + } | |
| 1069 | + return list_; | |
| 1070 | + } | |
| 1071 | + | |
| 1072 | + | |
| 636 | 1073 | @Override |
| 637 | - public List<Singledata> singledatatj(Map<String, Object> map) { | |
| 1074 | + public List<Singledata> singledatatj2(Map<String, Object> map) { | |
| 638 | 1075 | String gsdm=""; |
| 639 | 1076 | if(map.get("gsdmSing")!=null){ |
| 640 | 1077 | gsdm=map.get("gsdmSing").toString(); |
| ... | ... | @@ -857,14 +1294,17 @@ public class FormsServiceImpl implements FormsService { |
| 857 | 1294 | } |
| 858 | 1295 | double jhgl=culateMileageService.culateJhgl(newList); |
| 859 | 1296 | double jhjcc=culateMileageService.culateJhJccgl(newList); |
| 860 | - double yygl=culateMileageService.culateSjgl(newList_); | |
| 861 | - double ljgl=culateMileageService.culateLjgl(newList_); | |
| 862 | - double ksgl=culateMileageService.culateKsgl(newList_); | |
| 863 | - double jcgl=culateMileageService.culateJccgl(newList_); | |
| 1297 | +// double yygl=culateMileageService.culateSjgl(newList_); | |
| 1298 | +// double ljgl=culateMileageService.culateLjgl(newList_); | |
| 1299 | +// double ksgl=culateMileageService.culateKsgl(newList_); | |
| 1300 | +// double jcgl=culateMileageService.culateJccgl(newList_); | |
| 864 | 1301 | |
| 865 | - double zyygl=Arith.add(yygl, ljgl); | |
| 866 | - double zksgl=Arith.add(ksgl, jcgl); | |
| 1302 | + double yygl=culateMileageService.culateSjgl_spy(newList_); | |
| 1303 | + double ljgl=culateMileageService.culateLjgl_spy(newList_); | |
| 867 | 1304 | |
| 1305 | + double zyygl=Arith.add(yygl, ljgl); | |
| 1306 | +// double zksgl=Arith.add(ksgl, jcgl); | |
| 1307 | + double zksgl=culateMileageService.culateSjfyylc_spy(newList_); | |
| 868 | 1308 | sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); |
| 869 | 1309 | |
| 870 | 1310 | sin.setEmptMileage(String.valueOf(zksgl)); |
| ... | ... | @@ -1562,6 +2002,284 @@ public class FormsServiceImpl implements FormsService { |
| 1562 | 2002 | } |
| 1563 | 2003 | return list; |
| 1564 | 2004 | } |
| 2005 | + | |
| 2006 | + | |
| 2007 | + // 路单数据 | |
| 2008 | + @Override | |
| 2009 | + public List<Singledata> singledata2(Map<String, Object> map) { | |
| 2010 | + | |
| 2011 | + String gsdm=""; | |
| 2012 | + if(map.get("gsdmSing")!=null){ | |
| 2013 | + gsdm=map.get("gsdmSing").toString(); | |
| 2014 | + } | |
| 2015 | + String fgsdm=""; | |
| 2016 | + if(map.get("fgsdmSing")!=null){ | |
| 2017 | + fgsdm=map.get("fgsdmSing").toString(); | |
| 2018 | + } | |
| 2019 | + | |
| 2020 | + String tjtype=map.get("tjtype").toString(); | |
| 2021 | + String xlbm=map.get("line").toString().trim(); | |
| 2022 | + startDate = map.get("startDate").toString(); | |
| 2023 | + | |
| 2024 | + List<ScheduleRealInfo> listReal=new ArrayList<ScheduleRealInfo>(); | |
| 2025 | + if(xlbm.equals("")){ | |
| 2026 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineByGs_(gsdm, fgsdm, startDate); | |
| 2027 | + }else{ | |
| 2028 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineQp(xlbm, startDate); | |
| 2029 | + } | |
| 2030 | + List<Singledata> list=new ArrayList<Singledata>(); | |
| 2031 | + List<Singledata> listY=new ArrayList<Singledata>(); | |
| 2032 | + List<Singledata> listD=new ArrayList<Singledata>(); | |
| 2033 | + | |
| 2034 | + if(tjtype.equals("jsy")){ | |
| 2035 | + DecimalFormat df = new DecimalFormat("0.00"); | |
| 2036 | + List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | |
| 2037 | + for (int i = 0; i < listYlb.size(); i++) { | |
| 2038 | + Ylb y=listYlb.get(i); | |
| 2039 | + boolean fage=false; | |
| 2040 | + if(xlbm.equals("")){ | |
| 2041 | + fage=true; | |
| 2042 | + }else{ | |
| 2043 | + if(xlbm.equals(y.getXlbm())){ | |
| 2044 | + fage=true; | |
| 2045 | + } | |
| 2046 | + } | |
| 2047 | + if(fage){ | |
| 2048 | + String jsy=y.getJsy(); | |
| 2049 | + String line=y.getXlbm(); | |
| 2050 | + String clzbh=y.getNbbm(); | |
| 2051 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 2052 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 2053 | + for (int j = 0; j < listReal.size(); j++) { | |
| 2054 | + ScheduleRealInfo s=listReal.get(j); | |
| 2055 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 2056 | + &&s.getXlBm().equals(line)){ | |
| 2057 | + if(y.getLp()==null){ | |
| 2058 | + newList.add(s); | |
| 2059 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 2060 | + if(cts != null && cts.size() > 0){ | |
| 2061 | + newList_.add(s); | |
| 2062 | + }else{ | |
| 2063 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 2064 | + newList_.add(s); | |
| 2065 | + } | |
| 2066 | + } | |
| 2067 | + }else{ | |
| 2068 | + if(y.getLp().equals(s.getLpName())){ | |
| 2069 | + newList.add(s); | |
| 2070 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 2071 | + if(cts != null && cts.size() > 0){ | |
| 2072 | + newList_.add(s); | |
| 2073 | + }else{ | |
| 2074 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 2075 | + newList_.add(s); | |
| 2076 | + } | |
| 2077 | + } | |
| 2078 | + } | |
| 2079 | + } | |
| 2080 | + } | |
| 2081 | + } | |
| 2082 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 2083 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 2084 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 2085 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 2086 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 2087 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 2088 | + | |
| 2089 | + double zyygl=Arith.add(yygl, ljgl); | |
| 2090 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 2091 | + | |
| 2092 | + Singledata sin=new Singledata(); | |
| 2093 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 2094 | + | |
| 2095 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 2096 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 2097 | + sin.setxL(y.getXlbm()); | |
| 2098 | + sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm())); | |
| 2099 | + sin.setClzbh(clzbh); | |
| 2100 | + sin.setJsy(jsy); | |
| 2101 | + sin.setrQ(startDate); | |
| 2102 | + if(newList.size()>0){ | |
| 2103 | + sin.setjName(newList.get(0).getjName()); | |
| 2104 | + }else{ | |
| 2105 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 2106 | + } | |
| 2107 | + sin.setSgh(""); | |
| 2108 | + sin.setsName(""); | |
| 2109 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 2110 | + sin.setHyl(df.format(y.getYh())); | |
| 2111 | + sin.setJzl(df.format(y.getJzl())); | |
| 2112 | + sin.setUnyyyl(df.format(y.getSh())); | |
| 2113 | + listY.add(sin); | |
| 2114 | + } | |
| 2115 | + | |
| 2116 | + } | |
| 2117 | + | |
| 2118 | + List<Dlb> listDlb= dlbRepository.obtainDl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | |
| 2119 | + for (int i = 0; i < listDlb.size(); i++) { | |
| 2120 | + Dlb y=listDlb.get(i); | |
| 2121 | + boolean fage=false; | |
| 2122 | + if(xlbm.equals("")){ | |
| 2123 | + fage=true; | |
| 2124 | + }else{ | |
| 2125 | + if(xlbm.equals(y.getXlbm())){ | |
| 2126 | + fage=true; | |
| 2127 | + } | |
| 2128 | + } | |
| 2129 | + if(fage){ | |
| 2130 | + String jsy=y.getJsy(); | |
| 2131 | + String line=y.getXlbm(); | |
| 2132 | + String clzbh=y.getNbbm(); | |
| 2133 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 2134 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 2135 | + for (int j = 0; j < listReal.size(); j++) { | |
| 2136 | + ScheduleRealInfo s=listReal.get(j); | |
| 2137 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 2138 | + &&s.getXlBm().equals(line)){ | |
| 2139 | + if(y.getLp()==null){ | |
| 2140 | + newList.add(s); | |
| 2141 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 2142 | + if(cts != null && cts.size() > 0){ | |
| 2143 | + newList_.add(s); | |
| 2144 | + }else{ | |
| 2145 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 2146 | + newList_.add(s); | |
| 2147 | + } | |
| 2148 | + } | |
| 2149 | + }else{ | |
| 2150 | + if(y.getLp().equals(s.getLpName())){ | |
| 2151 | + newList.add(s); | |
| 2152 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 2153 | + if(cts != null && cts.size() > 0){ | |
| 2154 | + newList_.add(s); | |
| 2155 | + }else{ | |
| 2156 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 2157 | + newList_.add(s); | |
| 2158 | + } | |
| 2159 | + } | |
| 2160 | + } | |
| 2161 | + } | |
| 2162 | + } | |
| 2163 | + } | |
| 2164 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 2165 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 2166 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 2167 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 2168 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 2169 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 2170 | + | |
| 2171 | + double zyygl=Arith.add(yygl, ljgl); | |
| 2172 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 2173 | + | |
| 2174 | + Singledata sin=new Singledata(); | |
| 2175 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 2176 | + | |
| 2177 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 2178 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 2179 | + sin.setxL(y.getXlbm()); | |
| 2180 | + sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm())); | |
| 2181 | + sin.setClzbh(clzbh); | |
| 2182 | + sin.setJsy(jsy); | |
| 2183 | + sin.setrQ(startDate); | |
| 2184 | + if(newList.size()>0){ | |
| 2185 | + sin.setjName(newList.get(0).getjName()); | |
| 2186 | + }else{ | |
| 2187 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 2188 | + } | |
| 2189 | + sin.setSgh(""); | |
| 2190 | + sin.setsName(""); | |
| 2191 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 2192 | + sin.setHyl(df.format(y.getHd())); | |
| 2193 | + sin.setJzl(df.format(y.getCdl())); | |
| 2194 | + sin.setUnyyyl(df.format(y.getSh())); | |
| 2195 | + listD.add(sin); | |
| 2196 | + } | |
| 2197 | + } | |
| 2198 | + | |
| 2199 | + Collections.sort(listY,new SingledataByXlbm()); | |
| 2200 | + Collections.sort(listD,new SingledataByXlbm()); | |
| 2201 | + list.addAll(listY); | |
| 2202 | + list.addAll(listD); | |
| 2203 | + }else{ | |
| 2204 | + String sql="select r.s_gh,r.s_name, " | |
| 2205 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm" | |
| 2206 | + + " from bsth_c_s_sp_info_real r where " | |
| 2207 | + + " r.schedule_date_str = '"+startDate+"'" | |
| 2208 | + + " and r.s_gh !='' and r.s_gh is not null "; | |
| 2209 | + if(xlbm.equals("")){ | |
| 2210 | + sql +="and r.gs_bm='"+gsdm+"' " | |
| 2211 | + + " and r.fgs_bm='"+fgsdm+"'"; | |
| 2212 | + }else{ | |
| 2213 | + sql += " and r.xl_bm = '"+xlbm+"'"; | |
| 2214 | + } | |
| 2215 | + sql += " group by r.s_gh,r.s_name," | |
| 2216 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | |
| 2217 | + | |
| 2218 | + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | |
| 2219 | + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 2220 | + @Override | |
| 2221 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 2222 | + Singledata sin = new Singledata(); | |
| 2223 | + sin.setrQ(startDate); | |
| 2224 | + sin.setxL(arg0.getString("xl_bm")); | |
| 2225 | + sin.setClzbh(arg0.getString("cl_zbh")); | |
| 2226 | + sin.setSgh(arg0.getString("s_gh")); | |
| 2227 | + sin.setsName(arg0.getString("s_name")); | |
| 2228 | + return sin; | |
| 2229 | + } | |
| 2230 | + }); | |
| 2231 | + | |
| 2232 | + for (int i = 0; i < list.size(); i++) { | |
| 2233 | + Singledata sin=list.get(i); | |
| 2234 | + String jsy=sin.getSgh(); | |
| 2235 | + String line=sin.getxL(); | |
| 2236 | + String clzbh=sin.getClzbh(); | |
| 2237 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 2238 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 2239 | + | |
| 2240 | + for (int j = 0; j < listReal.size(); j++) { | |
| 2241 | + ScheduleRealInfo s=listReal.get(j); | |
| 2242 | + if(s.getsGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 2243 | + &&s.getXlBm().equals(line)){ | |
| 2244 | + newList.add(s); | |
| 2245 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 2246 | + if(cts != null && cts.size() > 0){ | |
| 2247 | + newList_.add(s); | |
| 2248 | + }else{ | |
| 2249 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 2250 | + newList_.add(s); | |
| 2251 | + } | |
| 2252 | + } | |
| 2253 | + } | |
| 2254 | + } | |
| 2255 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 2256 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 2257 | +// double yygl=culateMileageService.culateSjgl(newList_); | |
| 2258 | +// double ljgl=culateMileageService.culateLjgl(newList_); | |
| 2259 | +// double ksgl=culateMileageService.culateKsgl(newList_); | |
| 2260 | +// double jcgl=culateMileageService.culateJccgl(newList_); | |
| 2261 | + double yygl=culateMileageService.culateSjgl_spy(newList_); | |
| 2262 | + double ljgl=culateMileageService.culateLjgl_spy(newList_); | |
| 2263 | + double zyygl=Arith.add(yygl, ljgl); | |
| 2264 | +// double zksgl=Arith.add(ksgl, jcgl); | |
| 2265 | + double zksgl=culateMileageService.culateSjfyylc_spy(newList_); | |
| 2266 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 2267 | + | |
| 2268 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 2269 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 2270 | + sin.setXlmc(BasicData.lineCode2NameMap.get(line)); | |
| 2271 | + sin.setClzbh(clzbh); | |
| 2272 | + sin.setJsy(""); | |
| 2273 | + sin.setjName(""); | |
| 2274 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 2275 | + sin.setHyl(""); | |
| 2276 | + sin.setJzl(""); | |
| 2277 | + sin.setUnyyyl(""); | |
| 2278 | + } | |
| 2279 | + Collections.sort(list,new SingledataByXlbm()); | |
| 2280 | + } | |
| 2281 | + return list; | |
| 2282 | + } | |
| 1565 | 2283 | |
| 1566 | 2284 | // 运营服务阶段报表 |
| 1567 | 2285 | @Override | ... | ... |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| ... | ... | @@ -188,25 +188,9 @@ public class GpsServiceImpl implements GpsService { |
| 188 | 188 | String nbbm = nbbmArray[0]; |
| 189 | 189 | |
| 190 | 190 | List<DeviceChange> dcs = findDeviceChangeLogs(nbbm, et, st); |
| 191 | - //没有设备变更记录,则参考车辆信息上的设备号 | |
| 192 | - if(null == dcs || dcs.size() == 0){ | |
| 193 | - DeviceChange dc = new DeviceChange(); | |
| 194 | - dc.setNbbm(nbbm); | |
| 195 | - dc.setDevice(BasicData.deviceId2NbbmMap.inverse().get(nbbm)); | |
| 196 | - dc.setSt(st); | |
| 197 | - dc.setEt(et); | |
| 198 | - dc.setType(1); | |
| 199 | - | |
| 200 | - dcs.add(dc); | |
| 201 | - } | |
| 202 | - | |
| 203 | - //bsth_c_gps_info | |
| 204 | - String tableName = "bsth_c_gps_info"; | |
| 205 | - String sYear = fmtyyyy.print(st), | |
| 206 | - currYear = fmtyyyy.print(System.currentTimeMillis()); | |
| 207 | 191 | |
| 208 | - if(!sYear.equals(currYear)) | |
| 209 | - tableName += "_" + sYear; | |
| 192 | + //按年分表 | |
| 193 | + String tableName = "bsth_c_gps_info_" + fmtyyyy.print(st); | |
| 210 | 194 | |
| 211 | 195 | StringBuilder sql = new StringBuilder(""); |
| 212 | 196 | long t1,t2; |
| ... | ... | @@ -217,11 +201,11 @@ public class GpsServiceImpl implements GpsService { |
| 217 | 201 | dc = dcs.get(i); |
| 218 | 202 | if(dc.getSt() > st) |
| 219 | 203 | t1 = dc.getSt(); |
| 220 | - if(dc.getEt() < et) | |
| 204 | + if(dc.getEt() < et && dc.getEt()!=0) | |
| 221 | 205 | t2 = dc.getEt(); |
| 222 | 206 | |
| 223 | 207 | sql.append("select DEVICE_ID,LON,LAT,TS,INOUT_STOP,SERVICE_STATE ,STOP_NO,DIRECTION,LINE_ID,SPEED_GPS,SECTION_CODE from "+tableName+" where days_year in ("+sDayOfYear+","+eDayOfYear+") " + |
| 224 | - " and device_id='"+dc.getDevice()+"' and ts > "+t1+" and ts < "+t2+" "); | |
| 208 | + " and device_id='"+dc.getDevice()+"' and ts >= "+t1+" and ts <= "+t2+" "); | |
| 225 | 209 | |
| 226 | 210 | if(i == len - 1) |
| 227 | 211 | sql.append(" ORDER BY device_id,ts,stop_no"); |
| ... | ... | @@ -329,17 +313,10 @@ public class GpsServiceImpl implements GpsService { |
| 329 | 313 | try{ |
| 330 | 314 | |
| 331 | 315 | //JdbcTemplate jdbcTemplate_ms = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 332 | - dcs = jdbcTemplate.query("select cl_zbh as nbbm,new_device_no as device,old_device_no as old_device,UNIX_TIMESTAMP(qyrq) * 1000 as st from bsth_c_car_device where cl_zbh='"+nbbm+"'" | |
| 316 | + dcs = jdbcTemplate.query("select cl_zbh as nbbm,new_device_no as device,old_device_no as old_device,UNIX_TIMESTAMP(qyrq) * 1000 as st from bsth_c_car_device where is_cancel=0 and cl_zbh='"+nbbm+"' order by qyrq" | |
| 333 | 317 | , BeanPropertyRowMapper.newInstance(DeviceChange.class)); |
| 334 | 318 | |
| 335 | 319 | |
| 336 | - Collections.sort(dcs, new Comparator<DeviceChange>() { | |
| 337 | - @Override | |
| 338 | - public int compare(DeviceChange d1, DeviceChange d2) { | |
| 339 | - return (int) (d1.getSt() - d2.getSt()); | |
| 340 | - } | |
| 341 | - }); | |
| 342 | - | |
| 343 | 320 | //生成一条初始记录 |
| 344 | 321 | if(dcs.size() > 0){ |
| 345 | 322 | DeviceChange first = dcs.get(0); |
| ... | ... | @@ -365,6 +342,18 @@ public class GpsServiceImpl implements GpsService { |
| 365 | 342 | |
| 366 | 343 | rs.add(dc); |
| 367 | 344 | } |
| 345 | + | |
| 346 | + //没有设备变更记录,则参考车辆信息上的设备号 | |
| 347 | + if(null == rs || rs.size() == 0){ | |
| 348 | + DeviceChange dc = new DeviceChange(); | |
| 349 | + dc.setNbbm(nbbm); | |
| 350 | + dc.setDevice(BasicData.deviceId2NbbmMap.inverse().get(nbbm)); | |
| 351 | + dc.setSt(st); | |
| 352 | + dc.setEt(et); | |
| 353 | + dc.setType(1); | |
| 354 | + | |
| 355 | + rs.add(dc); | |
| 356 | + } | |
| 368 | 357 | }catch (Exception e){ |
| 369 | 358 | logger.error("", e); |
| 370 | 359 | } |
| ... | ... | @@ -380,11 +369,14 @@ public class GpsServiceImpl implements GpsService { |
| 380 | 369 | |
| 381 | 370 | // weeks_year 分区字段 |
| 382 | 371 | Calendar sCal = Calendar.getInstance(); |
| 383 | - sCal.setTime(new Date(st * 1000)); | |
| 372 | + sCal.setTime(new Date(st)); | |
| 384 | 373 | int sWeekOfYear = sCal.get(Calendar.WEEK_OF_YEAR); |
| 385 | 374 | Calendar eCal = Calendar.getInstance(); |
| 386 | - eCal.setTime(new Date(et * 1000)); | |
| 387 | - int eWeekOfYear = eCal.get(Calendar.DAY_OF_YEAR); | |
| 375 | + eCal.setTime(new Date(et)); | |
| 376 | + int eWeekOfYear = eCal.get(Calendar.WEEK_OF_YEAR); | |
| 377 | + | |
| 378 | + //按年分表 | |
| 379 | + String tableName = "bsth_c_arrival_info_" + fmtyyyy.print(st); | |
| 388 | 380 | |
| 389 | 381 | StringBuilder sql = new StringBuilder(""); |
| 390 | 382 | long t1,t2; |
| ... | ... | @@ -398,8 +390,8 @@ public class GpsServiceImpl implements GpsService { |
| 398 | 390 | if(dc.getEt() < et) |
| 399 | 391 | t2 = dc.getEt(); |
| 400 | 392 | |
| 401 | - sql.append("SELECT DEVICE_ID,LINE_ID as LINE_CODE,STOP_NO,TS,UP_DOWN,IN_OUT,WEEKS_YEAR,CREATE_DATE FROM bsth_c_arrival_info " + | |
| 402 | - " where weeks_year in ("+sWeekOfYear+", "+eWeekOfYear+") and device_id='"+dc.getDevice()+"' and ts > "+t1+" and ts < " + t2); | |
| 393 | + sql.append("SELECT DEVICE_ID,LINE_ID as LINE_CODE,STOP_NO,TS,UP_DOWN,IN_OUT,WEEKS_YEAR,CREATE_DATE FROM " + tableName + | |
| 394 | + " where weeks_year in ("+sWeekOfYear+", "+eWeekOfYear+") and device_id='"+dc.getDevice()+"' and ts > "+t1+" and ts < " + t2); | |
| 403 | 395 | |
| 404 | 396 | if(i == len - 1) |
| 405 | 397 | sql.append(" ORDER BY device_id,ts,stop_no "); |
| ... | ... | @@ -407,6 +399,7 @@ public class GpsServiceImpl implements GpsService { |
| 407 | 399 | sql.append(" UNION "); |
| 408 | 400 | } |
| 409 | 401 | |
| 402 | + logger.info("arrivl sql : " + sql.toString()); | |
| 410 | 403 | JdbcTemplate jdbcTemplate_ms = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 411 | 404 | List<ArrivalEntity> list = jdbcTemplate_ms.query(sql.toString(), BeanPropertyRowMapper.newInstance(ArrivalEntity.class)); |
| 412 | 405 | |
| ... | ... | @@ -887,27 +880,84 @@ public class GpsServiceImpl implements GpsService { |
| 887 | 880 | |
| 888 | 881 | @Override |
| 889 | 882 | public List<GpsSpeed_DTO> speeds(String nbbm, long st, long et) { |
| 890 | - String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm); | |
| 891 | - String sql = "select vehicle, line, up_down, lon, lat, speed,timestamp from bsth_c_speeding where vehicle=? and timestamp>? and timestamp<?"; | |
| 883 | + st = st * 1000; | |
| 884 | + et = et * 1000; | |
| 885 | + //按周分区 | |
| 886 | + Calendar sCal = Calendar.getInstance(); | |
| 887 | + sCal.setTime(new Date(st)); | |
| 888 | + int sWeekYear = sCal.get(Calendar.WEEK_OF_YEAR); | |
| 889 | + Calendar eCal = Calendar.getInstance(); | |
| 890 | + eCal.setTime(new Date(et)); | |
| 891 | + int eWeekYear = eCal.get(Calendar.WEEK_OF_YEAR); | |
| 892 | + | |
| 893 | + //按年分表 | |
| 894 | + String tableName = "bsth_c_speeding_" + fmtyyyy.print(st); | |
| 895 | + | |
| 896 | + List<DeviceChange> dcs = findDeviceChangeLogs(nbbm, et, st); | |
| 897 | + StringBuilder sql = new StringBuilder(""); | |
| 898 | + long t1,t2; | |
| 899 | + DeviceChange dc; | |
| 900 | + for(int i = 0,len=dcs.size(); i < len; i++){ | |
| 901 | + t1 = st; | |
| 902 | + t2 = et; | |
| 903 | + dc = dcs.get(i); | |
| 904 | + if(dc.getSt() > st) | |
| 905 | + t1 = dc.getSt(); | |
| 906 | + if(dc.getEt() < et && dc.getEt()!=0) | |
| 907 | + t2 = dc.getEt(); | |
| 908 | + | |
| 909 | + sql.append(" select vehicle, line, up_down, lon, lat, speed,timestamp from "+tableName+" where " + | |
| 910 | + " weeks_year in ("+sWeekYear+", "+eWeekYear+") and vehicle='"+dc.getDevice()+"' and timestamp>="+t1+" and timestamp<= " + t2); | |
| 911 | + | |
| 912 | + if(i == len - 1) | |
| 913 | + sql.append(" ORDER BY vehicle,timestamp"); | |
| 914 | + else | |
| 915 | + sql.append(" UNION "); | |
| 916 | + } | |
| 892 | 917 | |
| 893 | - return GpsSpeed_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql, deviceId, st * 1000, et * 1000)); | |
| 918 | + logger.info("speed sql : " + sql.toString()); | |
| 919 | + return GpsSpeed_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql.toString())); | |
| 894 | 920 | } |
| 895 | 921 | |
| 896 | 922 | @Override |
| 897 | 923 | public List<GpsOutbound_DTO> outbounds(String nbbm, long st, long et) { |
| 898 | - /** | |
| 899 | - * 如果 st 和 et 跨了周分区,也只查询st 分区的数据。 | |
| 900 | - */ | |
| 901 | 924 | st = st * 1000; |
| 902 | 925 | et = et * 1000; |
| 903 | 926 | //按周分区 |
| 904 | - Calendar weekCal = Calendar.getInstance(); | |
| 905 | - weekCal.setTimeInMillis(st); | |
| 906 | - int weekYear = weekCal.get(Calendar.WEEK_OF_YEAR); | |
| 907 | - //设备号 | |
| 908 | - String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm); | |
| 909 | - String sql = "select vehicle,line,up_down,lon,lat,timestamp from bsth_c_outbound where weeks_year=" + weekYear + " and vehicle=? and timestamp>? and timestamp<?"; | |
| 910 | - return GpsOutbound_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql, deviceId, st, et)); | |
| 927 | + Calendar sCal = Calendar.getInstance(); | |
| 928 | + sCal.setTime(new Date(st)); | |
| 929 | + int sWeekYear = sCal.get(Calendar.WEEK_OF_YEAR); | |
| 930 | + Calendar eCal = Calendar.getInstance(); | |
| 931 | + eCal.setTime(new Date(et)); | |
| 932 | + int eWeekYear = eCal.get(Calendar.WEEK_OF_YEAR); | |
| 933 | + | |
| 934 | + //按年分表 | |
| 935 | + String tableName = "bsth_c_outbound_" + fmtyyyy.print(st); | |
| 936 | + | |
| 937 | + List<DeviceChange> dcs = findDeviceChangeLogs(nbbm, et, st); | |
| 938 | + StringBuilder sql = new StringBuilder(""); | |
| 939 | + long t1,t2; | |
| 940 | + DeviceChange dc; | |
| 941 | + for(int i = 0,len=dcs.size(); i < len; i++){ | |
| 942 | + t1 = st; | |
| 943 | + t2 = et; | |
| 944 | + dc = dcs.get(i); | |
| 945 | + if(dc.getSt() > st) | |
| 946 | + t1 = dc.getSt(); | |
| 947 | + if(dc.getEt() < et && dc.getEt()!=0) | |
| 948 | + t2 = dc.getEt(); | |
| 949 | + | |
| 950 | + sql.append("select vehicle,line,up_down,lon,lat,timestamp from "+tableName+" where " + | |
| 951 | + " weeks_year in ("+sWeekYear+", "+eWeekYear+") and vehicle='"+dc.getDevice()+"' and timestamp>="+t1+" and timestamp<=" + t2); | |
| 952 | + | |
| 953 | + if(i == len - 1) | |
| 954 | + sql.append(" ORDER BY vehicle,timestamp"); | |
| 955 | + else | |
| 956 | + sql.append(" UNION "); | |
| 957 | + } | |
| 958 | + | |
| 959 | + logger.info("outbounds sql : " + sql.toString()); | |
| 960 | + return GpsOutbound_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql.toString())); | |
| 911 | 961 | } |
| 912 | 962 | |
| 913 | 963 | @Override | ... | ... |
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| ... | ... | @@ -2815,4 +2815,224 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 2815 | 2815 | return map; |
| 2816 | 2816 | } |
| 2817 | 2817 | |
| 2818 | + @Override | |
| 2819 | + public List<Map<String, Object>> onTime(Map<String, Object> map) { | |
| 2820 | + // TODO Auto-generated method stub | |
| 2821 | + String startDate = map.get("startDate").toString().trim(); | |
| 2822 | + String endDate = map.get("endDate").toString().trim(); | |
| 2823 | + String line = map.get("line").toString().trim(); | |
| 2824 | + String company = map.get("gs").toString().trim(); | |
| 2825 | + String subCompany = map.get("fgs").toString().trim(); | |
| 2826 | + | |
| 2827 | + String sql = "select id, cl_zbh, fcsj, fcsj_actual, j_gh, j_name, lp_name, qdz_name, " + | |
| 2828 | + "schedule_date_str, xl_name, zdsj, zdsj_actual, fgs_name, gs_name, xl_dir, xl_bm " + | |
| 2829 | + "from bsth_c_s_sp_info_real " + | |
| 2830 | + "where schedule_date_str >= '"+startDate+"' and schedule_date_str <= '"+endDate+"' " + | |
| 2831 | + "and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and cc_service = 0"; | |
| 2832 | + | |
| 2833 | + if(company.length() != 0) | |
| 2834 | + sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; | |
| 2835 | + if(line.length() != 0) | |
| 2836 | + sql += " and xl_bm = '"+line+"'"; | |
| 2837 | + | |
| 2838 | + System.out.println(sql); | |
| 2839 | + List<ScheduleRealInfo> list = jdbcTemplate.query(sql, | |
| 2840 | + new RowMapper<ScheduleRealInfo>(){ | |
| 2841 | + @Override | |
| 2842 | + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 2843 | + ScheduleRealInfo schedule = new ScheduleRealInfo(); | |
| 2844 | + schedule.setId(rs.getLong("id")); | |
| 2845 | + schedule.setScheduleDateStr(rs.getString("schedule_date_str")); | |
| 2846 | + schedule.setXlDir(rs.getString("xl_dir")); | |
| 2847 | + schedule.setXlBm(rs.getString("xl_bm")); | |
| 2848 | + schedule.setXlName(rs.getString("xl_name")); | |
| 2849 | + schedule.setLpName(rs.getString("lp_name")); | |
| 2850 | + schedule.setFcsj(rs.getString("fcsj")); | |
| 2851 | + schedule.setFcsjActual(rs.getString("fcsj_actual")); | |
| 2852 | + schedule.setZdsj(rs.getString("zdsj")); | |
| 2853 | + schedule.setZdsjActual(rs.getString("zdsj_actual")); | |
| 2854 | + schedule.setQdzName(rs.getString("qdz_name")); | |
| 2855 | + schedule.setGsName(rs.getString("gs_name")); | |
| 2856 | + schedule.setFgsName(rs.getString("fgs_name")); | |
| 2857 | + schedule.setClZbh(rs.getString("cl_zbh")); | |
| 2858 | + schedule.setjGh(rs.getString("j_gh")); | |
| 2859 | + schedule.setjName(rs.getString("j_name")); | |
| 2860 | + return schedule; | |
| 2861 | + }}); | |
| 2862 | + | |
| 2863 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 2864 | + Map<String, Map<String, List<ScheduleRealInfo>>> sches = new HashMap<String, Map<String, List<ScheduleRealInfo>>>(); | |
| 2865 | + Map<String, List<List<Map<String, Object>>>> keyMap = new HashMap<String, List<List<Map<String, Object>>>>(); | |
| 2866 | + | |
| 2867 | + for(ScheduleRealInfo s : list){ | |
| 2868 | + String xl = s.getXlName(); | |
| 2869 | + String dateStr = s.getScheduleDateStr(); | |
| 2870 | + if(!sches.containsKey(xl)){ | |
| 2871 | + sches.put(xl, new HashMap<String, List<ScheduleRealInfo>>()); | |
| 2872 | + keyMap.put(xl, new ArrayList<List<Map<String, Object>>>()); | |
| 2873 | + } | |
| 2874 | + if(!sches.get(xl).containsKey(dateStr)){ | |
| 2875 | + sches.get(xl).put(dateStr, new ArrayList<ScheduleRealInfo>()); | |
| 2876 | + } | |
| 2877 | + sches.get(xl).get(dateStr).add(s); | |
| 2878 | + } | |
| 2879 | + for(String xl : sches.keySet()){ | |
| 2880 | + Map<String, List<ScheduleRealInfo>> sche1 = sches.get(xl); | |
| 2881 | + Set<String> dateSet = sche1.keySet(); | |
| 2882 | + Map<Long, String> timeTemp = new HashMap<Long, String>(); | |
| 2883 | + for(String date : dateSet){ | |
| 2884 | + try { | |
| 2885 | + Date parse = sdf.parse(date); | |
| 2886 | + timeTemp.put(parse.getTime(), date); | |
| 2887 | + } catch (ParseException e) { | |
| 2888 | + // TODO Auto-generated catch block | |
| 2889 | + e.printStackTrace(); | |
| 2890 | + } | |
| 2891 | + } | |
| 2892 | + List<Long> timeList = new ArrayList<Long>(timeTemp.keySet()); | |
| 2893 | + Collections.sort(timeList); | |
| 2894 | + | |
| 2895 | + List<List<Map<String, Object>>> lists = new ArrayList<List<Map<String, Object>>>(); | |
| 2896 | + Map<Long, ScheduleRealInfo> keyTemp = new HashMap<Long, ScheduleRealInfo>(); | |
| 2897 | + for(Long time : timeList){ | |
| 2898 | + List<Long> keyList = new ArrayList<Long>(); | |
| 2899 | + String date = timeTemp.get(time); | |
| 2900 | + List<ScheduleRealInfo> sche2 = sche1.get(date); | |
| 2901 | + for(ScheduleRealInfo s : sche2){ | |
| 2902 | + if(s.getFcsj()!=null && s.getFcsj().trim().length() > 0 | |
| 2903 | + && s.getFcsj().contains(":")){ | |
| 2904 | + String[] split = s.getFcsj().split(":"); | |
| 2905 | + Long key = Long.valueOf(s.getXlDir())*1500 + Long.valueOf(split[0])*60 + Long.valueOf(split[1]); | |
| 2906 | + while(keyTemp.containsKey(key)){ | |
| 2907 | + ++key; | |
| 2908 | + } | |
| 2909 | + keyList.add(key); | |
| 2910 | + keyTemp.put(key, s); | |
| 2911 | + } | |
| 2912 | + } | |
| 2913 | + Collections.sort(keyList); | |
| 2914 | + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); | |
| 2915 | + for(Long l : keyList){ | |
| 2916 | + ScheduleRealInfo s = keyTemp.get(l); | |
| 2917 | + Map<String, Object> temp = new HashMap<String, Object>(); | |
| 2918 | + temp.put("gs", s.getGsName()); | |
| 2919 | + temp.put("fgs", s.getFgsName()); | |
| 2920 | + temp.put("date", date); | |
| 2921 | + temp.put("xlbm", s.getXlBm()); | |
| 2922 | + temp.put("line", s.getXlName()); | |
| 2923 | + temp.put("clzbh", s.getClZbh()); | |
| 2924 | + temp.put("jsy", s.getjGh() + "/" + s.getjName()); | |
| 2925 | + temp.put("lp", s.getLpName()); | |
| 2926 | + temp.put("zd", s.getQdzName()); | |
| 2927 | + temp.put("fcsj", s.getFcsj()!=null?s.getFcsj():""); | |
| 2928 | + temp.put("fcsjA", s.getFcsjActual()!=null?s.getFcsjActual():"烂班"); | |
| 2929 | + temp.put("zdsj", s.getZdsj()!=null?s.getZdsj():""); | |
| 2930 | + temp.put("zdsjA", s.getZdsjActual()!=null?s.getZdsjActual():"烂班"); | |
| 2931 | + if(s.getFcsj() != null && s.getFcsjActual()!=null){ | |
| 2932 | + String[] split1 = s.getFcsj().split(":"); | |
| 2933 | + String[] split2 = s.getFcsjActual().split(":"); | |
| 2934 | + long fcsj = Long.valueOf(split1[0])*60 + Long.valueOf(split1[1]); | |
| 2935 | + long fcsjA = Long.valueOf(split2[0])*60 + Long.valueOf(split2[1]); | |
| 2936 | + if(fcsj > 23*60 && fcsjA < 60) | |
| 2937 | + fcsjA += 1440; | |
| 2938 | + if(fcsjA - fcsj <= 3 && fcsjA - fcsj >= -1){ | |
| 2939 | + temp.put("fcsjzd", "准点"); | |
| 2940 | + } else { | |
| 2941 | + temp.put("fcsjzd", "不准点"); | |
| 2942 | + temp.put("fcsjflag", 1); | |
| 2943 | + } | |
| 2944 | + } | |
| 2945 | + if(s.getZdsj() != null && s.getZdsjActual()!=null){ | |
| 2946 | + String[] split1 = s.getZdsj().split(":"); | |
| 2947 | + String[] split2 = s.getZdsjActual().split(":"); | |
| 2948 | + long zdsj = Long.valueOf(split1[0])*60 + Long.valueOf(split1[1]); | |
| 2949 | + long zdsjA = Long.valueOf(split2[0])*60 + Long.valueOf(split2[1]); | |
| 2950 | + if(zdsj > 23*60 && zdsjA < 60) | |
| 2951 | + zdsjA += 1440; | |
| 2952 | + if(zdsjA - zdsj <= 3 && zdsjA - zdsj >= -1){ | |
| 2953 | + temp.put("zdsjzd", "准点"); | |
| 2954 | + } else { | |
| 2955 | + temp.put("zdsjzd", "不准点"); | |
| 2956 | + temp.put("zdsjflag", 1); | |
| 2957 | + } | |
| 2958 | + } | |
| 2959 | + tempList.add(temp); | |
| 2960 | + } | |
| 2961 | + lists.add(tempList); | |
| 2962 | + } | |
| 2963 | + keyMap.put(xl, lists); | |
| 2964 | + } | |
| 2965 | + | |
| 2966 | + if(!map.containsKey("flag")){ | |
| 2967 | + for(String xl : keyMap.keySet()){ | |
| 2968 | + List<List<Map<String, Object>>> list1 = keyMap.get(xl); | |
| 2969 | + if(list1.size() == 0 || list1.get(0).size() == 0) | |
| 2970 | + continue; | |
| 2971 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | |
| 2972 | + int bcs = 0, fczd = 0, zdzd = 0; | |
| 2973 | + for(List<Map<String, Object>> list2 : list1){ | |
| 2974 | + for(Map<String, Object> m : list2){ | |
| 2975 | + bcs++; | |
| 2976 | + if(!m.containsKey("fcsjflag")) | |
| 2977 | + fczd++; | |
| 2978 | + if(!m.containsKey("zdsjflag")) | |
| 2979 | + zdzd++; | |
| 2980 | + } | |
| 2981 | + } | |
| 2982 | + tempMap.put("gs", list1.get(0).get(0).get("gs")); | |
| 2983 | + tempMap.put("fgs", list1.get(0).get(0).get("fgs")); | |
| 2984 | + tempMap.put("line", list1.get(0).get(0).get("line")); | |
| 2985 | + tempMap.put("date", list1.get(0).get(0).get("date")); | |
| 2986 | + tempMap.put("xlbm", list1.get(0).get(0).get("xlbm")); | |
| 2987 | + tempMap.put("bcs", bcs); | |
| 2988 | + tempMap.put("fczd", fczd); | |
| 2989 | + tempMap.put("zdzd", zdzd); | |
| 2990 | + tempMap.put("fczdl", (bcs>0?df.format((double)fczd/bcs*100):0)+"%"); | |
| 2991 | + tempMap.put("zdzdl", (bcs>0?df.format((double)zdzd/bcs*100):0)+"%"); | |
| 2992 | + resList.add(tempMap); | |
| 2993 | + } | |
| 2994 | + } else if(map.get("flag").toString().trim().equals("1")) { | |
| 2995 | + for(String xl : keyMap.keySet()){ | |
| 2996 | + List<List<Map<String, Object>>> list1 = keyMap.get(xl); | |
| 2997 | + if(list1.size() == 0 || list1.get(0).size() == 0) | |
| 2998 | + continue; | |
| 2999 | + for(List<Map<String, Object>> list2 : list1){ | |
| 3000 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | |
| 3001 | + int bcs = 0, fczd = 0, zdzd = 0; | |
| 3002 | + for(Map<String, Object> m : list2){ | |
| 3003 | + bcs++; | |
| 3004 | + if(!m.containsKey("fcsjflag")) | |
| 3005 | + fczd++; | |
| 3006 | + if(!m.containsKey("zdsjflag")) | |
| 3007 | + zdzd++; | |
| 3008 | + } | |
| 3009 | + tempMap.put("gs", list2.get(0).get("gs")); | |
| 3010 | + tempMap.put("fgs", list2.get(0).get("fgs")); | |
| 3011 | + tempMap.put("line", list2.get(0).get("line")); | |
| 3012 | + tempMap.put("date", list2.get(0).get("date")); | |
| 3013 | + tempMap.put("xl_date", list2.get(0).get("date") + "_" + list2.get(0).get("xlbm") + "_" + list2.get(0).get("line")); | |
| 3014 | + tempMap.put("bcs", bcs); | |
| 3015 | + tempMap.put("fczd", fczd); | |
| 3016 | + tempMap.put("zdzd", zdzd); | |
| 3017 | + tempMap.put("fczdl", (bcs>0?df.format((double)fczd/bcs*100):0)+"%"); | |
| 3018 | + tempMap.put("zdzdl", (bcs>0?df.format((double)zdzd/bcs*100):0)+"%"); | |
| 3019 | + resList.add(tempMap); | |
| 3020 | + } | |
| 3021 | + } | |
| 3022 | + } else if(map.get("flag").toString().trim().equals("2")) { | |
| 3023 | + for(String xl : keyMap.keySet()){ | |
| 3024 | + List<List<Map<String, Object>>> list1 = keyMap.get(xl); | |
| 3025 | + if(list1.size() == 0 || list1.get(0).size() == 0) | |
| 3026 | + continue; | |
| 3027 | + for(List<Map<String, Object>> list2 : list1){ | |
| 3028 | + for(Map<String, Object> m : list2){ | |
| 3029 | + resList.add(m); | |
| 3030 | + } | |
| 3031 | + } | |
| 3032 | + } | |
| 3033 | + } | |
| 3034 | + | |
| 3035 | + return resList; | |
| 3036 | + } | |
| 3037 | + | |
| 2818 | 3038 | } | ... | ... |
src/main/java/com/bsth/service/report/CulateMileageService.java
| ... | ... | @@ -14,6 +14,7 @@ public interface CulateMileageService { |
| 14 | 14 | List<Map<String,Object>> jobLjqk(List<ScheduleRealInfo> lists); |
| 15 | 15 | double culateLjgl(List<ScheduleRealInfo> lists); |
| 16 | 16 | double culateLjgl_(List<ScheduleRealInfo> lists,String item); |
| 17 | + double culateLjgl_spy(List<ScheduleRealInfo> lists); | |
| 17 | 18 | int culateLjbc(List<ScheduleRealInfo> lists,String item); |
| 18 | 19 | |
| 19 | 20 | double culateJhgl(List<ScheduleRealInfo> lists); |
| ... | ... | @@ -23,11 +24,13 @@ public interface CulateMileageService { |
| 23 | 24 | |
| 24 | 25 | double culateSjgl(List<ScheduleRealInfo> lists); |
| 25 | 26 | double culateSjgl_(List<ScheduleRealInfo> lists,String item); |
| 27 | + | |
| 28 | + double culateSjgl_spy(List<ScheduleRealInfo> lists); | |
| 26 | 29 | int culateSjbc(List<ScheduleRealInfo> lists,String item); |
| 27 | 30 | |
| 28 | 31 | double culateKsgl(List<ScheduleRealInfo> lists); |
| 29 | 32 | double culateJccgl(List<ScheduleRealInfo> lists); |
| 30 | - | |
| 33 | + double culateSjfyylc_spy(List<ScheduleRealInfo> lists); | |
| 31 | 34 | double culateJhJccgl(List<ScheduleRealInfo> lists); |
| 32 | 35 | |
| 33 | 36 | double culateCJLC(List<ScheduleRealInfo> lists,String item); | ... | ... |
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
| ... | ... | @@ -1476,5 +1476,130 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 1476 | 1476 | map.put("djgsj", djcsj); |
| 1477 | 1477 | return map; |
| 1478 | 1478 | } |
| 1479 | + | |
| 1480 | + @Override | |
| 1481 | + public double culateSjgl_spy(List<ScheduleRealInfo> lists) { | |
| 1482 | + // 实际营运里程 | |
| 1483 | + double sjgl = 0; | |
| 1484 | + for (int i = 0; i < lists.size(); i++) { | |
| 1485 | + ScheduleRealInfo scheduleRealInfo = lists.get(i); | |
| 1486 | + if (!isInOut(scheduleRealInfo)) { | |
| 1487 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 1488 | + if (!scheduleRealInfo.isSflj()) { | |
| 1489 | + if (childTaskPlans.isEmpty()) { | |
| 1490 | + if (!scheduleRealInfo.isDestroy()) { | |
| 1491 | + double jhlcOrig = scheduleRealInfo.getJhlcOrig() == null ? 0 | |
| 1492 | + : scheduleRealInfo.getJhlcOrig(); | |
| 1493 | + double jhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc(); | |
| 1494 | + if (jhlc - jhlcOrig > 0) { | |
| 1495 | + sjgl = Arith.add(sjgl, jhlcOrig); | |
| 1496 | + } else { | |
| 1497 | + sjgl = Arith.add(sjgl, jhlc); | |
| 1498 | + } | |
| 1499 | + } | |
| 1500 | + } else { | |
| 1501 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1502 | + while (it.hasNext()) { | |
| 1503 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 1504 | + if (childTaskPlan.getMileageType().equals("service") | |
| 1505 | + && "正常".equals(childTaskPlan.getType1()) && childTaskPlan.getCcId() == null | |
| 1506 | + && (!childTaskPlan.isNoClerk())) { | |
| 1507 | + if (!childTaskPlan.isDestroy()) { | |
| 1508 | + Float jhgl = childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage(); | |
| 1509 | + sjgl = Arith.add(sjgl, jhgl); | |
| 1510 | + } | |
| 1511 | + } | |
| 1512 | + } | |
| 1513 | + } | |
| 1514 | + } | |
| 1515 | + } | |
| 1516 | + } | |
| 1517 | + return sjgl; | |
| 1518 | + } | |
| 1519 | + | |
| 1520 | + @Override | |
| 1521 | + public double culateSjfyylc_spy(List<ScheduleRealInfo> lists) { | |
| 1522 | + // 实际非营运里程(售) | |
| 1523 | + double sjgl = 0; | |
| 1524 | + for (int i = 0; i < lists.size(); i++) { | |
| 1525 | + ScheduleRealInfo scheduleRealInfo = lists.get(i); | |
| 1526 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 1527 | + if (childTaskPlans.isEmpty()) { | |
| 1528 | + if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | |
| 1529 | + || scheduleRealInfo.getBcType().equals("ldks")) { | |
| 1530 | + if (!scheduleRealInfo.isDestroy()) { | |
| 1531 | + double jhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc(); | |
| 1532 | + sjgl = Arith.add(sjgl, jhlc); | |
| 1533 | + } | |
| 1534 | + } | |
| 1535 | + } else { | |
| 1536 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1537 | + while (it.hasNext()) { | |
| 1538 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 1539 | + if (childTaskPlan.getMileageType().equals("empty") | |
| 1540 | + && (!childTaskPlan.isNoClerk()) && childTaskPlan.getCcId() == null) { | |
| 1541 | + if (!childTaskPlan.isDestroy()) { | |
| 1542 | + Float jhgl = childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage(); | |
| 1543 | + sjgl = Arith.add(sjgl, jhgl); | |
| 1544 | + } | |
| 1545 | + } | |
| 1546 | + } | |
| 1547 | + } | |
| 1548 | + } | |
| 1549 | + return sjgl; | |
| 1550 | + } | |
| 1551 | + | |
| 1552 | + @Override | |
| 1553 | + public double culateLjgl_spy(List<ScheduleRealInfo> lists) { | |
| 1554 | + // 临加营运里程(售) | |
| 1555 | + double ljgl = 0; | |
| 1556 | + for (int i = 0; i < lists.size(); i++) { | |
| 1557 | + ScheduleRealInfo scheduleRealInfo = lists.get(i); | |
| 1558 | + if (!isInOut(scheduleRealInfo)) { | |
| 1559 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 1560 | + if (scheduleRealInfo.isSflj()) { | |
| 1561 | + if (childTaskPlans.isEmpty()) { | |
| 1562 | + if (!scheduleRealInfo.isDestroy()) | |
| 1563 | + ljgl = Arith.add(ljgl, scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc()); | |
| 1564 | + } else { | |
| 1565 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1566 | + while (it.hasNext()) { | |
| 1567 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 1568 | + if (childTaskPlan.getMileageType().equals("service") && childTaskPlan.getCcId() == null | |
| 1569 | + && (!childTaskPlan.isNoClerk())) { | |
| 1570 | + if (!childTaskPlan.isDestroy()) { | |
| 1571 | + Float jhgl = childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage(); | |
| 1572 | + ljgl = Arith.add(ljgl, jhgl); | |
| 1573 | + } | |
| 1574 | + } | |
| 1575 | + } | |
| 1576 | + } | |
| 1577 | + } else { | |
| 1578 | + if (childTaskPlans.isEmpty()) { | |
| 1579 | + double jhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc(); | |
| 1580 | + double jhlcOrig = scheduleRealInfo.getJhlcOrig() == null ? 0 : scheduleRealInfo.getJhlcOrig(); | |
| 1581 | + double zjlc = Arith.sub(jhlc, jhlcOrig); | |
| 1582 | + if (zjlc > 0) { | |
| 1583 | + ljgl = Arith.add(zjlc, ljgl); | |
| 1584 | + } | |
| 1585 | + } else { | |
| 1586 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1587 | + while (it.hasNext()) { | |
| 1588 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 1589 | + if ("service".equals(childTaskPlan.getMileageType()) | |
| 1590 | + && "临加".equals(childTaskPlan.getType1()) && childTaskPlan.getCcId() == null | |
| 1591 | + && (!childTaskPlan.isNoClerk())) { | |
| 1592 | + if (!childTaskPlan.isDestroy()) { | |
| 1593 | + Float jhgl = childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage(); | |
| 1594 | + ljgl = Arith.add(ljgl, jhgl); | |
| 1595 | + } | |
| 1596 | + } | |
| 1597 | + } | |
| 1598 | + } | |
| 1599 | + } | |
| 1600 | + } | |
| 1601 | + } | |
| 1602 | + return ljgl; | |
| 1603 | + } | |
| 1479 | 1604 | |
| 1480 | 1605 | } | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -96,7 +96,7 @@ public class ReportServiceImpl implements ReportService{ |
| 96 | 96 | Long date1=simpleDateFormat.parse(date+" "+sjfc+":00").getTime(); |
| 97 | 97 | Long date2=simpleDateFormat.parse(date+" "+sjdd+":00").getTime(); |
| 98 | 98 | Date dates=simpleDateFormat.parse(date+" 00:00:00"); |
| 99 | - List<ArrivalInfo> lists=load(line,sbbb,date1,date2,dates); | |
| 99 | + List<ArrivalInfo> lists=load(line,sbbb,date1,date2,dates,date); | |
| 100 | 100 | |
| 101 | 101 | for(int i=0;i<lists.size();i++){ |
| 102 | 102 | ArrivalInfo t1=lists.get(i); |
| ... | ... | @@ -123,7 +123,7 @@ public class ReportServiceImpl implements ReportService{ |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | |
| 126 | - public List<ArrivalInfo> load(String line,String sbbb,Long date1,Long date2,Date dates){ | |
| 126 | + public List<ArrivalInfo> load(String line,String sbbb,Long date1,Long date2,Date dates,String date){ | |
| 127 | 127 | List<ArrivalInfo> list = null; |
| 128 | 128 | Calendar cal = Calendar.getInstance(); |
| 129 | 129 | cal.setTime(dates); |
| ... | ... | @@ -133,8 +133,8 @@ public class ReportServiceImpl implements ReportService{ |
| 133 | 133 | Connection conn = null; |
| 134 | 134 | PreparedStatement ps = null; |
| 135 | 135 | ResultSet rs = null; |
| 136 | - | |
| 137 | - String sql = "select * from bsth_c_arrival_info where device_id=? AND line_id=? AND weeks_year=? AND ts > ? AND ts <=? order by ts"; | |
| 136 | + String year=date.substring(0,4); | |
| 137 | + String sql = "select * from bsth_c_arrival_info_"+year+" where device_id=? AND line_id=? AND weeks_year=? AND ts > ? AND ts <=? order by ts"; | |
| 138 | 138 | try{ |
| 139 | 139 | conn = DBUtils_MS.getConnection(); |
| 140 | 140 | ps = conn.prepareStatement(sql); |
| ... | ... | @@ -194,7 +194,7 @@ public class ReportServiceImpl implements ReportService{ |
| 194 | 194 | Long date2=simpleDateFormat.parse(ddsj+":00").getTime(); |
| 195 | 195 | Date dates1=simpleDateFormat.parse(fcsj+":00"); |
| 196 | 196 | Date dates2=simpleDateFormat.parse(ddsj+":00"); |
| 197 | - List<ArrivalInfo> lists=load2(line,date1,date2,dates1,dates2,zd,zdlx); | |
| 197 | + List<ArrivalInfo> lists=load2(line,date1,date2,dates1,dates2,zd,zdlx,fcsj); | |
| 198 | 198 | |
| 199 | 199 | for(int i=0;i<lists.size();i++){ |
| 200 | 200 | ArrivalInfo t1=lists.get(i); |
| ... | ... | @@ -224,7 +224,7 @@ public class ReportServiceImpl implements ReportService{ |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | |
| 227 | - public List<ArrivalInfo> load2(String line,Long date1,Long date2,Date dates1,Date dates2,String zd,String zdlx){ | |
| 227 | + public List<ArrivalInfo> load2(String line,Long date1,Long date2,Date dates1,Date dates2,String zd,String zdlx,String fcsj){ | |
| 228 | 228 | List<ArrivalInfo> list = null; |
| 229 | 229 | Calendar cal = Calendar.getInstance(); |
| 230 | 230 | cal.setTime(dates1); |
| ... | ... | @@ -235,8 +235,8 @@ public class ReportServiceImpl implements ReportService{ |
| 235 | 235 | Connection conn = null; |
| 236 | 236 | PreparedStatement ps = null; |
| 237 | 237 | ResultSet rs = null; |
| 238 | - | |
| 239 | - String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year>=? " | |
| 238 | + String year=fcsj.substring(0,4); | |
| 239 | + String sql = "select * from bsth_c_arrival_info_"+year+" where line_id=? AND weeks_year>=? " | |
| 240 | 240 | + " AND weeks_year<=? AND ts > ? AND ts <=? AND up_down=? AND stop_no like ? order by ts"; |
| 241 | 241 | try{ |
| 242 | 242 | conn = DBUtils_MS.getConnection(); |
| ... | ... | @@ -2025,7 +2025,7 @@ public class ReportServiceImpl implements ReportService{ |
| 2025 | 2025 | public List<Map<String, Object>> lineList() { |
| 2026 | 2026 | // TODO Auto-generated method stub |
| 2027 | 2027 | List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); |
| 2028 | - Iterator<Line> iterator = lineRepository.findAll().iterator(); | |
| 2028 | + Iterator<Line> iterator = lineRepository.findAllService().iterator(); | |
| 2029 | 2029 | Line line; |
| 2030 | 2030 | while (iterator.hasNext()) { |
| 2031 | 2031 | line = iterator.next(); |
| ... | ... | @@ -2179,8 +2179,8 @@ public class ReportServiceImpl implements ReportService{ |
| 2179 | 2179 | Connection conn = null; |
| 2180 | 2180 | PreparedStatement ps = null; |
| 2181 | 2181 | ResultSet rs = null; |
| 2182 | - | |
| 2183 | - String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year=? " | |
| 2182 | + String year=date.substring(0,4); | |
| 2183 | + String sql = "select * from bsth_c_arrival_info_"+year+" where line_id=? AND weeks_year=? " | |
| 2184 | 2184 | + " AND ts >= ? AND ts <=? AND up_down=? order by device_id,ts"; |
| 2185 | 2185 | try{ |
| 2186 | 2186 | conn = DBUtils_MS.getConnection(); |
| ... | ... | @@ -2229,8 +2229,8 @@ public class ReportServiceImpl implements ReportService{ |
| 2229 | 2229 | Connection conn = null; |
| 2230 | 2230 | PreparedStatement ps = null; |
| 2231 | 2231 | ResultSet rs = null; |
| 2232 | - | |
| 2233 | - String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year=? " | |
| 2232 | + String year=date.substring(0,4); | |
| 2233 | + String sql = "select * from bsth_c_arrival_info_"+year+" where line_id=? AND weeks_year=? " | |
| 2234 | 2234 | + " AND ts >= ? AND ts <=? AND up_down=? order by device_id,ts"; |
| 2235 | 2235 | try{ |
| 2236 | 2236 | conn = DBUtils_MS.getConnection(); |
| ... | ... | @@ -3529,7 +3529,7 @@ public class ReportServiceImpl implements ReportService{ |
| 3529 | 3529 | Long date1 = simpleDateFormat.parse(date+" 00:00:01").getTime(); |
| 3530 | 3530 | Long date2=simpleDateFormat.parse(date+" 23:59:59").getTime(); |
| 3531 | 3531 | Date dates=simpleDateFormat.parse(date+" 00:00:00"); |
| 3532 | - List<ArrivalInfo> lists=load_online(line,date1,date2,dates); | |
| 3532 | + List<ArrivalInfo> lists=load_online(line,date1,date2,dates,date); | |
| 3533 | 3533 | for (int i = 0; i < list.size(); i++) { |
| 3534 | 3534 | String nbbm=list.get(i); |
| 3535 | 3535 | String sbbb=BasicData.deviceId2NbbmMap.inverse().get(nbbm); |
| ... | ... | @@ -3582,7 +3582,7 @@ public class ReportServiceImpl implements ReportService{ |
| 3582 | 3582 | return map; |
| 3583 | 3583 | } |
| 3584 | 3584 | |
| 3585 | - public List<ArrivalInfo> load_online(String line,Long date1,Long date2,Date dates){ | |
| 3585 | + public List<ArrivalInfo> load_online(String line,Long date1,Long date2,Date dates,String date){ | |
| 3586 | 3586 | List<ArrivalInfo> list = null; |
| 3587 | 3587 | Calendar cal = Calendar.getInstance(); |
| 3588 | 3588 | cal.setTime(dates); |
| ... | ... | @@ -3592,8 +3592,8 @@ public class ReportServiceImpl implements ReportService{ |
| 3592 | 3592 | Connection conn = null; |
| 3593 | 3593 | PreparedStatement ps = null; |
| 3594 | 3594 | ResultSet rs = null; |
| 3595 | - | |
| 3596 | - String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year=? AND ts > ? AND ts <=? order by ts"; | |
| 3595 | + String year=date.substring(0,4); | |
| 3596 | + String sql = "select * from bsth_c_arrival_info_"+year+" where line_id=? AND weeks_year=? AND ts > ? AND ts <=? order by ts"; | |
| 3597 | 3597 | try{ |
| 3598 | 3598 | conn = DBUtils_MS.getConnection(); |
| 3599 | 3599 | ps = conn.prepareStatement(sql); | ... | ... |
src/main/java/com/bsth/service/traffic/impl/VehicleInoutStopServiceImpl.java
| ... | ... | @@ -2,9 +2,12 @@ package com.bsth.service.traffic.impl; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.traffic.VehicleInoutStop; |
| 4 | 4 | import com.bsth.service.impl.BaseServiceImpl; |
| 5 | +import com.bsth.service.impl.TrafficManageServiceImpl; | |
| 5 | 6 | import com.bsth.service.traffic.VehicleInoutStopService; |
| 6 | 7 | import com.bsth.util.DateUtils; |
| 7 | 8 | import com.bsth.util.db.DBUtils_MS; |
| 9 | +import org.slf4j.Logger; | |
| 10 | +import org.slf4j.LoggerFactory; | |
| 8 | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | 12 | import org.springframework.jdbc.core.JdbcTemplate; |
| 10 | 13 | import org.springframework.stereotype.Service; |
| ... | ... | @@ -30,9 +33,7 @@ import java.util.Map; |
| 30 | 33 | |
| 31 | 34 | @Service |
| 32 | 35 | public class VehicleInoutStopServiceImpl extends BaseServiceImpl<VehicleInoutStop,Integer> implements VehicleInoutStopService { |
| 33 | - | |
| 34 | - @Autowired | |
| 35 | - JdbcTemplate jdbcTemplate; | |
| 36 | + Logger logger = LoggerFactory.getLogger(TrafficManageServiceImpl.class); | |
| 36 | 37 | |
| 37 | 38 | /** |
| 38 | 39 | * 拼装sql |
| ... | ... | @@ -81,6 +82,7 @@ public class VehicleInoutStopServiceImpl extends BaseServiceImpl<VehicleInoutSto |
| 81 | 82 | "if( up_down= 0,'上行','下行') as up_down ," + |
| 82 | 83 | "if( in_out_stop= 0,'站内','站外') as in_out_stop , " + |
| 83 | 84 | "stop,report_date FROM bsth_c_shreal " + packageParam(map,"") ; |
| 85 | + logger.info("车载上报停靠站查询sql:",sql); | |
| 84 | 86 | List<Map<String, Object>> result = jdbcTemp.queryForList(sql); |
| 85 | 87 | return result; |
| 86 | 88 | } | ... | ... |
src/main/java/com/bsth/websocket/handler/SendUtils.java
| ... | ... | @@ -168,8 +168,7 @@ public class SendUtils{ |
| 168 | 168 | ObjectMapper mapper = new ObjectMapper(); |
| 169 | 169 | |
| 170 | 170 | try { |
| 171 | - socketHandler.sendMessage(mapper.writeValueAsString(map)); | |
| 172 | - | |
| 171 | + socketHandler.sendMessageToLine(sd.getXlbm(), mapper.writeValueAsString(map)); | |
| 173 | 172 | } catch (JsonProcessingException e) { |
| 174 | 173 | logger.error("", e); |
| 175 | 174 | } | ... | ... |
src/main/resources/fatso/start.js
| ... | ... | @@ -16,7 +16,7 @@ var platform = process.platform; |
| 16 | 16 | var iswin = platform=='win32'; |
| 17 | 17 | var sp = platform=='win32'?'\\':'/'; |
| 18 | 18 | //不参与的目录 |
| 19 | -var excludes = ['scheduleApp', 'trafficManage', 'control', 'permission'+sp+'authorize_all', 'summary', 'history_sch' ,'report'+sp+'oil','base'+sp+'geo_data_edit', 'forms', 'report'] | |
| 19 | +var excludes = ['scheduleApp', 'trafficManage', 'control', 'permission'+sp+'authorize_all', 'summary', 'history_sch' ,'report'+sp+'oil','base'+sp+'geo_data_edit', 'forms','mforms', 'report', 'punctual'] | |
| 20 | 20 | ,ep = new EventProxy() |
| 21 | 21 | ,pName = 'bsth_control' |
| 22 | 22 | ,path = process.cwd() | ... | ... |
src/main/resources/ms-jdbc.properties
| ... | ... | @@ -4,6 +4,6 @@ |
| 4 | 4 | #ms.mysql.password= 123456 |
| 5 | 5 | |
| 6 | 6 | ms.mysql.driver= com.mysql.jdbc.Driver |
| 7 | -ms.mysql.url= jdbc:mysql://10.10.150.21:3306/ms?useUnicode=true&characterEncoding=utf-8 | |
| 7 | +ms.mysql.url= jdbc:mysql://10.10.200.226:3306/ms?useUnicode=true&characterEncoding=utf-8 | |
| 8 | 8 | ms.mysql.username= root |
| 9 | -ms.mysql.password= root2jsp@JSP | |
| 9 | +ms.mysql.password= root2jsp | ... | ... |
src/main/resources/static/pages/base/line/js/line-list-table.js
| ... | ... | @@ -101,7 +101,7 @@ |
| 101 | 101 | var len_ = array.length,paramsD = new Array(); |
| 102 | 102 | if(len_>0) { |
| 103 | 103 | $.each(array, function(i, g){ |
| 104 | - if(g.name!='' || g.name != null) { | |
| 104 | + if(g.remove != 1 && (g.name!='' || g.name != null)) { | |
| 105 | 105 | paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name + gsdmTogsName(compD,g.company)}); |
| 106 | 106 | } |
| 107 | 107 | }); | ... | ... |
src/main/resources/static/pages/base/line/list.html
| ... | ... | @@ -305,7 +305,7 @@ |
| 305 | 305 | <a href="edit.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a> |
| 306 | 306 | |
| 307 | 307 | {{if obj.destroy==1}} |
| 308 | - <a class="ct_base_line_delete_link" data-id="{{obj.id}}" data-name="{{obj.name}}"> 删除 </a> | |
| 308 | + <!--<a class="ct_base_line_delete_link" data-id="{{obj.id}}" data-name="{{obj.name}}"> 删除 </a>--> | |
| 309 | 309 | {{/if}} |
| 310 | 310 | </td> |
| 311 | 311 | </tr> | ... | ... |
src/main/resources/static/pages/base/section/js/section-list-table.js
| ... | ... | @@ -147,7 +147,7 @@ |
| 147 | 147 | var len_ = array.length,paramsD = new Array(); |
| 148 | 148 | if(len_>0) { |
| 149 | 149 | $.each(array, function(i, g){ |
| 150 | - if(g.name!='' || g.name != null) { | |
| 150 | + if(g.remove != 1 && (g.name!='' || g.name != null)) { | |
| 151 | 151 | paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name + gsdmTogsName(compD,g.company)}); |
| 152 | 152 | } |
| 153 | 153 | }); | ... | ... |
src/main/resources/static/pages/base/station/js/station-list-table.js
| ... | ... | @@ -173,7 +173,7 @@ |
| 173 | 173 | var len_ = array.length,paramsD = new Array(); |
| 174 | 174 | if(len_>0) { |
| 175 | 175 | $.each(array, function(i, g){ |
| 176 | - if(g.name!='' || g.name != null) { | |
| 176 | + if(g.remove != 1 && (g.name!='' || g.name != null)) { | |
| 177 | 177 | paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name + gsdmTogsName(compD,g.company)}); |
| 178 | 178 | } |
| 179 | 179 | }); | ... | ... |
src/main/resources/static/pages/forms/statement/firstAndLastBus_delay.html
src/main/resources/static/pages/home.html
| ... | ... | @@ -64,7 +64,7 @@ |
| 64 | 64 | <li class="sub_title"><h6>基础信息</h6></li> |
| 65 | 65 | <li><span class="label s_c_add">新增</span>1、新增站点间双路段生成功能。</li> |
| 66 | 66 | <li><span class="label s_c_change">修复</span>2、修复一个bug,在线路编辑页面初始化线路的系统规划功能,百度地图上缺少的线路会显示一直加载。</li> |
| 67 | - <li><span class="label s_c_change">修复</span>3、修复一个bug,在修改站点时选择取消,不点击站点树状图,直接选择上/下行操作里的修改站点,会出现没有可修改站点的bug。</li> | |
| 67 | + <li><span class="label s_c_change">修改</span>3、修改站点位置修改。</li> | |
| 68 | 68 | <li><span class="label s_c_add">新增</span>4、新增线路删除功能,可以删除已撤销的线路,仅用于剔除录入错误的数据,如出现误操作,请联系管理员恢复数据。</li> |
| 69 | 69 | <li class="sub_title"><h6>用油和报表</h6></li> |
| 70 | 70 | <li><span class="label s_c_add">新增</span>5、油量,电量记录操作日志。</li> | ... | ... |
src/main/resources/static/pages/punctual/list.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" style="margin-left: 20px"> | |
| 21 | + <button id="exportList">数据导出</button> | |
| 22 | + </div> | |
| 23 | +</div> | |
| 24 | + | |
| 25 | +<div class="row" id="onTime"> | |
| 26 | + <div class="col-md-12"> | |
| 27 | + <div class="portlet light porttlet-fit bordered"> | |
| 28 | + <div class="portlet-body"> | |
| 29 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 600px"> | |
| 30 | + <table class="table table-bordered table-hover table-checkable" id="forms_2"> | |
| 31 | + <thead> | |
| 32 | + <tr> | |
| 33 | + <td></td> | |
| 34 | +<!-- <td>日期</td> --> | |
| 35 | +<!-- <td>线路</td> --> | |
| 36 | + <td>站点</td> | |
| 37 | + <td>车辆自编号</td> | |
| 38 | + <td>驾驶员</td> | |
| 39 | + <td>路牌</td> | |
| 40 | + <td>计划发车</td> | |
| 41 | + <td>实际发车</td> | |
| 42 | + <td>发车准点</td> | |
| 43 | + <td>计划到站</td> | |
| 44 | + <td>实际到站</td> | |
| 45 | + <td>到站准点</td> | |
| 46 | + </tr> | |
| 47 | + </thead> | |
| 48 | + | |
| 49 | + <tbody> | |
| 50 | + | |
| 51 | + </tbody> | |
| 52 | + </table> | |
| 53 | + </div> | |
| 54 | + </div> | |
| 55 | + </div> | |
| 56 | + </div> | |
| 57 | +</div> | |
| 58 | +<script src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script> | |
| 59 | +<script> | |
| 60 | + $(function(){ | |
| 61 | + // 关闭左侧栏 | |
| 62 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 63 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 64 | + var no=""; | |
| 65 | + $("#onTime").on('init', function (e, id) { | |
| 66 | + no=id; | |
| 67 | + var date = id.split("_")[0]; | |
| 68 | + var endDate = date; | |
| 69 | + var line = id.split("_")[1]; | |
| 70 | + var fgs=$('#fgsdm').val(); | |
| 71 | + var gs=$('#gsdm').val(); | |
| 72 | + $get('/busInterval/onTime',{line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs,flag:2},function(result){ | |
| 73 | + var onTime_2 = template('onTime_2',{list:result}); | |
| 74 | + $('#forms_2 tbody').html(onTime_2); | |
| 75 | + }); | |
| 76 | + }); | |
| 77 | + $("#exportList").on('click',function(){ | |
| 78 | + $("#forms_2").table2excel({ | |
| 79 | + // 不被导出的表格行的CSS class类 | |
| 80 | + exclude: ".noExl", | |
| 81 | + // 导出的Excel文档的名称,(没看到作用) | |
| 82 | + name: "Excel Document Name.xlsx", | |
| 83 | + // Excel文件的名称 | |
| 84 | + filename: "发车到站准点率" | |
| 85 | + }); | |
| 86 | + }); | |
| 87 | + | |
| 88 | + }); | |
| 89 | +</script> | |
| 90 | +<script type="text/html" id="onTime_2"> | |
| 91 | + {{each list as obj i}} | |
| 92 | + <tr> | |
| 93 | + <td>{{i+1}}</td> | |
| 94 | + <td>{{obj.zd}}</td> | |
| 95 | + <td>{{obj.clzbh}}</td> | |
| 96 | + <td>{{obj.jsy}}</td> | |
| 97 | + <td>{{obj.lp}}</td> | |
| 98 | + <td {{if obj.fcsjflag=="1"}}style="color: red" {{/if}}>{{obj.fcsj}}</td> | |
| 99 | + <td {{if obj.fcsjflag=="1"}}style="color: red" {{/if}}>{{obj.fcsjA}}</td> | |
| 100 | + <td {{if obj.fcsjflag=="1"}}style="color: red" {{/if}}> | |
| 101 | + {{if obj.fcsjflag!="1"}}准点{{else}}不准点{{/if}} | |
| 102 | + </td> | |
| 103 | + <td {{if obj.zdsjflag=="1"}}style="color: red" {{/if}}>{{obj.zdsj}}</td> | |
| 104 | + <td {{if obj.zdsjflag=="1"}}style="color: red" {{/if}}>{{obj.zdsjA}}</td> | |
| 105 | + <td {{if obj.zdsjflag=="1"}}style="color: red" {{/if}}> | |
| 106 | + {{if obj.zdsjflag!="1"}}准点{{else}}不准点{{/if}} | |
| 107 | + </td> | |
| 108 | + </tr> | |
| 109 | + {{/each}} | |
| 110 | + {{if list.length == 0}} | |
| 111 | + <tr> | |
| 112 | + <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td> | |
| 113 | + </tr> | |
| 114 | + {{/if}} | |
| 115 | +</script> | |
| 0 | 116 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/punctual/onTime.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 class="form-inline" action=""> | |
| 30 | + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv"> | |
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | |
| 32 | + <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select> | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block; margin-left: 38px;" id="fgsdmDiv"> | |
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | |
| 36 | + <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select> | |
| 37 | + </div> | |
| 38 | + <div style="margin-top: 10px"> | |
| 39 | + </div> | |
| 40 | + <div style="display: inline-block;margin-left: 33px;"> | |
| 41 | + <span class="item-label" style="width: 80px;">线路: </span> | |
| 42 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | |
| 43 | + </div> | |
| 44 | + <div style="display: inline-block;"> | |
| 45 | + <span class="item-label" style="width: 80px;margin-left: 24px;">开始时间: </span> | |
| 46 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | |
| 47 | + </div> | |
| 48 | + <div style="display: inline-block;"> | |
| 49 | + <span class="item-label" style="width: 80px;margin-left: 24px;">结束时间: </span> | |
| 50 | + <input class="form-control" type="text" id="endDate" style="width: 180px;"/> | |
| 51 | + </div> | |
| 52 | + | |
| 53 | + <div class="form-group"> | |
| 54 | + <input class="btn btn-default" type="button" id="query" value="查询"/> | |
| 55 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 56 | + </div> | |
| 57 | + </form> | |
| 58 | + </div> | |
| 59 | + <div class="portlet-body"> | |
| 60 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 61 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | |
| 62 | + <thead> | |
| 63 | + <tr> | |
| 64 | + <td>公司</td> | |
| 65 | + <td>分公司</td> | |
| 66 | + <td>线路</td> | |
| 67 | + <td>班次数</td> | |
| 68 | + <td>发车准点班次</td> | |
| 69 | + <td>到站准点班次</td> | |
| 70 | + <td>发车准点率</td> | |
| 71 | + <td>到站准点率</td> | |
| 72 | + <td>查看</td> | |
| 73 | + </tr> | |
| 74 | + </thead> | |
| 75 | + | |
| 76 | + <tbody> | |
| 77 | + | |
| 78 | + </tbody> | |
| 79 | + </table> | |
| 80 | + | |
| 81 | + <table class="hidden" id="forms_h"> | |
| 82 | + <thead> | |
| 83 | + <tr> | |
| 84 | + <td>公司</td> | |
| 85 | + <td>分公司</td> | |
| 86 | + <td>线路</td> | |
| 87 | + <td>班次数</td> | |
| 88 | + <td>发车准点班次</td> | |
| 89 | + <td>到站准点班次</td> | |
| 90 | + <td>发车准点率</td> | |
| 91 | + <td>到站准点率</td> | |
| 92 | + </tr> | |
| 93 | + </thead> | |
| 94 | + | |
| 95 | + <tbody> | |
| 96 | + | |
| 97 | + </tbody> | |
| 98 | + </table> | |
| 99 | + </div> | |
| 100 | + | |
| 101 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 102 | + <input class="btn btn-default hidden" type="button" id="export_1" value="导出"/> | |
| 103 | + <table class="table table-bordered table-hover table-checkable" id="forms_1"> | |
| 104 | + <thead> | |
| 105 | + <tr class="hidden"> | |
| 106 | + <td>公司</td> | |
| 107 | + <td>分公司</td> | |
| 108 | + <td>日期</td> | |
| 109 | + <td>线路</td> | |
| 110 | + <td>班次数</td> | |
| 111 | + <td>发车准点班次</td> | |
| 112 | + <td>到站准点班次</td> | |
| 113 | + <td>发车准点率</td> | |
| 114 | + <td>到站准点率</td> | |
| 115 | + <td>查看</td> | |
| 116 | + </tr> | |
| 117 | + </thead> | |
| 118 | + | |
| 119 | + <tbody> | |
| 120 | + | |
| 121 | + </tbody> | |
| 122 | + </table> | |
| 123 | + <table class="hidden" id="forms_1_h"> | |
| 124 | + <thead> | |
| 125 | + <tr > | |
| 126 | + <td>公司</td> | |
| 127 | + <td>分公司</td> | |
| 128 | + <td>日期</td> | |
| 129 | + <td>线路</td> | |
| 130 | + <td>班次数</td> | |
| 131 | + <td>发车准点班次</td> | |
| 132 | + <td>到站准点班次</td> | |
| 133 | + <td>发车准点率</td> | |
| 134 | + <td>到站准点率</td> | |
| 135 | + </tr> | |
| 136 | + </thead> | |
| 137 | + | |
| 138 | + <tbody> | |
| 139 | + | |
| 140 | + </tbody> | |
| 141 | + </table> | |
| 142 | + </div> | |
| 143 | + </div> | |
| 144 | + </div> | |
| 145 | + </div> | |
| 146 | +</div> | |
| 147 | +<script src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script> | |
| 148 | +<script> | |
| 149 | + $(function(){ | |
| 150 | + // 关闭左侧栏 | |
| 151 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 152 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 153 | + | |
| 154 | + var d = new Date(); | |
| 155 | + d.setTime(d.getTime() - 3*1000*60*60*24); | |
| 156 | + var year = d.getFullYear(); | |
| 157 | + var month = d.getMonth() + 1; | |
| 158 | + var day = d.getDate(); | |
| 159 | + if(month < 10) | |
| 160 | + month = "0"+month; | |
| 161 | + if(day < 10) | |
| 162 | + day = "0"+day; | |
| 163 | + var dateTime = year + "-" + month + "-" + day; | |
| 164 | + $("#date").datetimepicker({ | |
| 165 | + format : 'YYYY-MM-DD', | |
| 166 | + locale : 'zh-cn', | |
| 167 | + maxDate : dateTime | |
| 168 | + }); | |
| 169 | + $("#endDate").datetimepicker({ | |
| 170 | + format : 'YYYY-MM-DD', | |
| 171 | + locale : 'zh-cn', | |
| 172 | + maxDate : dateTime | |
| 173 | + }); | |
| 174 | + $("#date").val(dateTime); | |
| 175 | + $("#endDate").val(dateTime); | |
| 176 | + | |
| 177 | + var fage=false; | |
| 178 | + var obj = []; | |
| 179 | + var xlList; | |
| 180 | + $.get('/report/lineList',function(result){ | |
| 181 | + xlList=result; | |
| 182 | + | |
| 183 | + $.get('/user/companyData', function(result){ | |
| 184 | + obj = result; | |
| 185 | + console.log(obj); | |
| 186 | + var options = ''; | |
| 187 | + for(var i = 0; i < obj.length; i++){ | |
| 188 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 189 | + } | |
| 190 | + | |
| 191 | + if(obj.length ==0){ | |
| 192 | + $("#gsdmDiv").css('display','none'); | |
| 193 | + }else if(obj.length ==1){ | |
| 194 | + $("#gsdmDiv").css('display','none'); | |
| 195 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 196 | + $('#fgsdmDiv').css('display','none'); | |
| 197 | + } | |
| 198 | + $('#gsdm').html(options); | |
| 199 | + | |
| 200 | + updateCompany(); | |
| 201 | + }); | |
| 202 | + }); | |
| 203 | + | |
| 204 | + $("#gsdm").on("change",updateCompany); | |
| 205 | + function updateCompany(){ | |
| 206 | + var company = $('#gsdm').val(); | |
| 207 | + var options = ''; | |
| 208 | + for(var i = 0; i < obj.length; i++){ | |
| 209 | + if(obj[i].companyCode == company){ | |
| 210 | + var children = obj[i].children; | |
| 211 | + for(var j = 0; j < children.length; j++){ | |
| 212 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 213 | + } | |
| 214 | + } | |
| 215 | + } | |
| 216 | + $('#fgsdm').html(options); | |
| 217 | + } | |
| 218 | + | |
| 219 | + var tempData = {}; | |
| 220 | + $.get('/report/lineList',function(xlList){ | |
| 221 | + var data = []; | |
| 222 | + data.push({id: " ", text: "全部线路"}); | |
| 223 | + $.get('/user/companyData', function(result){ | |
| 224 | + for(var i = 0; i < result.length; i++){ | |
| 225 | + var companyCode = result[i].companyCode; | |
| 226 | + var children = result[i].children; | |
| 227 | + for(var j = 0; j < children.length; j++){ | |
| 228 | + var code = children[j].code; | |
| 229 | + for(var k=0;k < xlList.length;k++ ){ | |
| 230 | + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | |
| 231 | + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | |
| 232 | + tempData[xlList[k]["xlbm"]] = companyCode+":"+code; | |
| 233 | + } | |
| 234 | + } | |
| 235 | + } | |
| 236 | + } | |
| 237 | + initPinYinSelect2('#line',data,''); | |
| 238 | + | |
| 239 | + }); | |
| 240 | + }); | |
| 241 | + | |
| 242 | + | |
| 243 | + $("#line").on("change", function(){ | |
| 244 | + if($("#line").val() == " "){ | |
| 245 | + $("#gsdm").attr("disabled", false); | |
| 246 | + $("#fgsdm").attr("disabled", false); | |
| 247 | + } else { | |
| 248 | + var temp = tempData[$("#line").val()].split(":"); | |
| 249 | + $("#gsdm").val(temp[0]); | |
| 250 | + updateCompany(); | |
| 251 | + $("#fgsdm").val(temp[1]); | |
| 252 | + $("#gsdm").attr("disabled", true); | |
| 253 | + $("#fgsdm").attr("disabled", true); | |
| 254 | + } | |
| 255 | + }); | |
| 256 | + | |
| 257 | + | |
| 258 | + //查询 | |
| 259 | + $("#query").on('click',function(){ | |
| 260 | + var line = $("#line").val(); | |
| 261 | + var date = $("#date").val(); | |
| 262 | + var endDate = $("#endDate").val(); | |
| 263 | + var fgs=$('#fgsdm').val(); | |
| 264 | + var gs=$('#gsdm').val(); | |
| 265 | + var i = layer.load(2); | |
| 266 | + $get('/busInterval/onTime',{line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs},function(result){ | |
| 267 | + var onTime = template('onTime',{list:result}); | |
| 268 | + $('#forms tbody').html(onTime); | |
| 269 | + $('#forms_h tbody').html(template('onTime_h',{list:result})); | |
| 270 | + $('.btn-onTime').on('click', showSheetList); | |
| 271 | + layer.close(i); | |
| 272 | + }); | |
| 273 | + }); | |
| 274 | + function showSheetList(){ | |
| 275 | + var line = $(this).data('id'); | |
| 276 | + var date = $("#date").val(); | |
| 277 | + var endDate = $("#endDate").val(); | |
| 278 | + var fgs=$('#fgsdm').val(); | |
| 279 | + var gs=$('#gsdm').val(); | |
| 280 | + var i = layer.load(2); | |
| 281 | + $get('/busInterval/onTime',{line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs,flag:1},function(result){ | |
| 282 | + var onTime = template('onTime_1',{list:result}); | |
| 283 | + $('#forms_1 tbody').html(onTime); | |
| 284 | + $('#forms_1_h tbody').html(template('onTime_1_h',{list:result})); | |
| 285 | + $("#forms_1 .hidden").removeClass("hidden"); | |
| 286 | + $('.btn-onTime_1').on('click', openSheetList); | |
| 287 | + $("#export_1").removeClass("hidden"); | |
| 288 | + $("html,body").animate({scrollTop:$("#forms_1").offset().top},1000); | |
| 289 | + layer.close(i); | |
| 290 | + }); | |
| 291 | + } | |
| 292 | + function openSheetList(){ | |
| 293 | + var id = $(this).data('id'); | |
| 294 | + var date = id.split("_")[0]; | |
| 295 | + var endDate = date; | |
| 296 | + var line = id.split("_")[1]; | |
| 297 | + var fgs=$('#fgsdm').val(); | |
| 298 | + var gs=$('#gsdm').val(); | |
| 299 | + $.get('/pages/punctual/list.html', function (content) { | |
| 300 | + layer.open({ | |
| 301 | + type: 1, | |
| 302 | + area: ['800px', '600px'], | |
| 303 | + content: content, | |
| 304 | + title: '线路准点率详细 - ' + id.split("_")[2] + ' - ' + date, | |
| 305 | + shift: 5, | |
| 306 | + scrollbar: false, | |
| 307 | + success: function () { | |
| 308 | + $('#onTime').trigger('init', id); | |
| 309 | + $('#onTime').unbind(); | |
| 310 | + } | |
| 311 | + }); | |
| 312 | + }); | |
| 313 | + } | |
| 314 | + $("#export").on("click",function(){ | |
| 315 | + var date = $("#date").val(); | |
| 316 | + var endDate = $("#endDate").val(); | |
| 317 | + $("#forms_h").table2excel({ | |
| 318 | + // 不被导出的表格行的CSS class类 | |
| 319 | + exclude: ".noExl", | |
| 320 | + // 导出的Excel文档的名称,(没看到作用) | |
| 321 | + name: "Excel Document Name.xlsx", | |
| 322 | + // Excel文件的名称 | |
| 323 | + filename: date+"-"+endDate+"发车到站准点率" | |
| 324 | + }); | |
| 325 | + }) | |
| 326 | + | |
| 327 | + $("#export_1").on("click",function(){ | |
| 328 | + var date = $("#date").val(); | |
| 329 | + var endDate = $("#endDate").val(); | |
| 330 | + $("#forms_1_h").table2excel({ | |
| 331 | + // 不被导出的表格行的CSS class类 | |
| 332 | + exclude: ".noExl", | |
| 333 | + // 导出的Excel文档的名称,(没看到作用) | |
| 334 | + name: "Excel Document Name.xlsx", | |
| 335 | + // Excel文件的名称 | |
| 336 | + filename: date+"-"+endDate+"发车到站准点率" | |
| 337 | + }); | |
| 338 | + }) | |
| 339 | + | |
| 340 | + }); | |
| 341 | +</script> | |
| 342 | +<script type="text/html" id="onTime"> | |
| 343 | + {{each list as obj i}} | |
| 344 | + <tr> | |
| 345 | + <td>{{obj.gs}}</td> | |
| 346 | + <td>{{obj.fgs}}</td> | |
| 347 | + <td>{{obj.line}}</td> | |
| 348 | + <td>{{obj.bcs}}</td> | |
| 349 | + <td>{{obj.fczd}}</td> | |
| 350 | + <td>{{obj.zdzd}}</td> | |
| 351 | + <td>{{obj.fczdl}}</td> | |
| 352 | + <td>{{obj.zdzdl}}</td> | |
| 353 | + <td> | |
| 354 | + <button type="button" class="btn btn-sm blue btn-onTime" | |
| 355 | + data-id="{{obj.xlbm}}">查看</button> | |
| 356 | + </td> | |
| 357 | + </tr> | |
| 358 | + {{/each}} | |
| 359 | + {{if list.length == 0}} | |
| 360 | + <tr> | |
| 361 | + <td colspan="9"><h6 class="muted">没有找到相关数据</h6></td> | |
| 362 | + </tr> | |
| 363 | + {{/if}} | |
| 364 | +</script> | |
| 365 | + | |
| 366 | +<script type="text/html" id="onTime_h"> | |
| 367 | + {{each list as obj i}} | |
| 368 | + <tr> | |
| 369 | + <td>{{obj.gs}}</td> | |
| 370 | + <td>{{obj.fgs}}</td> | |
| 371 | + <td>{{obj.line}}</td> | |
| 372 | + <td>{{obj.bcs}}</td> | |
| 373 | + <td>{{obj.fczd}}</td> | |
| 374 | + <td>{{obj.zdzd}}</td> | |
| 375 | + <td>{{obj.fczdl}}</td> | |
| 376 | + <td>{{obj.zdzdl}}</td> | |
| 377 | + </tr> | |
| 378 | + {{/each}} | |
| 379 | + {{if list.length == 0}} | |
| 380 | + <tr> | |
| 381 | + <td colspan="9"><h6 class="muted">没有找到相关数据</h6></td> | |
| 382 | + </tr> | |
| 383 | + {{/if}} | |
| 384 | +</script> | |
| 385 | + | |
| 386 | +<script type="text/html" id="onTime_1"> | |
| 387 | + {{each list as obj i}} | |
| 388 | + <tr> | |
| 389 | + <td>{{obj.gs}}</td> | |
| 390 | + <td>{{obj.fgs}}</td> | |
| 391 | + <td>{{obj.date}}</td> | |
| 392 | + <td>{{obj.line}}</td> | |
| 393 | + <td>{{obj.bcs}}</td> | |
| 394 | + <td>{{obj.fczd}}</td> | |
| 395 | + <td>{{obj.zdzd}}</td> | |
| 396 | + <td>{{obj.fczdl}}</td> | |
| 397 | + <td>{{obj.zdzdl}}</td> | |
| 398 | + <td> | |
| 399 | + <button type="button" class="btn btn-sm blue btn-onTime_1" | |
| 400 | + data-id="{{obj.xl_date}}">详细</button> | |
| 401 | + </td> | |
| 402 | + </tr> | |
| 403 | + {{/each}} | |
| 404 | + {{if list.length == 0}} | |
| 405 | + <tr> | |
| 406 | + <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td> | |
| 407 | + </tr> | |
| 408 | + {{/if}} | |
| 409 | +</script> | |
| 410 | + | |
| 411 | + | |
| 412 | +<script type="text/html" id="onTime_1_h"> | |
| 413 | + {{each list as obj i}} | |
| 414 | + <tr> | |
| 415 | + <td>{{obj.gs}}</td> | |
| 416 | + <td>{{obj.fgs}}</td> | |
| 417 | + <td>{{obj.date}}</td> | |
| 418 | + <td>{{obj.line}}</td> | |
| 419 | + <td>{{obj.bcs}}</td> | |
| 420 | + <td>{{obj.fczd}}</td> | |
| 421 | + <td>{{obj.zdzd}}</td> | |
| 422 | + <td>{{obj.fczdl}}</td> | |
| 423 | + <td>{{obj.zdzdl}}</td> | |
| 424 | + </tr> | |
| 425 | + {{/each}} | |
| 426 | + {{if list.length == 0}} | |
| 427 | + <tr> | |
| 428 | + <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td> | |
| 429 | + </tr> | |
| 430 | + {{/if}} | |
| 431 | +</script> | |
| 0 | 432 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/report/inoutstation.html
| ... | ... | @@ -419,6 +419,8 @@ |
| 419 | 419 | layer.msg("请选择时间"); |
| 420 | 420 | }else if(zdlx=="" || zdlx==null){ |
| 421 | 421 | layer.msg("请选择方向"); |
| 422 | + }else if(zd=="" || zd==null){ | |
| 423 | + layer.msg("请选择站点"); | |
| 422 | 424 | }else{ |
| 423 | 425 | var xlmc="线路: "+$("#select2-line-container").html(); |
| 424 | 426 | var rqmc="日期: "+date1+"-"+date2; | ... | ... |
src/main/resources/static/pages/report/sheet/sheetList.html
| ... | ... | @@ -143,27 +143,28 @@ |
| 143 | 143 | if (!$('body').hasClass('page-sidebar-closed')) |
| 144 | 144 | $('.menu-toggler.sidebar-toggler').click(); |
| 145 | 145 | |
| 146 | - $("#date").datetimepicker({ | |
| 147 | - format : 'YYYY-MM-DD', | |
| 148 | - locale : 'zh-cn' | |
| 149 | - }); | |
| 150 | - $("#endDate").datetimepicker({ | |
| 151 | - format : 'YYYY-MM-DD', | |
| 152 | - locale : 'zh-cn' | |
| 153 | - }); | |
| 154 | 146 | var d = new Date(); |
| 147 | + d.setTime(d.getTime() - 1*1000*60*60*24); | |
| 155 | 148 | var year = d.getFullYear(); |
| 156 | 149 | var month = d.getMonth() + 1; |
| 157 | 150 | var day = d.getDate(); |
| 151 | + if(month < 10) | |
| 152 | + month = "0"+month; | |
| 158 | 153 | if(day < 10) |
| 159 | 154 | day = "0"+day; |
| 160 | - if(month > 9){ | |
| 161 | - $("#date").val(year + "-" + month + "-" + day); | |
| 162 | - $("#endDate").val(year + "-" + month + "-" + day); | |
| 163 | - } else { | |
| 164 | - $("#date").val(year + "-0" + month + "-" + day); | |
| 165 | - $("#endDate").val(year + "-" + month + "-" + day); | |
| 166 | - } | |
| 155 | + var dateTime = year + "-" + month + "-" + day; | |
| 156 | + $("#date").datetimepicker({ | |
| 157 | + format : 'YYYY-MM-DD', | |
| 158 | + locale : 'zh-cn', | |
| 159 | + maxDate : dateTime | |
| 160 | + }); | |
| 161 | + $("#endDate").datetimepicker({ | |
| 162 | + format : 'YYYY-MM-DD', | |
| 163 | + locale : 'zh-cn', | |
| 164 | + maxDate : dateTime | |
| 165 | + }); | |
| 166 | + $("#date").val(dateTime); | |
| 167 | + $("#endDate").val(dateTime); | |
| 167 | 168 | |
| 168 | 169 | var fage=false; |
| 169 | 170 | var obj = []; |
| ... | ... | @@ -205,6 +206,7 @@ |
| 205 | 206 | } |
| 206 | 207 | } |
| 207 | 208 | $('#fgsdm').html(options); |
| 209 | + } | |
| 208 | 210 | |
| 209 | 211 | var tempData = {}; |
| 210 | 212 | $.get('/report/lineList',function(xlList){ |
| ... | ... | @@ -242,7 +244,6 @@ |
| 242 | 244 | $("#fgsdm").attr("disabled", true); |
| 243 | 245 | } |
| 244 | 246 | }); |
| 245 | - } | |
| 246 | 247 | |
| 247 | 248 | |
| 248 | 249 | ... | ... |
src/main/resources/static/pages/trafficManage/js/lineStationUpload.js
| ... | ... | @@ -13,45 +13,49 @@ |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | (function(){ |
| 16 | + function getComp(cb) { | |
| 17 | + $.get('/user/companyData',null,function(rs) { | |
| 18 | + return cb && cb(rs); | |
| 19 | + }); | |
| 20 | + } | |
| 21 | + | |
| 22 | + initLineSelect2(); | |
| 16 | 23 | |
| 17 | - $('#line').select2({ | |
| 18 | - ajax: { | |
| 19 | - url: '/realSchedule/findLine', | |
| 20 | - type: 'post', | |
| 21 | - dataType: 'json', | |
| 22 | - delay: 150, | |
| 23 | - data: function(params){ | |
| 24 | - return{line: params.term}; | |
| 25 | - }, | |
| 26 | - processResults: function (data) { | |
| 27 | - return { | |
| 28 | - results: data | |
| 29 | - }; | |
| 30 | - }, | |
| 31 | - cache: true | |
| 32 | - }, | |
| 33 | - templateResult: function(repo){ | |
| 34 | - if (repo.loading) return repo.text; | |
| 35 | - var h = '<span>'+repo.text+'</span>'; | |
| 36 | - return h; | |
| 37 | - }, | |
| 38 | - escapeMarkup: function (markup) { return markup; }, | |
| 39 | - minimumInputLength: 1, | |
| 40 | - templateSelection: function(repo){ | |
| 41 | - return repo.text; | |
| 42 | - }, | |
| 43 | - language: { | |
| 44 | - noResults: function(){ | |
| 45 | - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 46 | - }, | |
| 47 | - inputTooShort : function(e) { | |
| 48 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 49 | - }, | |
| 50 | - searching : function() { | |
| 51 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 24 | + function initLineSelect2(compD) { | |
| 25 | + getComp(function(rs) { | |
| 26 | + var params = {}; | |
| 27 | + if(rs.length>0) { | |
| 28 | + var compA = new Array(); | |
| 29 | + for(var c = 0 ; c<rs.length;c++) { | |
| 30 | + var comC = rs[c].companyCode; | |
| 31 | + var child = rs[c].children; | |
| 32 | + if(child.length>0) { | |
| 33 | + for(var d = 0 ;d< child.length;d++) { | |
| 34 | + compA.push(comC + '_' + child[d].code); | |
| 35 | + } | |
| 36 | + }else { | |
| 37 | + compA.push(comC); | |
| 38 | + } | |
| 39 | + } | |
| 40 | + params.cgsbm_in = compA.toString(); | |
| 52 | 41 | } |
| 53 | - } | |
| 54 | - }); | |
| 42 | + params["remove_ne"] = 1; | |
| 43 | + // 填充线路拉框选择值 | |
| 44 | + $get('/line/all', params, function(array){ | |
| 45 | + var len_ = array.length,paramsD = new Array(); | |
| 46 | + if(len_>0) { | |
| 47 | + $.each(array, function(i, g){ | |
| 48 | + if(g.name!='' || g.name != null) { | |
| 49 | + paramsD.push({'id':g.id ,'text':g.name}); | |
| 50 | + } | |
| 51 | + }); | |
| 52 | + initPinYinSelect2($('#line'),paramsD,function(selector) { | |
| 53 | + selector.select2("val", storage.xlName_AgursData); | |
| 54 | + }); | |
| 55 | + } | |
| 56 | + }); | |
| 57 | + }); | |
| 58 | + } | |
| 55 | 59 | |
| 56 | 60 | // 绑定查询事件 |
| 57 | 61 | $("#search").click(searchM); | ... | ... |
src/main/resources/static/pages/trafficManage/js/lineStationUploadRecord.js
src/main/resources/static/pages/trafficManage/js/shLineCodeList.js
| ... | ... | @@ -34,8 +34,9 @@ |
| 34 | 34 | } |
| 35 | 35 | var lines = new Array(); |
| 36 | 36 | var gsmap = getBusMap(); |
| 37 | + var pars = {"remove_ne":1}; | |
| 37 | 38 | // 取得所有线路 |
| 38 | - $get('/line/all', null, function(allLine) { | |
| 39 | + $get('/line/all', pars, function(allLine) { | |
| 39 | 40 | // 遍历数组 |
| 40 | 41 | $.each(allLine, function(i, e) { |
| 41 | 42 | var companyCode = e.company; | ... | ... |
src/main/resources/static/pages/trafficManage/js/timeTempletUpload.js
| ... | ... | @@ -13,66 +13,51 @@ |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | (function(){ |
| 16 | - /** | |
| 17 | - * 取得编码-公司map | |
| 18 | - * gsmap["5"] = 南汇公司 | |
| 19 | - * gsmap["5_3"] = 芦潮港分公司 | |
| 20 | - */ | |
| 21 | - function getBusMap(){ | |
| 22 | - // 取得公司信息,替换公司编码 | |
| 23 | - var gsmap = {}; | |
| 24 | - $get('/business/all', null, function(array){ | |
| 25 | - $.each(array, function(i, gs){ | |
| 26 | - var k = gs.upCode + '_' + gs.businessCode; | |
| 27 | - if(gs.upCode === '88'){ | |
| 28 | - k = gs.businessCode; | |
| 29 | - } | |
| 30 | - gsmap[k] = gs.businessName; | |
| 31 | - }); | |
| 32 | - }); | |
| 33 | - return gsmap; | |
| 34 | - } | |
| 35 | - var lines = new Array(); | |
| 36 | - var gsmap = getBusMap(); | |
| 37 | - | |
| 38 | - $('#line').select2({ | |
| 39 | - ajax: { | |
| 40 | - url: '/realSchedule/findLine', | |
| 41 | - type: 'post', | |
| 42 | - dataType: 'json', | |
| 43 | - delay: 150, | |
| 44 | - data: function(params){ | |
| 45 | - return{line: params.term}; | |
| 46 | - }, | |
| 47 | - processResults: function (data) { | |
| 48 | - return { | |
| 49 | - results: data | |
| 50 | - }; | |
| 51 | - }, | |
| 52 | - cache: true | |
| 53 | - }, | |
| 54 | - templateResult: function(repo){ | |
| 55 | - if (repo.loading) return repo.text; | |
| 56 | - var h = '<span>'+repo.text+'</span>'; | |
| 57 | - return h; | |
| 58 | - }, | |
| 59 | - escapeMarkup: function (markup) { return markup; }, | |
| 60 | - minimumInputLength: 1, | |
| 61 | - templateSelection: function(repo){ | |
| 62 | - return repo.text; | |
| 63 | - }, | |
| 64 | - language: { | |
| 65 | - noResults: function(){ | |
| 66 | - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 67 | - }, | |
| 68 | - inputTooShort : function(e) { | |
| 69 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 70 | - }, | |
| 71 | - searching : function() { | |
| 72 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 73 | - } | |
| 74 | - } | |
| 75 | - }); | |
| 16 | + | |
| 17 | + function getComp(cb) { | |
| 18 | + $.get('/user/companyData',null,function(rs) { | |
| 19 | + return cb && cb(rs); | |
| 20 | + }); | |
| 21 | + } | |
| 22 | + | |
| 23 | + initLineSelect2(); | |
| 24 | + | |
| 25 | + function initLineSelect2(compD) { | |
| 26 | + getComp(function(rs) { | |
| 27 | + var params = {}; | |
| 28 | + if(rs.length>0) { | |
| 29 | + var compA = new Array(); | |
| 30 | + for(var c = 0 ; c<rs.length;c++) { | |
| 31 | + var comC = rs[c].companyCode; | |
| 32 | + var child = rs[c].children; | |
| 33 | + if(child.length>0) { | |
| 34 | + for(var d = 0 ;d< child.length;d++) { | |
| 35 | + compA.push(comC + '_' + child[d].code); | |
| 36 | + } | |
| 37 | + }else { | |
| 38 | + compA.push(comC); | |
| 39 | + } | |
| 40 | + } | |
| 41 | + params.cgsbm_in = compA.toString(); | |
| 42 | + } | |
| 43 | + params["remove_ne"] = 1; | |
| 44 | + // 填充线路拉框选择值 | |
| 45 | + $get('/line/all', params, function(array){ | |
| 46 | + var len_ = array.length,paramsD = new Array(); | |
| 47 | + if(len_>0) { | |
| 48 | + $.each(array, function(i, g){ | |
| 49 | + if(g.name!='' || g.name != null) { | |
| 50 | + paramsD.push({'id':g.id ,'text':g.name}); | |
| 51 | + } | |
| 52 | + }); | |
| 53 | + initPinYinSelect2($('#line'),paramsD,function(selector) { | |
| 54 | + selector.select2("val", storage.xlName_AgursData); | |
| 55 | + }); | |
| 56 | + } | |
| 57 | + }); | |
| 58 | + }); | |
| 59 | + } | |
| 60 | + | |
| 76 | 61 | |
| 77 | 62 | // 绑定查询事件 |
| 78 | 63 | $("#search").click(searchM); | ... | ... |
src/main/resources/static/pages/trafficManage/js/timeTempletUploadRecord.js
src/main/resources/static/real_control_v2/alone_page/map/alone_data_basic.js
| ... | ... | @@ -57,7 +57,7 @@ var gb_data_basic = (function () { |
| 57 | 57 | ep.emit('all_personnel', data); |
| 58 | 58 | }); |
| 59 | 59 | function loadAllPersonnel(cb) { |
| 60 | - $.get('/personnel/all_py', function (rs) { | |
| 60 | + $.get('/basic/all_personnel_py', function (rs) { | |
| 61 | 61 | //转换成自动补全组件需要的数据 |
| 62 | 62 | var data = [], code; |
| 63 | 63 | for(var i =0, p; p = rs[i++];){ | ... | ... |
src/main/resources/static/real_control_v2/js/data/data_basic.js
| ... | ... | @@ -56,7 +56,7 @@ var gb_data_basic = (function () { |
| 56 | 56 | ep.emit('all_personnel', data); |
| 57 | 57 | }); |
| 58 | 58 | function loadAllPersonnel(cb) { |
| 59 | - $.get('/personnel/all_py', function (rs) { | |
| 59 | + $.get('/basic/all_personnel_py', function (rs) { | |
| 60 | 60 | //转换成自动补全组件需要的数据 |
| 61 | 61 | var data = [], code; |
| 62 | 62 | for(var i =0, p; p = rs[i++];){ | ... | ... |
src/main/resources/static/real_control_v2/js/forms/wrap.html
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| ... | ... | @@ -37,6 +37,8 @@ var gb_schedule_table = (function () { |
| 37 | 37 | rs[lineCode].sort(schedule_sort); |
| 38 | 38 | //calc shift |
| 39 | 39 | $.each(rs[lineCode], function () { |
| 40 | + if(this.status==-1) | |
| 41 | + clearActualTime(this); | |
| 40 | 42 | calc_sch_real_shift(this); |
| 41 | 43 | line2Schedule[lineCode][this.id] = this; |
| 42 | 44 | //子任务公里是否与计划平 |
| ... | ... | @@ -246,6 +248,8 @@ var gb_schedule_table = (function () { |
| 246 | 248 | gb_schedule_table_dbclick.init(); |
| 247 | 249 | //重新初始化双击实发发车信息微调 |
| 248 | 250 | gb_schedule_table_dbclick.sfsjCellClick($('dd.fcsjActualCell', tabCont)); |
| 251 | + //重新初始化双击车辆 | |
| 252 | + gb_schedule_table_dbclick.carCellClick($('.ct_table_body dd[data-nbbm]')); | |
| 249 | 253 | //滚动条 |
| 250 | 254 | $('.schedule-wrap .ct_table_wrap', tabCont).perfectScrollbar({suppressScrollX: true}); |
| 251 | 255 | |
| ... | ... | @@ -308,6 +312,8 @@ var gb_schedule_table = (function () { |
| 308 | 312 | //var tMaps = {}; |
| 309 | 313 | $.each(schArr, function () { |
| 310 | 314 | try { |
| 315 | + if(this.status==-1) | |
| 316 | + clearActualTime(this); | |
| 311 | 317 | //子任务公里是否与计划平 |
| 312 | 318 | this.c_t_mileage_status = calcCTaskMileageStatus(this); |
| 313 | 319 | line2Schedule[this.xlBm][this.id] = this; |
| ... | ... | @@ -332,6 +338,8 @@ var gb_schedule_table = (function () { |
| 332 | 338 | if (!isArray(schArr)) |
| 333 | 339 | schArr = [schArr]; |
| 334 | 340 | $.each(schArr, function () { |
| 341 | + if(this.status==-1) | |
| 342 | + clearActualTime(this); | |
| 335 | 343 | line2Schedule[this.xlBm][this.id] = this; |
| 336 | 344 | }); |
| 337 | 345 | }; |
| ... | ... | @@ -795,6 +803,17 @@ var gb_schedule_table = (function () { |
| 795 | 803 | } |
| 796 | 804 | }; |
| 797 | 805 | |
| 806 | + var clearActualTime = function (sch) { | |
| 807 | + try{ | |
| 808 | + sch.fcsjActual=null; | |
| 809 | + sch.fcsjActualTime=null; | |
| 810 | + sch.zdsjActual=null; | |
| 811 | + sch.zdsjActualTime=null; | |
| 812 | + }catch (e){ | |
| 813 | + console.log(e); | |
| 814 | + } | |
| 815 | + }; | |
| 816 | + | |
| 798 | 817 | return { |
| 799 | 818 | show: show, |
| 800 | 819 | findScheduleByLine: findScheduleByLine, | ... | ... |
src/main/resources/static/real_control_v2/js/safe_driv/safeDriv.js
| ... | ... | @@ -20,10 +20,10 @@ var gb_safe_driv = (function () { |
| 20 | 20 | var max = 5; |
| 21 | 21 | |
| 22 | 22 | var pop = function (sd) { |
| 23 | - //只有admin用户能收到 | |
| 23 | + /*//只有admin用户能收到 | |
| 24 | 24 | var user = gb_northToolbar.user(); |
| 25 | 25 | if (!user || user.userName.indexOf('admin') == -1) |
| 26 | - return; | |
| 26 | + return;*/ | |
| 27 | 27 | |
| 28 | 28 | //时间格式化 |
| 29 | 29 | var stm = moment(sd.ts); |
| ... | ... | @@ -60,7 +60,7 @@ var gb_safe_driv = (function () { |
| 60 | 60 | '</div>'; |
| 61 | 61 | |
| 62 | 62 | $wrap.on('click', '.safe_driv_pop', function () { |
| 63 | - var title = $(this).data('title') + ' <button data-nbbm="'+$(this).data('nbbm')+'" class="uk-button uk-button-mini uk-button-primary" id="openPhoneModalBtn" type="button">打电话</button>'; | |
| 63 | + var title = $(this).data('title');// + ' <button data-nbbm="'+$(this).data('nbbm')+'" class="uk-button uk-button-mini uk-button-primary" id="openPhoneModalBtn" type="button">打电话</button>'; | |
| 64 | 64 | var url = $(this).data('url'); |
| 65 | 65 | $(this).remove(); |
| 66 | 66 | var lightbox = UIkit.lightbox.create([ | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v3/right.html