Commit ee992a2e9c817985b3d7809e59ab942bb3b89227
Merge branch 'pudong' of 192.168.168.201:panzhaov5/bsth_control into pudong
Showing
20 changed files
with
1209 additions
and
146 deletions
src/main/java/com/bsth/controller/forms/ExportController.java
| @@ -171,6 +171,51 @@ public class ExportController { | @@ -171,6 +171,51 @@ public class ExportController { | ||
| 171 | 171 | ||
| 172 | return resList; | 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 | @RequestMapping(value = "/singledataExport", method = RequestMethod.GET) | 221 | @RequestMapping(value = "/singledataExport", method = RequestMethod.GET) |
| @@ -214,6 +259,49 @@ public class ExportController { | @@ -214,6 +259,49 @@ public class ExportController { | ||
| 214 | 259 | ||
| 215 | return resList; | 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 | @RequestMapping(value = "/singledataExportTj", method = RequestMethod.GET) | 305 | @RequestMapping(value = "/singledataExportTj", method = RequestMethod.GET) |
| 218 | public List<Map<String, Object>> singledataExportTj(@RequestParam Map<String, Object> map) { | 306 | public List<Map<String, Object>> singledataExportTj(@RequestParam Map<String, Object> map) { |
| 219 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 307 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| @@ -255,6 +343,48 @@ public class ExportController { | @@ -255,6 +343,48 @@ public class ExportController { | ||
| 255 | 343 | ||
| 256 | return resList; | 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 | @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.GET) | 389 | @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.GET) |
| 260 | public List<Map<String, Object>> vehicleloadingExport(@RequestParam Map<String, Object> map) { | 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,6 +57,13 @@ public class MCY_FormsController { | ||
| 57 | 57 | ||
| 58 | return formsService.shiftuehiclemanth(map); | 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 | @RequestMapping(value = "/shifday", method = RequestMethod.GET) | 69 | @RequestMapping(value = "/shifday", method = RequestMethod.GET) |
| @@ -80,6 +87,13 @@ public class MCY_FormsController { | @@ -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 | @RequestMapping(value = "/singledatanew", method = RequestMethod.GET) | 97 | @RequestMapping(value = "/singledatanew", method = RequestMethod.GET) |
| 84 | public List<Singledata> singledatanew(@RequestParam Map<String, Object> map) { | 98 | public List<Singledata> singledatanew(@RequestParam Map<String, Object> map) { |
| 85 | 99 | ||
| @@ -92,6 +106,12 @@ public class MCY_FormsController { | @@ -92,6 +106,12 @@ public class MCY_FormsController { | ||
| 92 | return formsService.singledatatj(map); | 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 | @RequestMapping(value = "/vehicleloading", method = RequestMethod.GET) | 116 | @RequestMapping(value = "/vehicleloading", method = RequestMethod.GET) |
| 97 | public List<Vehicleloading> vehicleloading(@RequestParam String line, @RequestParam String data) { | 117 | public List<Vehicleloading> vehicleloading(@RequestParam String line, @RequestParam String data) { |
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| @@ -553,7 +553,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -553,7 +553,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 553 | 553 | ||
| 554 | long t = System.currentTimeMillis(); | 554 | long t = System.currentTimeMillis(); |
| 555 | if(c != 1) | 555 | if(c != 1) |
| 556 | - t -= (ONE_DAY + (1000 * 60 * 60 * 2)); | 556 | + t -= (ONE_DAY + (1000 * 60 * 60 * 6)); |
| 557 | for(int i = 0; i < 3; i ++){ | 557 | for(int i = 0; i < 3; i ++){ |
| 558 | rs.add(fmtyyyyMMdd.print(t)); | 558 | rs.add(fmtyyyyMMdd.print(t)); |
| 559 | t -= ONE_DAY; | 559 | t -= ONE_DAY; |
src/main/java/com/bsth/data/directive/GatewayHttpUtils.java
| @@ -46,6 +46,13 @@ public class GatewayHttpUtils { | @@ -46,6 +46,13 @@ public class GatewayHttpUtils { | ||
| 46 | 46 | ||
| 47 | response = httpClient.execute(post); | 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 | JSONObject json = JSONObject.parseObject(EntityUtils.toString(response.getEntity())); | 56 | JSONObject json = JSONObject.parseObject(EntityUtils.toString(response.getEntity())); |
| 50 | if (null != json && json.getInteger("errCode") == 0) | 57 | if (null != json && json.getInteger("errCode") == 0) |
| 51 | code = 0; | 58 | code = 0; |
src/main/java/com/bsth/data/gpsdata_v2/handlers/OutStationProcess.java
| @@ -116,9 +116,9 @@ public class OutStationProcess { | @@ -116,9 +116,9 @@ public class OutStationProcess { | ||
| 116 | LateAdjustHandle.remove(sch); | 116 | LateAdjustHandle.remove(sch); |
| 117 | 117 | ||
| 118 | //发车的时候,同步一下状态 | 118 | //发车的时候,同步一下状态 |
| 119 | - if (!gps.isService() && !dayOfSchedule.emptyService(sch)) | 119 | + /*if (!gps.isService() && !dayOfSchedule.emptyService(sch)) |
| 120 | gpsStatusManager.changeServiceState(sch.getClZbh(), sch.getXlDir(), 0, "发车@系统"); | 120 | gpsStatusManager.changeServiceState(sch.getClZbh(), sch.getXlDir(), 0, "发车@系统"); |
| 121 | - | 121 | +*/ |
| 122 | logger.info("车辆:" + sch.getClZbh() + " 班次:" + sch.getDfsj() + "发车, 时间:" + sch.getFcsjActual()); | 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,7 +5,6 @@ import org.joda.time.format.DateTimeFormat; | ||
| 5 | import org.joda.time.format.DateTimeFormatter; | 5 | import org.joda.time.format.DateTimeFormatter; |
| 6 | import org.springframework.beans.BeansException; | 6 | import org.springframework.beans.BeansException; |
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | -import org.springframework.boot.CommandLineRunner; | ||
| 9 | import org.springframework.context.ApplicationContext; | 8 | import org.springframework.context.ApplicationContext; |
| 10 | import org.springframework.context.ApplicationContextAware; | 9 | import org.springframework.context.ApplicationContextAware; |
| 11 | import org.springframework.stereotype.Component; | 10 | import org.springframework.stereotype.Component; |
| @@ -20,7 +19,7 @@ import java.util.Set; | @@ -20,7 +19,7 @@ import java.util.Set; | ||
| 20 | * Created by panzhao on 2017/4/6. | 19 | * Created by panzhao on 2017/4/6. |
| 21 | */ | 20 | */ |
| 22 | @Component | 21 | @Component |
| 23 | -public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware { | 22 | +public class SafeDrivCenter implements ApplicationContextAware { |
| 24 | 23 | ||
| 25 | private static Set<SafeDriv> data; | 24 | private static Set<SafeDriv> data; |
| 26 | 25 | ||
| @@ -65,12 +64,6 @@ public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware | @@ -65,12 +64,6 @@ public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware | ||
| 65 | } | 64 | } |
| 66 | 65 | ||
| 67 | @Override | 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 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | 67 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { |
| 75 | sendUtils = applicationContext.getBean(SendUtils.class); | 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,6 +2,7 @@ package com.bsth.data.safe_driv; | ||
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
| 4 | import org.apache.http.HttpEntity; | 4 | import org.apache.http.HttpEntity; |
| 5 | +import org.apache.http.client.config.RequestConfig; | ||
| 5 | import org.apache.http.client.methods.CloseableHttpResponse; | 6 | import org.apache.http.client.methods.CloseableHttpResponse; |
| 6 | import org.apache.http.client.methods.HttpGet; | 7 | import org.apache.http.client.methods.HttpGet; |
| 7 | import org.apache.http.impl.client.CloseableHttpClient; | 8 | import org.apache.http.impl.client.CloseableHttpClient; |
| @@ -21,24 +22,43 @@ import java.util.List; | @@ -21,24 +22,43 @@ import java.util.List; | ||
| 21 | @Component | 22 | @Component |
| 22 | public class SafeDrivDataLoadThread extends Thread{ | 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 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 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 | @Override | 45 | @Override |
| 29 | public void run() { | 46 | public void run() { |
| 30 | - List<SafeDriv> list = null; | ||
| 31 | - CloseableHttpClient httpClient = null; | ||
| 32 | - CloseableHttpResponse response = null; | 47 | + List<SafeDriv> list; |
| 33 | try { | 48 | try { |
| 34 | - httpClient = HttpClients.createDefault(); | ||
| 35 | - HttpGet get = new HttpGet(url); | ||
| 36 | 49 | ||
| 37 | response = httpClient.execute(get); | 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 | if (null != entity) { | 60 | if (null != entity) { |
| 41 | - BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent())); | 61 | + br = new BufferedReader(new InputStreamReader(entity.getContent())); |
| 42 | StringBuffer stringBuffer = new StringBuffer(); | 62 | StringBuffer stringBuffer = new StringBuffer(); |
| 43 | String str = ""; | 63 | String str = ""; |
| 44 | while ((str = br.readLine()) != null) | 64 | while ((str = br.readLine()) != null) |
| @@ -46,47 +66,14 @@ public class SafeDrivDataLoadThread extends Thread{ | @@ -46,47 +66,14 @@ public class SafeDrivDataLoadThread extends Thread{ | ||
| 46 | 66 | ||
| 47 | 67 | ||
| 48 | list = JSON.parseArray(stringBuffer.toString(), SafeDriv.class); | 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 | for(SafeDriv sd : list){ | 70 | for(SafeDriv sd : list){ |
| 84 | SafeDrivCenter.put(sd); | 71 | SafeDrivCenter.put(sd); |
| 85 | } | 72 | } |
| 86 | } | 73 | } |
| 87 | 74 | ||
| 88 | - httpClient.close(); | ||
| 89 | - response.close(); | 75 | + if (null != response) |
| 76 | + response.close(); | ||
| 90 | } catch (Exception e) { | 77 | } catch (Exception e) { |
| 91 | logger.error("安全驾驶接口报错了" , e.getMessage()); | 78 | logger.error("安全驾驶接口报错了" , e.getMessage()); |
| 92 | } | 79 | } |
src/main/java/com/bsth/service/forms/FormsService.java
| @@ -24,14 +24,19 @@ public interface FormsService { | @@ -24,14 +24,19 @@ public interface FormsService { | ||
| 24 | public List<Linepasswengerflow> linepasswengerflow(Map<String, Object> map); | 24 | public List<Linepasswengerflow> linepasswengerflow(Map<String, Object> map); |
| 25 | 25 | ||
| 26 | public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map); | 26 | public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map); |
| 27 | + public List<Shiftuehiclemanth> shiftuehiclemanth2(Map<String, Object> map); | ||
| 27 | 28 | ||
| 28 | public List<Changetochange> changetochange(Map<String, Object> map); | 29 | public List<Changetochange> changetochange(Map<String, Object> map); |
| 29 | 30 | ||
| 30 | public List<Shifday> shifday(Map<String, Object> map); | 31 | public List<Shifday> shifday(Map<String, Object> map); |
| 31 | 32 | ||
| 32 | public List<Singledata> singledata(Map<String, Object> map); | 33 | public List<Singledata> singledata(Map<String, Object> map); |
| 34 | + public List<Singledata> singledata2(Map<String, Object> map); | ||
| 35 | + | ||
| 33 | public List<Singledata> singledatanew(Map<String, Object> map); | 36 | public List<Singledata> singledatanew(Map<String, Object> map); |
| 34 | public List<Singledata> singledatatj(Map<String, Object> map); | 37 | public List<Singledata> singledatatj(Map<String, Object> map); |
| 38 | + public List<Singledata> singledatatj2(Map<String, Object> map); | ||
| 39 | + | ||
| 35 | 40 | ||
| 36 | public List<Vehicleloading> vehicleloading(String line,String data); | 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,7 +360,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 360 | int ljbc=culateMileageService.culateLjbc(list_s,""); | 360 | int ljbc=culateMileageService.culateLjbc(list_s,""); |
| 361 | int sjbc=culateMileageService.culateSjbc(list_s, ""); | 361 | int sjbc=culateMileageService.culateSjbc(list_s, ""); |
| 362 | double cjgl=culateMileageService.culateLbgl(sList); | 362 | double cjgl=culateMileageService.culateLbgl(sList); |
| 363 | - double zjgl=culateMileageService.culateLjgl(list_s); | 363 | +// double zjgl=culateMileageService.culateLjgl(list_s); |
| 364 | d.setEmptMileage(String.valueOf(zksgl));//空驶公里 | 364 | d.setEmptMileage(String.valueOf(zksgl));//空驶公里 |
| 365 | d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 | 365 | d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 |
| 366 | d.setSjbc(String.valueOf(sjbc+ljbc)); | 366 | d.setSjbc(String.valueOf(sjbc+ljbc)); |
| @@ -368,7 +368,7 @@ public class FormsServiceImpl implements FormsService { | @@ -368,7 +368,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 368 | d.setCjbc(String.valueOf(cjbc));//抽检班次 | 368 | d.setCjbc(String.valueOf(cjbc));//抽检班次 |
| 369 | d.setLjbc(String.valueOf(ljbc));//增加班次 | 369 | d.setLjbc(String.valueOf(ljbc));//增加班次 |
| 370 | d.setRemMileage(String.valueOf(cjgl));//抽检里程 | 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,6 +403,191 @@ public class FormsServiceImpl implements FormsService { | ||
| 403 | 403 | ||
| 404 | return list; | 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 | @Override | 593 | @Override |
| @@ -603,38 +788,290 @@ public class FormsServiceImpl implements FormsService { | @@ -603,38 +788,290 @@ public class FormsServiceImpl implements FormsService { | ||
| 603 | sql += " and gs= '"+gs+"' and fgs= '"+fgs+"'"; | 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 | @Override | 1073 | @Override |
| 637 | - public List<Singledata> singledatatj(Map<String, Object> map) { | 1074 | + public List<Singledata> singledatatj2(Map<String, Object> map) { |
| 638 | String gsdm=""; | 1075 | String gsdm=""; |
| 639 | if(map.get("gsdmSing")!=null){ | 1076 | if(map.get("gsdmSing")!=null){ |
| 640 | gsdm=map.get("gsdmSing").toString(); | 1077 | gsdm=map.get("gsdmSing").toString(); |
| @@ -857,14 +1294,17 @@ public class FormsServiceImpl implements FormsService { | @@ -857,14 +1294,17 @@ public class FormsServiceImpl implements FormsService { | ||
| 857 | } | 1294 | } |
| 858 | double jhgl=culateMileageService.culateJhgl(newList); | 1295 | double jhgl=culateMileageService.culateJhgl(newList); |
| 859 | double jhjcc=culateMileageService.culateJhJccgl(newList); | 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 | sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | 1308 | sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); |
| 869 | 1309 | ||
| 870 | sin.setEmptMileage(String.valueOf(zksgl)); | 1310 | sin.setEmptMileage(String.valueOf(zksgl)); |
| @@ -1562,6 +2002,284 @@ public class FormsServiceImpl implements FormsService { | @@ -1562,6 +2002,284 @@ public class FormsServiceImpl implements FormsService { | ||
| 1562 | } | 2002 | } |
| 1563 | return list; | 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 | @Override | 2285 | @Override |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| @@ -188,25 +188,9 @@ public class GpsServiceImpl implements GpsService { | @@ -188,25 +188,9 @@ public class GpsServiceImpl implements GpsService { | ||
| 188 | String nbbm = nbbmArray[0]; | 188 | String nbbm = nbbmArray[0]; |
| 189 | 189 | ||
| 190 | List<DeviceChange> dcs = findDeviceChangeLogs(nbbm, et, st); | 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 | StringBuilder sql = new StringBuilder(""); | 195 | StringBuilder sql = new StringBuilder(""); |
| 212 | long t1,t2; | 196 | long t1,t2; |
| @@ -221,7 +205,7 @@ public class GpsServiceImpl implements GpsService { | @@ -221,7 +205,7 @@ public class GpsServiceImpl implements GpsService { | ||
| 221 | t2 = dc.getEt(); | 205 | t2 = dc.getEt(); |
| 222 | 206 | ||
| 223 | 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+") " + | 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 | if(i == len - 1) | 210 | if(i == len - 1) |
| 227 | sql.append(" ORDER BY device_id,ts,stop_no"); | 211 | sql.append(" ORDER BY device_id,ts,stop_no"); |
| @@ -365,6 +349,18 @@ public class GpsServiceImpl implements GpsService { | @@ -365,6 +349,18 @@ public class GpsServiceImpl implements GpsService { | ||
| 365 | 349 | ||
| 366 | rs.add(dc); | 350 | rs.add(dc); |
| 367 | } | 351 | } |
| 352 | + | ||
| 353 | + //没有设备变更记录,则参考车辆信息上的设备号 | ||
| 354 | + if(null == rs || rs.size() == 0){ | ||
| 355 | + DeviceChange dc = new DeviceChange(); | ||
| 356 | + dc.setNbbm(nbbm); | ||
| 357 | + dc.setDevice(BasicData.deviceId2NbbmMap.inverse().get(nbbm)); | ||
| 358 | + dc.setSt(st); | ||
| 359 | + dc.setEt(et); | ||
| 360 | + dc.setType(1); | ||
| 361 | + | ||
| 362 | + rs.add(dc); | ||
| 363 | + } | ||
| 368 | }catch (Exception e){ | 364 | }catch (Exception e){ |
| 369 | logger.error("", e); | 365 | logger.error("", e); |
| 370 | } | 366 | } |
| @@ -380,11 +376,14 @@ public class GpsServiceImpl implements GpsService { | @@ -380,11 +376,14 @@ public class GpsServiceImpl implements GpsService { | ||
| 380 | 376 | ||
| 381 | // weeks_year 分区字段 | 377 | // weeks_year 分区字段 |
| 382 | Calendar sCal = Calendar.getInstance(); | 378 | Calendar sCal = Calendar.getInstance(); |
| 383 | - sCal.setTime(new Date(st * 1000)); | 379 | + sCal.setTime(new Date(st)); |
| 384 | int sWeekOfYear = sCal.get(Calendar.WEEK_OF_YEAR); | 380 | int sWeekOfYear = sCal.get(Calendar.WEEK_OF_YEAR); |
| 385 | Calendar eCal = Calendar.getInstance(); | 381 | Calendar eCal = Calendar.getInstance(); |
| 386 | - eCal.setTime(new Date(et * 1000)); | ||
| 387 | - int eWeekOfYear = eCal.get(Calendar.DAY_OF_YEAR); | 382 | + eCal.setTime(new Date(et)); |
| 383 | + int eWeekOfYear = eCal.get(Calendar.WEEK_OF_YEAR); | ||
| 384 | + | ||
| 385 | + //按年分表 | ||
| 386 | + String tableName = "bsth_c_arrival_info_" + fmtyyyy.print(st); | ||
| 388 | 387 | ||
| 389 | StringBuilder sql = new StringBuilder(""); | 388 | StringBuilder sql = new StringBuilder(""); |
| 390 | long t1,t2; | 389 | long t1,t2; |
| @@ -398,8 +397,8 @@ public class GpsServiceImpl implements GpsService { | @@ -398,8 +397,8 @@ public class GpsServiceImpl implements GpsService { | ||
| 398 | if(dc.getEt() < et) | 397 | if(dc.getEt() < et) |
| 399 | t2 = dc.getEt(); | 398 | t2 = dc.getEt(); |
| 400 | 399 | ||
| 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); | 400 | + sql.append("SELECT DEVICE_ID,LINE_ID as LINE_CODE,STOP_NO,TS,UP_DOWN,IN_OUT,WEEKS_YEAR,CREATE_DATE FROM " + tableName + |
| 401 | + " where weeks_year in ("+sWeekOfYear+", "+eWeekOfYear+") and device_id='"+dc.getDevice()+"' and ts > "+t1+" and ts < " + t2); | ||
| 403 | 402 | ||
| 404 | if(i == len - 1) | 403 | if(i == len - 1) |
| 405 | sql.append(" ORDER BY device_id,ts,stop_no "); | 404 | sql.append(" ORDER BY device_id,ts,stop_no "); |
| @@ -407,6 +406,7 @@ public class GpsServiceImpl implements GpsService { | @@ -407,6 +406,7 @@ public class GpsServiceImpl implements GpsService { | ||
| 407 | sql.append(" UNION "); | 406 | sql.append(" UNION "); |
| 408 | } | 407 | } |
| 409 | 408 | ||
| 409 | + logger.info("arrivl sql : " + sql.toString()); | ||
| 410 | JdbcTemplate jdbcTemplate_ms = new JdbcTemplate(DBUtils_MS.getDataSource()); | 410 | JdbcTemplate jdbcTemplate_ms = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 411 | List<ArrivalEntity> list = jdbcTemplate_ms.query(sql.toString(), BeanPropertyRowMapper.newInstance(ArrivalEntity.class)); | 411 | List<ArrivalEntity> list = jdbcTemplate_ms.query(sql.toString(), BeanPropertyRowMapper.newInstance(ArrivalEntity.class)); |
| 412 | 412 | ||
| @@ -887,27 +887,84 @@ public class GpsServiceImpl implements GpsService { | @@ -887,27 +887,84 @@ public class GpsServiceImpl implements GpsService { | ||
| 887 | 887 | ||
| 888 | @Override | 888 | @Override |
| 889 | public List<GpsSpeed_DTO> speeds(String nbbm, long st, long et) { | 889 | 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<?"; | 890 | + st = st * 1000; |
| 891 | + et = et * 1000; | ||
| 892 | + //按周分区 | ||
| 893 | + Calendar sCal = Calendar.getInstance(); | ||
| 894 | + sCal.setTime(new Date(st)); | ||
| 895 | + int sWeekYear = sCal.get(Calendar.WEEK_OF_YEAR); | ||
| 896 | + Calendar eCal = Calendar.getInstance(); | ||
| 897 | + eCal.setTime(new Date(et)); | ||
| 898 | + int eWeekYear = eCal.get(Calendar.WEEK_OF_YEAR); | ||
| 899 | + | ||
| 900 | + //按年分表 | ||
| 901 | + String tableName = "bsth_c_speeding_" + fmtyyyy.print(st); | ||
| 902 | + | ||
| 903 | + List<DeviceChange> dcs = findDeviceChangeLogs(nbbm, et, st); | ||
| 904 | + StringBuilder sql = new StringBuilder(""); | ||
| 905 | + long t1,t2; | ||
| 906 | + DeviceChange dc; | ||
| 907 | + for(int i = 0,len=dcs.size(); i < len; i++){ | ||
| 908 | + t1 = st; | ||
| 909 | + t2 = et; | ||
| 910 | + dc = dcs.get(i); | ||
| 911 | + if(dc.getSt() > st) | ||
| 912 | + t1 = dc.getSt(); | ||
| 913 | + if(dc.getEt() < et && dc.getEt()!=0) | ||
| 914 | + t2 = dc.getEt(); | ||
| 915 | + | ||
| 916 | + sql.append(" select vehicle, line, up_down, lon, lat, speed,timestamp from "+tableName+" where " + | ||
| 917 | + " weeks_year in ("+sWeekYear+", "+eWeekYear+") and vehicle='"+dc.getDevice()+"' and timestamp>="+t1+" and timestamp<= " + t2); | ||
| 892 | 918 | ||
| 893 | - return GpsSpeed_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql, deviceId, st * 1000, et * 1000)); | 919 | + if(i == len - 1) |
| 920 | + sql.append(" ORDER BY vehicle,timestamp"); | ||
| 921 | + else | ||
| 922 | + sql.append(" UNION "); | ||
| 923 | + } | ||
| 924 | + | ||
| 925 | + logger.info("speed sql : " + sql.toString()); | ||
| 926 | + return GpsSpeed_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql.toString())); | ||
| 894 | } | 927 | } |
| 895 | 928 | ||
| 896 | @Override | 929 | @Override |
| 897 | public List<GpsOutbound_DTO> outbounds(String nbbm, long st, long et) { | 930 | public List<GpsOutbound_DTO> outbounds(String nbbm, long st, long et) { |
| 898 | - /** | ||
| 899 | - * 如果 st 和 et 跨了周分区,也只查询st 分区的数据。 | ||
| 900 | - */ | ||
| 901 | st = st * 1000; | 931 | st = st * 1000; |
| 902 | et = et * 1000; | 932 | et = et * 1000; |
| 903 | //按周分区 | 933 | //按周分区 |
| 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)); | 934 | + Calendar sCal = Calendar.getInstance(); |
| 935 | + sCal.setTime(new Date(st)); | ||
| 936 | + int sWeekYear = sCal.get(Calendar.WEEK_OF_YEAR); | ||
| 937 | + Calendar eCal = Calendar.getInstance(); | ||
| 938 | + eCal.setTime(new Date(et)); | ||
| 939 | + int eWeekYear = eCal.get(Calendar.WEEK_OF_YEAR); | ||
| 940 | + | ||
| 941 | + //按年分表 | ||
| 942 | + String tableName = "bsth_c_outbound_" + fmtyyyy.print(st); | ||
| 943 | + | ||
| 944 | + List<DeviceChange> dcs = findDeviceChangeLogs(nbbm, et, st); | ||
| 945 | + StringBuilder sql = new StringBuilder(""); | ||
| 946 | + long t1,t2; | ||
| 947 | + DeviceChange dc; | ||
| 948 | + for(int i = 0,len=dcs.size(); i < len; i++){ | ||
| 949 | + t1 = st; | ||
| 950 | + t2 = et; | ||
| 951 | + dc = dcs.get(i); | ||
| 952 | + if(dc.getSt() > st) | ||
| 953 | + t1 = dc.getSt(); | ||
| 954 | + if(dc.getEt() < et && dc.getEt()!=0) | ||
| 955 | + t2 = dc.getEt(); | ||
| 956 | + | ||
| 957 | + sql.append("select vehicle,line,up_down,lon,lat,timestamp from "+tableName+" where " + | ||
| 958 | + " weeks_year in ("+sWeekYear+", "+eWeekYear+") and vehicle='"+dc.getDevice()+"' and timestamp>="+t1+" and timestamp<=" + t2); | ||
| 959 | + | ||
| 960 | + if(i == len - 1) | ||
| 961 | + sql.append(" ORDER BY vehicle,timestamp"); | ||
| 962 | + else | ||
| 963 | + sql.append(" UNION "); | ||
| 964 | + } | ||
| 965 | + | ||
| 966 | + logger.info("outbounds sql : " + sql.toString()); | ||
| 967 | + return GpsOutbound_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql.toString())); | ||
| 911 | } | 968 | } |
| 912 | 969 | ||
| 913 | @Override | 970 | @Override |
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| @@ -2826,14 +2826,14 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2826,14 +2826,14 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2826 | 2826 | ||
| 2827 | String sql = "select id, cl_zbh, fcsj, fcsj_actual, j_gh, j_name, lp_name, qdz_name, " + | 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 " + | 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 where schedule_date_str >= '"+startDate+"' and schedule_date_str <= '"+endDate+"'"; | 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"; | ||
| 2830 | 2832 | ||
| 2831 | - if(line.length() != 0) | ||
| 2832 | - sql += " and xl_bm = '"+line+"'"; | ||
| 2833 | if(company.length() != 0) | 2833 | if(company.length() != 0) |
| 2834 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; | 2834 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; |
| 2835 | - | ||
| 2836 | - sql += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and cc_service = 0"; | 2835 | + if(line.length() != 0) |
| 2836 | + sql += " and xl_bm = '"+line+"'"; | ||
| 2837 | 2837 | ||
| 2838 | System.out.println(sql); | 2838 | System.out.println(sql); |
| 2839 | List<ScheduleRealInfo> list = jdbcTemplate.query(sql, | 2839 | List<ScheduleRealInfo> list = jdbcTemplate.query(sql, |
src/main/java/com/bsth/service/report/CulateMileageService.java
| @@ -14,6 +14,7 @@ public interface CulateMileageService { | @@ -14,6 +14,7 @@ public interface CulateMileageService { | ||
| 14 | List<Map<String,Object>> jobLjqk(List<ScheduleRealInfo> lists); | 14 | List<Map<String,Object>> jobLjqk(List<ScheduleRealInfo> lists); |
| 15 | double culateLjgl(List<ScheduleRealInfo> lists); | 15 | double culateLjgl(List<ScheduleRealInfo> lists); |
| 16 | double culateLjgl_(List<ScheduleRealInfo> lists,String item); | 16 | double culateLjgl_(List<ScheduleRealInfo> lists,String item); |
| 17 | + double culateLjgl_spy(List<ScheduleRealInfo> lists); | ||
| 17 | int culateLjbc(List<ScheduleRealInfo> lists,String item); | 18 | int culateLjbc(List<ScheduleRealInfo> lists,String item); |
| 18 | 19 | ||
| 19 | double culateJhgl(List<ScheduleRealInfo> lists); | 20 | double culateJhgl(List<ScheduleRealInfo> lists); |
| @@ -23,11 +24,13 @@ public interface CulateMileageService { | @@ -23,11 +24,13 @@ public interface CulateMileageService { | ||
| 23 | 24 | ||
| 24 | double culateSjgl(List<ScheduleRealInfo> lists); | 25 | double culateSjgl(List<ScheduleRealInfo> lists); |
| 25 | double culateSjgl_(List<ScheduleRealInfo> lists,String item); | 26 | double culateSjgl_(List<ScheduleRealInfo> lists,String item); |
| 27 | + | ||
| 28 | + double culateSjgl_spy(List<ScheduleRealInfo> lists); | ||
| 26 | int culateSjbc(List<ScheduleRealInfo> lists,String item); | 29 | int culateSjbc(List<ScheduleRealInfo> lists,String item); |
| 27 | 30 | ||
| 28 | double culateKsgl(List<ScheduleRealInfo> lists); | 31 | double culateKsgl(List<ScheduleRealInfo> lists); |
| 29 | double culateJccgl(List<ScheduleRealInfo> lists); | 32 | double culateJccgl(List<ScheduleRealInfo> lists); |
| 30 | - | 33 | + double culateSjfyylc_spy(List<ScheduleRealInfo> lists); |
| 31 | double culateJhJccgl(List<ScheduleRealInfo> lists); | 34 | double culateJhJccgl(List<ScheduleRealInfo> lists); |
| 32 | 35 | ||
| 33 | double culateCJLC(List<ScheduleRealInfo> lists,String item); | 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,5 +1476,130 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 1476 | map.put("djgsj", djcsj); | 1476 | map.put("djgsj", djcsj); |
| 1477 | return map; | 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/websocket/handler/SendUtils.java
| @@ -168,8 +168,7 @@ public class SendUtils{ | @@ -168,8 +168,7 @@ public class SendUtils{ | ||
| 168 | ObjectMapper mapper = new ObjectMapper(); | 168 | ObjectMapper mapper = new ObjectMapper(); |
| 169 | 169 | ||
| 170 | try { | 170 | try { |
| 171 | - socketHandler.sendMessage(mapper.writeValueAsString(map)); | ||
| 172 | - | 171 | + socketHandler.sendMessageToLine(sd.getXlbm(), mapper.writeValueAsString(map)); |
| 173 | } catch (JsonProcessingException e) { | 172 | } catch (JsonProcessingException e) { |
| 174 | logger.error("", e); | 173 | logger.error("", e); |
| 175 | } | 174 | } |
src/main/resources/ms-jdbc.properties
| @@ -4,6 +4,6 @@ | @@ -4,6 +4,6 @@ | ||
| 4 | #ms.mysql.password= 123456 | 4 | #ms.mysql.password= 123456 |
| 5 | 5 | ||
| 6 | ms.mysql.driver= com.mysql.jdbc.Driver | 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 | ms.mysql.username= root | 8 | ms.mysql.username= root |
| 9 | -ms.mysql.password= root2jsp@JSP | 9 | +ms.mysql.password= root2jsp |
src/main/resources/static/pages/base/line/list.html
| @@ -305,7 +305,7 @@ | @@ -305,7 +305,7 @@ | ||
| 305 | <a href="edit.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a> | 305 | <a href="edit.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a> |
| 306 | 306 | ||
| 307 | {{if obj.destroy==1}} | 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 | {{/if}} | 309 | {{/if}} |
| 310 | </td> | 310 | </td> |
| 311 | </tr> | 311 | </tr> |
src/main/resources/static/pages/punctual/onTime.html
| @@ -152,7 +152,7 @@ | @@ -152,7 +152,7 @@ | ||
| 152 | $('.menu-toggler.sidebar-toggler').click(); | 152 | $('.menu-toggler.sidebar-toggler').click(); |
| 153 | 153 | ||
| 154 | var d = new Date(); | 154 | var d = new Date(); |
| 155 | - d.setTime(d.getTime() - 1*1000*60*60*24); | 155 | + d.setTime(d.getTime() - 3*1000*60*60*24); |
| 156 | var year = d.getFullYear(); | 156 | var year = d.getFullYear(); |
| 157 | var month = d.getMonth() + 1; | 157 | var month = d.getMonth() + 1; |
| 158 | var day = d.getDate(); | 158 | var day = d.getDate(); |
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,6 +37,8 @@ var gb_schedule_table = (function () { | ||
| 37 | rs[lineCode].sort(schedule_sort); | 37 | rs[lineCode].sort(schedule_sort); |
| 38 | //calc shift | 38 | //calc shift |
| 39 | $.each(rs[lineCode], function () { | 39 | $.each(rs[lineCode], function () { |
| 40 | + if(this.status==-1) | ||
| 41 | + clearActualTime(this); | ||
| 40 | calc_sch_real_shift(this); | 42 | calc_sch_real_shift(this); |
| 41 | line2Schedule[lineCode][this.id] = this; | 43 | line2Schedule[lineCode][this.id] = this; |
| 42 | //子任务公里是否与计划平 | 44 | //子任务公里是否与计划平 |
| @@ -308,6 +310,8 @@ var gb_schedule_table = (function () { | @@ -308,6 +310,8 @@ var gb_schedule_table = (function () { | ||
| 308 | //var tMaps = {}; | 310 | //var tMaps = {}; |
| 309 | $.each(schArr, function () { | 311 | $.each(schArr, function () { |
| 310 | try { | 312 | try { |
| 313 | + if(this.status==-1) | ||
| 314 | + clearActualTime(this); | ||
| 311 | //子任务公里是否与计划平 | 315 | //子任务公里是否与计划平 |
| 312 | this.c_t_mileage_status = calcCTaskMileageStatus(this); | 316 | this.c_t_mileage_status = calcCTaskMileageStatus(this); |
| 313 | line2Schedule[this.xlBm][this.id] = this; | 317 | line2Schedule[this.xlBm][this.id] = this; |
| @@ -332,6 +336,8 @@ var gb_schedule_table = (function () { | @@ -332,6 +336,8 @@ var gb_schedule_table = (function () { | ||
| 332 | if (!isArray(schArr)) | 336 | if (!isArray(schArr)) |
| 333 | schArr = [schArr]; | 337 | schArr = [schArr]; |
| 334 | $.each(schArr, function () { | 338 | $.each(schArr, function () { |
| 339 | + if(this.status==-1) | ||
| 340 | + clearActualTime(this); | ||
| 335 | line2Schedule[this.xlBm][this.id] = this; | 341 | line2Schedule[this.xlBm][this.id] = this; |
| 336 | }); | 342 | }); |
| 337 | }; | 343 | }; |
| @@ -795,6 +801,17 @@ var gb_schedule_table = (function () { | @@ -795,6 +801,17 @@ var gb_schedule_table = (function () { | ||
| 795 | } | 801 | } |
| 796 | }; | 802 | }; |
| 797 | 803 | ||
| 804 | + var clearActualTime = function (sch) { | ||
| 805 | + try{ | ||
| 806 | + sch.fcsjActual=null; | ||
| 807 | + sch.fcsjActualTime=null; | ||
| 808 | + sch.zdsjActual=null; | ||
| 809 | + sch.zdsjActualTime=null; | ||
| 810 | + }catch (e){ | ||
| 811 | + console.log(e); | ||
| 812 | + } | ||
| 813 | + }; | ||
| 814 | + | ||
| 798 | return { | 815 | return { |
| 799 | show: show, | 816 | show: show, |
| 800 | findScheduleByLine: findScheduleByLine, | 817 | findScheduleByLine: findScheduleByLine, |
src/main/resources/static/real_control_v2/js/safe_driv/safeDriv.js
| @@ -20,10 +20,10 @@ var gb_safe_driv = (function () { | @@ -20,10 +20,10 @@ var gb_safe_driv = (function () { | ||
| 20 | var max = 5; | 20 | var max = 5; |
| 21 | 21 | ||
| 22 | var pop = function (sd) { | 22 | var pop = function (sd) { |
| 23 | - //只有admin用户能收到 | 23 | + /*//只有admin用户能收到 |
| 24 | var user = gb_northToolbar.user(); | 24 | var user = gb_northToolbar.user(); |
| 25 | if (!user || user.userName.indexOf('admin') == -1) | 25 | if (!user || user.userName.indexOf('admin') == -1) |
| 26 | - return; | 26 | + return;*/ |
| 27 | 27 | ||
| 28 | //时间格式化 | 28 | //时间格式化 |
| 29 | var stm = moment(sd.ts); | 29 | var stm = moment(sd.ts); |
| @@ -60,7 +60,7 @@ var gb_safe_driv = (function () { | @@ -60,7 +60,7 @@ var gb_safe_driv = (function () { | ||
| 60 | '</div>'; | 60 | '</div>'; |
| 61 | 61 | ||
| 62 | $wrap.on('click', '.safe_driv_pop', function () { | 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 | var url = $(this).data('url'); | 64 | var url = $(this).data('url'); |
| 65 | $(this).remove(); | 65 | $(this).remove(); |
| 66 | var lightbox = UIkit.lightbox.create([ | 66 | var lightbox = UIkit.lightbox.create([ |