Commit 2e21b287f67d1ed5796e9e7972cf3962588de9a5
1 parent
3dab8c1c
1
Showing
65 changed files
with
6817 additions
and
447 deletions
.gitignore
pom.xml
| ... | ... | @@ -396,6 +396,12 @@ |
| 396 | 396 | <artifactId>wsdl4j</artifactId> |
| 397 | 397 | </dependency> |
| 398 | 398 | |
| 399 | + <dependency> | |
| 400 | + <groupId>net.sf.json-lib</groupId> | |
| 401 | + <artifactId>json-lib</artifactId> | |
| 402 | + <version>2.4</version> | |
| 403 | + <classifier>jdk15</classifier> | |
| 404 | + </dependency> | |
| 399 | 405 | </dependencies> |
| 400 | 406 | |
| 401 | 407 | <dependencyManagement> | ... | ... |
src/main/java/com/bsth/XDApplication.java
| ... | ... | @@ -4,6 +4,7 @@ import com.bsth.data.BasicData; |
| 4 | 4 | import com.bsth.data.LineVersionsData; |
| 5 | 5 | import com.bsth.data.ThreadMonotor; |
| 6 | 6 | import com.bsth.data.car_out_info.UpdateDBThread; |
| 7 | +import com.bsth.data.ddexam.DdexamThread; | |
| 7 | 8 | import com.bsth.data.directive.DirectivesPstThread; |
| 8 | 9 | import com.bsth.data.forecast.SampleTimeDataLoader; |
| 9 | 10 | import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread; |
| ... | ... | @@ -85,13 +86,16 @@ public class XDApplication implements CommandLineRunner { |
| 85 | 86 | |
| 86 | 87 | @Autowired |
| 87 | 88 | FixedCheckStationCodeThread fixedCheckStationCodeThread; |
| 89 | + | |
| 90 | + @Autowired | |
| 91 | + DdexamThread ddexamThread; | |
| 88 | 92 | |
| 89 | 93 | private static long timeDiff; |
| 90 | 94 | private static long timeDiffTraffic; |
| 91 | 95 | |
| 92 | 96 | static { |
| 93 | - // 早上2:20 | |
| 94 | - timeDiff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis(); | |
| 97 | + // 早上2:20 ---- 0点10分 | |
| 98 | + timeDiff = (DateUtils.getTimestamp() + 1000 * 60 * 10) - System.currentTimeMillis(); | |
| 95 | 99 | if (timeDiff < 0) |
| 96 | 100 | timeDiff += (1000 * 60 * 60 * 24); |
| 97 | 101 | // 早上07:00 |
| ... | ... | @@ -139,7 +143,7 @@ public class XDApplication implements CommandLineRunner { |
| 139 | 143 | //sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS); |
| 140 | 144 | |
| 141 | 145 | /** 线调业务 */ |
| 142 | - sexec.scheduleWithFixedDelay(scheduleRefreshThread, 1, 120, TimeUnit.SECONDS);//班次更新线程 | |
| 146 | + sexec.scheduleWithFixedDelay(scheduleRefreshThread, 30, 120, TimeUnit.SECONDS);//班次更新线程 | |
| 143 | 147 | sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点 |
| 144 | 148 | //sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据 |
| 145 | 149 | //sexec.scheduleWithFixedDelay(rfidDataLoader, 5, 5, TimeUnit.SECONDS);//抓取RFID数据 |
| ... | ... | @@ -157,17 +161,19 @@ public class XDApplication implements CommandLineRunner { |
| 157 | 161 | WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 |
| 158 | 162 | |
| 159 | 163 | /** 线调为其他程序提供的数据 --写入数据库 */ |
| 160 | - sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布) | |
| 164 | + //sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布) | |
| 161 | 165 | //线路首末班数据(网关用,班次更新时写入) |
| 162 | 166 | //com.bsth.data.schedule.f_a_l.FirstAndLastHandler |
| 163 | - sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号) | |
| 164 | - | |
| 167 | + //sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号) | |
| 168 | + /******************************************************/ | |
| 169 | + sexec.scheduleAtFixedRate(ddexamThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS); | |
| 170 | + | |
| 165 | 171 | //运管处静态数据提交 |
| 166 | 172 | //log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处"); |
| 167 | 173 | //sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS); |
| 168 | 174 | |
| 169 | 175 | //线路版本更新 |
| 170 | - sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS); | |
| 176 | + //sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS); | |
| 171 | 177 | |
| 172 | 178 | //线路版本更新 |
| 173 | 179 | //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 60 * 4, 60 * 2 , TimeUnit.SECONDS); | ... | ... |
src/main/java/com/bsth/controller/ddexam/DdexamController.java
| 1 | 1 | package com.bsth.controller.ddexam; |
| 2 | 2 | |
| 3 | +import com.bsth.entity.sys.SysUser; | |
| 3 | 4 | import com.bsth.service.ddexam.DdexamService; |
| 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 5 | 6 | import org.springframework.web.bind.annotation.RequestMapping; |
| 6 | 7 | import org.springframework.web.bind.annotation.RequestParam; |
| 7 | 8 | import org.springframework.web.bind.annotation.RestController; |
| 8 | 9 | |
| 10 | +import java.util.Date; | |
| 11 | +import java.util.List; | |
| 12 | +import java.util.Map; | |
| 13 | + | |
| 9 | 14 | @RestController |
| 10 | 15 | @RequestMapping("ddexam") |
| 11 | 16 | public class DdexamController { |
| 12 | 17 | @Autowired |
| 13 | 18 | DdexamService ddexamService; |
| 14 | 19 | |
| 15 | - //初始化 | |
| 20 | + //创建账号 | |
| 16 | 21 | @RequestMapping("initialization") |
| 17 | - public int initializationAll(@RequestParam Integer rs){ | |
| 18 | - return ddexamService.initializationAll(rs); | |
| 22 | + public Map initializationAll(@RequestParam Integer rs ,@RequestParam Long userName){ | |
| 23 | + return ddexamService.initializationAll(rs,userName); | |
| 24 | + } | |
| 25 | + //初始化 | |
| 26 | + @RequestMapping("initialization2") | |
| 27 | + public Map initializationAll2(@RequestParam Long userName){ | |
| 28 | + return ddexamService.initializationAll2(userName); | |
| 29 | + } | |
| 30 | + //恢复系统时间 | |
| 31 | + @RequestMapping("hftime") | |
| 32 | + public int hftime(){ | |
| 33 | + return ddexamService.hftime(); | |
| 34 | + } | |
| 35 | + | |
| 36 | + @RequestMapping("initDate") | |
| 37 | + //修改系統时间 | |
| 38 | + public int initDate(String date){ | |
| 39 | + | |
| 40 | + return ddexamService.initDate(date); | |
| 19 | 41 | } |
| 42 | + | |
| 43 | + @RequestMapping("userAll") | |
| 44 | + //修改系統时间 | |
| 45 | + public List<SysUser> userAll(){ | |
| 46 | + return ddexamService.userAll(); | |
| 47 | + } | |
| 48 | + @RequestMapping("getTime") | |
| 49 | + //修改系統时间 | |
| 50 | + public Date getTime(){ | |
| 51 | + return new Date(); | |
| 52 | + } | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 20 | 57 | } | ... | ... |
src/main/java/com/bsth/controller/forms/ExportController.java
0 → 100644
| 1 | +package com.bsth.controller.forms; | |
| 2 | + | |
| 3 | +import com.bsth.data.BasicData; | |
| 4 | +import com.bsth.entity.mcy_forms.*; | |
| 5 | +import com.bsth.service.forms.ExportService; | |
| 6 | +import com.bsth.service.forms.FormsService; | |
| 7 | +import com.bsth.util.Arith; | |
| 8 | +import com.bsth.util.ReportUtils; | |
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 11 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 12 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 13 | +import org.springframework.web.bind.annotation.RestController; | |
| 14 | + | |
| 15 | +import java.text.SimpleDateFormat; | |
| 16 | +import java.util.*; | |
| 17 | + | |
| 18 | +@RestController | |
| 19 | +@RequestMapping("mcy_export") | |
| 20 | +public class ExportController { | |
| 21 | + | |
| 22 | + | |
| 23 | + @Autowired | |
| 24 | + FormsService formsService; | |
| 25 | + | |
| 26 | + @Autowired | |
| 27 | + ExportService exportService; | |
| 28 | + | |
| 29 | + // 行车路单日报表 | |
| 30 | + @RequestMapping(value = "/waybilldayExport", method = RequestMethod.POST) | |
| 31 | + public List<Waybillday> waybilldayExport(@RequestParam Map<String, Object> map) { | |
| 32 | + List<Waybillday> waybillday = formsService.waybillday(map); | |
| 33 | + exportService.waybillday(map.get("date").toString(), | |
| 34 | + map.get("lineName").toString(), waybillday); | |
| 35 | + return waybillday; | |
| 36 | + } | |
| 37 | + | |
| 38 | + // 线路客流量报表 | |
| 39 | + @RequestMapping(value = "/linepasswengerflowExport", method = RequestMethod.POST) | |
| 40 | + public List<Map<String, Object>> linepasswengerflowExport(@RequestParam Map<String, Object> map) { | |
| 41 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 42 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 43 | + ReportUtils ee = new ReportUtils(); | |
| 44 | + List<Linepasswengerflow> linepasswengerflow = formsService.linepasswengerflow(map); | |
| 45 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 46 | + int i = 1; | |
| 47 | + for (Linepasswengerflow l : linepasswengerflow) { | |
| 48 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 49 | + m.put("i", i); | |
| 50 | + m.put("stationName", l.getStationName()); | |
| 51 | + m.put("1", " "); | |
| 52 | + m.put("2", " "); | |
| 53 | + resList.add(m); | |
| 54 | + i++; | |
| 55 | + } | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + try { | |
| 60 | + listI.add(resList.iterator()); | |
| 61 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 62 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/linepasswengerflow.xls", | |
| 63 | + path + "export/线路客流量报表" + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls"); | |
| 64 | + } catch (Exception e) { | |
| 65 | + e.printStackTrace(); | |
| 66 | + } | |
| 67 | + return resList; | |
| 68 | + } | |
| 69 | + | |
| 70 | + // 班次车辆人员日统计 | |
| 71 | + @RequestMapping(value = "/shifdayExport", method = RequestMethod.GET) | |
| 72 | + public List<Map<String, Object>> shifdayExport(@RequestParam Map<String, Object> map) { | |
| 73 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 74 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 75 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 76 | + Map<String, Object> map2 = new HashMap<String, Object>(); | |
| 77 | + ReportUtils ee = new ReportUtils(); | |
| 78 | + List<Shifday> shifday = formsService.shifday(map); | |
| 79 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 80 | + for (Shifday l : shifday) { | |
| 81 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 82 | + m.put("jName", l.getjName()); | |
| 83 | + m.put("sName", l.getsName()); | |
| 84 | + m.put("lpName", l.getLpName()); | |
| 85 | + m.put("carPlate", l.getCarPlate()); | |
| 86 | + m.put("jhlc", l.getJhlc()); | |
| 87 | + m.put("sjjhlc", l.getSjjhlc()); | |
| 88 | + m.put("yygl", l.getYygl()); | |
| 89 | + m.put("emptMileage", l.getEmptMileage()); | |
| 90 | + m.put("remMileage", l.getRemMileage()); | |
| 91 | + m.put("addMileage", l.getAddMileage()); | |
| 92 | + m.put("totalm", l.getTotalm()); | |
| 93 | + m.put("jhbc", l.getJhbc()); | |
| 94 | + m.put("sjjhbc", l.getSjjhbc()); | |
| 95 | + m.put("cjbc", l.getCjbc()); | |
| 96 | + m.put("ljbc", l.getLjbc()); | |
| 97 | + m.put("sjbc", l.getSjbc()); | |
| 98 | + resList.add(m); | |
| 99 | + } | |
| 100 | + if(resList.size() > 0){ | |
| 101 | + map2 = resList.get(resList.size() - 1); | |
| 102 | + resList.remove(map2); | |
| 103 | + } | |
| 104 | + | |
| 105 | + try { | |
| 106 | + String lineName = ""; | |
| 107 | + if(map.containsKey("lineName")) | |
| 108 | + lineName = map.get("lineName").toString(); | |
| 109 | + listI.add(resList.iterator()); | |
| 110 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 111 | + ee.excelReplace(listI, new Object[] { map2 }, path + "mould/shifday.xls", | |
| 112 | + path + "export/" + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) | |
| 113 | + + "-" + lineName + "-班次车辆人员日报表.xls"); | |
| 114 | + } catch (Exception e) { | |
| 115 | + e.printStackTrace(); | |
| 116 | + } | |
| 117 | + return resList; | |
| 118 | + } | |
| 119 | + | |
| 120 | + // 班次车辆人员月统计 | |
| 121 | + @RequestMapping(value = "/shiftuehiclemanthExport", method = RequestMethod.GET) | |
| 122 | + public List<Map<String, Object>> shiftuehiclemanthExport(@RequestParam Map<String, Object> map) { | |
| 123 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 124 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 125 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 126 | + ReportUtils ee = new ReportUtils(); | |
| 127 | + List<Shiftuehiclemanth> shiftuehiclemanth = formsService.shiftuehiclemanth(map); | |
| 128 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 129 | + int i = 1; | |
| 130 | + for (Shiftuehiclemanth l : shiftuehiclemanth) { | |
| 131 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 132 | + m.put("i", i); | |
| 133 | + m.put("jName", l.getjName()); | |
| 134 | + m.put("jhlc", l.getJhlc()); | |
| 135 | + m.put("emptMileage", l.getEmptMileage()); | |
| 136 | + m.put("remMileage", l.getRemMileage()); | |
| 137 | + m.put("addMileage", l.getAddMileage()); | |
| 138 | + m.put("totalm", l.getTotalm()); | |
| 139 | + m.put("cjbc", l.getCjbc()); | |
| 140 | + m.put("ljbc", l.getLjbc()); | |
| 141 | + m.put("sjbc", l.getSjbc()); | |
| 142 | + resList.add(m); | |
| 143 | + i++; | |
| 144 | + } | |
| 145 | + | |
| 146 | + try { | |
| 147 | + String mouldurl = null, lineName = "", dateTime = "" | |
| 148 | + , startDate = "", endDate = ""; | |
| 149 | + if(map.containsKey("lineName")) | |
| 150 | + lineName = map.get("lineName").toString(); | |
| 151 | + if(map.containsKey("startDate")) | |
| 152 | + startDate = map.get("startDate").toString(); | |
| 153 | + if(map.containsKey("endDate")) | |
| 154 | + endDate = map.get("endDate").toString(); | |
| 155 | + if(startDate.equals(endDate)){ | |
| 156 | + dateTime = sdfSimple.format(sdfMonth.parse(startDate)); | |
| 157 | + } else { | |
| 158 | + dateTime = sdfSimple.format(sdfMonth.parse(startDate)) | |
| 159 | + +"-"+sdfSimple.format(sdfMonth.parse(endDate)); | |
| 160 | + } | |
| 161 | + if(map.get("empnames").equals("驾驶员")){ | |
| 162 | + mouldurl="mould/shiftuehiclemanth.xls"; | |
| 163 | + }else if(map.get("empnames").equals("售票员")){ | |
| 164 | + mouldurl="mould/shiftuehiclemanthspy.xls"; | |
| 165 | + }else if(map.get("empnames").equals("车辆自编号")){ | |
| 166 | + mouldurl="mould/shiftuehiclemanthclzbh.xls"; | |
| 167 | + } | |
| 168 | + listI.add(resList.iterator()); | |
| 169 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 170 | + ee.excelReplace(listI, new Object[] { map }, path +mouldurl, | |
| 171 | + path + "export/" + dateTime + "-" + lineName + "-班次车辆人员月报表.xls"); | |
| 172 | + } catch (Exception e) { | |
| 173 | + e.printStackTrace(); | |
| 174 | + } | |
| 175 | + | |
| 176 | + return resList; | |
| 177 | + } | |
| 178 | + | |
| 179 | + // 班次车辆人员月统计 | |
| 180 | + @RequestMapping(value = "/shiftuehiclemanthExport2", method = RequestMethod.GET) | |
| 181 | + public List<Map<String, Object>> shiftuehiclemanthExport2(@RequestParam Map<String, Object> map) { | |
| 182 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 183 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 184 | + ReportUtils ee = new ReportUtils(); | |
| 185 | + List<Shiftuehiclemanth> shiftuehiclemanth = formsService.shiftuehiclemanth2(map); | |
| 186 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 187 | + int i = 1; | |
| 188 | + for (Shiftuehiclemanth l : shiftuehiclemanth) { | |
| 189 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 190 | + m.put("i", i); | |
| 191 | + m.put("jName", l.getjName()); | |
| 192 | + m.put("jhlc", l.getJhlc()); | |
| 193 | + m.put("emptMileage", l.getEmptMileage()); | |
| 194 | + m.put("remMileage", l.getRemMileage()); | |
| 195 | + m.put("addMileage", l.getAddMileage()); | |
| 196 | + m.put("totalm", l.getTotalm()); | |
| 197 | + m.put("cjbc", l.getCjbc()); | |
| 198 | + m.put("ljbc", l.getLjbc()); | |
| 199 | + m.put("sjbc", l.getSjbc()); | |
| 200 | + resList.add(m); | |
| 201 | + i++; | |
| 202 | + } | |
| 203 | + | |
| 204 | + try { | |
| 205 | + String mouldurl = null; | |
| 206 | + if(map.get("empnames").equals("驾驶员")){ | |
| 207 | + mouldurl="mould/shiftuehiclemanth.xls"; | |
| 208 | + }else if(map.get("empnames").equals("售票员")){ | |
| 209 | + mouldurl="mould/shiftuehiclemanthspy.xls"; | |
| 210 | + }else if(map.get("empnames").equals("车辆自编号")){ | |
| 211 | + mouldurl="mould/shiftuehiclemanthclzbh.xls"; | |
| 212 | + } | |
| 213 | + listI.add(resList.iterator()); | |
| 214 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 215 | + ee.excelReplace(listI, new Object[] { map }, path +mouldurl, | |
| 216 | + path + "export/班次车辆人员月报表" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 217 | + } catch (Exception e) { | |
| 218 | + e.printStackTrace(); | |
| 219 | + } | |
| 220 | + | |
| 221 | + return resList; | |
| 222 | + } | |
| 223 | + | |
| 224 | + // 路单数据报表 | |
| 225 | + @RequestMapping(value = "/singledataExport", method = RequestMethod.GET) | |
| 226 | + public List<Map<String, Object>> singledataExport(@RequestParam Map<String, Object> map) { | |
| 227 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 228 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 229 | + ReportUtils ee = new ReportUtils(); | |
| 230 | + List<Singledata> singledata = formsService.singledata(map); | |
| 231 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 232 | + int i = 1; | |
| 233 | + for (Singledata l : singledata) { | |
| 234 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 235 | + m.put("i", i); | |
| 236 | + m.put("rQ", l.getrQ()); | |
| 237 | + m.put("gS", l.getgS()); | |
| 238 | + m.put("xL", l.getXlmc()); | |
| 239 | + m.put("clzbh", l.getClzbh()); | |
| 240 | + m.put("jsy", l.getJsy()); | |
| 241 | + m.put("jName", l.getjName()); | |
| 242 | + m.put("sgh", l.getSgh()); | |
| 243 | + m.put("sName", l.getsName()); | |
| 244 | + m.put("jhlc", l.getJhlc()); | |
| 245 | + m.put("emptMileage", l.getEmptMileage()); | |
| 246 | + m.put("hyl", l.getHyl()); | |
| 247 | + m.put("jzl", l.getJzl()); | |
| 248 | + m.put("unyyyl", l.getUnyyyl()); | |
| 249 | + m.put("jhjl", l.getJhjl()); | |
| 250 | + resList.add(m); | |
| 251 | + | |
| 252 | + i++; | |
| 253 | + } | |
| 254 | + | |
| 255 | + try { | |
| 256 | + listI.add(resList.iterator()); | |
| 257 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 258 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls", | |
| 259 | + path + "export/路单数据" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 260 | + } catch (Exception e) { | |
| 261 | + e.printStackTrace(); | |
| 262 | + } | |
| 263 | + | |
| 264 | + return resList; | |
| 265 | + } | |
| 266 | + | |
| 267 | + // 路单数据报表 | |
| 268 | + @RequestMapping(value = "/singledataExport2", method = RequestMethod.GET) | |
| 269 | + public List<Map<String, Object>> singledataExport2(@RequestParam Map<String, Object> map) { | |
| 270 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 271 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 272 | + ReportUtils ee = new ReportUtils(); | |
| 273 | + List<Singledata> singledata = formsService.singledata2(map); | |
| 274 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 275 | + int i = 1; | |
| 276 | + for (Singledata l : singledata) { | |
| 277 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 278 | + m.put("i", i); | |
| 279 | + m.put("rQ", l.getrQ()); | |
| 280 | + m.put("gS", l.getgS()); | |
| 281 | + m.put("xL", l.getXlmc()); | |
| 282 | + m.put("clzbh", l.getClzbh()); | |
| 283 | + m.put("jsy", l.getJsy()); | |
| 284 | + m.put("jName", l.getjName()); | |
| 285 | + m.put("sgh", l.getSgh()); | |
| 286 | + m.put("sName", l.getsName()); | |
| 287 | + m.put("jhlc", l.getJhlc()); | |
| 288 | + m.put("emptMileage", l.getEmptMileage()); | |
| 289 | + m.put("hyl", l.getHyl()); | |
| 290 | + m.put("jzl", l.getJzl()); | |
| 291 | + m.put("unyyyl", l.getUnyyyl()); | |
| 292 | + m.put("jhjl", l.getJhjl()); | |
| 293 | + resList.add(m); | |
| 294 | + | |
| 295 | + i++; | |
| 296 | + } | |
| 297 | + | |
| 298 | + try { | |
| 299 | + listI.add(resList.iterator()); | |
| 300 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 301 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls", | |
| 302 | + path + "export/路单数据" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 303 | + } catch (Exception e) { | |
| 304 | + e.printStackTrace(); | |
| 305 | + } | |
| 306 | + | |
| 307 | + return resList; | |
| 308 | + } | |
| 309 | + @RequestMapping(value = "/singledataExportTj", method = RequestMethod.GET) | |
| 310 | + public List<Map<String, Object>> singledataExportTj(@RequestParam Map<String, Object> map) { | |
| 311 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 312 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 313 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 314 | + ReportUtils ee = new ReportUtils(); | |
| 315 | + List<Singledata> singledata = formsService.singledatatj(map); | |
| 316 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 317 | + int i = 1; | |
| 318 | + for (Singledata l : singledata) { | |
| 319 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 320 | + m.put("i", i); | |
| 321 | + m.put("rQ", l.getrQ()); | |
| 322 | + m.put("gS", l.getgS()); | |
| 323 | + m.put("xL", l.getXlmc()); | |
| 324 | + m.put("clzbh", l.getClzbh()); | |
| 325 | + m.put("jsy", l.getJsy()); | |
| 326 | + m.put("jName", l.getjName()); | |
| 327 | + m.put("sgh", l.getSgh()); | |
| 328 | + m.put("sName", l.getsName()); | |
| 329 | + m.put("jhlc", l.getJhlc()); | |
| 330 | + m.put("emptMileage", l.getEmptMileage()); | |
| 331 | + m.put("hyl", l.getHyl()); | |
| 332 | + m.put("jzl", l.getJzl()); | |
| 333 | + m.put("unyyyl", l.getUnyyyl()); | |
| 334 | + m.put("jhjl", l.getJhjl()); | |
| 335 | + resList.add(m); | |
| 336 | + | |
| 337 | + i++; | |
| 338 | + } | |
| 339 | + | |
| 340 | + try { | |
| 341 | + String startDate = "", lineName = ""; | |
| 342 | + if(map.containsKey("startDate")) | |
| 343 | + startDate = map.get("startDate").toString(); | |
| 344 | + if(map.containsKey("lineName")) | |
| 345 | + lineName = map.get("lineName").toString(); | |
| 346 | + listI.add(resList.iterator()); | |
| 347 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 348 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls", | |
| 349 | + path + "export/" + sdfSimple.format(sdfMonth.parse(startDate)) | |
| 350 | + + "-" + lineName + "-路单数据.xls"); | |
| 351 | + } catch (Exception e) { | |
| 352 | + e.printStackTrace(); | |
| 353 | + } | |
| 354 | + | |
| 355 | + return resList; | |
| 356 | + } | |
| 357 | + | |
| 358 | + @RequestMapping(value = "/singledataExportTj2", method = RequestMethod.GET) | |
| 359 | + public List<Map<String, Object>> singledataExportTj2(@RequestParam Map<String, Object> map) { | |
| 360 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 361 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 362 | + ReportUtils ee = new ReportUtils(); | |
| 363 | + List<Singledata> singledata = formsService.singledatatj2(map); | |
| 364 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 365 | + int i = 1; | |
| 366 | + for (Singledata l : singledata) { | |
| 367 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 368 | + m.put("i", i); | |
| 369 | + m.put("rQ", l.getrQ()); | |
| 370 | + m.put("gS", l.getgS()); | |
| 371 | + m.put("xL", l.getXlmc()); | |
| 372 | + m.put("clzbh", l.getClzbh()); | |
| 373 | + m.put("jsy", l.getJsy()); | |
| 374 | + m.put("jName", l.getjName()); | |
| 375 | + m.put("sgh", l.getSgh()); | |
| 376 | + m.put("sName", l.getsName()); | |
| 377 | + m.put("jhlc", l.getJhlc()); | |
| 378 | + m.put("emptMileage", l.getEmptMileage()); | |
| 379 | + m.put("hyl", l.getHyl()); | |
| 380 | + m.put("jzl", l.getJzl()); | |
| 381 | + m.put("unyyyl", l.getUnyyyl()); | |
| 382 | + m.put("jhjl", l.getJhjl()); | |
| 383 | + resList.add(m); | |
| 384 | + | |
| 385 | + i++; | |
| 386 | + } | |
| 387 | + | |
| 388 | + try { | |
| 389 | + listI.add(resList.iterator()); | |
| 390 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 391 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls", | |
| 392 | + path + "export/路单数据" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 393 | + } catch (Exception e) { | |
| 394 | + e.printStackTrace(); | |
| 395 | + } | |
| 396 | + | |
| 397 | + return resList; | |
| 398 | + } | |
| 399 | + // 车辆加注 | |
| 400 | + @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.GET) | |
| 401 | + public List<Map<String, Object>> vehicleloadingExport(@RequestParam Map<String, Object> map) { | |
| 402 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 403 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 404 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 405 | + ReportUtils ee = new ReportUtils(); | |
| 406 | + List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("line").toString(), | |
| 407 | + map.get("data").toString()); | |
| 408 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 409 | + int i = 1; | |
| 410 | + for (Vehicleloading l : vehicleloading) { | |
| 411 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 412 | + m.put("i", i); | |
| 413 | + m.put("rQ", l.getrQ()); | |
| 414 | + m.put("gS", l.getgS()); | |
| 415 | + m.put("xL", l.getxL()); | |
| 416 | + m.put("clzbh", l.getClzbh()); | |
| 417 | + m.put("jzl", l.getJzl()); | |
| 418 | + m.put("hyl", l.getHyl()); | |
| 419 | + m.put("ls", l.getLs()); | |
| 420 | + m.put("jhlc", l.getJhlc()); | |
| 421 | + m.put("unyyyl", l.getUnyyyl()); | |
| 422 | + m.put("jhbc", l.getJhbc()); | |
| 423 | + m.put("sjbc", l.getSjbc()); | |
| 424 | + resList.add(m); | |
| 425 | + i++; | |
| 426 | + } | |
| 427 | + | |
| 428 | + try { | |
| 429 | + String date = "", lineName = ""; | |
| 430 | + if(map.containsKey("data")) | |
| 431 | + date = map.get("data").toString(); | |
| 432 | + if(map.containsKey("lineName")) | |
| 433 | + lineName = map.get("lineName").toString(); | |
| 434 | + listI.add(resList.iterator()); | |
| 435 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 436 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/vehicleloading.xls", | |
| 437 | + path + "export/" + sdfSimple.format(sdfMonth.parse(date)) + "-" + lineName + "-车辆加注.xls"); | |
| 438 | + } catch (Exception e) { | |
| 439 | + e.printStackTrace(); | |
| 440 | + } | |
| 441 | + return resList; | |
| 442 | + } | |
| 443 | + | |
| 444 | + // 运营服务阶段报表 | |
| 445 | + @RequestMapping(value = "/operationserviceExport", method = RequestMethod.GET) | |
| 446 | + public List<Map<String, Object>> operationserviceExport(@RequestParam Map<String, Object> map) { | |
| 447 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 448 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 449 | + ReportUtils ee = new ReportUtils(); | |
| 450 | + List<Operationservice> operationservice = formsService.operationservice(map); | |
| 451 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 452 | + int i = 1; | |
| 453 | + for (Operationservice l : operationservice) { | |
| 454 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 455 | + m.put("i", i); | |
| 456 | + m.put("fgs", l.getFgs()!=null?l.getFgs():""); | |
| 457 | + m.put("xlName", l.getXlName()!=null?l.getXlName():""); | |
| 458 | + m.put("jzl", l.getJzl()!=null?l.getJzl():""); | |
| 459 | + m.put("xhl", l.getXhl()!=null?l.getXhl():""); | |
| 460 | + m.put("xsgl", l.getXsgl()!=null?l.getXsgl():""); | |
| 461 | + m.put("emptMileage", l.getEmptMileage()!=null?l.getEmptMileage():""); | |
| 462 | + m.put("sjbc", l.getSjbc()!=null?l.getSjbc():""); | |
| 463 | + resList.add(m); | |
| 464 | + i++; | |
| 465 | + } | |
| 466 | + | |
| 467 | + try { | |
| 468 | + String dateTime = "", startDate = "", endDate = "", lineName = ""; | |
| 469 | + if(map.containsKey("startDate")) | |
| 470 | + startDate = map.get("startDate").toString(); | |
| 471 | + if(map.containsKey("endDate")) | |
| 472 | + endDate = map.get("endDate").toString(); | |
| 473 | + if(map.containsKey("lineName")) | |
| 474 | + lineName = map.get("lineName").toString(); | |
| 475 | + if(startDate.equals(endDate)){ | |
| 476 | + dateTime = sdfSimple.format(sdfMonth.parse(startDate)); | |
| 477 | + } else { | |
| 478 | + dateTime = sdfSimple.format(sdfMonth.parse(startDate)) | |
| 479 | + +"-"+sdfSimple.format(sdfMonth.parse(endDate)); | |
| 480 | + } | |
| 481 | + listI.add(resList.iterator()); | |
| 482 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 483 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/operationservice.xls", path + "export/" | |
| 484 | + + dateTime + "-" + lineName + "-运营服务阶段报表.xls"); | |
| 485 | + } catch (Exception e) { | |
| 486 | + e.printStackTrace(); | |
| 487 | + } | |
| 488 | + return resList; | |
| 489 | + } | |
| 490 | + | |
| 491 | + // 换人换车情况日统计 | |
| 492 | + @RequestMapping(value = "/changetochangeExport", method = RequestMethod.POST) | |
| 493 | + public List<Map<String, Object>> changetochangeExport(@RequestParam Map<String, Object> map) { | |
| 494 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 495 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 496 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 497 | + ReportUtils ee = new ReportUtils(); | |
| 498 | + List<Changetochange> changetochange = formsService.changetochange(map); | |
| 499 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 500 | + for (Changetochange l : changetochange) { | |
| 501 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 502 | + m.put("rq", l.getRq()); | |
| 503 | + m.put("gs", l.getGs()); | |
| 504 | + m.put("fgs", l.getFgs()); | |
| 505 | + m.put("xl", l.getXl()); | |
| 506 | + m.put("lp", l.getLp()); | |
| 507 | + m.put("fssj", l.getFssj()); | |
| 508 | + m.put("xgsj", l.getXgsj()); | |
| 509 | + m.put("pcch", l.getPcch()); | |
| 510 | + m.put("sjch", l.getSjch()); | |
| 511 | + m.put("fcgh", l.getPcry()); | |
| 512 | + m.put("sjgh", l.getSjgh()); | |
| 513 | + m.put("yy", l.getYy()==null?"":l.getYy()); | |
| 514 | + m.put("xgr", l.getXgr()); | |
| 515 | + resList.add(m); | |
| 516 | + } | |
| 517 | + | |
| 518 | + try { | |
| 519 | + String dateTime = "", startDate = "", endDate = "", lineName = ""; | |
| 520 | + if(map.containsKey("startDate")) | |
| 521 | + startDate = map.get("startDate").toString(); | |
| 522 | + if(map.containsKey("endDate")) | |
| 523 | + endDate = map.get("endDate").toString(); | |
| 524 | + if(map.containsKey("lineName")) | |
| 525 | + lineName = map.get("lineName").toString(); | |
| 526 | + if(startDate.equals(endDate)){ | |
| 527 | + dateTime = sdfSimple.format(sdfMonth.parse(startDate)); | |
| 528 | + } else { | |
| 529 | + dateTime = sdfSimple.format(sdfMonth.parse(startDate)) | |
| 530 | + +"-"+sdfSimple.format(sdfMonth.parse(endDate)); | |
| 531 | + } | |
| 532 | + listI.add(resList.iterator()); | |
| 533 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 534 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/changetochange.xls", path + "export/" | |
| 535 | + + dateTime + "-" + lineName + "-换人换车情况日统计.xls"); | |
| 536 | + } catch (Exception e) { | |
| 537 | + e.printStackTrace(); | |
| 538 | + } | |
| 539 | + return resList; | |
| 540 | + } | |
| 541 | + | |
| 542 | + // 营运线路出车率统计表 | |
| 543 | + @RequestMapping(value = "/turnoutrateExport", method = RequestMethod.POST) | |
| 544 | + public List<Map<String, Object>> turnoutrateExport(@RequestParam Map<String, Object> map) { | |
| 545 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 546 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 547 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 548 | + ReportUtils ee = new ReportUtils(); | |
| 549 | + Map<String, Object> map1 = new HashMap<String, Object>(); | |
| 550 | + | |
| 551 | + List<Map<String, Object>> resList = formsService.turnoutrate(map); | |
| 552 | + Map<String, Object> m = resList.get(resList.size() - 1); | |
| 553 | + map1.put("line", m.get("line")); | |
| 554 | + map1.put("jhcc", m.get("jhcc")); | |
| 555 | + map1.put("sjcc", m.get("sjcc")); | |
| 556 | + map1.put("jhbc", m.get("jhbc")); | |
| 557 | + map1.put("sjbc", m.get("sjbc")); | |
| 558 | + map1.put("ccl", m.get("ccl")); | |
| 559 | + map1.put("zxl", m.get("zxl")); | |
| 560 | + map1.put("qz", m.get("qz")); | |
| 561 | + map1.put("sm", m.get("sm")); | |
| 562 | + | |
| 563 | + resList.remove(m); | |
| 564 | + | |
| 565 | + try { | |
| 566 | + String dateTime = "", startDate = "", endDate = "", lineName = ""; | |
| 567 | + if(map.containsKey("startDate")) | |
| 568 | + startDate = map.get("startDate").toString(); | |
| 569 | + if(map.containsKey("endDate")) | |
| 570 | + endDate = map.get("endDate").toString(); | |
| 571 | + if(map.containsKey("lineName")) | |
| 572 | + lineName = map.get("lineName").toString(); | |
| 573 | + if(startDate.equals(endDate)){ | |
| 574 | + dateTime = sdfSimple.format(sdfMonth.parse(startDate)); | |
| 575 | + } else { | |
| 576 | + dateTime = sdfSimple.format(sdfMonth.parse(startDate)) | |
| 577 | + +"-"+sdfSimple.format(sdfMonth.parse(endDate)); | |
| 578 | + } | |
| 579 | + listI.add(resList.iterator()); | |
| 580 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 581 | + ee.excelReplace(listI, new Object[] { map1 }, path + "mould/turnoutrate.xls", path + "export/" | |
| 582 | + + dateTime + "-" + lineName + "-营运线路出车率统计表.xls"); | |
| 583 | + } catch (Exception e) { | |
| 584 | + e.printStackTrace(); | |
| 585 | + } | |
| 586 | + return resList; | |
| 587 | + } | |
| 588 | + | |
| 589 | + //班次执行率统计表 | |
| 590 | + @RequestMapping(value = "/executionrateExport", method = RequestMethod.POST) | |
| 591 | + public List<Map<String, Object>> executionrateExport(@RequestParam Map<String, Object> map) { | |
| 592 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 593 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 594 | + ReportUtils ee = new ReportUtils(); | |
| 595 | + List<Executionrate> executionrate = formsService.executionrate(map); | |
| 596 | + Map<String, Object> map1 = new HashMap<String, Object>(); | |
| 597 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 598 | + String xlts=""; | |
| 599 | + String zsgs=""; | |
| 600 | + String jh=""; | |
| 601 | + Float sj=0f; | |
| 602 | + Float ccl=0f; | |
| 603 | + Float bcjh=0f; | |
| 604 | + String bcsj=""; | |
| 605 | + Float bczxl=0f; | |
| 606 | + String gs=""; | |
| 607 | + String zhgs=""; | |
| 608 | + | |
| 609 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 610 | + | |
| 611 | + for (Executionrate l : executionrate) { | |
| 612 | + | |
| 613 | + xlts +=l.getGsgs()==""?0:String.valueOf(l.getGsgs()); | |
| 614 | + zsgs +=l.getFgsgs()==""?0:String.valueOf(l.getFgsgs()); | |
| 615 | + jh +=l.getXl()==""?0:String.valueOf(l.getXl()); | |
| 616 | + sj +=l.getCchjh()==""?0f:Float.valueOf(l.getCchjh()); | |
| 617 | + ccl +=l.getCchsj()==""?0f:Float.valueOf(l.getCchsj()); | |
| 618 | + bcsj +=l.getChl()==""?0:String.valueOf(l.getChl()); | |
| 619 | + bczxl +=l.getBcjh()==""?0f:Float.valueOf(l.getBcjh()); | |
| 620 | + gs +=l.getBcsj()==""?0:String.valueOf(l.getBcsj()); | |
| 621 | + zhgs +=l.getBbzxl()==""?0:String.valueOf(l.getBbzxl()); | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + m.put("rq", l.getRq()); | |
| 626 | + m.put("gs", l.getGs()); | |
| 627 | + m.put("zhgs", l.getZhgs()); | |
| 628 | + m.put("xl", l.getXl()); | |
| 629 | + m.put("cchjh", l.getCchjh()); | |
| 630 | + m.put("cchsj", l.getCchsj()); | |
| 631 | + m.put("chl", l.getChl()); | |
| 632 | + m.put("bcjh", l.getBcjh()); | |
| 633 | + m.put("bcsj", l.getBcsj()); | |
| 634 | + m.put("bbzxl", l.getBbzxl()); | |
| 635 | + m.put("sm", l.getSm()); | |
| 636 | + resList.add(m); | |
| 637 | + | |
| 638 | + | |
| 639 | + m=new HashMap<String,Object>(); | |
| 640 | + m.put("total_gs", xlts); | |
| 641 | + m.put("total_zhgs", zsgs); | |
| 642 | + m.put("total_xlts", jh); | |
| 643 | + m.put("total_jh", sj); | |
| 644 | + m.put("total_sj", ccl); | |
| 645 | + m.put("total_ccl",bcsj); | |
| 646 | + m.put("total_bcjh", bczxl); | |
| 647 | + m.put("total_bcsj", gs); | |
| 648 | + m.put("total_bczxl", zhgs); | |
| 649 | + | |
| 650 | + map1 = m; | |
| 651 | + } | |
| 652 | + | |
| 653 | + try { | |
| 654 | + listI.add(resList.iterator()); | |
| 655 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 656 | + ee.excelReplace(listI, new Object[] { map1 }, path + "mould/executionrate.xls", path + "export/班次执行率统计表" | |
| 657 | + + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 658 | + } catch (Exception e) { | |
| 659 | + e.printStackTrace(); | |
| 660 | + } | |
| 661 | + return resList; | |
| 662 | + } | |
| 663 | + | |
| 664 | + | |
| 665 | + ////营运线路名称统计表 | |
| 666 | + @RequestMapping(value = "/alllineExport", method = RequestMethod.POST) | |
| 667 | + public List<Map<String, Object>> alllineExport(@RequestParam Map<String, Object> map) { | |
| 668 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 669 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 670 | + ReportUtils ee = new ReportUtils(); | |
| 671 | + List<Allline> allline = formsService.allline(map); | |
| 672 | + Map<String, Object> map1 = new HashMap<String, Object>(); | |
| 673 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 674 | + Integer jh=0; | |
| 675 | + Integer sj=0; | |
| 676 | + Integer ccl=0; | |
| 677 | + Double bcjh=0.0; | |
| 678 | + String bcsj=""; | |
| 679 | + Integer bczxl=0; | |
| 680 | + String gs=""; | |
| 681 | + String zhgs=""; | |
| 682 | + Map<String, Object> m ; | |
| 683 | + for (Allline l : allline) { | |
| 684 | + m = new HashMap<String, Object>(); | |
| 685 | + | |
| 686 | + jh +=l.getGsgs()=="" ? 0: Integer.valueOf(l.getGsgs()); | |
| 687 | + sj +=l.getFgsgs()==""?0: Integer.valueOf(l.getFgsgs()); | |
| 688 | + ccl +=l.getCchjh()==""?0: Integer.valueOf(l.getCchjh()); | |
| 689 | + bcjh +=l.getCchsj()==""?0: Double.valueOf(l.getCchsj()); | |
| 690 | + | |
| 691 | + bcsj +=l.getChl()==""? 0:String.valueOf(l.getChl()); | |
| 692 | + bczxl +=l.getBcjh()==""?0: Integer.valueOf(l.getBcjh()); | |
| 693 | + gs +=l.getBcsj()==""?0: String.valueOf(l.getBcsj()); | |
| 694 | + zhgs +=l.getBbzxl()==""?0:String.valueOf(l.getBbzxl()); | |
| 695 | + | |
| 696 | + m.put("rq", l.getRq()); | |
| 697 | + m.put("gs", l.getGs()); | |
| 698 | + m.put("zhgs", l.getZhgs()); | |
| 699 | + m.put("xl", l.getXl()); | |
| 700 | + m.put("cchjh", l.getCchjh()); | |
| 701 | + m.put("cchsj", l.getCchsj()); | |
| 702 | + m.put("chl", l.getChl()); | |
| 703 | + m.put("bcjh", l.getBcjh()); | |
| 704 | + m.put("bcsj", l.getBcsj()); | |
| 705 | + m.put("bbzxl", l.getBbzxl()); | |
| 706 | + m.put("sm", l.getSm()); | |
| 707 | + resList.add(m); | |
| 708 | + | |
| 709 | + m=new HashMap<String,Object>(); | |
| 710 | + m.put("total_jh", jh); | |
| 711 | + m.put("total_sj", sj); | |
| 712 | + m.put("total_ccl", ccl); | |
| 713 | + m.put("total_bcjh", bcjh); | |
| 714 | + m.put("total_bcsj", bcsj); | |
| 715 | + m.put("total_bczxl", bczxl); | |
| 716 | + m.put("total_gs", gs); | |
| 717 | + m.put("total_zhgs", zhgs); | |
| 718 | + map1 = m; | |
| 719 | + | |
| 720 | + } | |
| 721 | + | |
| 722 | + try { | |
| 723 | + listI.add(resList.iterator()); | |
| 724 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 725 | + ee.excelReplace(listI, new Object[] { map1 }, path + "mould/allline.xls", path + "export/营运线路名称统计表" | |
| 726 | + + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls"); | |
| 727 | + } catch (Exception e) { | |
| 728 | + e.printStackTrace(); | |
| 729 | + } | |
| 730 | + return resList; | |
| 731 | + } | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + //班次日报表 | |
| 736 | + @RequestMapping(value = "/dailyExport", method = RequestMethod.POST) | |
| 737 | + public List<Map<String, Object>> dailyExport(@RequestParam Map<String, Object> map) { | |
| 738 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 739 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 740 | + ReportUtils ee = new ReportUtils(); | |
| 741 | + List<Daily> allline = formsService.daily(map); | |
| 742 | + | |
| 743 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 744 | + double zgl=0.0; | |
| 745 | + double ks=0.0; | |
| 746 | + double yh=0.0; | |
| 747 | + int bc=0; | |
| 748 | + Map<String, Object> m ; | |
| 749 | + for (Daily d : allline) { | |
| 750 | + m = new HashMap<String, Object>(); | |
| 751 | + m.put("zbh", d.getZbh()); | |
| 752 | + m.put("jgh",d.getJgh()); | |
| 753 | + m.put("jName", d.getjName()); | |
| 754 | + m.put("zlc", d.getZlc()); | |
| 755 | + m.put("jzl1", d.getJzl1()); | |
| 756 | + m.put("yh", d.getYh()); | |
| 757 | + m.put("bc", d.getBc()); | |
| 758 | + zgl =Arith.add(zgl, d.getZlc()); | |
| 759 | + ks =Arith.add(ks, d.getJzl1()); | |
| 760 | + yh =Arith.add(yh, d.getYh()); | |
| 761 | + bc +=Integer.parseInt(d.getBc()); | |
| 762 | + | |
| 763 | + resList.add(m); | |
| 764 | + } | |
| 765 | + | |
| 766 | + m=new HashMap<String,Object>(); | |
| 767 | + m.put("total_zgl", zgl); | |
| 768 | + m.put("total_ks", ks); | |
| 769 | + m.put("total_yh", yh); | |
| 770 | + m.put("total_bc", bc); | |
| 771 | + | |
| 772 | + m.put("line", BasicData.lineCode2NameMap.get(map.get("line").toString())); | |
| 773 | + m.put("date", map.get("date").toString()); | |
| 774 | + try { | |
| 775 | + String lineName = map.get("lineName").toString(); | |
| 776 | + String date = map.get("date").toString(); | |
| 777 | + listI.add(resList.iterator()); | |
| 778 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | |
| 779 | + ee.excelReplace(listI, new Object[] { m }, path + "mould/daily.xls", | |
| 780 | + path + "export/" + sdfSimple.format(sdfMonth.parse(date)) | |
| 781 | + + "-" + lineName + "-班次日报表.xls"); | |
| 782 | + } catch (Exception e) { | |
| 783 | + e.printStackTrace(); | |
| 784 | + } | |
| 785 | + return resList; | |
| 786 | + } | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | +} | ... | ... |
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
0 → 100644
| 1 | +package com.bsth.controller.forms; | |
| 2 | + | |
| 3 | +import com.bsth.entity.mcy_forms.*; | |
| 4 | +import com.bsth.service.forms.FormsService; | |
| 5 | +import com.bsth.service.realcontrol.ScheduleRealInfoService; | |
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 7 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 8 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 9 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 10 | +import org.springframework.web.bind.annotation.RestController; | |
| 11 | + | |
| 12 | +import java.util.List; | |
| 13 | +import java.util.Map; | |
| 14 | + | |
| 15 | +@RestController | |
| 16 | +@RequestMapping("mcy_forms") | |
| 17 | +public class MCY_FormsController { | |
| 18 | + | |
| 19 | + @Autowired | |
| 20 | + FormsService formsService; | |
| 21 | + | |
| 22 | + @Autowired | |
| 23 | + ScheduleRealInfoService scheduleRealInfoService; | |
| 24 | + | |
| 25 | + // 行车路单日报表 | |
| 26 | + | |
| 27 | + @RequestMapping(value = "/waybillday", method = RequestMethod.POST) | |
| 28 | + public List<Waybillday> waybillday(@RequestParam Map<String, Object> map) { | |
| 29 | + | |
| 30 | + // scheduleRealInfoService.findKMBC(jName, clZbh, lpName, date) | |
| 31 | + return formsService.waybillday(map); | |
| 32 | + } | |
| 33 | + | |
| 34 | + // 线路客流量报表 | |
| 35 | + | |
| 36 | + @RequestMapping(value = "/linepasswengerflow", method = RequestMethod.POST) | |
| 37 | + public List<Linepasswengerflow> linepasswengerflow(@RequestParam Map<String, Object> map) { | |
| 38 | + | |
| 39 | + return formsService.linepasswengerflow(map); | |
| 40 | + } | |
| 41 | + | |
| 42 | + // 班次车辆人员月报表 | |
| 43 | + @RequestMapping(value = "/shiftuehiclemanth", method = RequestMethod.GET) | |
| 44 | + public List<Shiftuehiclemanth> shiftuehiclemanth(@RequestParam Map<String, Object> map) { | |
| 45 | + | |
| 46 | + return formsService.shiftuehiclemanth(map); | |
| 47 | + } | |
| 48 | + | |
| 49 | + // 班次车辆人员月报表 | |
| 50 | + @RequestMapping(value = "/shiftuehiclemanth2", method = RequestMethod.GET) | |
| 51 | + public List<Shiftuehiclemanth> shiftuehiclemanth2(@RequestParam Map<String, Object> map) { | |
| 52 | + | |
| 53 | + return formsService.shiftuehiclemanth2(map); | |
| 54 | + } | |
| 55 | + | |
| 56 | + // 班次车辆人员日统计 | |
| 57 | + @RequestMapping(value = "/shifday", method = RequestMethod.GET) | |
| 58 | + public List<Shifday> shifday(@RequestParam Map<String, Object> map) { | |
| 59 | + | |
| 60 | + return formsService.shifday(map); | |
| 61 | + } | |
| 62 | + | |
| 63 | + // 换人换车情况统计表 | |
| 64 | + @RequestMapping(value = "/changetochange", method = RequestMethod.GET) | |
| 65 | + public List<Changetochange> changetochange(@RequestParam Map<String, Object> map) { | |
| 66 | + | |
| 67 | + return formsService.changetochange(map); | |
| 68 | + } | |
| 69 | + | |
| 70 | + // 路单数据 | |
| 71 | + @RequestMapping(value = "/singledata", method = RequestMethod.GET) | |
| 72 | + public List<Singledata> singledata(@RequestParam Map<String, Object> map) { | |
| 73 | + | |
| 74 | + return formsService.singledata(map); | |
| 75 | + } | |
| 76 | + | |
| 77 | + // 路单数据 | |
| 78 | + @RequestMapping(value = "/singledata2", method = RequestMethod.GET) | |
| 79 | + public List<Singledata> singledata2(@RequestParam Map<String, Object> map) { | |
| 80 | + | |
| 81 | + return formsService.singledata2(map); | |
| 82 | + } | |
| 83 | + | |
| 84 | + // 路单数据 | |
| 85 | + @RequestMapping(value = "/singledatanew", method = RequestMethod.GET) | |
| 86 | + public List<Singledata> singledatanew(@RequestParam Map<String, Object> map) { | |
| 87 | + | |
| 88 | + return formsService.singledatanew(map); | |
| 89 | + } | |
| 90 | + | |
| 91 | + @RequestMapping(value = "/singledatatj", method = RequestMethod.GET) | |
| 92 | + public List<Singledata> singledatatj(@RequestParam Map<String, Object> map) { | |
| 93 | + | |
| 94 | + return formsService.singledatatj(map); | |
| 95 | + } | |
| 96 | + | |
| 97 | + | |
| 98 | + @RequestMapping(value = "/singledatatj2", method = RequestMethod.GET) | |
| 99 | + public List<Singledata> singledatatj2(@RequestParam Map<String, Object> map) { | |
| 100 | + | |
| 101 | + return formsService.singledatatj2(map); | |
| 102 | + } | |
| 103 | + // 车辆加注 | |
| 104 | + @RequestMapping(value = "/vehicleloading", method = RequestMethod.GET) | |
| 105 | + public List<Vehicleloading> vehicleloading(@RequestParam String line, @RequestParam String data) { | |
| 106 | + return formsService.vehicleloading(line, data); | |
| 107 | + } | |
| 108 | + | |
| 109 | + // 运营服务阶段报表 | |
| 110 | + @RequestMapping(value = "/operationservice", method = RequestMethod.GET) | |
| 111 | + public List<Operationservice> operationservice(@RequestParam Map<String, Object> map) { | |
| 112 | + | |
| 113 | + return formsService.operationservice(map); | |
| 114 | + } | |
| 115 | + | |
| 116 | + // 营运线路出车率统计表 | |
| 117 | + @RequestMapping(value = "/turnoutrate", method = RequestMethod.POST) | |
| 118 | + public List<Map<String, Object>> turnoutrate(@RequestParam Map<String, Object> map) { | |
| 119 | + | |
| 120 | + return formsService.turnoutrate(map); | |
| 121 | + } | |
| 122 | + | |
| 123 | + // 班次执行率统计表 | |
| 124 | + @RequestMapping(value = "/executionrate", method = RequestMethod.POST) | |
| 125 | + public List<Executionrate> executionrate(@RequestParam Map<String, Object> map) { | |
| 126 | + | |
| 127 | + return formsService.executionrate(map); | |
| 128 | + } | |
| 129 | + | |
| 130 | + // 营运线路名称统计表 | |
| 131 | + @RequestMapping(value = "/allline", method = RequestMethod.POST) | |
| 132 | + public List<Allline> allline(@RequestParam Map<String, Object> map) { | |
| 133 | + | |
| 134 | + return formsService.allline(map); | |
| 135 | + } | |
| 136 | + | |
| 137 | + // 营运线路名称统计表 | |
| 138 | + @RequestMapping(value = "/daily", method = RequestMethod.GET) | |
| 139 | + public List<Daily> daily(@RequestParam Map<String, Object> map) { | |
| 140 | + | |
| 141 | + return formsService.daily(map); | |
| 142 | + } | |
| 143 | + | |
| 144 | +} | ... | ... |
src/main/java/com/bsth/controller/gps/GpsController.java
| 1 | 1 | package com.bsth.controller.gps; |
| 2 | 2 | |
| 3 | +import com.alibaba.fastjson.JSONObject; | |
| 3 | 4 | import com.bsth.data.BasicData; |
| 4 | 5 | import com.bsth.data.gpsdata_v2.GpsRealData; |
| 5 | 6 | import com.bsth.data.gpsdata_v2.entity.GpsEntity; |
| ... | ... | @@ -7,18 +8,22 @@ import com.bsth.data.gpsdata_v2.handlers.overspeed.GpsOverspeed; |
| 7 | 8 | import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess; |
| 8 | 9 | import com.bsth.data.schedule.e_state_check.ScheduleStationCodeChecker; |
| 9 | 10 | import com.bsth.data.schedule.e_state_check.entity.SCodeInfo; |
| 11 | +import com.bsth.entity.Line; | |
| 12 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 13 | +import com.bsth.repository.LineRepository; | |
| 14 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | |
| 10 | 15 | import com.bsth.service.gps.GpsService; |
| 11 | 16 | import com.bsth.service.gps.entity.GpsSpeed; |
| 12 | 17 | import com.google.common.base.Splitter; |
| 18 | +import org.hibernate.validator.constraints.Length; | |
| 19 | +import org.springframework.beans.BeanUtils; | |
| 13 | 20 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | 21 | import org.springframework.web.bind.annotation.*; |
| 15 | 22 | |
| 16 | 23 | import javax.servlet.http.HttpServletResponse; |
| 17 | 24 | import java.text.ParseException; |
| 18 | -import java.util.ArrayList; | |
| 19 | -import java.util.HashMap; | |
| 20 | -import java.util.List; | |
| 21 | -import java.util.Map; | |
| 25 | +import java.text.SimpleDateFormat; | |
| 26 | +import java.util.*; | |
| 22 | 27 | |
| 23 | 28 | @RestController |
| 24 | 29 | @RequestMapping("gps") |
| ... | ... | @@ -32,7 +37,14 @@ public class GpsController { |
| 32 | 37 | |
| 33 | 38 | @Autowired |
| 34 | 39 | OverspeedProcess overspeedProcess; |
| 40 | + | |
| 41 | + @Autowired | |
| 42 | + LineRepository lineRepository; | |
| 43 | + @Autowired | |
| 44 | + ScheduleRealInfoRepository scheduleRealInfoRepository; | |
| 35 | 45 | |
| 46 | + // 格式化 年月日 | |
| 47 | + private SimpleDateFormat sdfnyr = new SimpleDateFormat("yyyy-MM-dd"); | |
| 36 | 48 | @RequestMapping(value = "/real/all") |
| 37 | 49 | public Map<String, Object> search(@RequestParam Map<String, Object> map, |
| 38 | 50 | @RequestParam(defaultValue = "0") int page, |
| ... | ... | @@ -51,11 +63,31 @@ public class GpsController { |
| 51 | 63 | |
| 52 | 64 | @RequestMapping(value = "/real/line") |
| 53 | 65 | public Map<String, Object> findByLineCodes(@RequestParam String lineCodes) { |
| 66 | + | |
| 67 | + String json ="{\"lineId\":\"90018\",\"deviceId\":\"05S0Q141\",\"carparkNo\":\"\",\"stopNo\":\"119734\",\"stationName\":\"张江地铁站\",\"lon\":121.582085,\"lat\":31.203028,\"timestamp\":1637659686000,\"serverTimestamp\":1637659686742,\"speed\":0.0,\"direction\":0.0,\"state\":0,\"upDown\":0,\"origStateStr\":null,\"nbbm\":\"Q4A-009\",\"expectStopTime\":null,\"schId\":1040196467,\"version\":152,\"instation\":1,\"signalState\":\"normal\",\"abnormalStatus\":null,\"outOfBoundDistance\":0.0,\"valid\":0,\"source\":-1,\"remark\":null,\"planCode\":null,\"dvrcode\":null,\"offline\":false,\"service\":true}"; | |
| 68 | + GpsEntity res = JSONObject.parseObject(json, GpsEntity.class); | |
| 54 | 69 | Map<String, Object> rs = new HashMap(); |
| 55 | 70 | List<String> lineArray = Splitter.on(",").splitToList(lineCodes); |
| 56 | 71 | //实时gps |
| 57 | 72 | List<GpsEntity> gpsList = gpsRealData.get(lineArray); |
| 58 | - | |
| 73 | + String[] t = lineCodes.split(","); | |
| 74 | + List<Map<String, Object>> clZbhMap = new ArrayList<>(); | |
| 75 | + clZbhMap= scheduleRealInfoRepository.selectclZbhGroup(sdfnyr.format(new Date()),t); | |
| 76 | + for (int i = 0 ; i< t.length;i++){ | |
| 77 | + for(Map clm : clZbhMap){ | |
| 78 | + if(clm.get("xlBm").equals(t[i])){ | |
| 79 | + String lineName = BasicData.lineCode2NameMap.get(t[i]); | |
| 80 | + GpsEntity snt = new GpsEntity(); | |
| 81 | + BeanUtils.copyProperties(res,snt); | |
| 82 | + snt.setLineId(t[i]); | |
| 83 | + snt.setNbbm(clm.get("clZbh")+"-"+lineName); | |
| 84 | + snt.setDeviceId(clm.get("clZbh") +","+lineName); | |
| 85 | + gpsList.add(snt); | |
| 86 | + } | |
| 87 | + } | |
| 88 | + | |
| 89 | + | |
| 90 | + } | |
| 59 | 91 | //超速信息 |
| 60 | 92 | List<GpsOverspeed> overspeedList = overspeedProcess.findByLines(lineArray); |
| 61 | 93 | ... | ... |
src/main/java/com/bsth/data/LineConfigData.java
| ... | ... | @@ -54,6 +54,13 @@ public class LineConfigData implements CommandLineRunner { |
| 54 | 54 | //异步入库 |
| 55 | 55 | Application.mainServices.scheduleWithFixedDelay(configPersistThread, 60, 60, TimeUnit.SECONDS); |
| 56 | 56 | } |
| 57 | + | |
| 58 | + public void lineAll(){ | |
| 59 | + lineConfMap = new HashMap<>(); | |
| 60 | + Iterator<LineConfig> itr = lineConfigService.findAll().iterator(); | |
| 61 | + while (itr.hasNext()) | |
| 62 | + setBuffer(itr.next()); | |
| 63 | + } | |
| 57 | 64 | |
| 58 | 65 | /** |
| 59 | 66 | * 起点发出,应用缓冲区设置参数 | ... | ... |
src/main/java/com/bsth/data/ddexam/DdexamThread.java
0 → 100644
| 1 | +package com.bsth.data.ddexam; | |
| 2 | + | |
| 3 | +import com.bsth.repository.sys.SysRepository; | |
| 4 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 5 | +import org.springframework.stereotype.Component; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 每日把所有账号变为未考试状态 | |
| 9 | + */ | |
| 10 | +@Component | |
| 11 | +public class DdexamThread extends Thread{ | |
| 12 | + @Autowired | |
| 13 | + SysUserRepository sysUserRepository; | |
| 14 | + | |
| 15 | + //每日把所有账号变为未考试状态 | |
| 16 | + @Override | |
| 17 | + public void run() { | |
| 18 | + sysUserRepository.changeKsStatusAll(); | |
| 19 | + } | |
| 20 | +} | ... | ... |
src/main/java/com/bsth/data/directive/DirectiveCreator.java
| ... | ... | @@ -45,7 +45,7 @@ public class DirectiveCreator { |
| 45 | 45 | public D60 createD60(String nbbm, String text, Short dispatchInstruct, int upDown, int state,String lineCode) { |
| 46 | 46 | Long timestamp = System.currentTimeMillis(); |
| 47 | 47 | |
| 48 | - Short company = Short.parseShort(BasicData.nbbm2CompanyCodeMap.get(nbbm)); | |
| 48 | + //Short company = Short.parseShort(BasicData.nbbm2CompanyCodeMap.get(nbbm)); | |
| 49 | 49 | String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm); |
| 50 | 50 | |
| 51 | 51 | int msgId = MsgIdGenerator.getMsgId(); |
| ... | ... | @@ -55,15 +55,15 @@ public class DirectiveCreator { |
| 55 | 55 | // 一级协议 |
| 56 | 56 | directive.setOperCode((short) 0x60); |
| 57 | 57 | // 设备号 |
| 58 | - directive.setDeviceId(deviceId); | |
| 58 | + directive.setDeviceId(nbbm); | |
| 59 | 59 | // 时间戳 |
| 60 | 60 | directive.setTimestamp(timestamp); |
| 61 | 61 | directive.setMsgId(msgId); |
| 62 | 62 | // 构造数据 |
| 63 | - data.setDeviceId(deviceId); | |
| 63 | + data.setDeviceId(nbbm); | |
| 64 | 64 | data.setDispatchInstruct(dispatchInstruct); |
| 65 | 65 | data.setTimestamp(timestamp); |
| 66 | - data.setCompanyCode(company); | |
| 66 | + //data.setCompanyCode(company); | |
| 67 | 67 | data.setMsgId(msgId); |
| 68 | 68 | directive.setData(data); |
| 69 | 69 | directive.setLineCode(lineCode); | ... | ... |
src/main/java/com/bsth/data/gpsdata_v2/entity/GpsEntity.java
| ... | ... | @@ -293,13 +293,13 @@ public class GpsEntity implements Cloneable{ |
| 293 | 293 | |
| 294 | 294 | |
| 295 | 295 | |
| 296 | - public short getCompanyCode() { | |
| 296 | +/* public short getCompanyCode() { | |
| 297 | 297 | return companyCode; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | public void setCompanyCode(short companyCode) { |
| 301 | 301 | this.companyCode = companyCode; |
| 302 | - } | |
| 302 | + }*/ | |
| 303 | 303 | |
| 304 | 304 | public Byte getUpDown() { |
| 305 | 305 | return upDown; | ... | ... |
src/main/java/com/bsth/data/msg_queue/WebSocketPushQueue.java
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| ... | ... | @@ -155,6 +155,10 @@ public class DayOfSchedule { |
| 155 | 155 | return currSchDateMap; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | + public void lineAll(){ | |
| 159 | + currSchDateMap = new HashMap<>(); | |
| 160 | + } | |
| 161 | + | |
| 158 | 162 | /** |
| 159 | 163 | * @Title: calcSchDateB |
| 160 | 164 | * @Description: TODO(计算线路当前应该使用的排班日期) |
| ... | ... | @@ -189,8 +193,9 @@ public class DayOfSchedule { |
| 189 | 193 | else |
| 190 | 194 | clearRAMData(lineCode); |
| 191 | 195 | |
| 192 | - if (existRealSch(lineCode, schDate)) | |
| 196 | + if (existRealSch(lineCode, schDate)) | |
| 193 | 197 | list = loadRealSch(lineCode, schDate);// 从实际排班表加载 |
| 198 | + | |
| 194 | 199 | else { |
| 195 | 200 | list = loadPlanSch(lineCode, schDate);// 从计划排班表加载 |
| 196 | 201 | // 写入数据库 | ... | ... |
src/main/java/com/bsth/data/schedule/thread/ScheduleRefreshThread.java
| ... | ... | @@ -47,8 +47,10 @@ public class ScheduleRefreshThread extends Thread{ |
| 47 | 47 | |
| 48 | 48 | String currSchDate, oldSchDate; |
| 49 | 49 | String lineCode = null; |
| 50 | + String lineName = null; | |
| 50 | 51 | for(LineConfig conf : confs){ |
| 51 | 52 | try{ |
| 53 | + lineName = conf.getLine().getName(); | |
| 52 | 54 | lineCode = conf.getLine().getLineCode(); |
| 53 | 55 | oldSchDate = dayOfSchedule.getCurrSchDate().get(lineCode); |
| 54 | 56 | currSchDate = dayOfSchedule.calcSchDate(lineCode); |
| ... | ... | @@ -71,7 +73,7 @@ public class ScheduleRefreshThread extends Thread{ |
| 71 | 73 | |
| 72 | 74 | //重载排班数据 |
| 73 | 75 | dayOfSchedule.reloadSch(lineCode, currSchDate, false); |
| 74 | - logger.info(lineCode + "翻班完成, " + currSchDate + " -班次数量:" + dayOfSchedule.findByLineCode(lineCode).size()); | |
| 76 | + logger.info(lineName + "翻班完成, " + currSchDate + " -班次数量:" + dayOfSchedule.findByLineCode(lineCode).size()); | |
| 75 | 77 | } |
| 76 | 78 | }catch (Exception e){ |
| 77 | 79 | logger.error("班次更新失败!! -" + lineCode, e); | ... | ... |
src/main/java/com/bsth/entity/StationRouteSt.java
| ... | ... | @@ -18,10 +18,9 @@ import java.util.Date; |
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | 20 | @Entity |
| 21 | -@Table(name = "bsth_c_stationroute") | |
| 21 | +@Table(name = "bsth_c_stationroute_st") | |
| 22 | 22 | @NamedEntityGraphs({ |
| 23 | - @NamedEntityGraph(name = "stationRoute_station", attributeNodes = { | |
| 24 | - @NamedAttributeNode("station"), | |
| 23 | + @NamedEntityGraph(name = "stationRoute_station_st", attributeNodes = { | |
| 25 | 24 | @NamedAttributeNode("line") |
| 26 | 25 | }) |
| 27 | 26 | }) |
| ... | ... | @@ -102,13 +101,13 @@ public class StationRouteSt { |
| 102 | 101 | @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") |
| 103 | 102 | private Date updateDate; |
| 104 | 103 | |
| 105 | - // 站点信息 | |
| 104 | + /*// 站点信息 | |
| 106 | 105 | @ManyToOne(fetch = FetchType.LAZY) |
| 107 | 106 | private Station station; |
| 108 | - | |
| 107 | + */ | |
| 109 | 108 | // 线路信息 |
| 110 | 109 | @ManyToOne |
| 111 | - private Line line; | |
| 110 | + private LineSt line; | |
| 112 | 111 | |
| 113 | 112 | public Integer getId() { |
| 114 | 113 | return id; |
| ... | ... | @@ -270,19 +269,12 @@ public class StationRouteSt { |
| 270 | 269 | this.updateDate = updateDate; |
| 271 | 270 | } |
| 272 | 271 | |
| 273 | - public Station getStation() { | |
| 274 | - return station; | |
| 275 | - } | |
| 276 | - | |
| 277 | - public void setStation(Station station) { | |
| 278 | - this.station = station; | |
| 279 | - } | |
| 280 | 272 | |
| 281 | - public Line getLine() { | |
| 273 | + public LineSt getLine() { | |
| 282 | 274 | return line; |
| 283 | 275 | } |
| 284 | 276 | |
| 285 | - public void setLine(Line line) { | |
| 277 | + public void setLine(LineSt line) { | |
| 286 | 278 | this.line = line; |
| 287 | 279 | } |
| 288 | 280 | } |
| 289 | 281 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/entity/realcontrol/ChildTaskPlan.java
| ... | ... | @@ -109,10 +109,7 @@ public class ChildTaskPlan { |
| 109 | 109 | */ |
| 110 | 110 | private boolean noClerk; |
| 111 | 111 | |
| 112 | - /** 创建日期 */ | |
| 113 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 114 | - private Date createDate; | |
| 115 | - | |
| 112 | + | |
| 116 | 113 | /** |
| 117 | 114 | * 主排班计划 |
| 118 | 115 | */ |
| ... | ... | @@ -251,14 +248,7 @@ public class ChildTaskPlan { |
| 251 | 248 | public boolean equals(Object obj) { |
| 252 | 249 | return this.id.equals(((ChildTaskPlan)obj).getId()); |
| 253 | 250 | } |
| 254 | - | |
| 255 | - public Date getCreateDate() { | |
| 256 | - return createDate; | |
| 257 | - } | |
| 258 | - | |
| 259 | - public void setCreateDate(Date createDate) { | |
| 260 | - this.createDate = createDate; | |
| 261 | - } | |
| 251 | + | |
| 262 | 252 | |
| 263 | 253 | public String getReason() { |
| 264 | 254 | return reason; | ... | ... |
src/main/java/com/bsth/entity/realcontrol/LineConfigSt.java
0 → 100644
| 1 | +package com.bsth.entity.realcontrol; | |
| 2 | + | |
| 3 | +import com.bsth.entity.Line; | |
| 4 | +import com.bsth.entity.LineSt; | |
| 5 | +import com.google.common.base.Splitter; | |
| 6 | +import org.apache.commons.lang3.StringUtils; | |
| 7 | +import org.slf4j.Logger; | |
| 8 | +import org.slf4j.LoggerFactory; | |
| 9 | + | |
| 10 | +import javax.persistence.*; | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * | |
| 15 | + * @ClassName: LineConfig | |
| 16 | + * @Description: TODO(线调 线路相关配置信息) | |
| 17 | + * @author PanZhao | |
| 18 | + * @date 2016年8月15日 下午1:57:56 | |
| 19 | + * | |
| 20 | + */ | |
| 21 | +@Entity | |
| 22 | +@Table(name = "bsth_c_line_config_st") | |
| 23 | +public class LineConfigSt { | |
| 24 | + | |
| 25 | + @Id | |
| 26 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 27 | + private Integer id; | |
| 28 | + | |
| 29 | + @OneToOne | |
| 30 | + private LineSt line; | |
| 31 | + | |
| 32 | + /** 开始运营时间 HH:mm */ | |
| 33 | + private String startOpt; | |
| 34 | + | |
| 35 | + /** 出场时间设置 0:真实出场(设备离开缓冲区时间) 1:请求出场时间 2:出站即出场 */ | |
| 36 | + private int outConfig; | |
| 37 | + | |
| 38 | + /** 出站既出场 对应的停车场 , 号分割多个*/ | |
| 39 | + private String twinsParks; | |
| 40 | + | |
| 41 | + /** 出站既出场 对应的起点站 */ | |
| 42 | + private String twinsStations; | |
| 43 | + | |
| 44 | + /** 调度指令模板 */ | |
| 45 | + private String schDirectiveTemp; | |
| 46 | + | |
| 47 | + /** 识别区间调头 */ | |
| 48 | + private boolean readReverse; | |
| 49 | + | |
| 50 | + /** 原线路回场 */ | |
| 51 | + private boolean inParkForSource; | |
| 52 | + | |
| 53 | + /** 自动执行 */ | |
| 54 | + private boolean autoExec; | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * 到离站偏移值 | |
| 58 | + */ | |
| 59 | + | |
| 60 | + //上行进站 | |
| 61 | + private int upInDiff; | |
| 62 | + //上行出站 | |
| 63 | + private int upOutDiff; | |
| 64 | + //下行进站 | |
| 65 | + private int downInDiff; | |
| 66 | + //下行出站 | |
| 67 | + private int downOutDiff; | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * 应急停靠 | |
| 71 | + */ | |
| 72 | + private boolean enableYjtk; | |
| 73 | + /** HH:mm */ | |
| 74 | + private String yjtkStart; | |
| 75 | + /** HH:mm */ | |
| 76 | + private String yjtkEnd; | |
| 77 | + private int upStopMinute; | |
| 78 | + private int downStopMinute; | |
| 79 | + | |
| 80 | + /** | |
| 81 | + * 使用第一个发车时间,不匹配最佳时间 | |
| 82 | + */ | |
| 83 | + private boolean lockFirstOutTime; | |
| 84 | + | |
| 85 | + public Integer getId() { | |
| 86 | + return id; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public void setId(Integer id) { | |
| 90 | + this.id = id; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public LineSt getLine() { | |
| 94 | + return line; | |
| 95 | + } | |
| 96 | + | |
| 97 | + public void setLine(LineSt line) { | |
| 98 | + this.line = line; | |
| 99 | + } | |
| 100 | + | |
| 101 | + public String getStartOpt() { | |
| 102 | + return startOpt; | |
| 103 | + } | |
| 104 | + | |
| 105 | + public void setStartOpt(String startOpt) { | |
| 106 | + this.startOpt = startOpt; | |
| 107 | + } | |
| 108 | + | |
| 109 | + public int getOutConfig() { | |
| 110 | + return outConfig; | |
| 111 | + } | |
| 112 | + | |
| 113 | + public void setOutConfig(int outConfig) { | |
| 114 | + this.outConfig = outConfig; | |
| 115 | + } | |
| 116 | + | |
| 117 | + public String getSchDirectiveTemp() { | |
| 118 | + return schDirectiveTemp; | |
| 119 | + } | |
| 120 | + | |
| 121 | + public void setSchDirectiveTemp(String schDirectiveTemp) { | |
| 122 | + this.schDirectiveTemp = schDirectiveTemp; | |
| 123 | + } | |
| 124 | + | |
| 125 | + public boolean isReadReverse() { | |
| 126 | + return readReverse; | |
| 127 | + } | |
| 128 | + | |
| 129 | + public void setReadReverse(boolean readReverse) { | |
| 130 | + this.readReverse = readReverse; | |
| 131 | + } | |
| 132 | + | |
| 133 | + public boolean isInParkForSource() { | |
| 134 | + return inParkForSource; | |
| 135 | + } | |
| 136 | + | |
| 137 | + public void setInParkForSource(boolean inParkForSource) { | |
| 138 | + this.inParkForSource = inParkForSource; | |
| 139 | + } | |
| 140 | + | |
| 141 | + public int getUpInDiff() { | |
| 142 | + return upInDiff; | |
| 143 | + } | |
| 144 | + | |
| 145 | + public void setUpInDiff(int upInDiff) { | |
| 146 | + this.upInDiff = upInDiff; | |
| 147 | + } | |
| 148 | + | |
| 149 | + public int getUpOutDiff() { | |
| 150 | + return upOutDiff; | |
| 151 | + } | |
| 152 | + | |
| 153 | + public void setUpOutDiff(int upOutDiff) { | |
| 154 | + this.upOutDiff = upOutDiff; | |
| 155 | + } | |
| 156 | + | |
| 157 | + public int getDownInDiff() { | |
| 158 | + return downInDiff; | |
| 159 | + } | |
| 160 | + | |
| 161 | + public void setDownInDiff(int downInDiff) { | |
| 162 | + this.downInDiff = downInDiff; | |
| 163 | + } | |
| 164 | + | |
| 165 | + public int getDownOutDiff() { | |
| 166 | + return downOutDiff; | |
| 167 | + } | |
| 168 | + | |
| 169 | + public void setDownOutDiff(int downOutDiff) { | |
| 170 | + this.downOutDiff = downOutDiff; | |
| 171 | + } | |
| 172 | + | |
| 173 | + | |
| 174 | + public String getYjtkStart() { | |
| 175 | + return yjtkStart; | |
| 176 | + } | |
| 177 | + | |
| 178 | + public void setYjtkStart(String yjtkStart) { | |
| 179 | + this.yjtkStart = yjtkStart; | |
| 180 | + } | |
| 181 | + | |
| 182 | + public String getYjtkEnd() { | |
| 183 | + return yjtkEnd; | |
| 184 | + } | |
| 185 | + | |
| 186 | + public void setYjtkEnd(String yjtkEnd) { | |
| 187 | + this.yjtkEnd = yjtkEnd; | |
| 188 | + } | |
| 189 | + | |
| 190 | + public int getUpStopMinute() { | |
| 191 | + return upStopMinute; | |
| 192 | + } | |
| 193 | + | |
| 194 | + public void setUpStopMinute(int upStopMinute) { | |
| 195 | + this.upStopMinute = upStopMinute; | |
| 196 | + } | |
| 197 | + | |
| 198 | + public int getDownStopMinute() { | |
| 199 | + return downStopMinute; | |
| 200 | + } | |
| 201 | + | |
| 202 | + public void setDownStopMinute(int downStopMinute) { | |
| 203 | + this.downStopMinute = downStopMinute; | |
| 204 | + } | |
| 205 | + | |
| 206 | + public boolean isEnableYjtk() { | |
| 207 | + return enableYjtk; | |
| 208 | + } | |
| 209 | + | |
| 210 | + public void setEnableYjtk(boolean enableYjtk) { | |
| 211 | + this.enableYjtk = enableYjtk; | |
| 212 | + } | |
| 213 | + | |
| 214 | + | |
| 215 | + public boolean isLockFirstOutTime() { | |
| 216 | + return lockFirstOutTime; | |
| 217 | + } | |
| 218 | + | |
| 219 | + public void setLockFirstOutTime(boolean lockFirstOutTime) { | |
| 220 | + this.lockFirstOutTime = lockFirstOutTime; | |
| 221 | + } | |
| 222 | + | |
| 223 | + public boolean isAutoExec() { | |
| 224 | + return autoExec; | |
| 225 | + } | |
| 226 | + | |
| 227 | + public void setAutoExec(boolean autoExec) { | |
| 228 | + this.autoExec = autoExec; | |
| 229 | + } | |
| 230 | + | |
| 231 | + public String getTwinsParks() { | |
| 232 | + return twinsParks; | |
| 233 | + } | |
| 234 | + | |
| 235 | + public void setTwinsParks(String twinsParks) { | |
| 236 | + this.twinsParks = twinsParks; | |
| 237 | + } | |
| 238 | + | |
| 239 | + public String getTwinsStations() { | |
| 240 | + return twinsStations; | |
| 241 | + } | |
| 242 | + | |
| 243 | + public void setTwinsStations(String twinsStations) { | |
| 244 | + this.twinsStations = twinsStations; | |
| 245 | + } | |
| 246 | + | |
| 247 | + | |
| 248 | + @Transient | |
| 249 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 250 | + | |
| 251 | + | |
| 252 | + public List<String> findTwinsParkList() { | |
| 253 | + try{ | |
| 254 | + if(StringUtils.isEmpty(this.twinsParks)) | |
| 255 | + return null; | |
| 256 | + return Splitter.on(",").splitToList(this.twinsParks); | |
| 257 | + }catch (Exception e){ | |
| 258 | + logger.error("", e); | |
| 259 | + return null; | |
| 260 | + } | |
| 261 | + } | |
| 262 | +} | ... | ... |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfoSt.java
0 → 100644
| 1 | +package com.bsth.entity.realcontrol; | |
| 2 | + | |
| 3 | +import com.bsth.entity.sys.SysUser; | |
| 4 | +import com.fasterxml.jackson.annotation.JsonIgnore; | |
| 5 | +import org.apache.commons.lang3.StringUtils; | |
| 6 | +import org.joda.time.format.DateTimeFormat; | |
| 7 | +import org.joda.time.format.DateTimeFormatter; | |
| 8 | + | |
| 9 | +import javax.persistence.*; | |
| 10 | +import java.util.Date; | |
| 11 | +import java.util.HashSet; | |
| 12 | +import java.util.Set; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 实际排班计划明细。 | |
| 16 | + */ | |
| 17 | +@Entity | |
| 18 | +@Table(name = "bsth_c_s_sp_info_real_st") | |
| 19 | +public class ScheduleRealInfoSt { | |
| 20 | + /** 主键Id */ | |
| 21 | + @Id | |
| 22 | + private Long id; | |
| 23 | + | |
| 24 | + /** 计划ID */ | |
| 25 | + private Long spId; | |
| 26 | + | |
| 27 | + /** 排班计划日期 --no webSocket */ | |
| 28 | + private Date scheduleDate; | |
| 29 | + /** 排班日期字符串 YYYY-MM-DD */ | |
| 30 | + private String scheduleDateStr; | |
| 31 | + | |
| 32 | + /** 真实执行时间 yyyy-MM-dd */ | |
| 33 | + private String realExecDate; | |
| 34 | + | |
| 35 | + /** 线路名称 */ | |
| 36 | + private String xlName; | |
| 37 | + /** 线路编码 */ | |
| 38 | + private String xlBm; | |
| 39 | + | |
| 40 | + /** 路牌名称 */ | |
| 41 | + private String lpName; | |
| 42 | + | |
| 43 | + /** 车辆自编号 */ | |
| 44 | + private String clZbh; | |
| 45 | + | |
| 46 | + /** 驾驶员工号 */ | |
| 47 | + private String jGh; | |
| 48 | + /** 驾驶员名字 */ | |
| 49 | + private String jName; | |
| 50 | + /** 售票员工号 */ | |
| 51 | + private String sGh; | |
| 52 | + /** 售票员名字 */ | |
| 53 | + private String sName; | |
| 54 | + | |
| 55 | + /** 线路方向 */ | |
| 56 | + private String xlDir; | |
| 57 | + /** 起点站code*/ | |
| 58 | + private String qdzCode; | |
| 59 | + /** 起点站名字 */ | |
| 60 | + private String qdzName; | |
| 61 | + | |
| 62 | + /** 终点站code*/ | |
| 63 | + private String zdzCode; | |
| 64 | + /** 终点站名字 */ | |
| 65 | + private String zdzName; | |
| 66 | + | |
| 67 | + /** 计划发车时间(格式 HH:mm) */ | |
| 68 | + private String fcsj; | |
| 69 | + /** 计划发车时间戳*/ | |
| 70 | + @Transient | |
| 71 | + private Long fcsjT; | |
| 72 | + | |
| 73 | + /** 计划终点时间(格式 HH:mm) */ | |
| 74 | + private String zdsj; | |
| 75 | + /** 计划终点时间戳*/ | |
| 76 | + @Transient | |
| 77 | + private Long zdsjT; | |
| 78 | + | |
| 79 | + /** 发车顺序号 --no webSocket*/ | |
| 80 | + private Integer fcno; | |
| 81 | + /** 对应班次数 --no webSocket*/ | |
| 82 | + private Integer bcs; | |
| 83 | + /** 计划里程 */ | |
| 84 | + private Double jhlc; | |
| 85 | + | |
| 86 | + /** 原始计划里程 (原计调的数据) */ | |
| 87 | + private Double jhlcOrig; | |
| 88 | + | |
| 89 | + /** 实际里程 --no webSocket*/ | |
| 90 | + @Transient | |
| 91 | + @JsonIgnore | |
| 92 | + private Double realMileage; | |
| 93 | + | |
| 94 | + /** 实际里程 --no webSocket */ | |
| 95 | + @Transient | |
| 96 | + private String sjlc; | |
| 97 | + /** 班次历时 */ | |
| 98 | + private Integer bcsj; | |
| 99 | + | |
| 100 | + /** | |
| 101 | + * 班次类型 TODO:正常班次、出场、进场、加油、区间班次、放空班次、放大站班次、两点间空驶 | |
| 102 | + */ | |
| 103 | + private String bcType; | |
| 104 | + | |
| 105 | + //放站班次 站点名称 | |
| 106 | + private String majorStationName; | |
| 107 | + | |
| 108 | + /** 创建人 */ | |
| 109 | + @JsonIgnore | |
| 110 | + @ManyToOne(fetch = FetchType.LAZY) | |
| 111 | + private SysUser createBy; | |
| 112 | + /** 修改人 */ | |
| 113 | + @JsonIgnore | |
| 114 | + @ManyToOne(fetch = FetchType.LAZY) | |
| 115 | + private SysUser updateBy; | |
| 116 | + /** 创建日期 */ | |
| 117 | + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 118 | + private Date createDate; | |
| 119 | + /** 修改日期 */ | |
| 120 | + @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | |
| 121 | + private Date updateDate; | |
| 122 | + | |
| 123 | + /** 实际发车时间*/ | |
| 124 | + private String fcsjActual; | |
| 125 | + /** 实际发车时间戳*/ | |
| 126 | + @Transient | |
| 127 | + private Long fcsjActualTime; | |
| 128 | + /**实际终点时间 */ | |
| 129 | + private String zdsjActual; | |
| 130 | + /** 实际终点时间戳*/ | |
| 131 | + @Transient | |
| 132 | + private Long zdsjActualTime; | |
| 133 | + | |
| 134 | + /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */ | |
| 135 | + private int status; | |
| 136 | + | |
| 137 | + private String adjustExps; | |
| 138 | + | |
| 139 | + /** 是否是临加班次 */ | |
| 140 | + private boolean sflj; | |
| 141 | + | |
| 142 | + /** 是否误点 (应发未发)*/ | |
| 143 | + @Transient | |
| 144 | + private boolean late; | |
| 145 | + | |
| 146 | + /** 是否误点 (应发未到) */ | |
| 147 | + @Transient | |
| 148 | + private boolean late2; | |
| 149 | + /** 误点停靠时间 */ | |
| 150 | + @Transient | |
| 151 | + private float lateMinute; | |
| 152 | + | |
| 153 | + /** 备注*/ | |
| 154 | + private String remarks; | |
| 155 | + | |
| 156 | + /** 原计划排班备注 --no webSocket */ | |
| 157 | + @Transient | |
| 158 | + private String remark; | |
| 159 | + | |
| 160 | + /**待发时间(格式 HH:mm) */ | |
| 161 | + private String dfsj; | |
| 162 | + | |
| 163 | + /**待发时间戳 */ | |
| 164 | + @Transient | |
| 165 | + private Long dfsjT; | |
| 166 | + | |
| 167 | + /** 指令下发状态 60: 已发送, 100: 设备确认收到, 200:驾驶员确认 0:失败 */ | |
| 168 | + private Integer directiveState = -1; | |
| 169 | + | |
| 170 | + /** 起点站计划到达时间 */ | |
| 171 | + @Transient | |
| 172 | + private String qdzArrDatejh; | |
| 173 | + | |
| 174 | + /** 起点站实际到达时间 */ | |
| 175 | + @Transient | |
| 176 | + private String qdzArrDatesj; | |
| 177 | + | |
| 178 | + /** 子任务 */ | |
| 179 | + @OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule") | |
| 180 | + private Set<ChildTaskPlan> cTasks = new HashSet<>(); | |
| 181 | + | |
| 182 | + /** 关联的公司名称 */ | |
| 183 | + private String gsName; | |
| 184 | + /** 关联的公司编码 */ | |
| 185 | + private String gsBm; | |
| 186 | + /** 关联的分公司名称 */ | |
| 187 | + private String fgsName; | |
| 188 | + /** 关联的分公司编码 */ | |
| 189 | + private String fgsBm; | |
| 190 | + /** 出场顺序号 */ | |
| 191 | + private Integer ccno; | |
| 192 | + | |
| 193 | + //待发调试(是否自动调整) | |
| 194 | + private boolean dfAuto; | |
| 195 | + //是否有GPS信号 | |
| 196 | + private boolean online; | |
| 197 | + | |
| 198 | + /** 是否有补发GPS信号 */ | |
| 199 | + private boolean reissue; | |
| 200 | + | |
| 201 | + /** 发车屏 发车顺序号,不持久化,会动态变化 --no webSocket*/ | |
| 202 | + @Transient | |
| 203 | + private int fcpSn; | |
| 204 | + | |
| 205 | + /** 标记班次已被删除 */ | |
| 206 | + @Transient | |
| 207 | + @JsonIgnore | |
| 208 | + private boolean deleted; | |
| 209 | + | |
| 210 | + @Transient | |
| 211 | + @JsonIgnore | |
| 212 | + private int saveFailCount=0; | |
| 213 | + | |
| 214 | + /** 是否需要补充GPS信号 (网关提交至运管处动态数据用) 1: 能发车, 2:能到达 3: 补发过*/ | |
| 215 | + private int siginCompate; | |
| 216 | + | |
| 217 | + /** | |
| 218 | + * 漂移状态 | |
| 219 | + * 1: 发车漂移 | |
| 220 | + * 2:到站漂移 | |
| 221 | + * 3:中途漂移 | |
| 222 | + */ | |
| 223 | + private Integer driftStatus = 0; | |
| 224 | + | |
| 225 | + /** | |
| 226 | + * 换车营运标记 true 表示该主任务由 【中途换车子任务】 级联生成 | |
| 227 | + */ | |
| 228 | + private boolean ccService; | |
| 229 | + private Integer lpChange; | |
| 230 | + | |
| 231 | + /** | |
| 232 | + * rfid状态 | |
| 233 | + */ | |
| 234 | + private int rfidState; | |
| 235 | + | |
| 236 | + /** | |
| 237 | + * 起点站rfid状态 | |
| 238 | + */ | |
| 239 | + private int firstRfidState; | |
| 240 | + | |
| 241 | + public Integer getLpChange() { | |
| 242 | + return lpChange; | |
| 243 | + } | |
| 244 | + | |
| 245 | + public void setLpChange(Integer lpChange) { | |
| 246 | + this.lpChange = lpChange; | |
| 247 | + } | |
| 248 | + | |
| 249 | + public boolean isDfAuto() { | |
| 250 | + return dfAuto; | |
| 251 | + } | |
| 252 | + | |
| 253 | + public void setDfAuto(boolean dfAuto) { | |
| 254 | + this.dfAuto = dfAuto; | |
| 255 | + } | |
| 256 | + | |
| 257 | + public boolean isOnline() { | |
| 258 | + return online; | |
| 259 | + } | |
| 260 | + | |
| 261 | + public void setOnline(boolean online) { | |
| 262 | + this.online = online; | |
| 263 | + } | |
| 264 | + | |
| 265 | + public String getQdzArrDatejh() { | |
| 266 | + return qdzArrDatejh; | |
| 267 | + } | |
| 268 | + | |
| 269 | + public void setQdzArrDatejh(String qdzArrDatejh) { | |
| 270 | + this.qdzArrDatejh = qdzArrDatejh; | |
| 271 | + } | |
| 272 | + | |
| 273 | + public String getQdzArrDatesj() { | |
| 274 | + return qdzArrDatesj; | |
| 275 | + } | |
| 276 | + | |
| 277 | + public void setQdzArrDatesj(String qdzArrDatesj) { | |
| 278 | + this.qdzArrDatesj = qdzArrDatesj; | |
| 279 | + } | |
| 280 | + | |
| 281 | + public void setcTasks(Set<ChildTaskPlan> cTasks) { | |
| 282 | + this.cTasks = cTasks; | |
| 283 | + } | |
| 284 | + | |
| 285 | + public String getGsName() { | |
| 286 | + return gsName; | |
| 287 | + } | |
| 288 | + | |
| 289 | + public void setGsName(String gsName) { | |
| 290 | + this.gsName = gsName; | |
| 291 | + } | |
| 292 | + | |
| 293 | + public String getGsBm() { | |
| 294 | + return gsBm; | |
| 295 | + } | |
| 296 | + | |
| 297 | + public void setGsBm(String gsBm) { | |
| 298 | + this.gsBm = gsBm; | |
| 299 | + } | |
| 300 | + | |
| 301 | + public String getFgsName() { | |
| 302 | + return fgsName; | |
| 303 | + } | |
| 304 | + | |
| 305 | + public void setFgsName(String fgsName) { | |
| 306 | + this.fgsName = fgsName; | |
| 307 | + } | |
| 308 | + | |
| 309 | + public String getFgsBm() { | |
| 310 | + return fgsBm; | |
| 311 | + } | |
| 312 | + | |
| 313 | + public void setFgsBm(String fgsBm) { | |
| 314 | + this.fgsBm = fgsBm; | |
| 315 | + } | |
| 316 | + | |
| 317 | + public Integer getCcno() { | |
| 318 | + return ccno; | |
| 319 | + } | |
| 320 | + | |
| 321 | + public void setCcno(Integer ccno) { | |
| 322 | + this.ccno = ccno; | |
| 323 | + } | |
| 324 | + | |
| 325 | + | |
| 326 | + /** ---------------- | |
| 327 | + @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) | |
| 328 | + private RealTimeModel sjfcModel; | |
| 329 | + @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) | |
| 330 | + private RealTimeModel sjddModel; | |
| 331 | + */ | |
| 332 | + public void addRemarks(String remark){ | |
| 333 | + if(StringUtils.isBlank(remark)) | |
| 334 | + return; | |
| 335 | + String old = this.getRemarks(); | |
| 336 | + if(StringUtils.isBlank(old)) | |
| 337 | + old = ""; | |
| 338 | + | |
| 339 | + old += remark + ";"; | |
| 340 | + this.setRemarks(old); | |
| 341 | + | |
| 342 | + } | |
| 343 | + | |
| 344 | + public Long getId() { | |
| 345 | + return id; | |
| 346 | + } | |
| 347 | + | |
| 348 | + public void setId(Long id) { | |
| 349 | + this.id = id; | |
| 350 | + } | |
| 351 | + | |
| 352 | + public Date getScheduleDate() { | |
| 353 | + return scheduleDate; | |
| 354 | + } | |
| 355 | + | |
| 356 | + public void setScheduleDate(Date scheduleDate) { | |
| 357 | + this.scheduleDate = scheduleDate; | |
| 358 | + } | |
| 359 | + | |
| 360 | + public String getXlName() { | |
| 361 | + return xlName; | |
| 362 | + } | |
| 363 | + | |
| 364 | + public void setXlName(String xlName) { | |
| 365 | + this.xlName = xlName; | |
| 366 | + } | |
| 367 | + | |
| 368 | + public String getXlBm() { | |
| 369 | + return xlBm; | |
| 370 | + } | |
| 371 | + | |
| 372 | + public void setXlBm(String xlBm) { | |
| 373 | + this.xlBm = xlBm; | |
| 374 | + } | |
| 375 | + | |
| 376 | + public String getLpName() { | |
| 377 | + return lpName; | |
| 378 | + } | |
| 379 | + | |
| 380 | + public void setLpName(String lpName) { | |
| 381 | + this.lpName = lpName; | |
| 382 | + } | |
| 383 | + | |
| 384 | + public String getClZbh() { | |
| 385 | + return clZbh; | |
| 386 | + } | |
| 387 | + | |
| 388 | + public void setClZbh(String clZbh) { | |
| 389 | + this.clZbh = clZbh; | |
| 390 | + } | |
| 391 | + | |
| 392 | + public String getjGh() { | |
| 393 | + return jGh; | |
| 394 | + } | |
| 395 | + | |
| 396 | + public void setjGh(String jGh) { | |
| 397 | + this.jGh = jGh; | |
| 398 | + } | |
| 399 | + | |
| 400 | + public String getjName() { | |
| 401 | + return jName; | |
| 402 | + } | |
| 403 | + | |
| 404 | + public void setjName(String jName) { | |
| 405 | + this.jName = jName; | |
| 406 | + } | |
| 407 | + | |
| 408 | + public String getsGh() { | |
| 409 | + if(sGh == null) | |
| 410 | + return ""; | |
| 411 | + return sGh; | |
| 412 | + } | |
| 413 | + | |
| 414 | + public void setsGh(String sGh) { | |
| 415 | + this.sGh = sGh; | |
| 416 | + } | |
| 417 | + | |
| 418 | + public String getsName() { | |
| 419 | + if(sGh == null) | |
| 420 | + return ""; | |
| 421 | + return sName; | |
| 422 | + } | |
| 423 | + | |
| 424 | + public void setsName(String sName) { | |
| 425 | + this.sName = sName; | |
| 426 | + } | |
| 427 | + | |
| 428 | + public String getXlDir() { | |
| 429 | + return xlDir; | |
| 430 | + } | |
| 431 | + | |
| 432 | + public void setXlDir(String xlDir) { | |
| 433 | + this.xlDir = xlDir; | |
| 434 | + } | |
| 435 | + | |
| 436 | + public String getQdzCode() { | |
| 437 | + return qdzCode; | |
| 438 | + } | |
| 439 | + | |
| 440 | + public void setQdzCode(String qdzCode) { | |
| 441 | + this.qdzCode = qdzCode; | |
| 442 | + } | |
| 443 | + | |
| 444 | + public String getQdzName() { | |
| 445 | + return qdzName; | |
| 446 | + } | |
| 447 | + | |
| 448 | + public void setQdzName(String qdzName) { | |
| 449 | + this.qdzName = qdzName; | |
| 450 | + } | |
| 451 | + | |
| 452 | + public String getZdzCode() { | |
| 453 | + return zdzCode; | |
| 454 | + } | |
| 455 | + | |
| 456 | + public void setZdzCode(String zdzCode) { | |
| 457 | + this.zdzCode = zdzCode; | |
| 458 | + } | |
| 459 | + | |
| 460 | + public String getZdzName() { | |
| 461 | + return zdzName; | |
| 462 | + } | |
| 463 | + | |
| 464 | + public void setZdzName(String zdzName) { | |
| 465 | + this.zdzName = zdzName; | |
| 466 | + } | |
| 467 | + | |
| 468 | + public String getFcsj() { | |
| 469 | + return fcsj; | |
| 470 | + } | |
| 471 | + | |
| 472 | + public void setFcsj(String fcsj) { | |
| 473 | + this.fcsj = fcsj; | |
| 474 | + } | |
| 475 | + | |
| 476 | + public Long getFcsjT() { | |
| 477 | + return fcsjT; | |
| 478 | + } | |
| 479 | + | |
| 480 | + public void setFcsjT(Long fcsjT) { | |
| 481 | + this.fcsjT = fcsjT; | |
| 482 | + } | |
| 483 | + | |
| 484 | + public String getZdsj() { | |
| 485 | + return zdsj; | |
| 486 | + } | |
| 487 | + | |
| 488 | + public void setZdsj(String zdsj) { | |
| 489 | + this.zdsj = zdsj; | |
| 490 | + } | |
| 491 | + | |
| 492 | + public Long getZdsjT() { | |
| 493 | + return zdsjT; | |
| 494 | + } | |
| 495 | + | |
| 496 | + public void setZdsjT(Long zdsjT) { | |
| 497 | + this.zdsjT = zdsjT; | |
| 498 | + } | |
| 499 | + | |
| 500 | + public Integer getFcno() { | |
| 501 | + return fcno; | |
| 502 | + } | |
| 503 | + | |
| 504 | + public void setFcno(Integer fcno) { | |
| 505 | + this.fcno = fcno; | |
| 506 | + } | |
| 507 | + | |
| 508 | + public Integer getBcs() { | |
| 509 | + return bcs; | |
| 510 | + } | |
| 511 | + | |
| 512 | + public void setBcs(Integer bcs) { | |
| 513 | + this.bcs = bcs; | |
| 514 | + } | |
| 515 | + | |
| 516 | + public Double getJhlc() { | |
| 517 | + return jhlc; | |
| 518 | + } | |
| 519 | + | |
| 520 | + public void setJhlc(Double jhlc) { | |
| 521 | + this.jhlc = jhlc; | |
| 522 | + //临加班次 计划公里 和 实际计划公里一样 | |
| 523 | + if(this.isSflj()) | |
| 524 | + this.setJhlcOrig(this.getJhlc()); | |
| 525 | + } | |
| 526 | + | |
| 527 | + public String getSjlc() { | |
| 528 | + return sjlc; | |
| 529 | + } | |
| 530 | + | |
| 531 | + public void setSjlc(String sjlc) { | |
| 532 | + this.sjlc = sjlc; | |
| 533 | + } | |
| 534 | + | |
| 535 | + public Integer getBcsj() { | |
| 536 | + return bcsj; | |
| 537 | + } | |
| 538 | + | |
| 539 | + public void setBcsj(Integer bcsj) { | |
| 540 | + this.bcsj = bcsj; | |
| 541 | + } | |
| 542 | + | |
| 543 | + public String getBcType() { | |
| 544 | + return bcType; | |
| 545 | + } | |
| 546 | + | |
| 547 | + public void setBcType(String bcType) { | |
| 548 | + this.bcType = bcType; | |
| 549 | + } | |
| 550 | + | |
| 551 | + public SysUser getCreateBy() { | |
| 552 | + return createBy; | |
| 553 | + } | |
| 554 | + | |
| 555 | + public void setCreateBy(SysUser createBy) { | |
| 556 | + this.createBy = createBy; | |
| 557 | + } | |
| 558 | + | |
| 559 | + public SysUser getUpdateBy() { | |
| 560 | + return updateBy; | |
| 561 | + } | |
| 562 | + | |
| 563 | + public void setUpdateBy(SysUser updateBy) { | |
| 564 | + this.updateBy = updateBy; | |
| 565 | + } | |
| 566 | + | |
| 567 | + public Date getCreateDate() { | |
| 568 | + return createDate; | |
| 569 | + } | |
| 570 | + | |
| 571 | + public void setCreateDate(Date createDate) { | |
| 572 | + this.createDate = createDate; | |
| 573 | + } | |
| 574 | + | |
| 575 | + public Date getUpdateDate() { | |
| 576 | + return updateDate; | |
| 577 | + } | |
| 578 | + | |
| 579 | + public void setUpdateDate(Date updateDate) { | |
| 580 | + this.updateDate = updateDate; | |
| 581 | + } | |
| 582 | + | |
| 583 | + public String getFcsjActual() { | |
| 584 | + return fcsjActual; | |
| 585 | + } | |
| 586 | + | |
| 587 | + public void setFcsjActual(String fcsjActual) { | |
| 588 | + this.fcsjActual = fcsjActual; | |
| 589 | + } | |
| 590 | + | |
| 591 | + public Long getFcsjActualTime() { | |
| 592 | + return fcsjActualTime; | |
| 593 | + } | |
| 594 | + | |
| 595 | + public void setFcsjActualTime(Long fcsjActualTime) { | |
| 596 | + this.fcsjActualTime = fcsjActualTime; | |
| 597 | + } | |
| 598 | + | |
| 599 | + public String getZdsjActual() { | |
| 600 | + return zdsjActual; | |
| 601 | + } | |
| 602 | + | |
| 603 | + public void setZdsjActual(String zdsjActual) { | |
| 604 | + this.zdsjActual = zdsjActual; | |
| 605 | + } | |
| 606 | + | |
| 607 | + public Long getZdsjActualTime() { | |
| 608 | + return zdsjActualTime; | |
| 609 | + } | |
| 610 | + | |
| 611 | + public void setZdsjActualTime(Long zdsjActualTime) { | |
| 612 | + this.zdsjActualTime = zdsjActualTime; | |
| 613 | + } | |
| 614 | + | |
| 615 | + public int getStatus() { | |
| 616 | + return status; | |
| 617 | + } | |
| 618 | + | |
| 619 | + public void setStatus(int status) { | |
| 620 | + this.status = status; | |
| 621 | + } | |
| 622 | + | |
| 623 | + public String getRemarks() { | |
| 624 | + return remarks; | |
| 625 | + } | |
| 626 | + | |
| 627 | + public void setRemarks(String remarks) { | |
| 628 | + this.remarks = remarks; | |
| 629 | + } | |
| 630 | + | |
| 631 | + public String getDfsj() { | |
| 632 | + return dfsj; | |
| 633 | + } | |
| 634 | + | |
| 635 | + public void setDfsj(String dfsj) { | |
| 636 | + this.dfsj = dfsj; | |
| 637 | + } | |
| 638 | + | |
| 639 | + public Long getDfsjT() { | |
| 640 | + return dfsjT; | |
| 641 | + } | |
| 642 | + | |
| 643 | + public void setDfsjT(Long dfsjT) { | |
| 644 | + this.dfsjT = dfsjT; | |
| 645 | + } | |
| 646 | + | |
| 647 | + | |
| 648 | + @Transient | |
| 649 | + private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm"); | |
| 650 | + @Transient | |
| 651 | + private static DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm"); | |
| 652 | + | |
| 653 | + public void setDfsjAll(Long dfsjT) { | |
| 654 | + this.dfsjT = dfsjT; | |
| 655 | + this.dfsj = fmtHHmm.print(this.dfsjT); | |
| 656 | + } | |
| 657 | + | |
| 658 | + public void setDfsjAll(String dfsj) { | |
| 659 | + this.dfsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + dfsj); | |
| 660 | + this.dfsj = dfsj; | |
| 661 | + } | |
| 662 | + | |
| 663 | + public void calcEndTime(){ | |
| 664 | + //计划终点时间 | |
| 665 | + if(this.getBcsj() != null){ | |
| 666 | + //this.setZdsjT(this.getDfsjT() + (this.getBcsj() * 60 * 1000)); | |
| 667 | + this.setZdsjT(this.getFcsjT() + (this.getBcsj() * 60 * 1000));//计划终点时间不变 | |
| 668 | + this.setZdsj(fmtHHmm.print(this.zdsjT)); | |
| 669 | + } | |
| 670 | + } | |
| 671 | + | |
| 672 | + public Integer getDirectiveState() { | |
| 673 | + return directiveState; | |
| 674 | + } | |
| 675 | + | |
| 676 | + public void setDirectiveState(Integer directiveState) { | |
| 677 | + this.directiveState = directiveState; | |
| 678 | + } | |
| 679 | + | |
| 680 | + @Override | |
| 681 | + public boolean equals(Object obj) { | |
| 682 | + try{ | |
| 683 | + return this.id.equals(((ScheduleRealInfoSt)obj).getId()); | |
| 684 | + }catch(Exception e){ | |
| 685 | + return false; | |
| 686 | + } | |
| 687 | + } | |
| 688 | + | |
| 689 | + @Override | |
| 690 | + public int hashCode() { | |
| 691 | + return ("schedule_" + this.id).hashCode(); | |
| 692 | + } | |
| 693 | + | |
| 694 | + public boolean isSflj() { | |
| 695 | + return sflj; | |
| 696 | + } | |
| 697 | + | |
| 698 | + public void setSflj(boolean sflj) { | |
| 699 | + this.sflj = sflj; | |
| 700 | + } | |
| 701 | + | |
| 702 | + /** | |
| 703 | + * | |
| 704 | + * @Title: setFcsjAll | |
| 705 | + * @Description: TODO(设置计划发车时间) | |
| 706 | + * @throws | |
| 707 | + */ | |
| 708 | + public void setFcsjAll(String fcsj){ | |
| 709 | + this.fcsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + fcsj); | |
| 710 | + this.fcsj = fcsj; | |
| 711 | + } | |
| 712 | + | |
| 713 | + /** | |
| 714 | + * | |
| 715 | + * @Title: setFcsjAll | |
| 716 | + * @Description: TODO(设置计划发车时间) | |
| 717 | + * @throws | |
| 718 | + */ | |
| 719 | + public void setFcsjAll(Long fcsjT){ | |
| 720 | + this.fcsjT = fcsjT; | |
| 721 | + this.fcsj = fmtHHmm.print(fcsjT); | |
| 722 | + } | |
| 723 | + | |
| 724 | + /** | |
| 725 | + * | |
| 726 | + * @Title: setFcsjActualAll | |
| 727 | + * @Description: TODO(设置实际发车时间 字符串) | |
| 728 | + * @throws | |
| 729 | + */ | |
| 730 | + public void setFcsjActualAll(String fcsjActual){ | |
| 731 | + this.fcsjActualTime = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + fcsjActual); | |
| 732 | + this.fcsjActual = fcsjActual; | |
| 733 | + calcStatus(); | |
| 734 | + } | |
| 735 | + | |
| 736 | + /** | |
| 737 | + * | |
| 738 | + * @Title: setFcsjActualAll | |
| 739 | + * @Description: TODO(设置实际发车时间 时间戳) | |
| 740 | + * @throws | |
| 741 | + */ | |
| 742 | + public void setFcsjActualAll(Long t){ | |
| 743 | + | |
| 744 | + this.fcsjActualTime = t; | |
| 745 | + if(null == t) | |
| 746 | + this.fcsjActual = null; | |
| 747 | + else | |
| 748 | + this.fcsjActual = fmtHHmm.print(t); | |
| 749 | + | |
| 750 | + //更新班次状态 | |
| 751 | + calcStatus(); | |
| 752 | + } | |
| 753 | + | |
| 754 | + /** | |
| 755 | + * | |
| 756 | + * @Title: setFcsjActualAll | |
| 757 | + * @Description: TODO(设置实际终点时间) | |
| 758 | + * @throws | |
| 759 | + */ | |
| 760 | + public void setZdsjActualAll(Long t){ | |
| 761 | + this.zdsjActualTime = t; | |
| 762 | + | |
| 763 | + if(null == t) | |
| 764 | + this.zdsjActual = null; | |
| 765 | + else | |
| 766 | + this.zdsjActual = fmtHHmm.print(t); | |
| 767 | + | |
| 768 | + //更新班次状态 | |
| 769 | + calcStatus(); | |
| 770 | + } | |
| 771 | + | |
| 772 | + /** | |
| 773 | + * | |
| 774 | + * @Title: setFcsjActualAll | |
| 775 | + * @Description: TODO(设置实际终点时间) | |
| 776 | + * @throws | |
| 777 | + */ | |
| 778 | + public void setZdsjActualAll(String zdsjActual){ | |
| 779 | + this.zdsjActualTime = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + zdsjActual); | |
| 780 | + this.zdsjActual = zdsjActual; | |
| 781 | + | |
| 782 | + calcStatus(); | |
| 783 | + } | |
| 784 | + | |
| 785 | + public Long getSpId() { | |
| 786 | + return spId; | |
| 787 | + } | |
| 788 | + | |
| 789 | + public void setSpId(Long spId) { | |
| 790 | + this.spId = spId; | |
| 791 | + } | |
| 792 | + | |
| 793 | + public String getRealExecDate() { | |
| 794 | + return realExecDate; | |
| 795 | + } | |
| 796 | + | |
| 797 | + public void setRealExecDate(String realExecDate) { | |
| 798 | + this.realExecDate = realExecDate; | |
| 799 | + } | |
| 800 | + | |
| 801 | + public void calcStatus() { | |
| 802 | + if(this.status == -1) | |
| 803 | + return; | |
| 804 | + | |
| 805 | + this.status = 0; | |
| 806 | + if(StringUtils.isNotBlank(this.fcsjActual)){ | |
| 807 | + this.status = 1; | |
| 808 | + | |
| 809 | + //进出场班次并且没有计划里程的 | |
| 810 | + if((this.bcType.equals("out") || this.bcType.equals("in")) | |
| 811 | + && this.jhlc == null){ | |
| 812 | + this.status = 2; | |
| 813 | + } | |
| 814 | + } | |
| 815 | + if(StringUtils.isNotBlank(this.zdsjActual)) | |
| 816 | + this.status = 2; | |
| 817 | + } | |
| 818 | + | |
| 819 | + public void destroy(){ | |
| 820 | + this.jhlc = 0.0; | |
| 821 | + if(this.isSflj()) | |
| 822 | + this.jhlcOrig = 0.0; | |
| 823 | + this.status = -1; | |
| 824 | + this.clearFcsjActual(); | |
| 825 | + } | |
| 826 | + | |
| 827 | + public boolean isDestroy(){ | |
| 828 | + return this.status == -1; | |
| 829 | + } | |
| 830 | + | |
| 831 | +/* public boolean isNotDestroy(){ | |
| 832 | + return this.status != -1; | |
| 833 | + }*/ | |
| 834 | + | |
| 835 | + public Set<ChildTaskPlan> getcTasks() { | |
| 836 | + return cTasks; | |
| 837 | + } | |
| 838 | + | |
| 839 | +/* public void setcTasks(Set<ChildTaskPlan> cTasks) { | |
| 840 | + this.cTasks = cTasks; | |
| 841 | + }*/ | |
| 842 | + | |
| 843 | + public String getScheduleDateStr() { | |
| 844 | + return scheduleDateStr; | |
| 845 | + } | |
| 846 | + | |
| 847 | + public void setScheduleDateStr(String scheduleDateStr) { | |
| 848 | + this.scheduleDateStr = scheduleDateStr; | |
| 849 | + } | |
| 850 | + | |
| 851 | + public void clearFcsjActual(){ | |
| 852 | + this.setFcsjActual(null); | |
| 853 | + this.setFcsjActualTime(null); | |
| 854 | + this.calcStatus(); | |
| 855 | + } | |
| 856 | + | |
| 857 | + //清除实际终点时间 | |
| 858 | + public void clearZdsjActual(){ | |
| 859 | + this.setZdsjActual(null); | |
| 860 | + this.setZdsjActualTime(null); | |
| 861 | + | |
| 862 | + calcStatus(); | |
| 863 | + } | |
| 864 | + | |
| 865 | + public boolean isLate() { | |
| 866 | + return late; | |
| 867 | + } | |
| 868 | + | |
| 869 | + public void setLate(boolean late) { | |
| 870 | + this.late = late; | |
| 871 | + } | |
| 872 | + | |
| 873 | + public String getAdjustExps() { | |
| 874 | + return adjustExps; | |
| 875 | + } | |
| 876 | + | |
| 877 | + public void setAdjustExps(String adjustExps) { | |
| 878 | + this.adjustExps = adjustExps; | |
| 879 | + } | |
| 880 | + | |
| 881 | + public boolean isReissue() { | |
| 882 | + return reissue; | |
| 883 | + } | |
| 884 | + | |
| 885 | + public void setReissue(boolean reissue) { | |
| 886 | + this.reissue = reissue; | |
| 887 | + } | |
| 888 | + | |
| 889 | + public Double getRealMileage() { | |
| 890 | + return realMileage; | |
| 891 | + } | |
| 892 | + | |
| 893 | + public void setRealMileage(Double realMileage) { | |
| 894 | + this.realMileage = realMileage; | |
| 895 | + } | |
| 896 | + | |
| 897 | + public Double getJhlcOrig() { | |
| 898 | + return jhlcOrig; | |
| 899 | + } | |
| 900 | + | |
| 901 | + public void setJhlcOrig(Double jhlcOrig) { | |
| 902 | + this.jhlcOrig = jhlcOrig; | |
| 903 | + } | |
| 904 | + | |
| 905 | + public void reCalcLate() { | |
| 906 | + if(this.getStatus() == 0 | |
| 907 | + && this.getFcsjActual() == null | |
| 908 | + && this.dfsjT < System.currentTimeMillis()){ | |
| 909 | + this.setLate(true); | |
| 910 | + } | |
| 911 | + else | |
| 912 | + this.setLate(false); | |
| 913 | + } | |
| 914 | + | |
| 915 | + public String getRemark() { | |
| 916 | + return remark; | |
| 917 | + } | |
| 918 | + | |
| 919 | + public void setRemark(String remark) { | |
| 920 | + this.remark = remark; | |
| 921 | + } | |
| 922 | + | |
| 923 | + public float getLateMinute() { | |
| 924 | + return lateMinute; | |
| 925 | + } | |
| 926 | + | |
| 927 | + public void setLateMinute(float lateMinute) { | |
| 928 | + this.lateMinute = lateMinute; | |
| 929 | + } | |
| 930 | + | |
| 931 | + public boolean isLate2() { | |
| 932 | + return late2; | |
| 933 | + } | |
| 934 | + | |
| 935 | + public void setLate2(boolean late2) { | |
| 936 | + this.late2 = late2; | |
| 937 | + } | |
| 938 | + | |
| 939 | + public int getFcpSn() { | |
| 940 | + return fcpSn; | |
| 941 | + } | |
| 942 | + | |
| 943 | + public void setFcpSn(int fcpSn) { | |
| 944 | + this.fcpSn = fcpSn; | |
| 945 | + } | |
| 946 | + | |
| 947 | + public boolean _isInout(){ | |
| 948 | + return this.getBcType().equals("out") || this.getBcType().equals("in"); | |
| 949 | + } | |
| 950 | + | |
| 951 | + public boolean isDeleted() { | |
| 952 | + return deleted; | |
| 953 | + } | |
| 954 | + | |
| 955 | + public void setDeleted(boolean deleted) { | |
| 956 | + this.deleted = deleted; | |
| 957 | + } | |
| 958 | + | |
| 959 | + public int getSaveFailCount() { | |
| 960 | + return saveFailCount; | |
| 961 | + } | |
| 962 | + | |
| 963 | + public void setSaveFailCount(int saveFailCount) { | |
| 964 | + this.saveFailCount = saveFailCount; | |
| 965 | + } | |
| 966 | + | |
| 967 | + public int getSiginCompate() { | |
| 968 | + return siginCompate; | |
| 969 | + } | |
| 970 | + | |
| 971 | + public void setSiginCompate(int siginCompate) { | |
| 972 | + this.siginCompate = siginCompate; | |
| 973 | + } | |
| 974 | + | |
| 975 | + public Integer getDriftStatus() { | |
| 976 | + return driftStatus; | |
| 977 | + } | |
| 978 | + | |
| 979 | + public void setDriftStatus(Integer driftStatus) { | |
| 980 | + this.driftStatus = driftStatus; | |
| 981 | + } | |
| 982 | + | |
| 983 | + public boolean isCcService() { | |
| 984 | + return ccService; | |
| 985 | + } | |
| 986 | + | |
| 987 | + public void setCcService(boolean ccService) { | |
| 988 | + this.ccService = ccService; | |
| 989 | + } | |
| 990 | + | |
| 991 | + public String getMajorStationName() { | |
| 992 | + return majorStationName; | |
| 993 | + } | |
| 994 | + | |
| 995 | + public void setMajorStationName(String majorStationName) { | |
| 996 | + this.majorStationName = majorStationName; | |
| 997 | + } | |
| 998 | + | |
| 999 | + public int getRfidState() { | |
| 1000 | + return rfidState; | |
| 1001 | + } | |
| 1002 | + | |
| 1003 | + public void setRfidState(int rfidState) { | |
| 1004 | + this.rfidState = rfidState; | |
| 1005 | + } | |
| 1006 | + | |
| 1007 | + public int getFirstRfidState() { | |
| 1008 | + return firstRfidState; | |
| 1009 | + } | |
| 1010 | + | |
| 1011 | + public void setFirstRfidState(int firstRfidState) { | |
| 1012 | + this.firstRfidState = firstRfidState; | |
| 1013 | + } | |
| 1014 | +} | ... | ... |
src/main/java/com/bsth/entity/sys/SysUser.java
| ... | ... | @@ -40,6 +40,8 @@ public class SysUser implements Serializable { |
| 40 | 40 | |
| 41 | 41 | private String status; |
| 42 | 42 | |
| 43 | + private String ksstatus; | |
| 44 | + | |
| 43 | 45 | @ManyToMany(fetch = FetchType.EAGER) |
| 44 | 46 | private Set<Role> roles = new LinkedHashSet<>(); |
| 45 | 47 | |
| ... | ... | @@ -123,4 +125,12 @@ public class SysUser implements Serializable { |
| 123 | 125 | public void setStatus(String status) { |
| 124 | 126 | this.status = status; |
| 125 | 127 | } |
| 128 | + | |
| 129 | + public String getKsstatus() { | |
| 130 | + return ksstatus; | |
| 131 | + } | |
| 132 | + | |
| 133 | + public void setKsstatus(String ksstatus) { | |
| 134 | + this.ksstatus = ksstatus; | |
| 135 | + } | |
| 126 | 136 | } | ... | ... |
src/main/java/com/bsth/repository/StationRouteStRepository.java
| ... | ... | @@ -2,6 +2,7 @@ package com.bsth.repository; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.Line; |
| 4 | 4 | import com.bsth.entity.StationRoute; |
| 5 | +import com.bsth.entity.StationRouteSt; | |
| 5 | 6 | import org.springframework.data.domain.Page; |
| 6 | 7 | import org.springframework.data.domain.Pageable; |
| 7 | 8 | import org.springframework.data.domain.Sort; |
| ... | ... | @@ -32,6 +33,10 @@ import java.util.Map; |
| 32 | 33 | */ |
| 33 | 34 | |
| 34 | 35 | @Repository |
| 35 | -public interface StationRouteStRepository extends BaseRepository<StationRoute, Integer> { | |
| 36 | +public interface StationRouteStRepository extends BaseRepository<StationRouteSt, Integer> { | |
| 37 | + | |
| 38 | + | |
| 39 | + @Query("select r from StationRouteSt r where r.lineCode=?1 and r.destroy=0 order by r.stationRouteCode") | |
| 40 | + List<StationRouteSt> findByLine(String lineCode); | |
| 36 | 41 | |
| 37 | 42 | } | ... | ... |
src/main/java/com/bsth/repository/realcontrol/LineConfigStRepository.java
0 → 100644
| 1 | +package com.bsth.repository.realcontrol; | |
| 2 | + | |
| 3 | +import com.bsth.entity.Line; | |
| 4 | +import com.bsth.entity.realcontrol.LineConfig; | |
| 5 | +import com.bsth.entity.realcontrol.LineConfigSt; | |
| 6 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 7 | +import com.bsth.repository.BaseRepository; | |
| 8 | +import org.springframework.data.domain.Page; | |
| 9 | +import org.springframework.data.domain.Pageable; | |
| 10 | +import org.springframework.data.jpa.domain.Specification; | |
| 11 | +import org.springframework.data.jpa.repository.EntityGraph; | |
| 12 | +import org.springframework.data.jpa.repository.Query; | |
| 13 | +import org.springframework.stereotype.Repository; | |
| 14 | + | |
| 15 | +import java.util.List; | |
| 16 | + | |
| 17 | +@Repository | |
| 18 | +public interface LineConfigStRepository extends BaseRepository<LineConfigSt, Integer>{ | |
| 19 | + | |
| 20 | + @Query("SELECT L FROM LineConfigSt L") | |
| 21 | + List<LineConfigSt> findAll(); | |
| 22 | + | |
| 23 | +} | ... | ... |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -219,6 +219,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 219 | 219 | @Override |
| 220 | 220 | List<ScheduleRealInfo> findAll(Specification<ScheduleRealInfo> spec); |
| 221 | 221 | |
| 222 | + | |
| 222 | 223 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 223 | 224 | @Override |
| 224 | 225 | List<ScheduleRealInfo> findAll(); |
| ... | ... | @@ -231,4 +232,10 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 231 | 232 | @Query(value = "select count (s.id) from ScheduleRealInfo s where s.clZbh=?1 and s.scheduleDateStr=?2 and s.xlBm=?3 and s.qdzCode=?4") |
| 232 | 233 | Long isCircleQdz(String clzbh,String sdr,String xlbm,String qdzCode); |
| 233 | 234 | |
| 235 | + | |
| 236 | + | |
| 237 | + @Query(value="select s.xlBm as xlBm,s.clZbh as clZbh from ScheduleRealInfo s where s.scheduleDateStr = ?1 and s.xlBm in (?2) GROUP BY s.xlBm, s.clZbh") | |
| 238 | + List<Map<String, Object>> selectclZbhGroup(String date, String[] t); | |
| 239 | + | |
| 240 | + | |
| 234 | 241 | } | ... | ... |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoStRepository.java
0 → 100644
| 1 | +package com.bsth.repository.realcontrol; | |
| 2 | + | |
| 3 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 4 | +import com.bsth.entity.realcontrol.ScheduleRealInfoSt; | |
| 5 | +import com.bsth.repository.BaseRepository; | |
| 6 | +import org.springframework.data.domain.Page; | |
| 7 | +import org.springframework.data.domain.Pageable; | |
| 8 | +import org.springframework.data.jpa.domain.Specification; | |
| 9 | +import org.springframework.data.jpa.repository.EntityGraph; | |
| 10 | +import org.springframework.data.jpa.repository.Modifying; | |
| 11 | +import org.springframework.data.jpa.repository.Query; | |
| 12 | +import org.springframework.stereotype.Repository; | |
| 13 | + | |
| 14 | +import javax.transaction.Transactional; | |
| 15 | +import java.util.List; | |
| 16 | +import java.util.Map; | |
| 17 | + | |
| 18 | +@Repository | |
| 19 | +public interface ScheduleRealInfoStRepository extends BaseRepository<ScheduleRealInfoSt, Long>{ | |
| 20 | + | |
| 21 | + @Query("select s from ScheduleRealInfo s where s.xlBm in ?1") | |
| 22 | + List<ScheduleRealInfoSt> findByLines(List<String> lines); | |
| 23 | + | |
| 24 | + | |
| 25 | + @Query(value="select s from ScheduleRealInfoSt s where s.xlBm = ?1 and s.scheduleDateStr = ?2 GROUP BY s.id,s.jGh,s.clZbh,s.lpName order by (lpName+1)") | |
| 26 | + List<ScheduleRealInfoSt> queryUserInfo(String line,String date); | |
| 27 | +} | ... | ... |
src/main/java/com/bsth/repository/sys/SysUserRepository.java
| ... | ... | @@ -25,12 +25,28 @@ public interface SysUserRepository extends BaseRepository<SysUser, Integer>{ |
| 25 | 25 | @Query(value="update bsth_c_sys_user set password=?2 where id=?1",nativeQuery=true) |
| 26 | 26 | int changePWD(int id,String newPWD); |
| 27 | 27 | |
| 28 | + | |
| 29 | + @Transactional | |
| 30 | + @Modifying | |
| 31 | + @Query(value="update bsth_c_sys_user set ksstatus='1' where id=?1",nativeQuery=true) | |
| 32 | + int changeKsStatus(int id); | |
| 33 | + | |
| 34 | + @Transactional | |
| 35 | + @Modifying | |
| 36 | + @Query(value="update bsth_c_sys_user set ksstatus='0'",nativeQuery=true) | |
| 37 | + int changeKsStatusAll( ); | |
| 38 | + | |
| 39 | + | |
| 28 | 40 | @EntityGraph(value = "sysUser_role", type = EntityGraph.EntityGraphType.FETCH) |
| 29 | 41 | @Query(value = "select DISTINCT u from SysUser u") |
| 30 | 42 | List<SysUser> findAll_distinct(); |
| 31 | 43 | |
| 32 | 44 | |
| 33 | - @Query("SELECT u FROM SysUser u where u.userName like 'ks%'") | |
| 34 | - List<SysUser> findBySusUser( ); | |
| 45 | + @Query("SELECT u FROM SysUser u where u.userName like %?1% and u.ksstatus = 0") | |
| 46 | + List<SysUser> findBySusUser(String t ); | |
| 47 | + | |
| 48 | + | |
| 49 | + @Query("SELECT u FROM SysUser u where u.status is null") | |
| 50 | + List<SysUser> findBySusUserAll(); | |
| 35 | 51 | |
| 36 | 52 | } | ... | ... |
src/main/java/com/bsth/service/ddexam/DdexamService.java
| 1 | 1 | package com.bsth.service.ddexam; |
| 2 | 2 | |
| 3 | +import com.bsth.entity.sys.SysUser; | |
| 4 | + | |
| 5 | +import java.io.IOException; | |
| 6 | +import java.util.List; | |
| 7 | +import java.util.Map; | |
| 8 | + | |
| 3 | 9 | public interface DdexamService { |
| 4 | 10 | |
| 5 | - public int initializationAll(Integer rs); | |
| 11 | + public Map initializationAll(Integer rs,Long userName); | |
| 12 | + | |
| 13 | + public Map initializationAll2(Long userName); | |
| 14 | + | |
| 15 | + | |
| 16 | + public int hftime(); | |
| 17 | + | |
| 18 | + public int initDate(String date); | |
| 19 | + | |
| 20 | + public List<SysUser> userAll(); | |
| 21 | + | |
| 6 | 22 | } | ... | ... |
src/main/java/com/bsth/service/ddexam/impl/DdexamServiceImpl.java
| 1 | 1 | package com.bsth.service.ddexam.impl; |
| 2 | 2 | |
| 3 | -import com.bsth.entity.Line; | |
| 4 | -import com.bsth.entity.LineInformation; | |
| 5 | -import com.bsth.entity.LineInformationSt; | |
| 6 | -import com.bsth.entity.LineSt; | |
| 3 | +import com.alibaba.dubbo.common.URL; | |
| 4 | +import com.bsth.data.BasicData; | |
| 5 | +import com.bsth.data.LineConfigData; | |
| 6 | +import com.bsth.data.schedule.DayOfSchedule; | |
| 7 | +import com.bsth.data.schedule.thread.ScheduleRefreshThread; | |
| 8 | +import com.bsth.entity.*; | |
| 9 | +import com.bsth.entity.realcontrol.LineConfig; | |
| 10 | +import com.bsth.entity.realcontrol.LineConfigSt; | |
| 11 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 12 | +import com.bsth.entity.realcontrol.ScheduleRealInfoSt; | |
| 7 | 13 | import com.bsth.entity.sys.BsthCSysUserRoles; |
| 8 | 14 | import com.bsth.entity.sys.RealControAuthority; |
| 9 | 15 | import com.bsth.entity.sys.SysUser; |
| 10 | -import com.bsth.repository.LineInformationRepository; | |
| 11 | -import com.bsth.repository.LineInformationStRepository; | |
| 12 | -import com.bsth.repository.LineRepository; | |
| 13 | -import com.bsth.repository.LineStRepository; | |
| 16 | +import com.bsth.repository.*; | |
| 17 | +import com.bsth.repository.realcontrol.LineConfigRepository; | |
| 18 | +import com.bsth.repository.realcontrol.LineConfigStRepository; | |
| 19 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | |
| 20 | +import com.bsth.repository.realcontrol.ScheduleRealInfoStRepository; | |
| 14 | 21 | import com.bsth.repository.sys.BsthCSysUserRolesRepository; |
| 15 | 22 | import com.bsth.repository.sys.RealControAuthorityRepository; |
| 16 | 23 | import com.bsth.repository.sys.SysUserRepository; |
| 17 | 24 | import com.bsth.service.ddexam.DdexamService; |
| 25 | +import com.bsth.util.ConfigUtil; | |
| 26 | +import org.junit.Test; | |
| 18 | 27 | import org.slf4j.Logger; |
| 19 | 28 | import org.slf4j.LoggerFactory; |
| 20 | 29 | import org.springframework.beans.BeanUtils; |
| ... | ... | @@ -23,8 +32,11 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| 23 | 32 | import org.springframework.stereotype.Service; |
| 24 | 33 | import org.springframework.transaction.annotation.Transactional; |
| 25 | 34 | |
| 26 | -import java.util.Date; | |
| 27 | -import java.util.List; | |
| 35 | +import java.io.IOException; | |
| 36 | +import java.net.URLConnection; | |
| 37 | +import java.text.SimpleDateFormat; | |
| 38 | +import java.util.*; | |
| 39 | + | |
| 28 | 40 | |
| 29 | 41 | @Service |
| 30 | 42 | public class DdexamServiceImpl implements DdexamService { |
| ... | ... | @@ -44,54 +56,297 @@ public class DdexamServiceImpl implements DdexamService { |
| 44 | 56 | LineInformationStRepository LineInformationStRepository; |
| 45 | 57 | @Autowired |
| 46 | 58 | LineInformationRepository lineInformationRepository; |
| 59 | + @Autowired | |
| 60 | + StationRouteStRepository stationRouteStRepository; | |
| 61 | + @Autowired | |
| 62 | + StationRouteRepository stationRouteRepository; | |
| 63 | + @Autowired | |
| 64 | + ScheduleRealInfoStRepository ScheduleRealInfoStRepository; | |
| 65 | + @Autowired | |
| 66 | + ScheduleRealInfoRepository ScheduleRealInfoRepository; | |
| 67 | + @Autowired | |
| 68 | + BasicData.BasicDataLoader basicDataLoader; | |
| 69 | + @Autowired | |
| 70 | + ScheduleRefreshThread scheduleRefreshThread; | |
| 71 | + @Autowired | |
| 72 | + DayOfSchedule dayOfSchedule; | |
| 73 | + @Autowired | |
| 74 | + LineConfigStRepository lineConfigStRepository; | |
| 75 | + @Autowired | |
| 76 | + LineConfigData lineConfigData; | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + @Autowired | |
| 81 | + LineConfigRepository lineConfigRepository; | |
| 47 | 82 | |
| 48 | - //考生人初始化 | |
| 83 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 84 | + SimpleDateFormat sdfhms = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 85 | + public List<SysUser> userAll(){ | |
| 86 | + return sysUserRepository.findBySusUserAll(); | |
| 87 | + } | |
| 88 | + | |
| 49 | 89 | @Override |
| 50 | - @Transactional //事务 | |
| 51 | - public int initializationAll(Integer rs) { | |
| 52 | - | |
| 90 | + public int hftime(){ | |
| 91 | + URLConnection url = null; | |
| 53 | 92 | try { |
| 54 | - List<SysUser> userList = sysUserRepository.findBySusUser(); //已有的用户 不考虑用户角色表 正常情况下创建必分配 | |
| 55 | - if (userList.size() >= rs) { //满足考试人数 检查是否分配线路 | |
| 56 | - for (SysUser user : userList) { | |
| 57 | - if (realControAuthorityRepository.findByUserId(user.getId()) == null) { //检查未分配线路 | |
| 93 | + java.net.URL baseUrl; | |
| 94 | + baseUrl = com.bsth.webService.trafficManage.geotool.services.Internal.class.getResource("."); | |
| 95 | + url = new java.net.URL(baseUrl, | |
| 96 | + "http://time.tianqi.com/").openConnection(); | |
| 58 | 97 | |
| 59 | - } | |
| 98 | + url.connect(); //发出连接 | |
| 99 | + long ld = url.getDate(); //取得网站日期时间 | |
| 100 | + Date date = new Date(ld); //转换为标准时间对象 | |
| 101 | + /* Calendar calendar = Calendar.getInstance(); | |
| 102 | + calendar.setTime(date); | |
| 103 | + calendar.add(Calendar.YEAR, -1);//当前时间减去一年,即一年前的时间 | |
| 104 | + //(时间校准网上快了一年,减去一年)*/ | |
| 105 | + String data = sdfhms.format(date.getTime()); | |
| 106 | + String[] lk = data.split(" "); | |
| 107 | + if(lk.length == 2){ | |
| 108 | + Runtime.getRuntime().exec(ConfigUtil.get("jp.date") +" " +lk[0]);//Windows 系统 | |
| 109 | + Runtime.getRuntime().exec(ConfigUtil.get("jp.time") +" " +lk[1]);//Windows 系统 | |
| 110 | + } | |
| 111 | + } catch (IOException e) { | |
| 112 | + e.printStackTrace(); | |
| 113 | + } | |
| 114 | + return 0; | |
| 115 | + } | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + @Override | |
| 120 | + public int initDate(String date) { | |
| 121 | + try { | |
| 122 | + Runtime.getRuntime().exec(ConfigUtil.get("jp.time") +" " +date);//Windows 系统 | |
| 123 | + }catch (Exception e){ | |
| 124 | + log.error("修改系统时间失败",e); | |
| 125 | + } | |
| 126 | + return 1; | |
| 127 | + } | |
| 128 | + | |
| 129 | + | |
| 130 | +/* //考生人初始化 无线程 | |
| 131 | + @Override | |
| 132 | + public Map initializationAll(Integer rs) { | |
| 133 | + Long start = System.currentTimeMillis(); | |
| 134 | + Map m = new HashMap<>(); | |
| 135 | + try { //用户当天分配完直接改状态 无二次分配的可能 | |
| 136 | + List<SysUser> userList = sysUserRepository.findBySusUser(); //已有的用户 不考虑用户角色表 正常情况下创建必分配 | |
| 137 | + if (userList.size() >= rs) { //满足考试人数 默认配置都是全的 | |
| 138 | + for (int i = 0 ; i < rs ; i++ ){ //已rs人数为准 | |
| 139 | + SysUser user = userList.get(i); | |
| 140 | + useryType(user); | |
| 141 | + sysUserRepository.changeKsStatus(user.getId()); ////状态 表示今日账户已用 | |
| 60 | 142 | } |
| 143 | + | |
| 61 | 144 | } else { |
| 62 | 145 | if (userList.size() == 0) { //考试人数 全部重新创建 |
| 63 | - | |
| 146 | + if(usercreateType(rs)){ | |
| 147 | + log.info("考试初始化创建成功"); | |
| 148 | + } | |
| 64 | 149 | } else { //已有的人检查分配线路 不够的创建 |
| 65 | - for (SysUser user : userList) { | |
| 66 | - if (realControAuthorityRepository.findByUserId(8) == null) { //检查未分配线路 | |
| 67 | - | |
| 68 | - //未分配的创建线路并分配 | |
| 69 | - System.out.println("1"); | |
| 150 | + | |
| 151 | + for (SysUser user : userList) { //已有的分配班次 | |
| 152 | + if (realControAuthorityRepository.findByUserId(user.getId()) == null) { //检查未分配线路 | |
| 70 | 153 | } else { //已分配线路的分配班次 |
| 71 | 154 | System.out.println("分配班次..."); |
| 155 | + sysUserRepository.changeKsStatus(user.getId()); ////状态 表示今日账户已用 | |
| 156 | + useryType(user); | |
| 72 | 157 | } |
| 73 | 158 | } |
| 159 | + | |
| 74 | 160 | int st = rs - userList.size(); //未创建考试人数 |
| 161 | + //未分配的创建线路并分配 | |
| 75 | 162 | if(usercreateType(st)){ |
| 76 | 163 | log.info("考试初始化创建成功"); |
| 77 | - }else{ | |
| 78 | - log.error("-------------1.模板线路大于6条"); //如果情况多了 可以switch | |
| 79 | - return 0; | |
| 80 | 164 | } |
| 81 | 165 | |
| 166 | + | |
| 167 | + | |
| 82 | 168 | } |
| 83 | 169 | } |
| 84 | 170 | }catch (Exception e){ |
| 85 | 171 | log.error("-----考试初始化失败------",e); |
| 86 | - return 1; | |
| 172 | + m.put("code","创建失败"); | |
| 173 | + return m; | |
| 87 | 174 | } |
| 88 | - return 0; | |
| 175 | + //调用排班初始话功能 | |
| 176 | + m.put("code","创建成功"); | |
| 177 | + System.out.println("----------创建时间--------------"+(System.currentTimeMillis() - start)); | |
| 178 | + dayOfSchedule.lineAll(); //查询所有线路 | |
| 179 | + basicDataLoader.loadAllData(); //加载所有数据 | |
| 180 | + | |
| 181 | + lineConfigData.lineAll(); | |
| 182 | + scheduleRefreshThread.run(); | |
| 183 | + System.out.println("-------------本次执行时间-----------"+(System.currentTimeMillis() - start)); | |
| 184 | + return m; | |
| 185 | + | |
| 186 | + } | |
| 187 | + */ | |
| 188 | + //考生人初始化 单线程 测试1:执行中途再次执行是否同步 测试2: | |
| 189 | + @Override | |
| 190 | + @Transactional //事务 | |
| 191 | + public synchronized Map initializationAll(Integer rs,Long userName) { | |
| 192 | + Long start = System.currentTimeMillis(); | |
| 193 | + Map m = new HashMap<>(); | |
| 194 | + try { //用户当天分配完直接改状态 无二次分配的可能 | |
| 195 | + List<SysUser> userList = sysUserRepository.findBySusUserAll(); //已有的用户 不考虑用户角色表 正常情况下创建必分配 | |
| 196 | + Map suerMap = new HashMap(); | |
| 197 | + for (SysUser s :userList){ | |
| 198 | + if(Long.parseLong(s.getUserName()) == userName ){ | |
| 199 | + m.put("code","创建失败 账号重复"); | |
| 200 | + return m; | |
| 201 | + } | |
| 202 | + } | |
| 203 | + | |
| 204 | + new Thread() { | |
| 205 | + public synchronized void run() { | |
| 206 | + if(usercreateType(rs,userName)){ | |
| 207 | + log.info("考试初始化创建成功"); | |
| 208 | + kk(); | |
| 209 | + } | |
| 210 | + } | |
| 211 | + }.start(); | |
| 212 | + | |
| 213 | + }catch (Exception e){ | |
| 214 | + log.error("-----考试初始化失败------",e); | |
| 215 | + m.put("code","创建失败"); | |
| 216 | + return m; | |
| 217 | + } | |
| 218 | + //调用排班初始话功能 | |
| 219 | + m.put("code","创建成功"); | |
| 220 | + System.out.println("-------------本次执行时间-----------"+(System.currentTimeMillis() - start)); | |
| 221 | + return m; | |
| 89 | 222 | |
| 223 | + } | |
| 224 | + | |
| 225 | + | |
| 226 | + public Map initializationAll2(Long userName){ | |
| 227 | + Long start = System.currentTimeMillis(); | |
| 228 | + Map m = new HashMap<>(); | |
| 229 | + String t = String.valueOf(userName).substring(0,8); | |
| 90 | 230 | |
| 231 | + try { //用户当天分配完直接改状态 无二次分配的可能 | |
| 232 | + List<SysUser> userList = sysUserRepository.findBySusUser(t); //已有的用户 不考虑用户角色表 正常情况下创建必分配 | |
| 233 | + if (userList.size() > 0) { | |
| 234 | + //已有的人检查分配线路 | |
| 235 | + new Thread() { | |
| 236 | + public synchronized void run() { | |
| 237 | + if (snt(userList)) { | |
| 238 | + kk(); | |
| 239 | + } | |
| 240 | + } | |
| 241 | + }.start(); | |
| 242 | + } | |
| 243 | + }catch (Exception e){ | |
| 244 | + log.error("-----考试初始化失败------",e); | |
| 245 | + m.put("code","创建失败"); | |
| 246 | + return m; | |
| 247 | + } | |
| 248 | + //调用排班初始话功能 | |
| 249 | + m.put("code","初始化成功"); | |
| 250 | + System.out.println("-------------本次执行时间-----------"+(System.currentTimeMillis() - start)); | |
| 251 | + return m; | |
| 91 | 252 | |
| 92 | 253 | } |
| 254 | + /*public void aa(){ | |
| 255 | + Long start = System.currentTimeMillis(); | |
| 256 | + Map m = new HashMap<>(); | |
| 257 | + try { //用户当天分配完直接改状态 无二次分配的可能 | |
| 258 | + List<SysUser> userList = sysUserRepository.findBySusUser(); //已有的用户 不考虑用户角色表 正常情况下创建必分配 | |
| 259 | + if (userList.size() >= rs) { //满足考试人数 默认配置都是全的 | |
| 260 | + new Thread() { | |
| 261 | + public synchronized void run() { | |
| 262 | + if(snt(rs,userList,0)){ | |
| 263 | + log.info("考试初始化创建成功"); | |
| 264 | + kk(); | |
| 265 | + } | |
| 266 | + } | |
| 267 | + }.start(); | |
| 268 | + } else { | |
| 269 | + if (userList.size() == 0) { //考试人数 全部重新创建 | |
| 270 | + new Thread() { | |
| 271 | + public synchronized void run() { | |
| 272 | + if(usercreateType(rs)){ | |
| 273 | + log.info("考试初始化创建成功"); | |
| 274 | + kk(); | |
| 275 | + } | |
| 276 | + } | |
| 277 | + }.start(); | |
| 278 | + | |
| 279 | + } else { //已有的人检查分配线路 不够的创建 | |
| 280 | + | |
| 281 | + new Thread() { | |
| 282 | + public synchronized void run() { | |
| 283 | + if(snt(rs,userList,1)){ | |
| 284 | + kk(); | |
| 285 | + } | |
| 286 | + } | |
| 287 | + }.start(); | |
| 288 | + | |
| 289 | + int st = rs - userList.size(); //未创建考试人数 | |
| 290 | + //* //未分配的创建线路并分配 | |
| 291 | + if(usercreateType(st)){ //暂无问题 | |
| 292 | + log.info("考试初始化创建成功"); | |
| 293 | + kk(); | |
| 294 | + }//* | |
| 295 | + new Thread() { | |
| 296 | + public synchronized void run() { | |
| 297 | + if(usercreateType(st)){ | |
| 298 | + log.info("考试初始化创建成功"); | |
| 299 | + kk(); | |
| 300 | + } | |
| 301 | + } | |
| 302 | + }.start(); | |
| 303 | + | |
| 304 | + } | |
| 305 | + } | |
| 306 | + }catch (Exception e){ | |
| 307 | + log.error("-----考试初始化失败------",e); | |
| 308 | + m.put("code","创建失败"); | |
| 309 | + return m; | |
| 310 | + } | |
| 311 | + //调用排班初始话功能 | |
| 312 | + m.put("code","创建成功"); | |
| 313 | + System.out.println("-------------本次执行时间-----------"+(System.currentTimeMillis() - start)); | |
| 314 | + return m; | |
| 315 | + } | |
| 316 | + */ | |
| 317 | + public void kk(){ | |
| 318 | + basicDataLoader.loadAllData(); //加载所有数据 | |
| 319 | + dayOfSchedule.lineAll(); //查询所有线路 | |
| 320 | + lineConfigData.lineAll(); | |
| 321 | + scheduleRefreshThread.run(); | |
| 322 | + } | |
| 323 | + //已创建好的用户分配排班 | |
| 324 | + | |
| 325 | + public Boolean snt(List<SysUser> userList){ | |
| 326 | + for (int i = 0 ; i < userList.size() ; i++ ){ //已rs人数为准 | |
| 327 | + SysUser user = userList.get(i); | |
| 328 | + if (realControAuthorityRepository.findByUserId(user.getId()) != null) { | |
| 329 | + useryType(user); | |
| 330 | + System.out.println("分配班次..."); | |
| 331 | + sysUserRepository.changeKsStatus(user.getId()); ////状态 表示今日账户已用 | |
| 332 | + } | |
| 333 | + } | |
| 334 | + return true; | |
| 335 | + } | |
| 336 | + | |
| 337 | + | |
| 338 | + public Boolean useryType(SysUser user){ | |
| 339 | + RealControAuthority hoit = realControAuthorityRepository.findByUserId(user.getId()); | |
| 340 | + String[] st = hoit.getLineCodeStr().split(","); | |
| 341 | + for (int k = 0 ; k < st.length ; k++){ | |
| 342 | + Line l = lineRepository.findById(Integer.parseInt(st[k])).get(); | |
| 343 | + inforealType(l); | |
| 344 | + } | |
| 345 | + return true; | |
| 346 | + } | |
| 347 | + | |
| 93 | 348 | //创建考试人数 并分配线路信息 |
| 94 | - public Boolean usercreateType(int st){ | |
| 349 | + public Boolean usercreateType(int st,Long userName){ | |
| 95 | 350 | int usernum = sysUserRepository.findAll_distinct().size(); |
| 96 | 351 | SysUser user = new SysUser();//总人数 |
| 97 | 352 | for (int i = 0; i < st; i++) { //创建考试人数 |
| ... | ... | @@ -99,26 +354,27 @@ public class DdexamServiceImpl implements DdexamService { |
| 99 | 354 | user = new SysUser(); |
| 100 | 355 | user.setCreateDate(new Date()); |
| 101 | 356 | user.setEnabled(true); |
| 102 | - user.setName("ks00"+username); | |
| 103 | - user.setPassword(new BCryptPasswordEncoder(4).encode("Aa123456")); | |
| 104 | - user.setUserName("ks00"+username); | |
| 105 | - // sysUserRepository.save(user);添加 -------**-- | |
| 106 | - user.setId(2); //------暂用 | |
| 357 | + user.setName(String.valueOf(userName + i)); | |
| 358 | + user.setPassword(new BCryptPasswordEncoder(4).encode("123456")); | |
| 359 | + user.setUserName(String.valueOf(userName + i)); | |
| 360 | + user.setKsstatus("1"); //状态 表示今日账户已用 | |
| 361 | + sysUserRepository.save(user); //添加 -------**-- | |
| 362 | + | |
| 107 | 363 | BsthCSysUserRoles userRoles = new BsthCSysUserRoles(); |
| 108 | 364 | userRoles.setUsers(user.getId()); |
| 109 | 365 | userRoles.setRoles(73); //统一用73考生 |
| 110 | - // bsthCSysUserRolesRepository.save(userRoles);添加 -------**-- | |
| 111 | - | |
| 112 | - //List<LineSt> lineStList = lineStRepository.findStAll();//所有模板线路 | |
| 366 | + bsthCSysUserRolesRepository.save(userRoles); //添加 -------**-- | |
| 367 | + List<LineConfigSt> lineConfigList = lineConfigStRepository.findAll(); //线调 线路相关配置信息 | |
| 113 | 368 | Integer linebumber = lineRepository.findAll().size(); //线路数量 线路code |
| 114 | 369 | String [] mtline = {"A线","B线","C线","D线","E线","F线"}; //对应模板6条线 换成线路name |
| 115 | 370 | List<LineInformationSt> litst = (List<LineInformationSt>) LineInformationStRepository.findAll(); //所有模板线路标准和线路 |
| 116 | 371 | if(litst.size() != 6){ |
| 117 | 372 | return false; |
| 118 | 373 | } |
| 119 | - for(int j = 0 ; j <= litst.size() ; j++){ | |
| 120 | - LineSt linest = litst.get(j).getLine(); | |
| 121 | - LineInformationSt Limst = litst.get(j); | |
| 374 | + String lineCodeStr = ""; | |
| 375 | + for(int j = 0 ; j < litst.size() ; j++){ //6个 <6 | |
| 376 | + LineSt linest = litst.get(j).getLine(); //旧line | |
| 377 | + LineInformationSt Limst = litst.get(j); | |
| 122 | 378 | Line line = new Line(); |
| 123 | 379 | BeanUtils.copyProperties(linest,line); //copy |
| 124 | 380 | Integer linecodeId = linebumber++ ; |
| ... | ... | @@ -127,20 +383,64 @@ public class DdexamServiceImpl implements DdexamService { |
| 127 | 383 | line.setName(mtline[j]+"+"+user.getName()); |
| 128 | 384 | line.setCoLineCode(linest.getLineCode()); |
| 129 | 385 | lineRepository.save(line); //线路添加 |
| 386 | + //----------------线路--------------------------// | |
| 130 | 387 | LineInformation lifat = new LineInformation(); //线路标准 |
| 131 | 388 | BeanUtils.copyProperties(Limst,lifat); |
| 132 | 389 | lifat.setLine(line); |
| 133 | 390 | lineInformationRepository.save(lifat); //线路标准信息条件 |
| 134 | - inforealType(linest.getLineCode()); | |
| 391 | + //-------------------线路标准-----------------------// | |
| 392 | + for(LineConfigSt cfgt : lineConfigList){ | |
| 393 | + if(cfgt.getLine().getLineCode().equals(linest.getLineCode())){ | |
| 394 | + LineConfig config = new LineConfig(); | |
| 395 | + BeanUtils.copyProperties(cfgt,config); //copy | |
| 396 | + config.setLine(line); | |
| 397 | + lineConfigRepository.save(config); | |
| 398 | + } | |
| 399 | + } | |
| 400 | + //-------------------线调 线路相关配置信息-----------------------// | |
| 401 | + | |
| 402 | + List<StationRouteSt> srstList = stationRouteStRepository.findByLine(linest.getLineCode()); | |
| 403 | + List<StationRoute> srstListAll = new ArrayList<>(); | |
| 404 | + for(StationRouteSt route : srstList){ | |
| 405 | + StationRoute srt = new StationRoute(); | |
| 406 | + BeanUtils.copyProperties(route,srt); //copy | |
| 407 | + srt.setLine(line); | |
| 408 | + srt.setLineCode(linecodeId.toString()); | |
| 409 | + srstListAll.add(srt); | |
| 410 | + } | |
| 411 | + stationRouteRepository.saveAll(srstListAll);//添加站点 | |
| 412 | + //-------------------站点-----------------------// | |
| 413 | + lineCodeStr += linecodeId.toString()+","; //线调线路 | |
| 414 | + inforealType(line); | |
| 135 | 415 | } |
| 416 | + RealControAuthority raty = new RealControAuthority(); | |
| 417 | + raty.setUserId(user.getId()); | |
| 418 | + raty.setLineCodeStr(lineCodeStr); | |
| 419 | + raty.setPattern(1); //可用 | |
| 420 | + realControAuthorityRepository.save(raty); | |
| 421 | + //-------------------分配本次线调权限-----------------------// | |
| 136 | 422 | } |
| 137 | 423 | return true; |
| 138 | - | |
| 139 | 424 | } |
| 140 | 425 | |
| 141 | - | |
| 142 | - public void inforealType(String lineCode){ | |
| 143 | - | |
| 426 | + //添加排班 | |
| 427 | + public void inforealType(Line line){ | |
| 428 | + //用旧线路code查出模板排班表 | |
| 429 | + List<ScheduleRealInfoSt> sristList = ScheduleRealInfoStRepository.queryUserInfo(line.getCoLineCode(),"2021-11-18");//模板固定日期 | |
| 430 | + List<ScheduleRealInfo> sriList = new ArrayList<>(); | |
| 431 | + for(ScheduleRealInfoSt st : sristList){ | |
| 432 | + ScheduleRealInfo sri = new ScheduleRealInfo(); | |
| 433 | + BeanUtils.copyProperties(st,sri); //copy | |
| 434 | + sri.setScheduleDate(new Date()); | |
| 435 | + sri.setScheduleDateStr(sdf.format(new Date())); | |
| 436 | + sri.setXlBm(line.getLineCode()); | |
| 437 | + sri.setXlName(line.getName()); | |
| 438 | + sriList.add(sri); | |
| 439 | + } | |
| 440 | + ScheduleRealInfoRepository.saveAll(sriList); | |
| 144 | 441 | } |
| 145 | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 146 | 446 | } | ... | ... |
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
| ... | ... | @@ -87,6 +87,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen |
| 87 | 87 | return -1; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | +/* | |
| 90 | 91 | if (null == d60) |
| 91 | 92 | return -1; |
| 92 | 93 | |
| ... | ... | @@ -95,12 +96,13 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen |
| 95 | 96 | if (null != sender) |
| 96 | 97 | d60.setSender(sender); |
| 97 | 98 | d60.setHttpCode(code); |
| 99 | +*/ | |
| 98 | 100 | |
| 99 | - if (code != 0) | |
| 101 | + /* if (code != 0) | |
| 100 | 102 | d60.setErrorText("网关通讯失败, code: " + code); |
| 101 | - | |
| 103 | +*/ | |
| 102 | 104 | dayOfDirectives.put60(d60); |
| 103 | - return code; | |
| 105 | + return 0; | |
| 104 | 106 | } |
| 105 | 107 | |
| 106 | 108 | @Override |
| ... | ... | @@ -272,13 +274,14 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen |
| 272 | 274 | |
| 273 | 275 | public D60 create60Data(String nbbm, String text, Short dispatchInstruct, ScheduleRealInfo sch) { |
| 274 | 276 | |
| 275 | - String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm); | |
| 277 | + // String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm); | |
| 276 | 278 | String lineCode = null; |
| 277 | - if (null == deviceId) { | |
| 279 | + /* if (null == deviceId) { | |
| 278 | 280 | logger.error("没有设备号对照的车辆:" + nbbm); |
| 279 | 281 | return null; |
| 280 | - } | |
| 282 | + }*/ | |
| 281 | 283 | // 根据当前GPS确定 上下行和营运状态 |
| 284 | + String deviceId = "111"; | |
| 282 | 285 | Byte upDown = null; |
| 283 | 286 | Integer state = null; |
| 284 | 287 | if (null == sch) { |
| ... | ... | @@ -390,7 +393,6 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen |
| 390 | 393 | //调度指令 |
| 391 | 394 | Collection<D60> dptArray = dayOfDirectives.all60(); |
| 392 | 395 | for (D60 d60 : dptArray) { |
| 393 | - if (d60.isDispatch()) | |
| 394 | 396 | list.add(d60); |
| 395 | 397 | } |
| 396 | 398 | break; |
| ... | ... | @@ -433,7 +435,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen |
| 433 | 435 | |
| 434 | 436 | for(Directive d : list){ |
| 435 | 437 | d.setTimeHHmm(fmtHHmm.print(d.getTimestamp())); |
| 436 | - d.setNbbm(BasicData.deviceId2NbbmMap.get(d.getDeviceId())); | |
| 438 | + d.setNbbm(d.getDeviceId()); | |
| 437 | 439 | } |
| 438 | 440 | |
| 439 | 441 | int count = list.size(); | ... | ... |
src/main/java/com/bsth/service/forms/CommonService.java
0 → 100644
| 1 | +package com.bsth.service.forms; | |
| 2 | + | |
| 3 | +import org.springframework.stereotype.Service; | |
| 4 | + | |
| 5 | +import java.util.Map; | |
| 6 | + | |
| 7 | +@Service | |
| 8 | +public interface CommonService{ | |
| 9 | + | |
| 10 | + Map<String,Object> findKMBC1(String jName,String clZbh, String date,String enddate); | |
| 11 | + | |
| 12 | + Map<String,Object> findKMBC2(String jName,String clZbh,String date); | |
| 13 | +} | ... | ... |
src/main/java/com/bsth/service/forms/ExportService.java
0 → 100644
| 1 | +package com.bsth.service.forms; | |
| 2 | + | |
| 3 | +import com.bsth.entity.mcy_forms.*; | |
| 4 | + | |
| 5 | +import java.util.List; | |
| 6 | + | |
| 7 | +public interface ExportService { | |
| 8 | + | |
| 9 | + public void waybillday(String date, String linaName, List<Waybillday> resList); | |
| 10 | + | |
| 11 | + public void linepasswengerflow(String date,List<Linepasswengerflow> resList); | |
| 12 | + | |
| 13 | + public void shifday(String date, List<Shifday> resList); | |
| 14 | + | |
| 15 | + public void shiftuehiclemanth(String startDate, String endDate, String lpName, | |
| 16 | + List<Shiftuehiclemanth> resList); | |
| 17 | + | |
| 18 | + public void singledata(String startDate, String endDate, String lpName, List<Singledata> resList); | |
| 19 | + | |
| 20 | + public void vehicleloading(String date, List<Vehicleloading> resList); | |
| 21 | + | |
| 22 | + public void operationservice(String startDate, String endDate, String lpName, | |
| 23 | + List<Operationservice> resList); | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | +} | ... | ... |
src/main/java/com/bsth/service/forms/FormsService.java
0 → 100644
| 1 | +package com.bsth.service.forms; | |
| 2 | + | |
| 3 | +import com.bsth.entity.mcy_forms.*; | |
| 4 | + | |
| 5 | +import java.util.List; | |
| 6 | +import java.util.Map; | |
| 7 | + | |
| 8 | + | |
| 9 | +public interface FormsService { | |
| 10 | + | |
| 11 | + public List<Waybillday> waybillday(Map<String, Object> map); | |
| 12 | + | |
| 13 | + public List<Linepasswengerflow> linepasswengerflow(Map<String, Object> map); | |
| 14 | + | |
| 15 | + public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map); | |
| 16 | + public List<Shiftuehiclemanth> shiftuehiclemanth2(Map<String, Object> map); | |
| 17 | + | |
| 18 | + public List<Changetochange> changetochange(Map<String, Object> map); | |
| 19 | + | |
| 20 | + public List<Shifday> shifday(Map<String, Object> map); | |
| 21 | + | |
| 22 | + public List<Singledata> singledata(Map<String, Object> map); | |
| 23 | + public List<Singledata> singledata2(Map<String, Object> map); | |
| 24 | + | |
| 25 | + public List<Singledata> singledatanew(Map<String, Object> map); | |
| 26 | + public List<Singledata> singledatatj(Map<String, Object> map); | |
| 27 | + public List<Singledata> singledatatj2(Map<String, Object> map); | |
| 28 | + | |
| 29 | + | |
| 30 | + public List<Vehicleloading> vehicleloading(String line,String data); | |
| 31 | + | |
| 32 | + public List<Operationservice> operationservice(Map<String, Object> map); | |
| 33 | + | |
| 34 | + public List<Map<String, Object>> turnoutrate(Map<String, Object> map); | |
| 35 | + | |
| 36 | + public List<Executionrate> executionrate(Map<String, Object> map); | |
| 37 | + | |
| 38 | + public List<Allline> allline(Map<String, Object> map); | |
| 39 | + | |
| 40 | + public List<Daily> daily(Map<String, Object> map); | |
| 41 | +} | ... | ... |
src/main/java/com/bsth/service/forms/impl/CommonServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.forms.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.realcontrol.ChildTaskPlan; | |
| 4 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 5 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | |
| 6 | +import com.bsth.service.forms.CommonService; | |
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | +import org.springframework.stereotype.Service; | |
| 9 | + | |
| 10 | +import java.text.DecimalFormat; | |
| 11 | +import java.util.*; | |
| 12 | + | |
| 13 | +@Service | |
| 14 | +public class CommonServiceImpl implements CommonService{ | |
| 15 | + | |
| 16 | + | |
| 17 | + @Autowired | |
| 18 | + ScheduleRealInfoRepository scheduleRealInfoRepository; | |
| 19 | + | |
| 20 | + @Override | |
| 21 | + public Map<String, Object> findKMBC1(String jName, String clZbh, | |
| 22 | + String date, String enddate) { | |
| 23 | + | |
| 24 | + String sql=" select s from s " | |
| 25 | + + " where s.j_gh ='" + jName + "' and s.cl_zbh ='" + clZbh + "' and " | |
| 26 | + + " to_days(s.schedule_date) BETWEEN to_days('" + date + "') and to_days('" + enddate + "')" | |
| 27 | + + " order by bcs"; | |
| 28 | + | |
| 29 | + | |
| 30 | + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill4(jName, clZbh, date, enddate); | |
| 31 | + DecimalFormat format = new DecimalFormat("0.00"); | |
| 32 | +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); | |
| 33 | +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); | |
| 34 | + int jhbc = 0,cjbc = 0,ljbc = 0; | |
| 35 | + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0; | |
| 36 | + float addMileage = 0l,remMileage = 0l; | |
| 37 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 38 | + for(ScheduleRealInfo scheduleRealInfo : list){ | |
| 39 | + if(scheduleRealInfo != null){ | |
| 40 | + //计划里程(主任务过滤掉临加班次), | |
| 41 | + //烂班里程(主任务烂班), | |
| 42 | + //临加里程(主任务临加), | |
| 43 | + //计划班次,烂班班次,增加班次 | |
| 44 | + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | |
| 45 | + if(scheduleRealInfo.isSflj()){ | |
| 46 | + addMileage += tempJhlc; | |
| 47 | + ljbc++; | |
| 48 | + }else{ | |
| 49 | + jhlc += tempJhlc; | |
| 50 | + jhbc++; | |
| 51 | + if(scheduleRealInfo.getStatus() == -1){ | |
| 52 | + remMileage += tempJhlc; | |
| 53 | + cjbc++; | |
| 54 | + } | |
| 55 | + } | |
| 56 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 57 | + //计算营运里程,空驶里程 | |
| 58 | + if(childTaskPlans.isEmpty()){ | |
| 59 | + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | |
| 60 | + || scheduleRealInfo.getBcType().equals("venting")){ | |
| 61 | + ksgl += tempJhlc; | |
| 62 | + }else{ | |
| 63 | + yygl += tempJhlc; | |
| 64 | + } | |
| 65 | + }else{ | |
| 66 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 67 | + while(it.hasNext()){ | |
| 68 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 69 | + if(childTaskPlan.getMileageType().equals("empty")){ | |
| 70 | + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 71 | + }else{ | |
| 72 | + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 73 | + } | |
| 74 | + } | |
| 75 | + } | |
| 76 | + } | |
| 77 | + } | |
| 78 | + map.put("jhlc", format.format(jhlc)); | |
| 79 | + map.put("remMileage", format.format(remMileage)); | |
| 80 | + map.put("addMileage", format.format(addMileage)); | |
| 81 | + map.put("yygl", format.format(yygl)); | |
| 82 | + map.put("ksgl", format.format(ksgl)); | |
| 83 | + map.put("realMileage", format.format(yygl+ksgl)); | |
| 84 | + map.put("jhbc", jhbc); | |
| 85 | + map.put("cjbc", cjbc); | |
| 86 | + map.put("ljbc", ljbc); | |
| 87 | + map.put("sjbc", jhbc-cjbc+ljbc); | |
| 88 | + return map; | |
| 89 | + } | |
| 90 | + | |
| 91 | + | |
| 92 | + @Override | |
| 93 | + public Map<String, Object> findKMBC2(String jName, String clZbh,String date) { | |
| 94 | + | |
| 95 | + String sql=" select s from bsth_c_s_sp_info_real s " | |
| 96 | + + " where s.j_gh ='" + jName + "' and s.cl_zbh ='" + clZbh + "' and " | |
| 97 | + + " to_days(s.schedule_date) =to_days('" + date + "')" | |
| 98 | + + " order by bcs"; | |
| 99 | + | |
| 100 | + | |
| 101 | + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill3(jName, clZbh , date,"",""); | |
| 102 | + | |
| 103 | + DecimalFormat format = new DecimalFormat("0.00"); | |
| 104 | +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); | |
| 105 | +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); | |
| 106 | + int jhbc = 0,cjbc = 0,ljbc = 0; | |
| 107 | + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0; | |
| 108 | + float addMileage = 0l,remMileage = 0l; | |
| 109 | + String j_Name=""; | |
| 110 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 111 | + for(ScheduleRealInfo scheduleRealInfo : list){ | |
| 112 | + if(scheduleRealInfo != null){ | |
| 113 | + j_Name=scheduleRealInfo.getjName(); | |
| 114 | + //计划里程(主任务过滤掉临加班次), | |
| 115 | + //烂班里程(主任务烂班), | |
| 116 | + //临加里程(主任务临加), | |
| 117 | + //计划班次,烂班班次,增加班次 | |
| 118 | + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | |
| 119 | + if(scheduleRealInfo.isSflj()){ | |
| 120 | + addMileage += tempJhlc; | |
| 121 | + ljbc++; | |
| 122 | + }else{ | |
| 123 | + jhlc += tempJhlc; | |
| 124 | + jhbc++; | |
| 125 | + if(scheduleRealInfo.getStatus() == -1){ | |
| 126 | + remMileage += tempJhlc; | |
| 127 | + cjbc++; | |
| 128 | + } | |
| 129 | + } | |
| 130 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 131 | + //计算营运里程,空驶里程 | |
| 132 | + if(childTaskPlans.isEmpty()){ | |
| 133 | + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | |
| 134 | + || scheduleRealInfo.getBcType().equals("venting")){ | |
| 135 | + ksgl += tempJhlc; | |
| 136 | + }else{ | |
| 137 | + yygl += tempJhlc; | |
| 138 | + } | |
| 139 | + }else{ | |
| 140 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 141 | + while(it.hasNext()){ | |
| 142 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 143 | + if(childTaskPlan.getMileageType().equals("empty")){ | |
| 144 | + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 145 | + }else{ | |
| 146 | + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 147 | + } | |
| 148 | + } | |
| 149 | + } | |
| 150 | + } | |
| 151 | + } | |
| 152 | + map.put("j_name", j_Name); | |
| 153 | + map.put("jhlc", format.format(jhlc)); | |
| 154 | + map.put("remMileage", format.format(remMileage)); | |
| 155 | + map.put("addMileage", format.format(addMileage)); | |
| 156 | + map.put("yygl", format.format(yygl)); | |
| 157 | + map.put("ksgl", format.format(ksgl)); | |
| 158 | + map.put("realMileage", format.format(yygl+ksgl)); | |
| 159 | + map.put("jhbc", jhbc); | |
| 160 | + map.put("cjbc", cjbc); | |
| 161 | + map.put("ljbc", ljbc); | |
| 162 | + map.put("sjbc", jhbc-cjbc+ljbc); | |
| 163 | + return map; | |
| 164 | + } | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | +} | ... | ... |
src/main/java/com/bsth/service/forms/impl/ExportServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.forms.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.mcy_forms.*; | |
| 4 | +import com.bsth.service.forms.ExportService; | |
| 5 | +import com.bsth.util.ReportUtils; | |
| 6 | +import org.springframework.stereotype.Service; | |
| 7 | + | |
| 8 | +import java.text.SimpleDateFormat; | |
| 9 | +import java.util.*; | |
| 10 | + | |
| 11 | +@Service | |
| 12 | +public class ExportServiceImpl implements ExportService{ | |
| 13 | + | |
| 14 | + | |
| 15 | + //行车路单日报表 | |
| 16 | + @Override | |
| 17 | + public void waybillday(String date, String lineName, List<Waybillday> list) { | |
| 18 | + | |
| 19 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 20 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 21 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 22 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 23 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 24 | + ReportUtils ee = new ReportUtils(); | |
| 25 | + | |
| 26 | + for(Waybillday w : list){ | |
| 27 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 28 | + m.put("carPlate", w.getNbbm()); | |
| 29 | + m.put("jzl1", w.getJzl1()); | |
| 30 | + m.put("jzl", w.getJzl()); | |
| 31 | + m.put("yh", w.getYh()); | |
| 32 | + m.put("sh", w.getSh()); | |
| 33 | + m.put("jName", w.getjName()); | |
| 34 | + m.put("zlc", w.getZlc()); | |
| 35 | + m.put("jy", ""); | |
| 36 | + resList.add(m); | |
| 37 | + } | |
| 38 | + | |
| 39 | + try { | |
| 40 | + listI.add(resList.iterator()); | |
| 41 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | |
| 42 | + ee.excelReplace(listI, new Object[] { map }, path+"mould/waybillday.xls", | |
| 43 | + path+"export/"+sdfSimple.format(sdfMonth.parse(date)) | |
| 44 | + +"-"+lineName+"-行车路单日报表.xls"); | |
| 45 | + } catch (Exception e) { | |
| 46 | + e.printStackTrace(); | |
| 47 | + } | |
| 48 | + } | |
| 49 | + | |
| 50 | + //线路客流量报表 | |
| 51 | + @Override | |
| 52 | + public void linepasswengerflow(String date, List<Linepasswengerflow> list) { | |
| 53 | + | |
| 54 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 55 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 56 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 57 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 58 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 59 | + ReportUtils ee = new ReportUtils(); | |
| 60 | + for(Linepasswengerflow l : list){ | |
| 61 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 62 | + m.put("stationName", l.getStationName()); | |
| 63 | + resList.add(m); | |
| 64 | + } | |
| 65 | + | |
| 66 | + try { | |
| 67 | + listI.add(resList.iterator()); | |
| 68 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | |
| 69 | + ee.excelReplace(listI, new Object[] { map }, path+"mould/linepasswengerflow.xls", | |
| 70 | + path+"export/线路客流量报表" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | |
| 71 | + } catch (Exception e) { | |
| 72 | + e.printStackTrace(); | |
| 73 | + } | |
| 74 | + | |
| 75 | + } | |
| 76 | + | |
| 77 | + | |
| 78 | + //班次车辆人员日统计 | |
| 79 | + @Override | |
| 80 | + public void shifday(String date,List<Shifday> list) { | |
| 81 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 82 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 83 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 84 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 85 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 86 | + ReportUtils ee = new ReportUtils(); | |
| 87 | + | |
| 88 | + for(Shifday l : list){ | |
| 89 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 90 | + m.put("jName",l.getjName()); | |
| 91 | + m.put("sName", l.getsName()); | |
| 92 | + m.put("lpName", l.getLpName()); | |
| 93 | + m.put("carPlate", l.getCarPlate()); | |
| 94 | + m.put("jhlc", l.getJhlc()); | |
| 95 | + m.put("sjjhlc", l.getSjjhlc()); | |
| 96 | + m.put("yygl", l.getYygl()); | |
| 97 | + m.put("emptMileage", l.getEmptMileage()); | |
| 98 | + m.put("remMileage", l.getRemMileage()); | |
| 99 | + m.put("addMileage", l.getAddMileage()); | |
| 100 | + m.put("totalm", l.getTotalm()); | |
| 101 | + m.put("jhbc", l.getJhbc()); | |
| 102 | + m.put("sjjhbc", l.getSjjhbc()); | |
| 103 | + m.put("cjbc", l.getCjbc()); | |
| 104 | + m.put("ljbc", l.getLjbc()); | |
| 105 | + m.put("sjbc", l.getSjbc()); | |
| 106 | + resList.add(m); | |
| 107 | + } | |
| 108 | + | |
| 109 | + try { | |
| 110 | + listI.add(resList.iterator()); | |
| 111 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | |
| 112 | + ee.excelReplace(listI, new Object[] { map }, path+"mould/shifday.xls", | |
| 113 | + path+"export/班次车辆人员日报表" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | |
| 114 | + } catch (Exception e) { | |
| 115 | + e.printStackTrace(); | |
| 116 | + } | |
| 117 | + | |
| 118 | + } | |
| 119 | + | |
| 120 | + //班次车辆人员月统计 | |
| 121 | + @Override | |
| 122 | + public void shiftuehiclemanth(String startDate,String endDate,String lpName, List<Shiftuehiclemanth> list) { | |
| 123 | + | |
| 124 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 125 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 126 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 127 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 128 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 129 | + ReportUtils ee = new ReportUtils(); | |
| 130 | + | |
| 131 | + for(Shiftuehiclemanth l : list){ | |
| 132 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 133 | + m.put("jName",l.getjName() ); | |
| 134 | + m.put("jhlc", l.getJhlc()); | |
| 135 | + m.put("emptMileage",l.getEmptMileage() ); | |
| 136 | + m.put("remMileage", l.getRemMileage()); | |
| 137 | + m.put("addMileage", l.getAddMileage()); | |
| 138 | + m.put("totalm", l.getTotalm()); | |
| 139 | + m.put("cjbc", l.getCjbc()); | |
| 140 | + m.put("ljbc", l.getLjbc()); | |
| 141 | + m.put("sjbc", l.getSjbc()); | |
| 142 | + resList.add(m); | |
| 143 | + } | |
| 144 | + | |
| 145 | + try { | |
| 146 | + listI.add(resList.iterator()); | |
| 147 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | |
| 148 | + ee.excelReplace(listI, new Object[] { map }, path+"mould/shiftuehiclemanth.xls", | |
| 149 | + path+"export/班次车辆人员月报表" + sdfSimple.format(sdfMonth.parse(startDate)) + ".xls"); | |
| 150 | + } catch (Exception e) { | |
| 151 | + e.printStackTrace(); | |
| 152 | + } | |
| 153 | + | |
| 154 | + } | |
| 155 | + | |
| 156 | + //路单报表 | |
| 157 | + @Override | |
| 158 | + public void singledata(String startDate,String endDate,String lpName, List<Singledata> list) { | |
| 159 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 160 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 161 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 162 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 163 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 164 | + ReportUtils ee = new ReportUtils(); | |
| 165 | + | |
| 166 | + for(Singledata l : list){ | |
| 167 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 168 | + m.put("rQ",l.getrQ()); | |
| 169 | + m.put("gS", l.getgS()); | |
| 170 | + m.put("xL",l.getxL() ); | |
| 171 | + m.put("clzbh", l.getClzbh()); | |
| 172 | + m.put("jsy", l.getJsy()); | |
| 173 | + m.put("jName", l.getjName()); | |
| 174 | + m.put("sgh", l.getSgh()); | |
| 175 | + m.put("sName", l.getsName()); | |
| 176 | + m.put("jhlc", l.getJhlc()); | |
| 177 | + m.put("emptMileage", l.getEmptMileage()); | |
| 178 | + m.put("hyl", l.getHyl()); | |
| 179 | + m.put("jzl", l.getJzl()); | |
| 180 | + m.put("unyyyl",l.getUnyyyl()); | |
| 181 | + m.put("jhjl", l.getJhjl()); | |
| 182 | + resList.add(m); | |
| 183 | + } | |
| 184 | + | |
| 185 | + try { | |
| 186 | + listI.add(resList.iterator()); | |
| 187 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | |
| 188 | + ee.excelReplace(listI, new Object[] { map }, path+"mould/singledata.xls", | |
| 189 | + path+"export/路单日报表" + sdfSimple.format(sdfMonth.parse(startDate)) + ".xls"); | |
| 190 | + } catch (Exception e) { | |
| 191 | + e.printStackTrace(); | |
| 192 | + } | |
| 193 | + | |
| 194 | + | |
| 195 | + } | |
| 196 | + | |
| 197 | + | |
| 198 | + //车辆加注 | |
| 199 | + @Override | |
| 200 | + public void vehicleloading(String date, List<Vehicleloading> list) { | |
| 201 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 202 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 203 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 204 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 205 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 206 | + ReportUtils ee = new ReportUtils(); | |
| 207 | + | |
| 208 | + for(Vehicleloading l : list){ | |
| 209 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 210 | + m.put("rQ", l.getrQ()); | |
| 211 | + m.put("gS", l.getgS()); | |
| 212 | + m.put("xL", l.getxL()); | |
| 213 | + m.put("clzbh", l.getClzbh()); | |
| 214 | + m.put("hyl", l.getHyl()); | |
| 215 | + m.put("jzl", l.getJzl()); | |
| 216 | + m.put("ls", l.getLs()); | |
| 217 | + m.put("jhlc", l.getJhlc()); | |
| 218 | + m.put("unyyyl", l.getUnyyyl()); | |
| 219 | + m.put("jhbc", l.getJhbc()); | |
| 220 | + m.put("sjbc", l.getSjbc()); | |
| 221 | + resList.add(m); | |
| 222 | + } | |
| 223 | + | |
| 224 | + try { | |
| 225 | + listI.add(resList.iterator()); | |
| 226 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | |
| 227 | + ee.excelReplace(listI, new Object[] { map }, path+"mould/vehicleloading.xls", | |
| 228 | + path+"export/车辆加注" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | |
| 229 | + } catch (Exception e) { | |
| 230 | + e.printStackTrace(); | |
| 231 | + } | |
| 232 | + } | |
| 233 | + | |
| 234 | + //运营服务阶段报表 | |
| 235 | + @Override | |
| 236 | + public void operationservice(String startDate,String endDate,String lpName,List<Operationservice> list) { | |
| 237 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 238 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 239 | + | |
| 240 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 241 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 242 | + ReportUtils ee = new ReportUtils(); | |
| 243 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 244 | + for(Operationservice l : list){ | |
| 245 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 246 | + m.put("xlName", l.getXlName()); | |
| 247 | + m.put("jzl", l.getJzl()); | |
| 248 | + m.put("xhl", l.getXhl()); | |
| 249 | + m.put("xsgl", l.getXsgl()); | |
| 250 | + m.put("emptMileage", l.getEmptMileage()); | |
| 251 | + m.put("sjbc", l.getSjbc()); | |
| 252 | + resList.add(m); | |
| 253 | + } | |
| 254 | + | |
| 255 | + try { | |
| 256 | + listI.add(resList.iterator()); | |
| 257 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | |
| 258 | + ee.excelReplace(listI, new Object[] { map }, path+"mould/operationservice.xls", | |
| 259 | + path+"export/运营服务阶段报表" + sdfSimple.format(sdfMonth.parse(startDate)) + ".xls"); | |
| 260 | + } catch (Exception e) { | |
| 261 | + e.printStackTrace(); | |
| 262 | + } | |
| 263 | + } | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | +} | ... | ... |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.forms.impl; | |
| 2 | + | |
| 3 | +import com.bsth.data.BasicData; | |
| 4 | +import com.bsth.entity.Line; | |
| 5 | +import com.bsth.entity.mcy_forms.*; | |
| 6 | +import com.bsth.entity.oil.Dlb; | |
| 7 | +import com.bsth.entity.oil.Ylb; | |
| 8 | +import com.bsth.entity.realcontrol.ChildTaskPlan; | |
| 9 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 10 | +import com.bsth.entity.schedule.SchedulePlanInfo; | |
| 11 | +import com.bsth.repository.LineRepository; | |
| 12 | +import com.bsth.repository.oil.DlbRepository; | |
| 13 | +import com.bsth.repository.oil.YlbRepository; | |
| 14 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | |
| 15 | +import com.bsth.service.LineService; | |
| 16 | +import com.bsth.service.forms.CommonService; | |
| 17 | +import com.bsth.service.forms.FormsService; | |
| 18 | +import com.bsth.service.realcontrol.ScheduleRealInfoService; | |
| 19 | +import com.bsth.service.report.CulateMileageService; | |
| 20 | +import com.bsth.util.Arith; | |
| 21 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 22 | +import org.springframework.jdbc.core.JdbcTemplate; | |
| 23 | +import org.springframework.jdbc.core.RowMapper; | |
| 24 | +import org.springframework.stereotype.Service; | |
| 25 | + | |
| 26 | +import java.math.BigDecimal; | |
| 27 | +import java.sql.ResultSet; | |
| 28 | +import java.sql.SQLException; | |
| 29 | +import java.text.DecimalFormat; | |
| 30 | +import java.text.NumberFormat; | |
| 31 | +import java.text.ParseException; | |
| 32 | +import java.text.SimpleDateFormat; | |
| 33 | +import java.util.*; | |
| 34 | + | |
| 35 | +@Service | |
| 36 | +public class FormsServiceImpl implements FormsService { | |
| 37 | + | |
| 38 | + @Autowired | |
| 39 | + JdbcTemplate jdbcTemplate; | |
| 40 | + | |
| 41 | + @Autowired | |
| 42 | + ScheduleRealInfoService scheduleRealInfoService; | |
| 43 | + | |
| 44 | + @Autowired | |
| 45 | + LineService lineService; | |
| 46 | + | |
| 47 | + @Autowired | |
| 48 | + CommonService commonService; | |
| 49 | + | |
| 50 | + @Autowired | |
| 51 | + ScheduleRealInfoRepository scheduleRealInfoRepository; | |
| 52 | + | |
| 53 | + @Autowired | |
| 54 | + CulateMileageService culateMileageService; | |
| 55 | + | |
| 56 | + @Autowired | |
| 57 | + YlbRepository ylbRepository; | |
| 58 | + | |
| 59 | + @Autowired | |
| 60 | + DlbRepository dlbRepository; | |
| 61 | + | |
| 62 | + @Autowired | |
| 63 | + LineRepository lineRepository; | |
| 64 | + | |
| 65 | + | |
| 66 | + // 行车路单日报表 | |
| 67 | + @Override | |
| 68 | + public List<Waybillday> waybillday(Map<String, Object> map) { | |
| 69 | + String line=map.get("line").toString(); | |
| 70 | + String date=map.get("date").toString(); | |
| 71 | + | |
| 72 | + String sql="select " | |
| 73 | + + " r.cl_zbh,r.j_gh" | |
| 74 | + + " from bsth_c_s_sp_info_real r where " | |
| 75 | + + " r.schedule_date_str = '"+date+"'" | |
| 76 | + + " and r.xl_bm = '"+line+"' " | |
| 77 | + + " group by " | |
| 78 | + + " r.cl_zbh,r.j_gh"; | |
| 79 | + | |
| 80 | + List<Waybillday> list = jdbcTemplate.query(sql, new RowMapper<Waybillday>() { | |
| 81 | + | |
| 82 | + @Override | |
| 83 | + public Waybillday mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 84 | + Waybillday w=new Waybillday(); | |
| 85 | + w.setJgh(arg0.getString("j_gh")); | |
| 86 | +// w.setjName(arg0.getString("j_name")); | |
| 87 | + w.setNbbm(arg0.getString("cl_zbh")); | |
| 88 | + return w; | |
| 89 | + | |
| 90 | + }; | |
| 91 | + }); | |
| 92 | + List<ScheduleRealInfo> realList= scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); | |
| 93 | + List<Ylb> listYlb= ylbRepository.obtainYl(date, "", "", line, "", "xlbm"); | |
| 94 | + List<Dlb> listDlb= dlbRepository.obtainDl(date, "", "", line, "", "xlbm"); | |
| 95 | + double jzl=0.0,sh=0.0,yh=0.0; | |
| 96 | + for (int i = 0; i < list.size(); i++) { | |
| 97 | + Waybillday w=list.get(i); | |
| 98 | + List<ScheduleRealInfo> listInfo=new ArrayList<ScheduleRealInfo>(); | |
| 99 | + for (int j = 0; j < realList.size(); j++) { | |
| 100 | + ScheduleRealInfo s=realList.get(j); | |
| 101 | + if(w.getNbbm().equals(s.getClZbh()) && w.getJgh().equals(s.getjGh())){ | |
| 102 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 103 | + if(cts != null && cts.size() > 0){ | |
| 104 | + listInfo.add(s); | |
| 105 | + }else{ | |
| 106 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 107 | + listInfo.add(s); | |
| 108 | + } | |
| 109 | + } | |
| 110 | + | |
| 111 | + if((w.getjName() == null || w.getjName().trim().length() == 0) | |
| 112 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 113 | + w.setjName(s.getjName()); | |
| 114 | + } | |
| 115 | + } | |
| 116 | + } | |
| 117 | + | |
| 118 | + double sjgl=culateMileageService.culateSjgl(listInfo); | |
| 119 | + double ljgl=culateMileageService.culateLjgl(listInfo); | |
| 120 | + double zyygl=Arith.add(sjgl, ljgl); | |
| 121 | + double jccg=culateMileageService.culateJccgl(listInfo); | |
| 122 | + double ksgl=culateMileageService.culateKsgl(listInfo); | |
| 123 | + double zksgl=Arith.add(jccg, ksgl); | |
| 124 | + | |
| 125 | + w.setJzl1(String.valueOf(zksgl)); | |
| 126 | + w.setZlc(String.valueOf(Arith.add(zyygl, zksgl))); | |
| 127 | + | |
| 128 | + | |
| 129 | + jzl=0.0; | |
| 130 | + sh=0.0; | |
| 131 | + yh=0.0; | |
| 132 | + for (int j = 0; j < listYlb.size(); j++) { | |
| 133 | + Ylb y=listYlb.get(j); | |
| 134 | + if(w.getNbbm().equals(y.getNbbm()) && w.getJgh().equals(y.getJsy())){ | |
| 135 | + jzl=Arith.add(jzl, y.getJzl()); | |
| 136 | + sh=Arith.add(sh, y.getSh()); | |
| 137 | + yh=Arith.add(yh, y.getYh()); | |
| 138 | + } | |
| 139 | + } | |
| 140 | + | |
| 141 | + for (int j = 0; j < listDlb.size(); j++) { | |
| 142 | + Dlb d=listDlb.get(j); | |
| 143 | + if(w.getNbbm().equals(d.getNbbm()) && w.getJgh().equals(d.getJsy())){ | |
| 144 | + jzl=Arith.add(jzl, d.getCdl()); | |
| 145 | + sh=Arith.add(sh, d.getSh()); | |
| 146 | + yh=Arith.add(yh, d.getHd()); | |
| 147 | + } | |
| 148 | + } | |
| 149 | + w.setJzl(String.valueOf(jzl)); | |
| 150 | + w.setYh(String.valueOf(yh)); | |
| 151 | + w.setSh(String.valueOf(sh)); | |
| 152 | + | |
| 153 | + } | |
| 154 | + | |
| 155 | + Waybillday way = new Waybillday(); | |
| 156 | + way.setNbbm("汇总合计"); | |
| 157 | + BigDecimal ksgl = new BigDecimal("0.0"); | |
| 158 | + BigDecimal jzl_ = new BigDecimal("0.0"); | |
| 159 | + BigDecimal sh_ = new BigDecimal("0.0"); | |
| 160 | + BigDecimal lc_ = new BigDecimal("0.0"); | |
| 161 | + BigDecimal yh_ = new BigDecimal("0.0"); | |
| 162 | + for(Waybillday w : list){ | |
| 163 | + if(w.getJzl1() != null && w.getJzl1().trim().length() != 0){ | |
| 164 | + ksgl = ksgl.add(new BigDecimal(w.getJzl1().trim())); | |
| 165 | + } | |
| 166 | + if(w.getJzl() != null && w.getJzl().trim().length() != 0){ | |
| 167 | + jzl_ = jzl_.add(new BigDecimal(w.getJzl().trim())); | |
| 168 | + } | |
| 169 | + if(w.getSh() != null && w.getSh().trim().length() != 0){ | |
| 170 | + sh_ = sh_.add(new BigDecimal(w.getSh().trim())); | |
| 171 | + } | |
| 172 | + if(w.getZlc() != null && w.getZlc().trim().length() != 0){ | |
| 173 | + lc_ = lc_.add(new BigDecimal(w.getZlc().trim())); | |
| 174 | + } | |
| 175 | + if(w.getYh() != null && w.getYh().trim().length() != 0){ | |
| 176 | + yh_ = yh_.add(new BigDecimal(w.getYh().trim())); | |
| 177 | + } | |
| 178 | + } | |
| 179 | + way.setJzl1(ksgl.toString()); | |
| 180 | + way.setJzl(jzl_.toString()); | |
| 181 | + way.setjName(""); | |
| 182 | + way.setSh(sh_.toString()); | |
| 183 | + way.setZlc(lc_.toString()); | |
| 184 | + way.setYh(yh_.toString()); | |
| 185 | + if(list.size() > 0) | |
| 186 | + list.add(way); | |
| 187 | + | |
| 188 | + return list; | |
| 189 | + } | |
| 190 | + | |
| 191 | + // 线路客流量报表 | |
| 192 | + @Override | |
| 193 | + public List<Linepasswengerflow> linepasswengerflow(Map<String, Object> map) { | |
| 194 | + String sql = " SELECT r.schedule_date,s.station_name,l.name,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name" | |
| 195 | + + " from bsth_c_stationroute s " | |
| 196 | + + " LEFT JOIN bsth_c_line l on s.line_code=l.line_code " | |
| 197 | + + " LEFT JOIN bsth_c_s_sp_info_real r on r.xl_bm=l.line_code" | |
| 198 | + + " where 1=1 "; | |
| 199 | + if(map.get("date").toString()!=""){ | |
| 200 | + sql+="and r.schedule_date_str='"+map.get("date").toString() + "'"; | |
| 201 | + } | |
| 202 | + if( map.get("line").toString()!=""){ | |
| 203 | + sql+=" and l.line_code=" + map.get("line").toString(); | |
| 204 | + } | |
| 205 | + sql+= " AND r.gs_bm is not null"; | |
| 206 | + if(map.get("gsdmLine") != null && map.get("gsdmLine").toString()!=""){ | |
| 207 | + sql+=" and r.gs_bm='"+map.get("gsdmLine").toString()+"' "; | |
| 208 | + } | |
| 209 | + if(map.get("fgsdmLine") != null && map.get("fgsdmLine").toString()!=""){ | |
| 210 | + sql+=" and r.fgs_bm='"+map.get("fgsdmLine").toString()+"' "; | |
| 211 | + } | |
| 212 | + sql += " GROUP BY s.station_name,l.name,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "; | |
| 213 | + List<Linepasswengerflow> list = jdbcTemplate.query(sql, new RowMapper<Linepasswengerflow>() { | |
| 214 | + | |
| 215 | + @Override | |
| 216 | + public Linepasswengerflow mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 217 | + Linepasswengerflow lin = new Linepasswengerflow(); | |
| 218 | + lin.setStationName(arg0.getString("station_name")); | |
| 219 | + | |
| 220 | + return lin; | |
| 221 | + } | |
| 222 | + }); | |
| 223 | + | |
| 224 | + return list; | |
| 225 | + } | |
| 226 | + | |
| 227 | + // 班次车辆人员月统计 | |
| 228 | + String startDate; | |
| 229 | + String endDate; | |
| 230 | + | |
| 231 | + @Override | |
| 232 | + public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map) { | |
| 233 | + final String empnames=map.get("empnames").toString(); | |
| 234 | + String gsdmManth=""; | |
| 235 | + String fgsdmManth=""; | |
| 236 | + if(map.get("gsdmManth") != null){ | |
| 237 | + gsdmManth=map.get("gsdmManth").toString(); | |
| 238 | + } | |
| 239 | + if(map.get("fgsdmManth") != null){ | |
| 240 | + fgsdmManth=map.get("fgsdmManth").toString(); | |
| 241 | + } | |
| 242 | + String sql ="select "; | |
| 243 | + if(empnames.equals("驾驶员")){ | |
| 244 | + sql += " r.j_gh "; | |
| 245 | + }else if(empnames.equals("售票员")){ | |
| 246 | + sql += " r.s_gh "; | |
| 247 | + }else{ | |
| 248 | + sql += " r.cl_zbh "; | |
| 249 | + } | |
| 250 | + sql += " from bsth_c_s_sp_info_real r where " | |
| 251 | + + " r.schedule_date_str >= '" + map.get("startDate").toString() + "' " | |
| 252 | + + " and r.schedule_date_str <='" + map.get("endDate").toString() + "' "; | |
| 253 | + if(map.get("line")!=null&&!map.get("line").equals("")){ | |
| 254 | + sql+=" and r.xl_bm='"+ map.get("line").toString() + "' "; | |
| 255 | + } | |
| 256 | + sql+=" and r.gs_bm like'%"+gsdmManth+"%' and r.fgs_bm like'%"+fgsdmManth+"%'"; | |
| 257 | + | |
| 258 | + if(empnames.equals("驾驶员")){ | |
| 259 | + sql += " GROUP BY " | |
| 260 | + + " r.j_gh "; | |
| 261 | + }else if(empnames.equals("售票员")){ | |
| 262 | + sql+="and r.s_gh is not null AND r.s_gh !='' GROUP BY r.s_gh"; | |
| 263 | + }else{ | |
| 264 | + sql += " GROUP BY r.cl_zbh"; | |
| 265 | + } | |
| 266 | + | |
| 267 | + List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() { | |
| 268 | + | |
| 269 | + @Override | |
| 270 | + public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 271 | + Shiftuehiclemanth shif = new Shiftuehiclemanth(); | |
| 272 | + if(empnames.equals("驾驶员")){ | |
| 273 | +// shif.setjName(arg0.getString("j_name")+"/"+arg0.getString("j_gh")); | |
| 274 | + shif.setJgh(arg0.getString("j_gh")); | |
| 275 | + }else if(empnames.equals("售票员")){ | |
| 276 | +// shif.setjName(arg0.getString("s_name")+"/"+arg0.getString("s_gh")); | |
| 277 | + shif.setSgh(arg0.getString("s_gh")==null ? "":arg0.getString("s_gh")); | |
| 278 | + }else if(empnames.equals("车辆自编号")){ | |
| 279 | + shif.setjName(arg0.getString("cl_zbh")); | |
| 280 | + } | |
| 281 | + return shif; | |
| 282 | + } | |
| 283 | + }); | |
| 284 | + | |
| 285 | + List<ScheduleRealInfo> sList; | |
| 286 | + List<ScheduleRealInfo> list_s; | |
| 287 | + List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineYbb(map.get("line").toString(), map.get("startDate").toString(), map.get("endDate").toString()); | |
| 288 | + for(int i=0;i<list.size();i++){ | |
| 289 | + sList =new ArrayList<ScheduleRealInfo>(); | |
| 290 | + list_s =new ArrayList<ScheduleRealInfo>(); | |
| 291 | + Shiftuehiclemanth d=list.get(i); | |
| 292 | + for (int j = 0; j < lists.size(); j++) { | |
| 293 | + ScheduleRealInfo s=lists.get(j); | |
| 294 | +// if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){ | |
| 295 | +// sList.add(s); | |
| 296 | +// } | |
| 297 | + if(empnames.equals("驾驶员")){ | |
| 298 | + if(d.getJgh().equals(s.getjGh())){ | |
| 299 | + sList.add(s); | |
| 300 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 301 | + if(cts != null && cts.size() > 0){ | |
| 302 | + list_s.add(s); | |
| 303 | + }else{ | |
| 304 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 305 | + list_s.add(s); | |
| 306 | + } | |
| 307 | + } | |
| 308 | + | |
| 309 | + if((d.getjName() == null || d.getjName().trim().length() == 0) | |
| 310 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 311 | + d.setjName(s.getjName() + "/" + d.getJgh()); | |
| 312 | + } | |
| 313 | + } | |
| 314 | + }else if(empnames.equals("售票员")){ | |
| 315 | + String sgh=s.getsGh()==null?"":s.getsGh(); | |
| 316 | + if(d.getSgh().equals(sgh)){ | |
| 317 | + sList.add(s); | |
| 318 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 319 | + if(cts != null && cts.size() > 0){ | |
| 320 | + list_s.add(s); | |
| 321 | + }else{ | |
| 322 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 323 | + list_s.add(s); | |
| 324 | + } | |
| 325 | + } | |
| 326 | + | |
| 327 | + if((d.getjName() == null || d.getjName().trim().length() == 0) | |
| 328 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 329 | + d.setjName(s.getsName() + "/" + d.getSgh()); | |
| 330 | + } | |
| 331 | + } | |
| 332 | + }else if(empnames.equals("车辆自编号")){ | |
| 333 | + if(d.getjName().equals(s.getClZbh())){ | |
| 334 | + sList.add(s); | |
| 335 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 336 | + if(cts != null && cts.size() > 0){ | |
| 337 | + list_s.add(s); | |
| 338 | + }else{ | |
| 339 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 340 | + list_s.add(s); | |
| 341 | + } | |
| 342 | + } | |
| 343 | + } | |
| 344 | + } | |
| 345 | + | |
| 346 | + } | |
| 347 | + | |
| 348 | + double ksgl=culateMileageService.culateKsgl(list_s); | |
| 349 | + double jccgl=culateMileageService.culateJccgl(list_s); | |
| 350 | + double zksgl=Arith.add(ksgl, jccgl); | |
| 351 | + double ljgl=culateMileageService.culateLjgl(list_s); | |
| 352 | + double sjgl=culateMileageService.culateSjgl(list_s); | |
| 353 | + double zyygl=Arith.add(ljgl, sjgl); | |
| 354 | + int cjbc=culateMileageService.culateLbbc(sList); | |
| 355 | + int ljbc=culateMileageService.culateLjbc(list_s,""); | |
| 356 | + int sjbc=culateMileageService.culateSjbc(list_s, ""); | |
| 357 | + double cjgl=culateMileageService.culateLbgl(sList); | |
| 358 | +// double zjgl=culateMileageService.culateLjgl(list_s); | |
| 359 | + d.setEmptMileage(String.valueOf(zksgl));//空驶公里 | |
| 360 | + d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 | |
| 361 | + d.setSjbc(String.valueOf(sjbc+ljbc)); | |
| 362 | + d.setJhlc(String.valueOf(zyygl));//运营里程 | |
| 363 | + d.setCjbc(String.valueOf(cjbc));//抽检班次 | |
| 364 | + d.setLjbc(String.valueOf(ljbc));//增加班次 | |
| 365 | + d.setRemMileage(String.valueOf(cjgl));//抽检里程 | |
| 366 | + d.setAddMileage(String.valueOf(ljgl));//增加里程 | |
| 367 | + | |
| 368 | + } | |
| 369 | + | |
| 370 | + Shiftuehiclemanth shif = new Shiftuehiclemanth(); | |
| 371 | + shif.setjName("汇总合计"); | |
| 372 | + BigDecimal yylc = new BigDecimal("0.0"); | |
| 373 | + BigDecimal kslc = new BigDecimal("0.0"); | |
| 374 | + BigDecimal cjlc = new BigDecimal("0.0"); | |
| 375 | + BigDecimal zjlc = new BigDecimal("0.0"); | |
| 376 | + BigDecimal zlc = new BigDecimal("0.0"); | |
| 377 | + int cjbc = 0, zjbc = 0, sjbc = 0; | |
| 378 | + for(Shiftuehiclemanth s : list){ | |
| 379 | + yylc = yylc.add(new BigDecimal(s.getJhlc())); | |
| 380 | + kslc = kslc.add(new BigDecimal(s.getEmptMileage())); | |
| 381 | + cjlc = cjlc.add(new BigDecimal(s.getRemMileage())); | |
| 382 | + zjlc = zjlc.add(new BigDecimal(s.getAddMileage())); | |
| 383 | + zlc = zlc.add(new BigDecimal(s.getTotalm())); | |
| 384 | + cjbc += Integer.valueOf(s.getCjbc()); | |
| 385 | + zjbc += Integer.valueOf(s.getLjbc()); | |
| 386 | + sjbc += Integer.valueOf(s.getSjbc()); | |
| 387 | + } | |
| 388 | + shif.setJhlc(yylc.toString()); | |
| 389 | + shif.setEmptMileage(kslc.toString()); | |
| 390 | + shif.setRemMileage(cjlc.toString()); | |
| 391 | + shif.setAddMileage(zjlc.toString()); | |
| 392 | + shif.setTotalm(zlc.toString()); | |
| 393 | + shif.setCjbc("" + cjbc); | |
| 394 | + shif.setLjbc("" + zjbc); | |
| 395 | + shif.setSjbc("" + sjbc); | |
| 396 | + if(list.size() > 0) | |
| 397 | + list.add(shif); | |
| 398 | + | |
| 399 | + return list; | |
| 400 | + } | |
| 401 | + | |
| 402 | + | |
| 403 | + @Override | |
| 404 | + public List<Shiftuehiclemanth> shiftuehiclemanth2(Map<String, Object> map) { | |
| 405 | + final String empnames=map.get("empnames").toString(); | |
| 406 | + String gsdmManth=""; | |
| 407 | + String fgsdmManth=""; | |
| 408 | + if(map.get("gsdmManth") != null){ | |
| 409 | + gsdmManth=map.get("gsdmManth").toString(); | |
| 410 | + } | |
| 411 | + if(map.get("fgsdmManth") != null){ | |
| 412 | + fgsdmManth=map.get("fgsdmManth").toString(); | |
| 413 | + } | |
| 414 | + String sql ="select "; | |
| 415 | + if(empnames.equals("驾驶员")){ | |
| 416 | + sql += " r.j_gh "; | |
| 417 | + }else if(empnames.equals("售票员")){ | |
| 418 | + sql += " r.s_gh "; | |
| 419 | + }else{ | |
| 420 | + sql += " r.cl_zbh "; | |
| 421 | + } | |
| 422 | + sql += " from bsth_c_s_sp_info_real r where " | |
| 423 | + + " r.schedule_date_str >= '" + map.get("startDate").toString() + "' " | |
| 424 | + + " and r.schedule_date_str <='" + map.get("endDate").toString() + "' "; | |
| 425 | + if(map.get("line")!=null&&!map.get("line").equals("")){ | |
| 426 | + sql+=" and r.xl_bm='"+ map.get("line").toString() + "' "; | |
| 427 | + } | |
| 428 | + sql+=" and r.gs_bm like'%"+gsdmManth+"%' and r.fgs_bm like'%"+fgsdmManth+"%'"; | |
| 429 | + | |
| 430 | + if(empnames.equals("驾驶员")){ | |
| 431 | + sql += " GROUP BY " | |
| 432 | + + " r.j_gh "; | |
| 433 | + }else if(empnames.equals("售票员")){ | |
| 434 | + sql+="and r.s_gh is not null AND r.s_gh !='' GROUP BY r.s_gh"; | |
| 435 | + }else{ | |
| 436 | + sql += " GROUP BY r.cl_zbh"; | |
| 437 | + } | |
| 438 | + | |
| 439 | + List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() { | |
| 440 | + | |
| 441 | + @Override | |
| 442 | + public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 443 | + Shiftuehiclemanth shif = new Shiftuehiclemanth(); | |
| 444 | + if(empnames.equals("驾驶员")){ | |
| 445 | +// shif.setjName(arg0.getString("j_name")+"/"+arg0.getString("j_gh")); | |
| 446 | + shif.setJgh(arg0.getString("j_gh")); | |
| 447 | + }else if(empnames.equals("售票员")){ | |
| 448 | +// shif.setjName(arg0.getString("s_name")+"/"+arg0.getString("s_gh")); | |
| 449 | + shif.setSgh(arg0.getString("s_gh")==null ? "":arg0.getString("s_gh")); | |
| 450 | + }else if(empnames.equals("车辆自编号")){ | |
| 451 | + shif.setjName(arg0.getString("cl_zbh")); | |
| 452 | + } | |
| 453 | + return shif; | |
| 454 | + } | |
| 455 | + }); | |
| 456 | + | |
| 457 | + List<ScheduleRealInfo> sList; | |
| 458 | + List<ScheduleRealInfo> list_s; | |
| 459 | + List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineYbb(map.get("line").toString(), map.get("startDate").toString(), map.get("endDate").toString()); | |
| 460 | + for(int i=0;i<list.size();i++){ | |
| 461 | + sList =new ArrayList<ScheduleRealInfo>(); | |
| 462 | + list_s =new ArrayList<ScheduleRealInfo>(); | |
| 463 | + Shiftuehiclemanth d=list.get(i); | |
| 464 | + for (int j = 0; j < lists.size(); j++) { | |
| 465 | + ScheduleRealInfo s=lists.get(j); | |
| 466 | +// if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){ | |
| 467 | +// sList.add(s); | |
| 468 | +// } | |
| 469 | + if(empnames.equals("驾驶员")){ | |
| 470 | + if(d.getJgh().equals(s.getjGh())){ | |
| 471 | + sList.add(s); | |
| 472 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 473 | + if(cts != null && cts.size() > 0){ | |
| 474 | + list_s.add(s); | |
| 475 | + }else{ | |
| 476 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 477 | + list_s.add(s); | |
| 478 | + } | |
| 479 | + } | |
| 480 | + | |
| 481 | + if((d.getjName() == null || d.getjName().trim().length() == 0) | |
| 482 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 483 | + d.setjName(s.getjName() + "/" + d.getJgh()); | |
| 484 | + } | |
| 485 | + } | |
| 486 | + }else if(empnames.equals("售票员")){ | |
| 487 | + String sgh=s.getsGh()==null?"":s.getsGh(); | |
| 488 | + if(d.getSgh().equals(sgh)){ | |
| 489 | + sList.add(s); | |
| 490 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 491 | + if(cts != null && cts.size() > 0){ | |
| 492 | + list_s.add(s); | |
| 493 | + }else{ | |
| 494 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 495 | + list_s.add(s); | |
| 496 | + } | |
| 497 | + } | |
| 498 | + | |
| 499 | + if((d.getjName() == null || d.getjName().trim().length() == 0) | |
| 500 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 501 | + d.setjName(s.getsName() + "/" + d.getSgh()); | |
| 502 | + } | |
| 503 | + } | |
| 504 | + }else if(empnames.equals("车辆自编号")){ | |
| 505 | + if(d.getjName().equals(s.getClZbh())){ | |
| 506 | + sList.add(s); | |
| 507 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 508 | + if(cts != null && cts.size() > 0){ | |
| 509 | + list_s.add(s); | |
| 510 | + }else{ | |
| 511 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 512 | + list_s.add(s); | |
| 513 | + } | |
| 514 | + } | |
| 515 | + } | |
| 516 | + } | |
| 517 | + | |
| 518 | + } | |
| 519 | + | |
| 520 | + if(empnames.equals("售票员")){ | |
| 521 | + double zksgl=culateMileageService.culateSjfyylc_spy(list_s); | |
| 522 | + double ljgl=culateMileageService.culateLjgl_spy(list_s); | |
| 523 | + double sjgl=culateMileageService.culateSjgl_spy(list_s); | |
| 524 | + double zyygl=Arith.add(ljgl, sjgl); | |
| 525 | + int cjbc=culateMileageService.culateLbbc(sList); | |
| 526 | + int ljbc=culateMileageService.culateLjbc(list_s,""); | |
| 527 | + int sjbc=culateMileageService.culateSjbc(list_s, ""); | |
| 528 | + double cjgl=culateMileageService.culateLbgl(sList); | |
| 529 | +// double zjgl=culateMileageService.culateLjgl(list_s); | |
| 530 | + d.setEmptMileage(String.valueOf(zksgl));//空驶公里 | |
| 531 | + d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 | |
| 532 | + d.setSjbc(String.valueOf(sjbc+ljbc)); | |
| 533 | + d.setJhlc(String.valueOf(zyygl));//运营里程 | |
| 534 | + d.setCjbc(String.valueOf(cjbc));//抽检班次 | |
| 535 | + d.setLjbc(String.valueOf(ljbc));//增加班次 | |
| 536 | + d.setRemMileage(String.valueOf(cjgl));//抽检里程 | |
| 537 | + d.setAddMileage(String.valueOf(ljgl));//增加里程 | |
| 538 | + }else{ | |
| 539 | + double ksgl=culateMileageService.culateKsgl(list_s); | |
| 540 | + double jccgl=culateMileageService.culateJccgl(list_s); | |
| 541 | + double zksgl=Arith.add(ksgl, jccgl); | |
| 542 | + double ljgl=culateMileageService.culateLjgl(list_s); | |
| 543 | + double sjgl=culateMileageService.culateSjgl(list_s); | |
| 544 | + double zyygl=Arith.add(ljgl, sjgl); | |
| 545 | + int cjbc=culateMileageService.culateLbbc(sList); | |
| 546 | + int ljbc=culateMileageService.culateLjbc(list_s,""); | |
| 547 | + int sjbc=culateMileageService.culateSjbc(list_s, ""); | |
| 548 | + double cjgl=culateMileageService.culateLbgl(sList); | |
| 549 | +// double zjgl=culateMileageService.culateLjgl(list_s); | |
| 550 | + d.setEmptMileage(String.valueOf(zksgl));//空驶公里 | |
| 551 | + d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 | |
| 552 | + d.setSjbc(String.valueOf(sjbc+ljbc)); | |
| 553 | + d.setJhlc(String.valueOf(zyygl));//运营里程 | |
| 554 | + d.setCjbc(String.valueOf(cjbc));//抽检班次 | |
| 555 | + d.setLjbc(String.valueOf(ljbc));//增加班次 | |
| 556 | + d.setRemMileage(String.valueOf(cjgl));//抽检里程 | |
| 557 | + d.setAddMileage(String.valueOf(ljgl));//增加里程 | |
| 558 | + } | |
| 559 | + } | |
| 560 | + | |
| 561 | + Shiftuehiclemanth shif = new Shiftuehiclemanth(); | |
| 562 | + shif.setjName("汇总合计"); | |
| 563 | + BigDecimal yylc = new BigDecimal("0.0"); | |
| 564 | + BigDecimal kslc = new BigDecimal("0.0"); | |
| 565 | + BigDecimal cjlc = new BigDecimal("0.0"); | |
| 566 | + BigDecimal zjlc = new BigDecimal("0.0"); | |
| 567 | + BigDecimal zlc = new BigDecimal("0.0"); | |
| 568 | + int cjbc = 0, zjbc = 0, sjbc = 0; | |
| 569 | + for(Shiftuehiclemanth s : list){ | |
| 570 | + yylc = yylc.add(new BigDecimal(s.getJhlc())); | |
| 571 | + kslc = kslc.add(new BigDecimal(s.getEmptMileage())); | |
| 572 | + cjlc = cjlc.add(new BigDecimal(s.getRemMileage())); | |
| 573 | + zjlc = zjlc.add(new BigDecimal(s.getAddMileage())); | |
| 574 | + zlc = zlc.add(new BigDecimal(s.getTotalm())); | |
| 575 | + cjbc += Integer.valueOf(s.getCjbc()); | |
| 576 | + zjbc += Integer.valueOf(s.getLjbc()); | |
| 577 | + sjbc += Integer.valueOf(s.getSjbc()); | |
| 578 | + } | |
| 579 | + shif.setJhlc(yylc.toString()); | |
| 580 | + shif.setEmptMileage(kslc.toString()); | |
| 581 | + shif.setRemMileage(cjlc.toString()); | |
| 582 | + shif.setAddMileage(zjlc.toString()); | |
| 583 | + shif.setTotalm(zlc.toString()); | |
| 584 | + shif.setCjbc("" + cjbc); | |
| 585 | + shif.setLjbc("" + zjbc); | |
| 586 | + shif.setSjbc("" + sjbc); | |
| 587 | + if(list.size() > 0) | |
| 588 | + list.add(shif); | |
| 589 | + | |
| 590 | + return list; | |
| 591 | + } | |
| 592 | + | |
| 593 | + // 班次车辆人员日统计 | |
| 594 | + @Override | |
| 595 | + public List<Shifday> shifday(Map<String, Object> map) { | |
| 596 | + | |
| 597 | + String line=""; | |
| 598 | + String date=""; | |
| 599 | + String gsdmShif=""; | |
| 600 | + String fgsdmShif=""; | |
| 601 | + if(map.get("line")!=null&&!map.get("line").equals("")){ | |
| 602 | + line =map.get("line").toString(); | |
| 603 | + } | |
| 604 | + if(map.get("date")!=null&&!map.get("date").equals("")){ | |
| 605 | + date =map.get("date").toString(); | |
| 606 | + } | |
| 607 | + if(map.get("gsdmShif")!=null&&!map.get("gsdmShif").equals("")){ | |
| 608 | + gsdmShif =map.get("gsdmShif").toString(); | |
| 609 | + } | |
| 610 | + if(map.get("fgsdmShif")!=null&&!map.get("fgsdmShif").equals("")){ | |
| 611 | + fgsdmShif =map.get("fgsdmShif").toString(); | |
| 612 | + } | |
| 613 | + String statue=""; | |
| 614 | + if(map.get("state") !=null){ | |
| 615 | + statue =map.get("state").toString(); | |
| 616 | + } | |
| 617 | + String type=""; | |
| 618 | + if(map.get("type") !=null){ | |
| 619 | + type =map.get("type").toString(); | |
| 620 | + } | |
| 621 | + String sql_ =""; | |
| 622 | + if(!type.equals("") && !statue.equals("")){ | |
| 623 | + sql_ +=" order by "+statue+" "+type; | |
| 624 | + } | |
| 625 | + String sql ="select t.* from (select r.schedule_date," | |
| 626 | + + " IFNULL(r.s_gh,'')as s_gh,r.cl_zbh," | |
| 627 | + + " r.xl_bm,r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name" | |
| 628 | + + " FROM bsth_c_s_sp_info_real r where 1=1 " | |
| 629 | + + " and r.schedule_date_str='"+date + "' " | |
| 630 | + + " and r.xl_bm = '"+line+"' " | |
| 631 | + + " and r.gs_bm like '%"+gsdmShif+"%' " | |
| 632 | + + " and r.fgs_bm like '%"+fgsdmShif+"%' "+sql_+") t" | |
| 633 | + + " GROUP BY t.schedule_date,t.xl_bm,t.cl_zbh,t.lp_name," | |
| 634 | + + " t.j_gh,t.s_gh,t.gs_bm,t.fgs_bm "; | |
| 635 | + | |
| 636 | + | |
| 637 | + List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() { | |
| 638 | + | |
| 639 | + @Override | |
| 640 | + public Shifday mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 641 | + Shifday shifday = new Shifday(); | |
| 642 | + shifday.setRq(arg0.getString("schedule_date")); | |
| 643 | +// shifday.setjName(arg0.getString("j_name").toString()); | |
| 644 | +// shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString()); | |
| 645 | + shifday.setCarPlate(arg0.getString("cl_zbh").toString()); | |
| 646 | + shifday.setJgh(arg0.getString("j_gh")); | |
| 647 | + shifday.setSgh(arg0.getString("s_gh") == null ? "" : arg0.getString("s_gh").toString()); | |
| 648 | + shifday.setLpName(arg0.getString("lp_name")== null ? "" : arg0.getString("lp_name").toString()); | |
| 649 | + return shifday; | |
| 650 | + } | |
| 651 | + }); | |
| 652 | + | |
| 653 | + List<ScheduleRealInfo> sList; | |
| 654 | + List<ScheduleRealInfo> list_s; | |
| 655 | + List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(map.get("line").toString(), map.get("date").toString()); | |
| 656 | + for(int i=0;i<list.size();i++){ | |
| 657 | + sList =new ArrayList<ScheduleRealInfo>(); | |
| 658 | + list_s =new ArrayList<ScheduleRealInfo>(); | |
| 659 | + Shifday d=list.get(i); | |
| 660 | + for (int j = 0; j < lists.size(); j++) { | |
| 661 | + ScheduleRealInfo s=lists.get(j); | |
| 662 | + if(d.getJgh().equals(s.getjGh()) && d.getSgh().equals(s.getsGh()) | |
| 663 | + && d.getCarPlate().equals(s.getClZbh()) | |
| 664 | + && d.getLpName().equals(s.getLpName())){ | |
| 665 | + sList.add(s); | |
| 666 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 667 | + if(cts != null && cts.size() > 0){ | |
| 668 | + list_s.add(s); | |
| 669 | + }else{ | |
| 670 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 671 | + list_s.add(s); | |
| 672 | + } | |
| 673 | + } | |
| 674 | + } | |
| 675 | + } | |
| 676 | + if(sList.size()>0){ | |
| 677 | + d.setjName(sList.get(0).getjName()); | |
| 678 | + d.setsName(sList.get(0).getsName() == null ? "":sList.get(0).getsName()); | |
| 679 | + } | |
| 680 | + double ksgl=culateMileageService.culateKsgl(list_s); | |
| 681 | + double jccgl=culateMileageService.culateJccgl(list_s); | |
| 682 | + double zksgl=Arith.add(ksgl, jccgl); | |
| 683 | + double ljgl=culateMileageService.culateLjgl(list_s); | |
| 684 | + double sjgl=culateMileageService.culateSjgl(list_s); | |
| 685 | + double zyygl=Arith.add(ljgl, sjgl); | |
| 686 | + double jhyygl=culateMileageService.culateJhgl(sList); | |
| 687 | + double jhjccgl=culateMileageService.culateJhJccgl(sList); | |
| 688 | + double jhzgl=Arith.add(jhyygl, jhjccgl); | |
| 689 | + | |
| 690 | + double cjgl=culateMileageService.culateLbgl(sList); | |
| 691 | + int jhbc=culateMileageService.culateJhbc(sList,""); | |
| 692 | + int cjbc=culateMileageService.culateLbbc(sList); | |
| 693 | + int ljbc=culateMileageService.culateLjbc(list_s,""); | |
| 694 | + int sjbc=culateMileageService.culateSjbc(list_s, ""); | |
| 695 | + double zjgl=culateMileageService.culateLjgl(list_s); | |
| 696 | + d.setEmptMileage(String.valueOf(zksgl));//空驶公里 | |
| 697 | + d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里 | |
| 698 | + d.setSjbc(String.valueOf(sjbc+ljbc)); | |
| 699 | + d.setJhlc(String.valueOf(jhzgl));//计划里程 | |
| 700 | + d.setYygl(String.valueOf(zyygl));//运营公里 | |
| 701 | + d.setSjjhlc(String.valueOf(jhyygl));//实际计划里程 | |
| 702 | + d.setRemMileage(String.valueOf(cjgl));//抽减里程 | |
| 703 | + d.setJhbc(String.valueOf(jhbc));//计划班次 | |
| 704 | + d.setCjbc(String.valueOf(cjbc));//抽检班次 | |
| 705 | + d.setLjbc(String.valueOf(ljbc));//增加班次 | |
| 706 | + d.setAddMileage(String.valueOf(zjgl));//增加公里 | |
| 707 | + d.setSjjhbc(String.valueOf(sjbc));//实际计划班次 | |
| 708 | + } | |
| 709 | + | |
| 710 | + Shifday shif = new Shifday(); | |
| 711 | + shif.setjName("汇总合计"); | |
| 712 | + BigDecimal jhlc = new BigDecimal("0.0"); | |
| 713 | + BigDecimal sjlc = new BigDecimal("0.0"); | |
| 714 | + BigDecimal yylc = new BigDecimal("0.0"); | |
| 715 | + BigDecimal kslc = new BigDecimal("0.0"); | |
| 716 | + BigDecimal cjlc = new BigDecimal("0.0"); | |
| 717 | + BigDecimal zjlc = new BigDecimal("0.0"); | |
| 718 | + BigDecimal zlc = new BigDecimal("0.0"); | |
| 719 | + int jhbc = 0, sjjhbc = 0, cjbc = 0, zjbc = 0, sjbc = 0; | |
| 720 | + for(Shifday s : list){ | |
| 721 | + jhlc = jhlc.add(new BigDecimal(s.getJhlc())); | |
| 722 | + sjlc = sjlc.add(new BigDecimal(s.getSjjhlc())); | |
| 723 | + yylc = yylc.add(new BigDecimal(s.getYygl())); | |
| 724 | + kslc = kslc.add(new BigDecimal(s.getEmptMileage())); | |
| 725 | + cjlc = cjlc.add(new BigDecimal(s.getRemMileage())); | |
| 726 | + zjlc = zjlc.add(new BigDecimal(s.getAddMileage())); | |
| 727 | + zlc = zlc.add(new BigDecimal(s.getTotalm())); | |
| 728 | + jhbc += Integer.valueOf(s.getJhbc()); | |
| 729 | + sjjhbc += Integer.valueOf(s.getSjjhbc()); | |
| 730 | + cjbc += Integer.valueOf(s.getCjbc()); | |
| 731 | + zjbc += Integer.valueOf(s.getLjbc()); | |
| 732 | + sjbc += Integer.valueOf(s.getSjbc()); | |
| 733 | + } | |
| 734 | + shif.setJhlc(jhlc.toString()); | |
| 735 | + shif.setSjjhlc(sjlc.toString()); | |
| 736 | + shif.setYygl(yylc.toString()); | |
| 737 | + shif.setEmptMileage(kslc.toString()); | |
| 738 | + shif.setRemMileage(cjlc.toString()); | |
| 739 | + shif.setAddMileage(zjlc.toString()); | |
| 740 | + shif.setTotalm(zlc.toString()); | |
| 741 | + shif.setJhbc("" + jhbc); | |
| 742 | + shif.setSjjhbc("" + sjjhbc); | |
| 743 | + shif.setCjbc("" + cjbc); | |
| 744 | + shif.setLjbc("" + zjbc); | |
| 745 | + shif.setSjbc("" + sjbc); | |
| 746 | + if(list.size() > 0) | |
| 747 | + list.add(shif); | |
| 748 | + | |
| 749 | + return list; | |
| 750 | + } | |
| 751 | + | |
| 752 | + // 换人换车情况日统计 | |
| 753 | + String rq; | |
| 754 | + | |
| 755 | + @Override | |
| 756 | + public List<Changetochange> changetochange(Map<String, Object> map) { | |
| 757 | + | |
| 758 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 759 | + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日"); | |
| 760 | + Date d = null; | |
| 761 | + Date d1 = null; | |
| 762 | + try { | |
| 763 | + d = sdf.parse(map.get("startDate").toString()); | |
| 764 | + d1 = sdf.parse(map.get("endDate").toString()); | |
| 765 | + } catch (ParseException e) { | |
| 766 | + | |
| 767 | + e.printStackTrace(); | |
| 768 | + } | |
| 769 | + String rq2 = sdf1.format(d); | |
| 770 | + String rq3 = sdf1.format(d1); | |
| 771 | + | |
| 772 | + rq = rq2 + "-" + rq3; | |
| 773 | + | |
| 774 | + String sfyy=""; | |
| 775 | + if(map.get("sfyy")!=null){ | |
| 776 | + sfyy=map.get("sfyy").toString(); | |
| 777 | + } | |
| 778 | + String line=""; | |
| 779 | + if(map.get("line")!=null){ | |
| 780 | + line=map.get("line").toString().trim(); | |
| 781 | + } | |
| 782 | + String gs=""; | |
| 783 | + if(map.get("gsdm")!=null){ | |
| 784 | + gs=map.get("gsdm").toString(); | |
| 785 | + } | |
| 786 | + String fgs=""; | |
| 787 | + if(map.get("fgsdm")!=null){ | |
| 788 | + fgs =map.get("fgsdm").toString(); | |
| 789 | + } | |
| 790 | + | |
| 791 | + String sql="select * from bsth_c_chtoch where rq BETWEEN '"+ map.get("startDate").toString()+"' " | |
| 792 | + + " and '"+map.get("endDate").toString() +"'"; | |
| 793 | + | |
| 794 | + if(!line.equals("")){ | |
| 795 | + sql +=" and xl= '"+line+"'"; | |
| 796 | + } | |
| 797 | + if(!gs.equals("")){ | |
| 798 | + sql += " and gs= '"+gs+"'"; | |
| 799 | + } | |
| 800 | + if(!fgs.equals("")){ | |
| 801 | + sql += " and fgs= '"+fgs+"'"; | |
| 802 | + } | |
| 803 | + | |
| 804 | + sql +=" order by rq"; | |
| 805 | + List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() { | |
| 806 | + @Override | |
| 807 | + public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 808 | + Changetochange chan = new Changetochange(); | |
| 809 | + chan.setRq(arg0.getString("rq")); | |
| 810 | + chan.setGs(BasicData.businessCodeNameMap.get(arg0.getString("gs"))); | |
| 811 | + chan.setFgs(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs")+"_"+arg0.getString("gs"))); | |
| 812 | + chan.setXl(arg0.getString("xl")); | |
| 813 | + chan.setLp(arg0.getString("lp")); | |
| 814 | + chan.setFssj(arg0.getString("fssj")); | |
| 815 | + chan.setXgsj(arg0.getString("xgsj")); | |
| 816 | + chan.setPcch(arg0.getString("pcch")); | |
| 817 | + chan.setPcry(arg0.getString("pcry")); | |
| 818 | + chan.setJhch(arg0.getString("jhch")); | |
| 819 | + chan.setJhgh(arg0.getString("jhgh")); | |
| 820 | + chan.setSjch(arg0.getString("sjch")); | |
| 821 | + chan.setSjgh(arg0.getString("sjgh")); | |
| 822 | + chan.setYy(arg0.getString("yy")); | |
| 823 | + chan.setXgr(arg0.getString("xgr")); | |
| 824 | + return chan; | |
| 825 | + } | |
| 826 | + }); | |
| 827 | + | |
| 828 | + Map<String, Boolean> lineNature = lineService.lineNature(); | |
| 829 | + List<Changetochange> resList = new ArrayList<Changetochange>(); | |
| 830 | + | |
| 831 | + for(Changetochange c : list){ | |
| 832 | + String xl = c.getXl(); | |
| 833 | + if(sfyy.length() != 0){ | |
| 834 | + if(sfyy.equals("0")){ | |
| 835 | + resList.add(c); | |
| 836 | + } else if(sfyy.equals("1")){ | |
| 837 | + if(lineNature.containsKey(xl) && lineNature.get(xl)){ | |
| 838 | + resList.add(c); | |
| 839 | + } | |
| 840 | + } else { | |
| 841 | + if(lineNature.containsKey(xl) && !lineNature.get(xl)){ | |
| 842 | + resList.add(c); | |
| 843 | + } | |
| 844 | + } | |
| 845 | + } else { | |
| 846 | + resList.add(c); | |
| 847 | + } | |
| 848 | + | |
| 849 | + c.setXl(BasicData.lineCode2NameMap.get(xl)); | |
| 850 | + } | |
| 851 | + | |
| 852 | + return resList; | |
| 853 | + } | |
| 854 | + | |
| 855 | + | |
| 856 | + // 路单数据 | |
| 857 | + @Override | |
| 858 | + public List<Singledata> singledatatj(Map<String, Object> map) { | |
| 859 | + String sfyy=""; | |
| 860 | + if(map.get("sfyy")!=null){ | |
| 861 | + sfyy=map.get("sfyy").toString(); | |
| 862 | + } | |
| 863 | + String gsdm=""; | |
| 864 | + if(map.get("gsdmSing")!=null){ | |
| 865 | + gsdm=map.get("gsdmSing").toString(); | |
| 866 | + } | |
| 867 | + String fgsdm=""; | |
| 868 | + if(map.get("fgsdmSing")!=null){ | |
| 869 | + fgsdm=map.get("fgsdmSing").toString(); | |
| 870 | + } | |
| 871 | + | |
| 872 | + String tjtype=map.get("tjtype").toString(); | |
| 873 | + String xlbm=map.get("line").toString().trim(); | |
| 874 | + startDate = map.get("startDate").toString(); | |
| 875 | + | |
| 876 | + List<ScheduleRealInfo> listReal=new ArrayList<ScheduleRealInfo>(); | |
| 877 | + if(xlbm.equals("")){ | |
| 878 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineByGs_(gsdm, fgsdm, startDate); | |
| 879 | + }else{ | |
| 880 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineQp(xlbm, startDate); | |
| 881 | + } | |
| 882 | + List<Singledata> list=new ArrayList<Singledata>(); | |
| 883 | + List<Singledata> list_=new ArrayList<Singledata>(); | |
| 884 | + if(tjtype.equals("jsy")){ | |
| 885 | + //油统计 | |
| 886 | + String sql="select r.j_gh, r.xl_bm,r.cl_zbh,r.fgs_bm" | |
| 887 | + + " from bsth_c_s_sp_info_real r where " | |
| 888 | + + " r.schedule_date_str = '"+startDate+"'"; | |
| 889 | + if(xlbm.length() != 0){ | |
| 890 | + sql += " and r.xl_bm = '"+xlbm+"'"; | |
| 891 | + } | |
| 892 | + if(gsdm.length() != 0){ | |
| 893 | + sql += " and r.gs_bm ='"+gsdm+"'"; | |
| 894 | + } | |
| 895 | + if(fgsdm.length() != 0){ | |
| 896 | + sql += " and r.fgs_bm ='"+fgsdm+"'"; | |
| 897 | + } | |
| 898 | + sql += " group by r.fgs_bm,r.j_gh,r.xl_bm,r.cl_zbh " + | |
| 899 | + "order by r.xl_bm,r.cl_zbh"; | |
| 900 | + | |
| 901 | + | |
| 902 | + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | |
| 903 | + @Override | |
| 904 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 905 | + Singledata sin = new Singledata(); | |
| 906 | + sin.setxL(arg0.getString("xl_bm")); | |
| 907 | + sin.setJsy(arg0.getString("j_gh")); | |
| 908 | +// sin.setjName(arg0.getString("j_name")); | |
| 909 | + sin.setClzbh(arg0.getString("cl_zbh")); | |
| 910 | + sin.setgS(arg0.getString("fgs_bm")); | |
| 911 | + return sin; | |
| 912 | + } | |
| 913 | + }); | |
| 914 | + | |
| 915 | + Collections.sort(list,new SingledataByXlbm()); | |
| 916 | + | |
| 917 | + String linesql=""; | |
| 918 | + if(!xlbm.equals("")){ | |
| 919 | + linesql +=" and xlbm ='"+xlbm+"' "; | |
| 920 | + } | |
| 921 | + if(!gsdm.equals("")){ | |
| 922 | + linesql +=" and ssgsdm ='"+gsdm+"' "; | |
| 923 | + } | |
| 924 | + if(!fgsdm.equals("")){ | |
| 925 | + linesql +=" and fgsdm ='"+fgsdm+"' "; | |
| 926 | + } | |
| 927 | + String nysql="SELECT id,xlbm,nbbm,jsy,jzl as jzl,yh as yh,sh as sh,fgsdm FROM bsth_c_ylb" | |
| 928 | + + " WHERE rq = '"+startDate+"'" | |
| 929 | + + linesql | |
| 930 | + + " union" | |
| 931 | + + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh,fgsdm FROM bsth_c_dlb" | |
| 932 | + + " WHERE rq = '"+startDate+"'" | |
| 933 | + + linesql; | |
| 934 | + List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() { | |
| 935 | + @Override | |
| 936 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 937 | + Singledata sin = new Singledata(); | |
| 938 | + sin.setxL(arg0.getString("xlbm")); | |
| 939 | + sin.setJsy(arg0.getString("jsy")); | |
| 940 | + sin.setClzbh(arg0.getString("nbbm")); | |
| 941 | + sin.setJzl(arg0.getString("jzl")); | |
| 942 | + sin.setHyl(arg0.getString("yh")); | |
| 943 | + sin.setUnyyyl(arg0.getString("sh")); | |
| 944 | + sin.setgS(arg0.getString("fgsdm")); | |
| 945 | + return sin; | |
| 946 | + } | |
| 947 | + }); | |
| 948 | + //统计油,电表中手动添加的或者有加注没里程的数据 | |
| 949 | + for (int i = 0; i < listNy.size(); i++) { | |
| 950 | + Singledata sin_=listNy.get(i); | |
| 951 | + String jsy=sin_.getJsy(); | |
| 952 | + String line=sin_.getxL(); | |
| 953 | + String clzbh=sin_.getClzbh(); | |
| 954 | + boolean fages=true; | |
| 955 | + for (int j = 0; j < list.size(); j++) { | |
| 956 | + Singledata sin=list.get(j); | |
| 957 | + String jsy_=sin.getJsy(); | |
| 958 | + String line_=sin.getxL(); | |
| 959 | + String clzbh_=sin.getClzbh(); | |
| 960 | + if(jsy.equals(jsy_) | |
| 961 | + &&line.equals(line_) | |
| 962 | + &&clzbh.equals(clzbh_)){ | |
| 963 | + fages=false; | |
| 964 | + } | |
| 965 | + } | |
| 966 | + if(fages){ | |
| 967 | + Singledata s=new Singledata(); | |
| 968 | + s.setJsy(jsy); | |
| 969 | +// s.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 970 | + s.setClzbh(clzbh); | |
| 971 | + s.setSgh(""); | |
| 972 | + s.setsName(""); | |
| 973 | + s.setgS(BasicData.businessFgsCodeNameMap.get(sin_.getgS()+"_"+gsdm)); | |
| 974 | + s.setxL(line); | |
| 975 | + s.setXlmc(BasicData.lineCodeAllNameMap.get(line)); | |
| 976 | + s.setJzl(sin_.getJzl()); | |
| 977 | + s.setHyl(sin_.getHyl()); | |
| 978 | + s.setUnyyyl(sin_.getUnyyyl()); | |
| 979 | + s.setJhlc("0.0"); | |
| 980 | + s.setEmptMileage("0.0"); | |
| 981 | + s.setJhjl("0.0"); | |
| 982 | + s.setrQ(startDate); | |
| 983 | + list_.add(s); | |
| 984 | + } | |
| 985 | + } | |
| 986 | + for (int i= 0; i < list.size(); i++) { | |
| 987 | + Singledata sin=list.get(i); | |
| 988 | + String jsy=sin.getJsy(); | |
| 989 | + String line=sin.getxL(); | |
| 990 | + String clzbh=sin.getClzbh(); | |
| 991 | + double jzl=0.0; | |
| 992 | + double yh=0.0; | |
| 993 | + double sh=0.0; | |
| 994 | + for (int j = 0; j < listNy.size(); j++) { | |
| 995 | + Singledata y=listNy.get(j); | |
| 996 | + if(y.getJsy().equals(jsy) | |
| 997 | + &&y.getClzbh().equals(clzbh) | |
| 998 | + &&y.getxL().equals(line)){ | |
| 999 | + jzl=Arith.add(jzl, y.getJzl()); | |
| 1000 | + yh=Arith.add(yh, y.getHyl()); | |
| 1001 | + sh=Arith.add(sh, y.getUnyyyl()); | |
| 1002 | + } | |
| 1003 | + } | |
| 1004 | + sin.setHyl(String.valueOf(yh)); | |
| 1005 | + sin.setJzl(String.valueOf(jzl)); | |
| 1006 | + sin.setUnyyyl(String.valueOf(sh)); | |
| 1007 | + | |
| 1008 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 1009 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 1010 | + for (int j = 0; j < listReal.size(); j++) { | |
| 1011 | + ScheduleRealInfo s=listReal.get(j); | |
| 1012 | + if(s.getjGh().equals(jsy) | |
| 1013 | + && s.getClZbh().equals(clzbh) | |
| 1014 | + &&s.getXlBm().equals(line)){ | |
| 1015 | + newList.add(s); | |
| 1016 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 1017 | + if(cts != null && cts.size() > 0){ | |
| 1018 | + newList_.add(s); | |
| 1019 | + }else{ | |
| 1020 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 1021 | + newList_.add(s); | |
| 1022 | + } | |
| 1023 | + } | |
| 1024 | + | |
| 1025 | + if((sin.getjName() == null || sin.getjName().trim().length() == 0) | |
| 1026 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 1027 | + sin.setjName(s.getjName()); | |
| 1028 | + } | |
| 1029 | + } | |
| 1030 | + } | |
| 1031 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 1032 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 1033 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 1034 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 1035 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 1036 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 1037 | + | |
| 1038 | + double zyygl=Arith.add(yygl, ljgl); | |
| 1039 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 1040 | + | |
| 1041 | + if(sin.getjName() == null || sin.getjName().trim().length() == 0){ | |
| 1042 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 1043 | + } | |
| 1044 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 1045 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 1046 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 1047 | + sin.setXlmc(BasicData.lineCode2NameMap.get(line)); | |
| 1048 | + sin.setrQ(startDate); | |
| 1049 | + sin.setSgh(""); | |
| 1050 | + sin.setsName(""); | |
| 1051 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(sin.getgS()+"_"+gsdm)); | |
| 1052 | + list_.add(sin); | |
| 1053 | + | |
| 1054 | + } | |
| 1055 | + }else{ | |
| 1056 | + String sql="select r.s_gh,r.s_name, " | |
| 1057 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm" | |
| 1058 | + + " from bsth_c_s_sp_info_real r where " | |
| 1059 | + + " r.schedule_date_str = '"+startDate+"'" | |
| 1060 | + + " and r.s_gh !='' and r.s_gh is not null "; | |
| 1061 | + if(!xlbm.equals("")){ | |
| 1062 | + sql += " and r.xl_bm = '"+xlbm+"'"; | |
| 1063 | + } | |
| 1064 | + if(!gsdm.equals("")){ | |
| 1065 | + sql += " and r.gs_bm = '"+gsdm+"'"; | |
| 1066 | + } | |
| 1067 | + if(!fgsdm.equals("")){ | |
| 1068 | + sql += " and r.fgs_bm = '"+fgsdm+"'"; | |
| 1069 | + } | |
| 1070 | + sql += " group by r.s_gh,r.s_name," | |
| 1071 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | |
| 1072 | + | |
| 1073 | + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | |
| 1074 | + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 1075 | + @Override | |
| 1076 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 1077 | + Singledata sin = new Singledata(); | |
| 1078 | + sin.setrQ(startDate); | |
| 1079 | + sin.setxL(arg0.getString("xl_bm")); | |
| 1080 | + sin.setClzbh(arg0.getString("cl_zbh")); | |
| 1081 | + sin.setSgh(arg0.getString("s_gh")); | |
| 1082 | + sin.setsName(arg0.getString("s_name")); | |
| 1083 | + sin.setgS(arg0.getString("fgs_bm")); | |
| 1084 | + return sin; | |
| 1085 | + } | |
| 1086 | + }); | |
| 1087 | + | |
| 1088 | + Collections.sort(list,new SingledataByXlbm()); | |
| 1089 | + | |
| 1090 | + for (int i = 0; i < list.size(); i++) { | |
| 1091 | + Singledata sin=list.get(i); | |
| 1092 | + String jsy=sin.getSgh(); | |
| 1093 | + String line=sin.getxL(); | |
| 1094 | + String clzbh=sin.getClzbh(); | |
| 1095 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 1096 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 1097 | + | |
| 1098 | + for (int j = 0; j < listReal.size(); j++) { | |
| 1099 | + ScheduleRealInfo s=listReal.get(j); | |
| 1100 | + if(s.getsGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 1101 | + &&s.getXlBm().equals(line)){ | |
| 1102 | + newList.add(s); | |
| 1103 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 1104 | + if(cts != null && cts.size() > 0){ | |
| 1105 | + newList_.add(s); | |
| 1106 | + }else{ | |
| 1107 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 1108 | + newList_.add(s); | |
| 1109 | + } | |
| 1110 | + } | |
| 1111 | + } | |
| 1112 | + } | |
| 1113 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 1114 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 1115 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 1116 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 1117 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 1118 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 1119 | + | |
| 1120 | + double zyygl=Arith.add(yygl, ljgl); | |
| 1121 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 1122 | + | |
| 1123 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 1124 | + | |
| 1125 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 1126 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 1127 | + sin.setXlmc(BasicData.lineCode2NameMap.get(line)); | |
| 1128 | + sin.setClzbh(clzbh); | |
| 1129 | + sin.setJsy(""); | |
| 1130 | + sin.setjName(""); | |
| 1131 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(sin.getgS()+"_"+gsdm)); | |
| 1132 | + sin.setHyl(""); | |
| 1133 | + sin.setJzl(""); | |
| 1134 | + sin.setUnyyyl(""); | |
| 1135 | + list_.add(sin); | |
| 1136 | + } | |
| 1137 | + } | |
| 1138 | + | |
| 1139 | + Map<String, Boolean> lineNature = lineService.lineNature(); | |
| 1140 | + List<Singledata> resList = new ArrayList<Singledata>(); | |
| 1141 | + for(Singledata s : list_){ | |
| 1142 | + String xlBm = s.getxL(); | |
| 1143 | + if(sfyy.length() != 0){ | |
| 1144 | + if(sfyy.equals("0")){ | |
| 1145 | + resList.add(s); | |
| 1146 | + } else if(sfyy.equals("1")){ | |
| 1147 | + if(lineNature.containsKey(xlBm) && lineNature.get(xlBm)){ | |
| 1148 | + resList.add(s); | |
| 1149 | + } | |
| 1150 | + } else { | |
| 1151 | + if(lineNature.containsKey(xlBm) && !lineNature.get(xlBm)){ | |
| 1152 | + resList.add(s); | |
| 1153 | + } | |
| 1154 | + } | |
| 1155 | + } else { | |
| 1156 | + resList.add(s); | |
| 1157 | + } | |
| 1158 | + } | |
| 1159 | + | |
| 1160 | + return resList; | |
| 1161 | + } | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + @Override | |
| 1165 | + public List<Singledata> singledatatj2(Map<String, Object> map) { | |
| 1166 | + String gsdm=""; | |
| 1167 | + if(map.get("gsdmSing")!=null){ | |
| 1168 | + gsdm=map.get("gsdmSing").toString(); | |
| 1169 | + } | |
| 1170 | + String fgsdm=""; | |
| 1171 | + if(map.get("fgsdmSing")!=null){ | |
| 1172 | + fgsdm=map.get("fgsdmSing").toString(); | |
| 1173 | + } | |
| 1174 | + | |
| 1175 | + String tjtype=map.get("tjtype").toString(); | |
| 1176 | + String xlbm=map.get("line").toString().trim(); | |
| 1177 | + startDate = map.get("startDate").toString(); | |
| 1178 | + | |
| 1179 | + List<ScheduleRealInfo> listReal=new ArrayList<ScheduleRealInfo>(); | |
| 1180 | + if(xlbm.equals("")){ | |
| 1181 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineByGs_(gsdm, fgsdm, startDate); | |
| 1182 | + }else{ | |
| 1183 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineQp(xlbm, startDate); | |
| 1184 | + } | |
| 1185 | + List<Singledata> list=new ArrayList<Singledata>(); | |
| 1186 | + List<Singledata> list_=new ArrayList<Singledata>(); | |
| 1187 | + if(tjtype.equals("jsy")){ | |
| 1188 | + //油统计 | |
| 1189 | + String sql="select r.j_gh, r.xl_bm,r.cl_zbh" | |
| 1190 | + + " from bsth_c_s_sp_info_real r where " | |
| 1191 | + + " r.schedule_date_str = '"+startDate+"'"; | |
| 1192 | + if(!xlbm.equals("")){ | |
| 1193 | + sql += " and r.xl_bm = '"+xlbm+"'"; | |
| 1194 | + } | |
| 1195 | + if(!gsdm.equals("")){ | |
| 1196 | + sql += " and r.gs_bm='"+gsdm+"'"; | |
| 1197 | + } | |
| 1198 | + if(!fgsdm.equals("")){ | |
| 1199 | + sql += " and r.fgs_bm='"+fgsdm+"'"; | |
| 1200 | + } | |
| 1201 | + sql += " group by r.j_gh,r.xl_bm,r.cl_zbh order by r.xl_bm,r.cl_zbh"; | |
| 1202 | + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | |
| 1203 | + @Override | |
| 1204 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 1205 | + Singledata sin = new Singledata(); | |
| 1206 | + sin.setxL(arg0.getString("xl_bm")); | |
| 1207 | + sin.setJsy(arg0.getString("j_gh")); | |
| 1208 | +// sin.setjName(arg0.getString("j_name")); | |
| 1209 | + sin.setClzbh(arg0.getString("cl_zbh")); | |
| 1210 | + return sin; | |
| 1211 | + } | |
| 1212 | + }); | |
| 1213 | + String linesql=""; | |
| 1214 | + if(!xlbm.equals("")){ | |
| 1215 | + linesql += " and xlbm ='"+xlbm+"' "; | |
| 1216 | + } | |
| 1217 | + if(!gsdm.equals("")){ | |
| 1218 | + linesql += " and ssgsdm ='"+gsdm+"'"; | |
| 1219 | + } | |
| 1220 | + if(!fgsdm.equals("")){ | |
| 1221 | + linesql += " and fgsdm ='"+fgsdm+"'"; | |
| 1222 | + } | |
| 1223 | + String nysql="SELECT id,xlbm,nbbm, jsy,jzl as jzl,yh as yh,sh as sh FROM bsth_c_ylb " | |
| 1224 | + + " WHERE rq = '"+startDate+"'" | |
| 1225 | + + linesql | |
| 1226 | + + " union" | |
| 1227 | + + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh FROM bsth_c_dlb" | |
| 1228 | + + " WHERE rq = '"+startDate+"'" | |
| 1229 | + + linesql; | |
| 1230 | + List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() { | |
| 1231 | + @Override | |
| 1232 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 1233 | + Singledata sin = new Singledata(); | |
| 1234 | + sin.setxL(arg0.getString("xlbm")); | |
| 1235 | + sin.setJsy(arg0.getString("jsy")); | |
| 1236 | + sin.setClzbh(arg0.getString("nbbm")); | |
| 1237 | + sin.setJzl(arg0.getString("jzl")); | |
| 1238 | + sin.setHyl(arg0.getString("yh")); | |
| 1239 | + sin.setUnyyyl(arg0.getString("sh")); | |
| 1240 | + return sin; | |
| 1241 | + } | |
| 1242 | + }); | |
| 1243 | + //统计油,电表中手动添加的或者有加注没里程的数据 | |
| 1244 | + for (int i = 0; i < listNy.size(); i++) { | |
| 1245 | + Singledata sin_=listNy.get(i); | |
| 1246 | + String jsy=sin_.getJsy(); | |
| 1247 | + String line=sin_.getxL(); | |
| 1248 | + String clzbh=sin_.getClzbh(); | |
| 1249 | + boolean fages=true; | |
| 1250 | + for (int j = 0; j < list.size(); j++) { | |
| 1251 | + Singledata sin=list.get(j); | |
| 1252 | + String jsy_=sin.getJsy(); | |
| 1253 | + String line_=sin.getxL(); | |
| 1254 | + String clzbh_=sin.getClzbh(); | |
| 1255 | + if(jsy.equals(jsy_) | |
| 1256 | + &&line.equals(line_) | |
| 1257 | + &&clzbh.equals(clzbh_)){ | |
| 1258 | + fages=false; | |
| 1259 | + } | |
| 1260 | + } | |
| 1261 | + if(fages){ | |
| 1262 | + Singledata s=new Singledata(); | |
| 1263 | + s.setJsy(jsy); | |
| 1264 | + s.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 1265 | + s.setClzbh(clzbh); | |
| 1266 | + s.setSgh(""); | |
| 1267 | + s.setsName(""); | |
| 1268 | + s.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 1269 | + s.setxL(line); | |
| 1270 | + s.setXlmc(BasicData.lineCode2NameMap.get(line)); | |
| 1271 | + s.setJzl(sin_.getJzl()); | |
| 1272 | + s.setHyl(sin_.getHyl()); | |
| 1273 | + s.setUnyyyl(sin_.getUnyyyl()); | |
| 1274 | + s.setJhlc("0.0"); | |
| 1275 | + s.setEmptMileage("0.0"); | |
| 1276 | + s.setJhjl("0.0"); | |
| 1277 | + s.setrQ(startDate); | |
| 1278 | + list_.add(s); | |
| 1279 | + } | |
| 1280 | + } | |
| 1281 | + for (int i= 0; i < list.size(); i++) { | |
| 1282 | + Singledata sin=list.get(i); | |
| 1283 | + String jsy=sin.getJsy(); | |
| 1284 | + String line=sin.getxL(); | |
| 1285 | + String clzbh=sin.getClzbh(); | |
| 1286 | + double jzl=0.0; | |
| 1287 | + double yh=0.0; | |
| 1288 | + double sh=0.0; | |
| 1289 | + for (int j = 0; j < listNy.size(); j++) { | |
| 1290 | + Singledata y=listNy.get(j); | |
| 1291 | + if(y.getJsy().equals(jsy) | |
| 1292 | + &&y.getClzbh().equals(clzbh) | |
| 1293 | + &&y.getxL().equals(line)){ | |
| 1294 | + jzl=Arith.add(jzl, y.getJzl()); | |
| 1295 | + yh=Arith.add(yh, y.getHyl()); | |
| 1296 | + sh=Arith.add(sh, y.getUnyyyl()); | |
| 1297 | + } | |
| 1298 | + } | |
| 1299 | + sin.setHyl(String.valueOf(yh)); | |
| 1300 | + sin.setJzl(String.valueOf(jzl)); | |
| 1301 | + sin.setUnyyyl(String.valueOf(sh)); | |
| 1302 | + | |
| 1303 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 1304 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 1305 | + for (int j = 0; j < listReal.size(); j++) { | |
| 1306 | + ScheduleRealInfo s=listReal.get(j); | |
| 1307 | + if(s.getjGh().equals(jsy) | |
| 1308 | + && s.getClZbh().equals(clzbh) | |
| 1309 | + &&s.getXlBm().equals(line)){ | |
| 1310 | + newList.add(s); | |
| 1311 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 1312 | + if(cts != null && cts.size() > 0){ | |
| 1313 | + newList_.add(s); | |
| 1314 | + }else{ | |
| 1315 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 1316 | + newList_.add(s); | |
| 1317 | + } | |
| 1318 | + } | |
| 1319 | + | |
| 1320 | + if((sin.getjName() == null || sin.getjName().trim().length() == 0) | |
| 1321 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 1322 | + sin.setjName(s.getjName()); | |
| 1323 | + } | |
| 1324 | + } | |
| 1325 | + } | |
| 1326 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 1327 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 1328 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 1329 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 1330 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 1331 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 1332 | + | |
| 1333 | + if(sin.getjName() == null || sin.getjName().trim().length() == 0){ | |
| 1334 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 1335 | + } | |
| 1336 | + double zyygl=Arith.add(yygl, ljgl); | |
| 1337 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 1338 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 1339 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 1340 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 1341 | + sin.setXlmc(BasicData.lineCode2NameMap.get(line)); | |
| 1342 | + sin.setrQ(startDate); | |
| 1343 | + sin.setSgh(""); | |
| 1344 | + sin.setsName(""); | |
| 1345 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 1346 | + list_.add(sin); | |
| 1347 | + | |
| 1348 | + } | |
| 1349 | + Collections.sort(list_,new SingledataByXlbm()); | |
| 1350 | + }else{ | |
| 1351 | + String sql="select r.s_gh, " | |
| 1352 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm" | |
| 1353 | + + " from bsth_c_s_sp_info_real r where " | |
| 1354 | + + " r.schedule_date_str = '"+startDate+"'" | |
| 1355 | + + " and r.s_gh !='' and r.s_gh is not null "; | |
| 1356 | + if(!xlbm.equals("")){ | |
| 1357 | + sql += " and r.xl_bm = '"+xlbm+"'"; | |
| 1358 | + } | |
| 1359 | + if(!gsdm.equals("")){ | |
| 1360 | + sql += " and r.gs_bm='"+gsdm+"'"; | |
| 1361 | + } | |
| 1362 | + if(!fgsdm.equals("")){ | |
| 1363 | + sql += " and r.fgs_bm='"+fgsdm+"'"; | |
| 1364 | + } | |
| 1365 | + sql += " group by r.s_gh," | |
| 1366 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | |
| 1367 | + | |
| 1368 | + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | |
| 1369 | + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 1370 | + @Override | |
| 1371 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 1372 | + Singledata sin = new Singledata(); | |
| 1373 | + sin.setrQ(startDate); | |
| 1374 | + sin.setxL(arg0.getString("xl_bm")); | |
| 1375 | + sin.setClzbh(arg0.getString("cl_zbh")); | |
| 1376 | + sin.setSgh(arg0.getString("s_gh")); | |
| 1377 | +// sin.setsName(arg0.getString("s_name")); | |
| 1378 | + return sin; | |
| 1379 | + } | |
| 1380 | + }); | |
| 1381 | + | |
| 1382 | + for (int i = 0; i < list.size(); i++) { | |
| 1383 | + Singledata sin=list.get(i); | |
| 1384 | + String jsy=sin.getSgh(); | |
| 1385 | + String line=sin.getxL(); | |
| 1386 | + String clzbh=sin.getClzbh(); | |
| 1387 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 1388 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 1389 | + | |
| 1390 | + for (int j = 0; j < listReal.size(); j++) { | |
| 1391 | + ScheduleRealInfo s=listReal.get(j); | |
| 1392 | + if(s.getsGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 1393 | + &&s.getXlBm().equals(line)){ | |
| 1394 | + newList.add(s); | |
| 1395 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 1396 | + if(cts != null && cts.size() > 0){ | |
| 1397 | + newList_.add(s); | |
| 1398 | + }else{ | |
| 1399 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 1400 | + newList_.add(s); | |
| 1401 | + } | |
| 1402 | + } | |
| 1403 | + | |
| 1404 | + if((sin.getsName() == null || sin.getsName().trim().length() == 0) | |
| 1405 | + && s.getsName() != null && s.getsName().length() > 0){ | |
| 1406 | + sin.setsName(s.getsName()); | |
| 1407 | + } | |
| 1408 | + } | |
| 1409 | + } | |
| 1410 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 1411 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 1412 | +// double yygl=culateMileageService.culateSjgl(newList_); | |
| 1413 | +// double ljgl=culateMileageService.culateLjgl(newList_); | |
| 1414 | +// double ksgl=culateMileageService.culateKsgl(newList_); | |
| 1415 | +// double jcgl=culateMileageService.culateJccgl(newList_); | |
| 1416 | + | |
| 1417 | + double yygl=culateMileageService.culateSjgl_spy(newList_); | |
| 1418 | + double ljgl=culateMileageService.culateLjgl_spy(newList_); | |
| 1419 | + | |
| 1420 | + double zyygl=Arith.add(yygl, ljgl); | |
| 1421 | +// double zksgl=Arith.add(ksgl, jcgl); | |
| 1422 | + double zksgl=culateMileageService.culateSjfyylc_spy(newList_); | |
| 1423 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 1424 | + | |
| 1425 | + if(sin.getsName() == null || sin.getsName().trim().length() == 0){ | |
| 1426 | + sin.setsName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 1427 | + } | |
| 1428 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 1429 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 1430 | + sin.setXlmc(BasicData.lineCode2NameMap.get(line)); | |
| 1431 | + sin.setClzbh(clzbh); | |
| 1432 | + sin.setJsy(""); | |
| 1433 | + sin.setjName(""); | |
| 1434 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 1435 | + sin.setHyl(""); | |
| 1436 | + sin.setJzl(""); | |
| 1437 | + sin.setUnyyyl(""); | |
| 1438 | + list_.add(sin); | |
| 1439 | + } | |
| 1440 | + Collections.sort(list_,new SingledataByXlbm()); | |
| 1441 | + } | |
| 1442 | + return list_; | |
| 1443 | + } | |
| 1444 | + | |
| 1445 | + /*// 路单数据 | |
| 1446 | + @Override | |
| 1447 | + public List<Singledata> singledatatj(Map<String, Object> map) { | |
| 1448 | + | |
| 1449 | + String gsdm=""; | |
| 1450 | + if(map.get("gsdmSing")!=null){ | |
| 1451 | + gsdm=map.get("gsdmSing").toString(); | |
| 1452 | + } | |
| 1453 | + String fgsdm=""; | |
| 1454 | + if(map.get("fgsdmSing")!=null){ | |
| 1455 | + fgsdm=map.get("fgsdmSing").toString(); | |
| 1456 | + } | |
| 1457 | + | |
| 1458 | + String tjtype=map.get("tjtype").toString(); | |
| 1459 | + String xlbm=map.get("line").toString().trim(); | |
| 1460 | + startDate = map.get("startDate").toString(); | |
| 1461 | + | |
| 1462 | + List<ScheduleRealInfo> listReal=new ArrayList<ScheduleRealInfo>(); | |
| 1463 | + if(xlbm.equals("")){ | |
| 1464 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineByGs_(gsdm, fgsdm, startDate); | |
| 1465 | + }else{ | |
| 1466 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineQp(xlbm, startDate); | |
| 1467 | + } | |
| 1468 | + List<Singledata> list=new ArrayList<Singledata>(); | |
| 1469 | + List<Singledata> listY=new ArrayList<Singledata>(); | |
| 1470 | + List<Singledata> listD=new ArrayList<Singledata>(); | |
| 1471 | + | |
| 1472 | + if(tjtype.equals("jsy")){ | |
| 1473 | + //油统计 | |
| 1474 | + String sql="select xlbm,nbbm,jsy from bsth_c_ylb where rq='"+startDate+"'"; | |
| 1475 | + if(xlbm.equals("")){ | |
| 1476 | + sql += " and ssgsdm= '"+gsdm+"' and fgsdm= '"+fgsdm+"'"; | |
| 1477 | + }else{ | |
| 1478 | + sql +=" and xlbm= '"+xlbm+"'"; | |
| 1479 | + } | |
| 1480 | + sql += " group by xlbm,nbbm,jsy"; | |
| 1481 | + listY = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | |
| 1482 | + @Override | |
| 1483 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 1484 | + Singledata sin = new Singledata(); | |
| 1485 | + sin.setxL(arg0.getString("xlbm")); | |
| 1486 | + sin.setJsy(arg0.getString("jsy")); | |
| 1487 | + sin.setClzbh(arg0.getString("nbbm")); | |
| 1488 | + return sin; | |
| 1489 | + } | |
| 1490 | + }); | |
| 1491 | + | |
| 1492 | + List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | |
| 1493 | + for (int i = 0; i < listY.size(); i++) { | |
| 1494 | + Singledata sin=listY.get(i); | |
| 1495 | + String jsy=sin.getJsy(); | |
| 1496 | + String line=sin.getxL(); | |
| 1497 | + String clzbh=sin.getClzbh(); | |
| 1498 | + | |
| 1499 | + double jzl=0.0; | |
| 1500 | + double yh=0.0; | |
| 1501 | + double sh=0.0; | |
| 1502 | + for (int j = 0; j < listYlb.size(); j++) { | |
| 1503 | + Ylb y=listYlb.get(j); | |
| 1504 | + if(y.getJsy().equals(jsy) | |
| 1505 | + &&y.getNbbm().equals(clzbh) | |
| 1506 | + &&y.getXlbm().equals(line)){ | |
| 1507 | + jzl=Arith.add(jzl, y.getJzl()); | |
| 1508 | + yh=Arith.add(yh, y.getYh()); | |
| 1509 | + sh=Arith.add(sh, y.getSh()); | |
| 1510 | + } | |
| 1511 | + } | |
| 1512 | + sin.setHyl(String.valueOf(yh)); | |
| 1513 | + sin.setJzl(String.valueOf(jzl)); | |
| 1514 | + sin.setUnyyyl(String.valueOf(sh)); | |
| 1515 | + | |
| 1516 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 1517 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 1518 | + for (int j = 0; j < listReal.size(); j++) { | |
| 1519 | + ScheduleRealInfo s=listReal.get(j); | |
| 1520 | + if(s.getjGh().equals(jsy) | |
| 1521 | + && s.getClZbh().equals(clzbh) | |
| 1522 | + &&s.getXlBm().equals(line)){ | |
| 1523 | + newList.add(s); | |
| 1524 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 1525 | + if(cts != null && cts.size() > 0){ | |
| 1526 | + newList_.add(s); | |
| 1527 | + }else{ | |
| 1528 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 1529 | + newList_.add(s); | |
| 1530 | + } | |
| 1531 | + } | |
| 1532 | + } | |
| 1533 | + } | |
| 1534 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 1535 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 1536 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 1537 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 1538 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 1539 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 1540 | + | |
| 1541 | + double zyygl=Arith.add(yygl, ljgl); | |
| 1542 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 1543 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 1544 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 1545 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 1546 | + sin.setXlmc(BasicData.lineCode2NameMap.get(line)); | |
| 1547 | + sin.setrQ(startDate); | |
| 1548 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 1549 | + sin.setSgh(""); | |
| 1550 | + sin.setsName(""); | |
| 1551 | + } | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + //电量计算 | |
| 1555 | + String sqldl="select xlbm,nbbm,jsy from bsth_c_dlb where rq='"+startDate+"'"; | |
| 1556 | + if(xlbm.equals("")){ | |
| 1557 | + sqldl += " and ssgsdm= '"+gsdm+"' and fgsdm= '"+fgsdm+"'"; | |
| 1558 | + }else{ | |
| 1559 | + sqldl +=" and xlbm= '"+xlbm+"'"; | |
| 1560 | + } | |
| 1561 | + sqldl += " group by xlbm,nbbm,jsy"; | |
| 1562 | + listD = jdbcTemplate.query(sqldl, new RowMapper<Singledata>() { | |
| 1563 | + @Override | |
| 1564 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 1565 | + Singledata sin = new Singledata(); | |
| 1566 | + sin.setxL(arg0.getString("xlbm")); | |
| 1567 | + sin.setJsy(arg0.getString("jsy")); | |
| 1568 | + sin.setClzbh(arg0.getString("nbbm")); | |
| 1569 | + return sin; | |
| 1570 | + } | |
| 1571 | + }); | |
| 1572 | + List<Dlb> listDlb= dlbRepository.obtainDl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | |
| 1573 | + | |
| 1574 | + for (int i = 0; i < listD.size(); i++) { | |
| 1575 | + Singledata sin=listD.get(i); | |
| 1576 | + String jsy=sin.getJsy(); | |
| 1577 | + String line=sin.getxL(); | |
| 1578 | + String clzbh=sin.getClzbh(); | |
| 1579 | + | |
| 1580 | + double jzl=0.0; | |
| 1581 | + double yh=0.0; | |
| 1582 | + double sh=0.0; | |
| 1583 | + for (int j = 0; j < listDlb.size(); j++) { | |
| 1584 | + Dlb d=listDlb.get(j); | |
| 1585 | + if(d.getJsy().equals(jsy) | |
| 1586 | + &&d.getNbbm().equals(clzbh) | |
| 1587 | + &&d.getXlbm().equals(line)){ | |
| 1588 | + jzl=Arith.add(jzl, d.getCdl()); | |
| 1589 | + yh=Arith.add(yh, d.getHd()); | |
| 1590 | + sh=Arith.add(sh, d.getSh()); | |
| 1591 | + } | |
| 1592 | + } | |
| 1593 | + sin.setHyl(String.valueOf(yh)); | |
| 1594 | + sin.setJzl(String.valueOf(jzl)); | |
| 1595 | + sin.setUnyyyl(String.valueOf(sh)); | |
| 1596 | + | |
| 1597 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 1598 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 1599 | + for (int j = 0; j < listReal.size(); j++) { | |
| 1600 | + ScheduleRealInfo s=listReal.get(j); | |
| 1601 | + if(s.getjGh().equals(jsy) | |
| 1602 | + && s.getClZbh().equals(clzbh) | |
| 1603 | + &&s.getXlBm().equals(line)){ | |
| 1604 | + newList.add(s); | |
| 1605 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 1606 | + if(cts != null && cts.size() > 0){ | |
| 1607 | + newList_.add(s); | |
| 1608 | + }else{ | |
| 1609 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 1610 | + newList_.add(s); | |
| 1611 | + } | |
| 1612 | + } | |
| 1613 | + } | |
| 1614 | + } | |
| 1615 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 1616 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 1617 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 1618 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 1619 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 1620 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 1621 | + | |
| 1622 | + double zyygl=Arith.add(yygl, ljgl); | |
| 1623 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 1624 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 1625 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 1626 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 1627 | + sin.setXlmc(BasicData.lineCode2NameMap.get(line)); | |
| 1628 | + sin.setrQ(startDate); | |
| 1629 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 1630 | + sin.setSgh(""); | |
| 1631 | + sin.setsName(""); | |
| 1632 | + } | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + Collections.sort(listY,new SingledataByXlbm()); | |
| 1636 | + Collections.sort(listD,new SingledataByXlbm()); | |
| 1637 | + list.addAll(listY); | |
| 1638 | + list.addAll(listD); | |
| 1639 | + }else{ | |
| 1640 | + String sql="select r.s_gh,r.s_name, " | |
| 1641 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm" | |
| 1642 | + + " from bsth_c_s_sp_info_real r where " | |
| 1643 | + + " r.schedule_date_str = '"+startDate+"'" | |
| 1644 | + + " and r.s_gh !='' and r.s_gh is not null "; | |
| 1645 | + if(xlbm.equals("")){ | |
| 1646 | + sql +="and r.gs_bm='"+gsdm+"' " | |
| 1647 | + + " and r.fgs_bm='"+fgsdm+"'"; | |
| 1648 | + }else{ | |
| 1649 | + sql += " and r.xl_bm = '"+xlbm+"'"; | |
| 1650 | + } | |
| 1651 | + sql += " group by r.s_gh,r.s_name," | |
| 1652 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | |
| 1653 | + | |
| 1654 | + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | |
| 1655 | + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 1656 | + @Override | |
| 1657 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 1658 | + Singledata sin = new Singledata(); | |
| 1659 | + sin.setrQ(startDate); | |
| 1660 | + sin.setxL(arg0.getString("xl_bm")); | |
| 1661 | + sin.setClzbh(arg0.getString("cl_zbh")); | |
| 1662 | + sin.setSgh(arg0.getString("s_gh")); | |
| 1663 | + sin.setsName(arg0.getString("s_name")); | |
| 1664 | + return sin; | |
| 1665 | + } | |
| 1666 | + }); | |
| 1667 | + | |
| 1668 | + for (int i = 0; i < list.size(); i++) { | |
| 1669 | + Singledata sin=list.get(i); | |
| 1670 | + String jsy=sin.getSgh(); | |
| 1671 | + String line=sin.getxL(); | |
| 1672 | + String clzbh=sin.getClzbh(); | |
| 1673 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 1674 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 1675 | + | |
| 1676 | + for (int j = 0; j < listReal.size(); j++) { | |
| 1677 | + ScheduleRealInfo s=listReal.get(j); | |
| 1678 | + if(s.getsGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 1679 | + &&s.getXlBm().equals(line)){ | |
| 1680 | + newList.add(s); | |
| 1681 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 1682 | + if(cts != null && cts.size() > 0){ | |
| 1683 | + newList_.add(s); | |
| 1684 | + }else{ | |
| 1685 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 1686 | + newList_.add(s); | |
| 1687 | + } | |
| 1688 | + } | |
| 1689 | + } | |
| 1690 | + } | |
| 1691 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 1692 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 1693 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 1694 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 1695 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 1696 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 1697 | + | |
| 1698 | + double zyygl=Arith.add(yygl, ljgl); | |
| 1699 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 1700 | + | |
| 1701 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 1702 | + | |
| 1703 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 1704 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 1705 | + sin.setxL(BasicData.lineCode2NameMap.get(line)); | |
| 1706 | + sin.setClzbh(clzbh); | |
| 1707 | + sin.setJsy(""); | |
| 1708 | + sin.setjName(""); | |
| 1709 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 1710 | + sin.setHyl(""); | |
| 1711 | + sin.setJzl(""); | |
| 1712 | + sin.setUnyyyl(""); | |
| 1713 | + } | |
| 1714 | + Collections.sort(list,new SingledataByXlbm()); | |
| 1715 | + } | |
| 1716 | + | |
| 1717 | + return list; | |
| 1718 | + | |
| 1719 | + }*/ | |
| 1720 | + | |
| 1721 | + // 路单数据 | |
| 1722 | + @Override | |
| 1723 | + public List<Singledata> singledatanew(Map<String, Object> map) { | |
| 1724 | + | |
| 1725 | + String gsdm=""; | |
| 1726 | + if(map.get("gsdmSing")!=null){ | |
| 1727 | + gsdm=map.get("gsdmSing").toString(); | |
| 1728 | + } | |
| 1729 | + String fgsdm=""; | |
| 1730 | + if(map.get("fgsdmSing")!=null){ | |
| 1731 | + fgsdm=map.get("fgsdmSing").toString(); | |
| 1732 | + } | |
| 1733 | + | |
| 1734 | + String xlbm=map.get("line").toString().trim(); | |
| 1735 | + | |
| 1736 | + /*SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 1737 | + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日"); | |
| 1738 | + Date d = null; | |
| 1739 | + Date d1 = null; | |
| 1740 | + try { | |
| 1741 | + d = sdf.parse(map.get("startDate").toString()); | |
| 1742 | + d1 = sdf.parse(map.get("endDate").toString()); | |
| 1743 | + } catch (ParseException e) { | |
| 1744 | + | |
| 1745 | + e.printStackTrace(); | |
| 1746 | + } | |
| 1747 | + String rq2 = sdf1.format(d); | |
| 1748 | + String rq3 = sdf1.format(d1);*/ | |
| 1749 | + | |
| 1750 | +// rq = rq2 + "-" + rq3; | |
| 1751 | + startDate = map.get("startDate").toString(); | |
| 1752 | + | |
| 1753 | + String sql="select r.s_gh,r.s_name, " | |
| 1754 | + + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm,xl_name" | |
| 1755 | + + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+startDate+"'"; | |
| 1756 | + if(!xlbm.equals("")){ | |
| 1757 | + sql += " and r.xl_bm = '"+xlbm+"'"; | |
| 1758 | + } | |
| 1759 | + if(!gsdm.equals("")){ | |
| 1760 | + sql += " and r.gs_bm='"+gsdm+"'"; | |
| 1761 | + } | |
| 1762 | + if(!fgsdm.equals("")){ | |
| 1763 | + sql += " and r.fgs_bm='"+fgsdm+"'"; | |
| 1764 | + } | |
| 1765 | + sql += " group by r.s_gh,r.s_name," | |
| 1766 | + + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm,xl_name order by r.xl_bm,r.cl_zbh"; | |
| 1767 | + | |
| 1768 | + List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | |
| 1769 | + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 1770 | + @Override | |
| 1771 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 1772 | + Singledata sin = new Singledata(); | |
| 1773 | + sin.setrQ(startDate); | |
| 1774 | + sin.setxL(arg0.getString("xl_bm")); | |
| 1775 | + sin.setClzbh(arg0.getString("cl_zbh")); | |
| 1776 | + sin.setJsy(arg0.getString("j_gh")); | |
| 1777 | +// sin.setjName(arg0.getString("j_name")); | |
| 1778 | + sin.setSgh(arg0.getString("s_gh")); | |
| 1779 | + sin.setsName(arg0.getString("s_name")); | |
| 1780 | + sin.setXlmc(arg0.getString("xl_name")); | |
| 1781 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs_bm")+"_"+arg0.getString("gs_bm"))); | |
| 1782 | + | |
| 1783 | + return sin; | |
| 1784 | + } | |
| 1785 | + }); | |
| 1786 | + DecimalFormat df = new DecimalFormat("0.00"); | |
| 1787 | + List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | |
| 1788 | + List<Dlb> listDlb= dlbRepository.obtainDl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | |
| 1789 | + List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLine(xlbm, startDate); | |
| 1790 | + for (int i = 0; i < list.size(); i++) { | |
| 1791 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 1792 | + Singledata sin=list.get(i); | |
| 1793 | + | |
| 1794 | + String jsy=sin.getJsy(); | |
| 1795 | + String clzbh=sin.getClzbh(); | |
| 1796 | + String xl=sin.getxL(); | |
| 1797 | + String spy=sin.getSgh(); | |
| 1798 | + sin.setxL(sin.getXlmc()); | |
| 1799 | + for (int j = 0; j < listReal.size(); j++) { | |
| 1800 | + ScheduleRealInfo s=listReal.get(j); | |
| 1801 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 1802 | + &&s.getXlBm().equals(xl)&&s.getsGh().equals(spy)){ | |
| 1803 | + newList.add(s); | |
| 1804 | + | |
| 1805 | + if((sin.getjName() == null || sin.getjName().trim().length() == 0) | |
| 1806 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 1807 | + sin.setjName(s.getjName()); | |
| 1808 | + } | |
| 1809 | + } | |
| 1810 | + } | |
| 1811 | + | |
| 1812 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 1813 | + double yygl=culateMileageService.culateSjgl(newList); | |
| 1814 | + double ljgl=culateMileageService.culateLjgl(newList); | |
| 1815 | + double ksgl=culateMileageService.culateKsgl(newList); | |
| 1816 | + double jcgl=culateMileageService.culateJccgl(newList); | |
| 1817 | + double zyygl=Arith.add(yygl, ljgl); | |
| 1818 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 1819 | + double zlc=Arith.add(zyygl,zksgl); | |
| 1820 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 1821 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 1822 | + sin.setJhjl(String.valueOf(jhgl)); | |
| 1823 | + double yhl=0.0; | |
| 1824 | + double jzl=0.0; | |
| 1825 | + double fyy=0.0; | |
| 1826 | + double zlcs=0.0; | |
| 1827 | + for (int j = 0; j < listYlb.size(); j++) { | |
| 1828 | + Ylb y=listYlb.get(j); | |
| 1829 | + if(y.getJsy().equals(jsy) && y.getNbbm().equals(clzbh)){ | |
| 1830 | + yhl=Arith.add(yhl, y.getYh()==null?0:y.getYh()); | |
| 1831 | + jzl=Arith.add(jzl, y.getJzl()==null?0:y.getJzl()); | |
| 1832 | + fyy=Arith.add(fyy, y.getSh()==null?0:y.getSh()); | |
| 1833 | + zlcs=Arith.add(zlcs, y.getZlc()==null?0:y.getZlc()); | |
| 1834 | + } | |
| 1835 | + } | |
| 1836 | + | |
| 1837 | + for(int j=0;j<listDlb.size();j++){ | |
| 1838 | + Dlb d=listDlb.get(j); | |
| 1839 | + if(d.getJsy().equals(jsy)&&d.getNbbm().equals(clzbh)){ | |
| 1840 | + yhl=Arith.add(yhl, d.getHd()==null?0:d.getHd()); | |
| 1841 | + jzl=Arith.add(jzl, d.getCdl()==null?0:d.getCdl()); | |
| 1842 | + fyy=Arith.add(fyy, d.getSh()==null?0:d.getSh()); | |
| 1843 | + zlcs=Arith.add(zlcs, d.getZlc()==null?0:d.getZlc()); | |
| 1844 | + } | |
| 1845 | + } | |
| 1846 | + if(zlcs>0){ | |
| 1847 | + double lcbfb= zlc/zlcs; | |
| 1848 | + sin.setHyl(df.format(yhl*lcbfb)); | |
| 1849 | + sin.setJzl(df.format(jzl*lcbfb)); | |
| 1850 | + sin.setUnyyyl(df.format(fyy*lcbfb)); | |
| 1851 | + } | |
| 1852 | + } | |
| 1853 | + return list; | |
| 1854 | + } | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + // 路单数据 | |
| 1858 | + @Override | |
| 1859 | + public List<Singledata> singledata(Map<String, Object> map) { | |
| 1860 | + | |
| 1861 | + String gsdm=""; | |
| 1862 | + if(map.get("gsdmSing")!=null){ | |
| 1863 | + gsdm=map.get("gsdmSing").toString(); | |
| 1864 | + } | |
| 1865 | + String fgsdm=""; | |
| 1866 | + if(map.get("fgsdmSing")!=null){ | |
| 1867 | + fgsdm=map.get("fgsdmSing").toString(); | |
| 1868 | + } | |
| 1869 | + | |
| 1870 | + String tjtype=map.get("tjtype").toString(); | |
| 1871 | + String xlbm=map.get("line").toString().trim(); | |
| 1872 | + startDate = map.get("startDate").toString(); | |
| 1873 | + | |
| 1874 | + List<ScheduleRealInfo> listReal=new ArrayList<ScheduleRealInfo>(); | |
| 1875 | + if(xlbm.equals("")){ | |
| 1876 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineByGs_(gsdm, fgsdm, startDate); | |
| 1877 | + }else{ | |
| 1878 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineQp(xlbm, startDate); | |
| 1879 | + } | |
| 1880 | + List<Singledata> list=new ArrayList<Singledata>(); | |
| 1881 | + List<Singledata> listY=new ArrayList<Singledata>(); | |
| 1882 | + List<Singledata> listD=new ArrayList<Singledata>(); | |
| 1883 | + | |
| 1884 | + if(tjtype.equals("jsy")){ | |
| 1885 | + DecimalFormat df = new DecimalFormat("0.00"); | |
| 1886 | + List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | |
| 1887 | + for (int i = 0; i < listYlb.size(); i++) { | |
| 1888 | + Ylb y=listYlb.get(i); | |
| 1889 | + boolean fage=false; | |
| 1890 | + if(xlbm.equals("")){ | |
| 1891 | + fage=true; | |
| 1892 | + }else{ | |
| 1893 | + if(xlbm.equals(y.getXlbm())){ | |
| 1894 | + fage=true; | |
| 1895 | + } | |
| 1896 | + } | |
| 1897 | + if(fage){ | |
| 1898 | + String jsy=y.getJsy(); | |
| 1899 | + String line=y.getXlbm(); | |
| 1900 | + String clzbh=y.getNbbm(); | |
| 1901 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 1902 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 1903 | + for (int j = 0; j < listReal.size(); j++) { | |
| 1904 | + ScheduleRealInfo s=listReal.get(j); | |
| 1905 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 1906 | + &&s.getXlBm().equals(line)){ | |
| 1907 | + if(y.getLp()==null){ | |
| 1908 | + newList.add(s); | |
| 1909 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 1910 | + if(cts != null && cts.size() > 0){ | |
| 1911 | + newList_.add(s); | |
| 1912 | + }else{ | |
| 1913 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 1914 | + newList_.add(s); | |
| 1915 | + } | |
| 1916 | + } | |
| 1917 | + }else{ | |
| 1918 | + if(y.getLp().equals(s.getLpName())){ | |
| 1919 | + newList.add(s); | |
| 1920 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 1921 | + if(cts != null && cts.size() > 0){ | |
| 1922 | + newList_.add(s); | |
| 1923 | + }else{ | |
| 1924 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 1925 | + newList_.add(s); | |
| 1926 | + } | |
| 1927 | + } | |
| 1928 | + } | |
| 1929 | + } | |
| 1930 | + } | |
| 1931 | + } | |
| 1932 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 1933 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 1934 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 1935 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 1936 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 1937 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 1938 | + | |
| 1939 | + double zyygl=Arith.add(yygl, ljgl); | |
| 1940 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 1941 | + | |
| 1942 | + Singledata sin=new Singledata(); | |
| 1943 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 1944 | + | |
| 1945 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 1946 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 1947 | + sin.setxL(y.getXlbm()); | |
| 1948 | + if(y.getLinename()==null){ | |
| 1949 | + sin.setXlmc(y.getXlname()); | |
| 1950 | + }else{ | |
| 1951 | + sin.setXlmc(y.getLinename()); | |
| 1952 | + } | |
| 1953 | + | |
| 1954 | + sin.setClzbh(clzbh); | |
| 1955 | + sin.setJsy(jsy); | |
| 1956 | + sin.setrQ(startDate); | |
| 1957 | + if(newList.size()>0){ | |
| 1958 | + sin.setjName(newList.get(0).getjName()); | |
| 1959 | + }else{ | |
| 1960 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 1961 | + } | |
| 1962 | + sin.setSgh(""); | |
| 1963 | + sin.setsName(""); | |
| 1964 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 1965 | + sin.setHyl(df.format(y.getYh())); | |
| 1966 | + sin.setJzl(df.format(y.getJzl())); | |
| 1967 | + sin.setUnyyyl(df.format(y.getSh())); | |
| 1968 | + listY.add(sin); | |
| 1969 | + } | |
| 1970 | + | |
| 1971 | + } | |
| 1972 | + | |
| 1973 | + List<Dlb> listDlb= dlbRepository.obtainDl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | |
| 1974 | + for (int i = 0; i < listDlb.size(); i++) { | |
| 1975 | + Dlb y=listDlb.get(i); | |
| 1976 | + boolean fage=false; | |
| 1977 | + if(xlbm.equals("")){ | |
| 1978 | + fage=true; | |
| 1979 | + }else{ | |
| 1980 | + if(xlbm.equals(y.getXlbm())){ | |
| 1981 | + fage=true; | |
| 1982 | + } | |
| 1983 | + } | |
| 1984 | + if(fage){ | |
| 1985 | + String jsy=y.getJsy(); | |
| 1986 | + String line=y.getXlbm(); | |
| 1987 | + String clzbh=y.getNbbm(); | |
| 1988 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 1989 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 1990 | + for (int j = 0; j < listReal.size(); j++) { | |
| 1991 | + ScheduleRealInfo s=listReal.get(j); | |
| 1992 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 1993 | + &&s.getXlBm().equals(line)){ | |
| 1994 | + if(y.getLp()==null){ | |
| 1995 | + newList.add(s); | |
| 1996 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 1997 | + if(cts != null && cts.size() > 0){ | |
| 1998 | + newList_.add(s); | |
| 1999 | + }else{ | |
| 2000 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 2001 | + newList_.add(s); | |
| 2002 | + } | |
| 2003 | + } | |
| 2004 | + }else{ | |
| 2005 | + if(y.getLp().equals(s.getLpName())){ | |
| 2006 | + newList.add(s); | |
| 2007 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 2008 | + if(cts != null && cts.size() > 0){ | |
| 2009 | + newList_.add(s); | |
| 2010 | + }else{ | |
| 2011 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 2012 | + newList_.add(s); | |
| 2013 | + } | |
| 2014 | + } | |
| 2015 | + } | |
| 2016 | + } | |
| 2017 | + } | |
| 2018 | + } | |
| 2019 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 2020 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 2021 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 2022 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 2023 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 2024 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 2025 | + | |
| 2026 | + double zyygl=Arith.add(yygl, ljgl); | |
| 2027 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 2028 | + | |
| 2029 | + Singledata sin=new Singledata(); | |
| 2030 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 2031 | + | |
| 2032 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 2033 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 2034 | + sin.setxL(y.getXlbm()); | |
| 2035 | + if(y.getLinename()==null){ | |
| 2036 | + sin.setXlmc(y.getXlname()); | |
| 2037 | + }else{ | |
| 2038 | + sin.setXlmc(y.getLinename()); | |
| 2039 | + } sin.setClzbh(clzbh); | |
| 2040 | + sin.setJsy(jsy); | |
| 2041 | + sin.setrQ(startDate); | |
| 2042 | + if(newList.size()>0){ | |
| 2043 | + sin.setjName(newList.get(0).getjName()); | |
| 2044 | + }else{ | |
| 2045 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 2046 | + } | |
| 2047 | + sin.setSgh(""); | |
| 2048 | + sin.setsName(""); | |
| 2049 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 2050 | + sin.setHyl(df.format(y.getHd())); | |
| 2051 | + sin.setJzl(df.format(y.getCdl())); | |
| 2052 | + sin.setUnyyyl(df.format(y.getSh())); | |
| 2053 | + listD.add(sin); | |
| 2054 | + } | |
| 2055 | + } | |
| 2056 | + | |
| 2057 | + Collections.sort(listY,new SingledataByXlbm()); | |
| 2058 | + Collections.sort(listD,new SingledataByXlbm()); | |
| 2059 | + list.addAll(listY); | |
| 2060 | + list.addAll(listD); | |
| 2061 | + }else{ | |
| 2062 | + String sql="select r.s_gh,r.s_name, " | |
| 2063 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,r.xl_name" | |
| 2064 | + + " from bsth_c_s_sp_info_real r where " | |
| 2065 | + + " r.schedule_date_str = '"+startDate+"'" | |
| 2066 | + + " and r.s_gh !='' and r.s_gh is not null "; | |
| 2067 | + if(!xlbm.equals("")){ | |
| 2068 | + sql += " and r.xl_bm = '"+xlbm+"'"; | |
| 2069 | + } | |
| 2070 | + if(!gsdm.equals("")){ | |
| 2071 | + sql += " and r.gs_bm='"+gsdm+"'"; | |
| 2072 | + } | |
| 2073 | + if(!fgsdm.equals("")){ | |
| 2074 | + sql += " and r.fgs_bm='"+fgsdm+"'"; | |
| 2075 | + } | |
| 2076 | + sql += " group by r.s_gh,r.s_name," | |
| 2077 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,r.xl_name order by r.xl_bm,r.cl_zbh"; | |
| 2078 | + | |
| 2079 | + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | |
| 2080 | + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 2081 | + @Override | |
| 2082 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 2083 | + Singledata sin = new Singledata(); | |
| 2084 | + sin.setrQ(startDate); | |
| 2085 | + sin.setxL(arg0.getString("xl_bm")); | |
| 2086 | + sin.setClzbh(arg0.getString("cl_zbh")); | |
| 2087 | + sin.setSgh(arg0.getString("s_gh")); | |
| 2088 | + sin.setsName(arg0.getString("s_name")); | |
| 2089 | + sin.setXlmc(arg0.getString("xl_name")); | |
| 2090 | + return sin; | |
| 2091 | + } | |
| 2092 | + }); | |
| 2093 | + | |
| 2094 | + for (int i = 0; i < list.size(); i++) { | |
| 2095 | + Singledata sin=list.get(i); | |
| 2096 | + String jsy=sin.getSgh(); | |
| 2097 | + String line=sin.getxL(); | |
| 2098 | + String clzbh=sin.getClzbh(); | |
| 2099 | + String xl_name=sin.getXlmc(); | |
| 2100 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 2101 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 2102 | + | |
| 2103 | + for (int j = 0; j < listReal.size(); j++) { | |
| 2104 | + ScheduleRealInfo s=listReal.get(j); | |
| 2105 | + if(s.getsGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 2106 | + &&s.getXlBm().equals(line)){ | |
| 2107 | + newList.add(s); | |
| 2108 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 2109 | + if(cts != null && cts.size() > 0){ | |
| 2110 | + newList_.add(s); | |
| 2111 | + }else{ | |
| 2112 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 2113 | + newList_.add(s); | |
| 2114 | + } | |
| 2115 | + } | |
| 2116 | + } | |
| 2117 | + } | |
| 2118 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 2119 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 2120 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 2121 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 2122 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 2123 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 2124 | + | |
| 2125 | + double zyygl=Arith.add(yygl, ljgl); | |
| 2126 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 2127 | + | |
| 2128 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 2129 | + | |
| 2130 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 2131 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 2132 | + sin.setXlmc(xl_name); | |
| 2133 | + sin.setClzbh(clzbh); | |
| 2134 | + sin.setJsy(""); | |
| 2135 | + sin.setjName(""); | |
| 2136 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 2137 | + sin.setHyl(""); | |
| 2138 | + sin.setJzl(""); | |
| 2139 | + sin.setUnyyyl(""); | |
| 2140 | + } | |
| 2141 | + Collections.sort(list,new SingledataByXlbm()); | |
| 2142 | + } | |
| 2143 | + return list; | |
| 2144 | + } | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + // 路单数据 | |
| 2148 | + @Override | |
| 2149 | + public List<Singledata> singledata2(Map<String, Object> map) { | |
| 2150 | + | |
| 2151 | + String gsdm=""; | |
| 2152 | + if(map.get("gsdmSing")!=null){ | |
| 2153 | + gsdm=map.get("gsdmSing").toString(); | |
| 2154 | + } | |
| 2155 | + String fgsdm=""; | |
| 2156 | + if(map.get("fgsdmSing")!=null){ | |
| 2157 | + fgsdm=map.get("fgsdmSing").toString(); | |
| 2158 | + } | |
| 2159 | + | |
| 2160 | + String tjtype=map.get("tjtype").toString(); | |
| 2161 | + String xlbm=map.get("line").toString().trim(); | |
| 2162 | + startDate = map.get("startDate").toString(); | |
| 2163 | + | |
| 2164 | + List<ScheduleRealInfo> listReal=new ArrayList<ScheduleRealInfo>(); | |
| 2165 | + if(xlbm.equals("")){ | |
| 2166 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineByGs_(gsdm, fgsdm, startDate); | |
| 2167 | + }else{ | |
| 2168 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineQp(xlbm, startDate); | |
| 2169 | + } | |
| 2170 | + List<Singledata> list=new ArrayList<Singledata>(); | |
| 2171 | + List<Singledata> listY=new ArrayList<Singledata>(); | |
| 2172 | + List<Singledata> listD=new ArrayList<Singledata>(); | |
| 2173 | + | |
| 2174 | + if(tjtype.equals("jsy")){ | |
| 2175 | + DecimalFormat df = new DecimalFormat("0.00"); | |
| 2176 | + List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | |
| 2177 | + for (int i = 0; i < listYlb.size(); i++) { | |
| 2178 | + Ylb y=listYlb.get(i); | |
| 2179 | + boolean fage=false; | |
| 2180 | + if(xlbm.equals("")){ | |
| 2181 | + fage=true; | |
| 2182 | + }else{ | |
| 2183 | + if(xlbm.equals(y.getXlbm())){ | |
| 2184 | + fage=true; | |
| 2185 | + } | |
| 2186 | + } | |
| 2187 | + if(fage){ | |
| 2188 | + String jsy=y.getJsy(); | |
| 2189 | + String line=y.getXlbm(); | |
| 2190 | + String clzbh=y.getNbbm(); | |
| 2191 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 2192 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 2193 | + for (int j = 0; j < listReal.size(); j++) { | |
| 2194 | + ScheduleRealInfo s=listReal.get(j); | |
| 2195 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 2196 | + &&s.getXlBm().equals(line)){ | |
| 2197 | + if(y.getLp()==null){ | |
| 2198 | + newList.add(s); | |
| 2199 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 2200 | + if(cts != null && cts.size() > 0){ | |
| 2201 | + newList_.add(s); | |
| 2202 | + }else{ | |
| 2203 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 2204 | + newList_.add(s); | |
| 2205 | + } | |
| 2206 | + } | |
| 2207 | + }else{ | |
| 2208 | + if(y.getLp().equals(s.getLpName())){ | |
| 2209 | + newList.add(s); | |
| 2210 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 2211 | + if(cts != null && cts.size() > 0){ | |
| 2212 | + newList_.add(s); | |
| 2213 | + }else{ | |
| 2214 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 2215 | + newList_.add(s); | |
| 2216 | + } | |
| 2217 | + } | |
| 2218 | + } | |
| 2219 | + } | |
| 2220 | + } | |
| 2221 | + } | |
| 2222 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 2223 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 2224 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 2225 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 2226 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 2227 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 2228 | + | |
| 2229 | + double zyygl=Arith.add(yygl, ljgl); | |
| 2230 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 2231 | + | |
| 2232 | + Singledata sin=new Singledata(); | |
| 2233 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 2234 | + | |
| 2235 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 2236 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 2237 | + sin.setxL(y.getXlbm()); | |
| 2238 | + if(y.getLinename()==null){ | |
| 2239 | + sin.setXlmc(y.getXlname()); | |
| 2240 | + }else{ | |
| 2241 | + sin.setXlmc(y.getLinename()); | |
| 2242 | + } sin.setClzbh(clzbh); | |
| 2243 | + sin.setJsy(jsy); | |
| 2244 | + sin.setrQ(startDate); | |
| 2245 | + if(newList.size()>0){ | |
| 2246 | + sin.setjName(newList.get(0).getjName()); | |
| 2247 | + }else{ | |
| 2248 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 2249 | + } | |
| 2250 | + sin.setSgh(""); | |
| 2251 | + sin.setsName(""); | |
| 2252 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 2253 | + sin.setHyl(df.format(y.getYh())); | |
| 2254 | + sin.setJzl(df.format(y.getJzl())); | |
| 2255 | + sin.setUnyyyl(df.format(y.getSh())); | |
| 2256 | + listY.add(sin); | |
| 2257 | + } | |
| 2258 | + | |
| 2259 | + } | |
| 2260 | + | |
| 2261 | + List<Dlb> listDlb= dlbRepository.obtainDl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | |
| 2262 | + for (int i = 0; i < listDlb.size(); i++) { | |
| 2263 | + Dlb y=listDlb.get(i); | |
| 2264 | + boolean fage=false; | |
| 2265 | + if(xlbm.equals("")){ | |
| 2266 | + fage=true; | |
| 2267 | + }else{ | |
| 2268 | + if(xlbm.equals(y.getXlbm())){ | |
| 2269 | + fage=true; | |
| 2270 | + } | |
| 2271 | + } | |
| 2272 | + if(fage){ | |
| 2273 | + String jsy=y.getJsy(); | |
| 2274 | + String line=y.getXlbm(); | |
| 2275 | + String clzbh=y.getNbbm(); | |
| 2276 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 2277 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 2278 | + for (int j = 0; j < listReal.size(); j++) { | |
| 2279 | + ScheduleRealInfo s=listReal.get(j); | |
| 2280 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 2281 | + &&s.getXlBm().equals(line)){ | |
| 2282 | + if(y.getLp()==null){ | |
| 2283 | + newList.add(s); | |
| 2284 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 2285 | + if(cts != null && cts.size() > 0){ | |
| 2286 | + newList_.add(s); | |
| 2287 | + }else{ | |
| 2288 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 2289 | + newList_.add(s); | |
| 2290 | + } | |
| 2291 | + } | |
| 2292 | + }else{ | |
| 2293 | + if(y.getLp().equals(s.getLpName())){ | |
| 2294 | + newList.add(s); | |
| 2295 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 2296 | + if(cts != null && cts.size() > 0){ | |
| 2297 | + newList_.add(s); | |
| 2298 | + }else{ | |
| 2299 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 2300 | + newList_.add(s); | |
| 2301 | + } | |
| 2302 | + } | |
| 2303 | + } | |
| 2304 | + } | |
| 2305 | + } | |
| 2306 | + } | |
| 2307 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 2308 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 2309 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 2310 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 2311 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 2312 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 2313 | + | |
| 2314 | + double zyygl=Arith.add(yygl, ljgl); | |
| 2315 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 2316 | + | |
| 2317 | + Singledata sin=new Singledata(); | |
| 2318 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 2319 | + | |
| 2320 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 2321 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 2322 | + sin.setxL(y.getXlbm()); | |
| 2323 | + if(y.getLinename()==null){ | |
| 2324 | + sin.setXlmc(y.getXlname()); | |
| 2325 | + }else{ | |
| 2326 | + sin.setXlmc(y.getLinename()); | |
| 2327 | + } | |
| 2328 | + sin.setClzbh(clzbh); | |
| 2329 | + sin.setJsy(jsy); | |
| 2330 | + sin.setrQ(startDate); | |
| 2331 | + if(newList.size()>0){ | |
| 2332 | + sin.setjName(newList.get(0).getjName()); | |
| 2333 | + }else{ | |
| 2334 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | |
| 2335 | + } | |
| 2336 | + sin.setSgh(""); | |
| 2337 | + sin.setsName(""); | |
| 2338 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 2339 | + sin.setHyl(df.format(y.getHd())); | |
| 2340 | + sin.setJzl(df.format(y.getCdl())); | |
| 2341 | + sin.setUnyyyl(df.format(y.getSh())); | |
| 2342 | + listD.add(sin); | |
| 2343 | + } | |
| 2344 | + } | |
| 2345 | + | |
| 2346 | + Collections.sort(listY,new SingledataByXlbm()); | |
| 2347 | + Collections.sort(listD,new SingledataByXlbm()); | |
| 2348 | + list.addAll(listY); | |
| 2349 | + list.addAll(listD); | |
| 2350 | + }else{ | |
| 2351 | + String sql="select r.s_gh,r.s_name, " | |
| 2352 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,r.xl_name" | |
| 2353 | + + " from bsth_c_s_sp_info_real r where " | |
| 2354 | + + " r.schedule_date_str = '"+startDate+"'" | |
| 2355 | + + " and r.s_gh !='' and r.s_gh is not null "; | |
| 2356 | + if(!xlbm.equals("")){ | |
| 2357 | + sql += " and r.xl_bm = '"+xlbm+"'"; | |
| 2358 | + } | |
| 2359 | + if(!gsdm.equals("")){ | |
| 2360 | + sql += " and r.gs_bm='"+gsdm+"'"; | |
| 2361 | + } | |
| 2362 | + if(!fgsdm.equals("")){ | |
| 2363 | + sql += " and r.fgs_bm='"+fgsdm+"'"; | |
| 2364 | + } | |
| 2365 | + sql += " group by r.s_gh,r.s_name," | |
| 2366 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,xl_name order by r.xl_bm,r.cl_zbh"; | |
| 2367 | + | |
| 2368 | + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | |
| 2369 | + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 2370 | + @Override | |
| 2371 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 2372 | + Singledata sin = new Singledata(); | |
| 2373 | + sin.setrQ(startDate); | |
| 2374 | + sin.setxL(arg0.getString("xl_bm")); | |
| 2375 | + sin.setClzbh(arg0.getString("cl_zbh")); | |
| 2376 | + sin.setSgh(arg0.getString("s_gh")); | |
| 2377 | + sin.setsName(arg0.getString("s_name")); | |
| 2378 | + sin.setXlmc(arg0.getString("xl_name")); | |
| 2379 | + return sin; | |
| 2380 | + } | |
| 2381 | + }); | |
| 2382 | + | |
| 2383 | + for (int i = 0; i < list.size(); i++) { | |
| 2384 | + Singledata sin=list.get(i); | |
| 2385 | + String jsy=sin.getSgh(); | |
| 2386 | + String line=sin.getxL(); | |
| 2387 | + String clzbh=sin.getClzbh(); | |
| 2388 | + String xl_name=sin.getXlmc(); | |
| 2389 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 2390 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 2391 | + | |
| 2392 | + for (int j = 0; j < listReal.size(); j++) { | |
| 2393 | + ScheduleRealInfo s=listReal.get(j); | |
| 2394 | + if(s.getsGh().equals(jsy) && s.getClZbh().equals(clzbh) | |
| 2395 | + &&s.getXlBm().equals(line)){ | |
| 2396 | + newList.add(s); | |
| 2397 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 2398 | + if(cts != null && cts.size() > 0){ | |
| 2399 | + newList_.add(s); | |
| 2400 | + }else{ | |
| 2401 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 2402 | + newList_.add(s); | |
| 2403 | + } | |
| 2404 | + } | |
| 2405 | + } | |
| 2406 | + } | |
| 2407 | + double jhgl=culateMileageService.culateJhgl(newList); | |
| 2408 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | |
| 2409 | +// double yygl=culateMileageService.culateSjgl(newList_); | |
| 2410 | +// double ljgl=culateMileageService.culateLjgl(newList_); | |
| 2411 | +// double ksgl=culateMileageService.culateKsgl(newList_); | |
| 2412 | +// double jcgl=culateMileageService.culateJccgl(newList_); | |
| 2413 | + double yygl=culateMileageService.culateSjgl_spy(newList_); | |
| 2414 | + double ljgl=culateMileageService.culateLjgl_spy(newList_); | |
| 2415 | + double zyygl=Arith.add(yygl, ljgl); | |
| 2416 | +// double zksgl=Arith.add(ksgl, jcgl); | |
| 2417 | + double zksgl=culateMileageService.culateSjfyylc_spy(newList_); | |
| 2418 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 2419 | + | |
| 2420 | + sin.setEmptMileage(String.valueOf(zksgl)); | |
| 2421 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | |
| 2422 | + sin.setXlmc(xl_name); | |
| 2423 | + sin.setClzbh(clzbh); | |
| 2424 | + sin.setJsy(""); | |
| 2425 | + sin.setjName(""); | |
| 2426 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 2427 | + sin.setHyl(""); | |
| 2428 | + sin.setJzl(""); | |
| 2429 | + sin.setUnyyyl(""); | |
| 2430 | + } | |
| 2431 | + Collections.sort(list,new SingledataByXlbm()); | |
| 2432 | + } | |
| 2433 | + return list; | |
| 2434 | + } | |
| 2435 | + | |
| 2436 | + // 运营服务阶段报表 | |
| 2437 | + @Override | |
| 2438 | + public List<Operationservice> operationservice(Map<String, Object> map) { | |
| 2439 | + | |
| 2440 | + String sfyy=""; | |
| 2441 | + if(map.get("sfyy")!=null){ | |
| 2442 | + sfyy=map.get("sfyy").toString(); | |
| 2443 | + } | |
| 2444 | + String gsdm=""; | |
| 2445 | + if(map.get("gsdmOperat")!=null){ | |
| 2446 | + gsdm=map.get("gsdmOperat").toString(); | |
| 2447 | + } | |
| 2448 | + String fgsdm=""; | |
| 2449 | + if(map.get("fgsdmOperat")!=null){ | |
| 2450 | + fgsdm=map.get("fgsdmOperat").toString(); | |
| 2451 | + } | |
| 2452 | + String xlbm=map.get("line").toString().trim(); | |
| 2453 | + String startDate=map.get("startDate").toString(); | |
| 2454 | + String endDate =map.get("endDate").toString(); | |
| 2455 | + | |
| 2456 | + String sql="select r.xl_bm, r.gs_bm, r.fgs_bm" | |
| 2457 | + + " from bsth_c_s_sp_info_real r where" | |
| 2458 | + + " r.schedule_date_str BETWEEN '"+startDate+"' and '"+endDate+"'"; | |
| 2459 | + if(xlbm.length() != 0){ | |
| 2460 | + sql += " and r.xl_bm = '"+xlbm+"'"; | |
| 2461 | + } | |
| 2462 | + if(gsdm.length() != 0){ | |
| 2463 | + sql += " and r.gs_bm='"+gsdm+"'"; | |
| 2464 | + } | |
| 2465 | + if(fgsdm.length() != 0){ | |
| 2466 | + sql += " and r.fgs_bm='"+fgsdm+"'"; | |
| 2467 | + } | |
| 2468 | + sql += " group by r.gs_bm, r.fgs_bm, r.xl_bm " + | |
| 2469 | + "order by r.gs_bm, r.fgs_bm, r.xl_bm"; | |
| 2470 | + | |
| 2471 | + List<Operationservice> query = jdbcTemplate.query(sql, new RowMapper<Operationservice>() { | |
| 2472 | + @Override | |
| 2473 | + public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 2474 | + Operationservice ve = new Operationservice(); | |
| 2475 | + ve.setXlBm(arg0.getString("xl_bm")); | |
| 2476 | + ve.setGs(arg0.getString("gs_bm")); | |
| 2477 | + ve.setFgs(arg0.getString("fgs_bm")); | |
| 2478 | + return ve; | |
| 2479 | + } | |
| 2480 | + }); | |
| 2481 | + | |
| 2482 | + List<Operationservice> list = new ArrayList<Operationservice>(); | |
| 2483 | + Map<String, Boolean> lineNature = lineService.lineNature(); | |
| 2484 | + for(Operationservice o : query){ | |
| 2485 | + o.setFgs(BasicData.businessFgsCodeNameMap.get(o.getFgs()+"_"+o.getGs())); | |
| 2486 | + | |
| 2487 | + String xl = o.getXlBm(); | |
| 2488 | + if(sfyy.length() != 0){ | |
| 2489 | + if(sfyy.equals("0")){ | |
| 2490 | + list.add(o); | |
| 2491 | + } else if(sfyy.equals("1")){ | |
| 2492 | + if(lineNature.containsKey(xl) && lineNature.get(xl)){ | |
| 2493 | + list.add(o); | |
| 2494 | + } | |
| 2495 | + } else { | |
| 2496 | + if(lineNature.containsKey(xl) && !lineNature.get(xl)){ | |
| 2497 | + list.add(o); | |
| 2498 | + } | |
| 2499 | + } | |
| 2500 | + } else { | |
| 2501 | + list.add(o); | |
| 2502 | + } | |
| 2503 | + } | |
| 2504 | + | |
| 2505 | + String ylbSql=" select * from bsth_c_ylb where rq BETWEEN '"+startDate+"' and '"+endDate+"'"; | |
| 2506 | + if(!xlbm.equals("")){ | |
| 2507 | + ylbSql += " and xlbm = '"+xlbm+"'"; | |
| 2508 | + } | |
| 2509 | + if(!gsdm.equals("")){ | |
| 2510 | + ylbSql += " and ssgsdm='"+gsdm+"'"; | |
| 2511 | + } | |
| 2512 | + if(!fgsdm.equals("")){ | |
| 2513 | + ylbSql += " and fgsdm='"+fgsdm+"'"; | |
| 2514 | + } | |
| 2515 | + List<Ylb> ylbList= jdbcTemplate.query(ylbSql, new RowMapper<Ylb>() { | |
| 2516 | + @Override | |
| 2517 | + public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 2518 | + Ylb y = new Ylb(); | |
| 2519 | + y.setXlbm(arg0.getString("xlbm")); | |
| 2520 | + y.setJzl(arg0.getDouble("jzl")); | |
| 2521 | + y.setYh(arg0.getDouble("yh")); | |
| 2522 | + return y; | |
| 2523 | + } | |
| 2524 | + }); | |
| 2525 | + | |
| 2526 | + String dlbSql=" select * from bsth_c_dlb where rq BETWEEN '"+startDate+"' and '"+endDate+"'"; | |
| 2527 | + if(!xlbm.equals("")){ | |
| 2528 | + ylbSql += " and xlbm = '"+xlbm+"'"; | |
| 2529 | + } | |
| 2530 | + if(!gsdm.equals("")){ | |
| 2531 | + ylbSql += " and ssgsdm='"+gsdm+"'"; | |
| 2532 | + } | |
| 2533 | + if(!fgsdm.equals("")){ | |
| 2534 | + ylbSql += " and fgsdm='"+fgsdm+"'"; | |
| 2535 | + } | |
| 2536 | + List<Dlb> dlbList= jdbcTemplate.query(dlbSql, new RowMapper<Dlb>() { | |
| 2537 | + @Override | |
| 2538 | + public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 2539 | + Dlb d = new Dlb(); | |
| 2540 | + d.setCdl(arg0.getDouble("cdl")); | |
| 2541 | + d.setXlbm(arg0.getString("xlbm")); | |
| 2542 | + d.setHd(arg0.getDouble("hd")); | |
| 2543 | + return d; | |
| 2544 | + } | |
| 2545 | + }); | |
| 2546 | + | |
| 2547 | + Set<String> lineSet = new HashSet<String>(); | |
| 2548 | + List<String> strList = new ArrayList<>(); | |
| 2549 | + sql = "select name from bsth_c_line where sfyy = 0"; | |
| 2550 | + strList = jdbcTemplate.query(sql, | |
| 2551 | + new RowMapper<String>(){ | |
| 2552 | + @Override | |
| 2553 | + public String mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 2554 | + return rs.getString("name"); | |
| 2555 | + } | |
| 2556 | + }); | |
| 2557 | + lineSet.addAll(strList); | |
| 2558 | + | |
| 2559 | + List<ScheduleRealInfo> listReal; | |
| 2560 | + if(xlbm.equals("")){ | |
| 2561 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineTj(xlbm, startDate, endDate, gsdm, fgsdm); | |
| 2562 | + }else{ | |
| 2563 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineTj2(xlbm, startDate, endDate); | |
| 2564 | + } | |
| 2565 | + List<Operationservice> resList = new ArrayList<Operationservice>(); | |
| 2566 | + for (int i = 0; i < list.size(); i++) { | |
| 2567 | + Operationservice o=list.get(i); | |
| 2568 | + String line=o.getXlBm(); | |
| 2569 | + String xlname=BasicData.lineCode2NameMap.get(line); | |
| 2570 | + if(lineSet.contains(xlname)) | |
| 2571 | + continue; | |
| 2572 | + o.setXlName(xlname); | |
| 2573 | + | |
| 2574 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 2575 | + for (int j = 0; j < listReal.size(); j++) { | |
| 2576 | + ScheduleRealInfo s = listReal.get(j); | |
| 2577 | + if (s.getXlBm().equals(line) && !lineSet.contains(s.getXlName())) { | |
| 2578 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 2579 | + if (cts != null && cts.size() > 0) { | |
| 2580 | + newList.add(s); | |
| 2581 | + } else { | |
| 2582 | + if (s.getZdsjActual() != null && s.getFcsjActual() != null) { | |
| 2583 | + newList.add(s); | |
| 2584 | + } | |
| 2585 | + } | |
| 2586 | + } | |
| 2587 | + } | |
| 2588 | + | |
| 2589 | + int sjbc=culateMileageService.culateSjbc(newList,""); | |
| 2590 | + int ljbc=culateMileageService.culateLjbc(newList,""); | |
| 2591 | + double ksgl=culateMileageService.culateKsgl(newList); | |
| 2592 | + double jccgl=culateMileageService.culateJccgl(newList); | |
| 2593 | + double zksgl=Arith.add(ksgl, jccgl); | |
| 2594 | + double sjgl=culateMileageService.culateSjgl(newList); | |
| 2595 | + double ljgl=culateMileageService.culateLjgl(newList); | |
| 2596 | + double zyygl=Arith.add(sjgl, ljgl); | |
| 2597 | + o.setEmptMileage(String.valueOf(Arith.add(ksgl, jccgl))); | |
| 2598 | + o.setXsgl(String.valueOf(Arith.add(zyygl, zksgl))); | |
| 2599 | + o.setSjbc(String.valueOf(sjbc+ljbc)); | |
| 2600 | + | |
| 2601 | + double jzl=0.0; | |
| 2602 | + double xhl=0.0; | |
| 2603 | + for (int j = 0; j < ylbList.size(); j++) { | |
| 2604 | + Ylb t=ylbList.get(j); | |
| 2605 | + if(t.getXlbm().equals(line)){ | |
| 2606 | + jzl=Arith.add(jzl, t.getJzl()); | |
| 2607 | + xhl=Arith.add(xhl, t.getYh()); | |
| 2608 | + } | |
| 2609 | + } | |
| 2610 | + for (int j = 0; j < dlbList.size(); j++) { | |
| 2611 | + Dlb d=dlbList.get(j); | |
| 2612 | + if(d.getXlbm().equals(line)){ | |
| 2613 | + jzl=Arith.add(jzl, d.getCdl()); | |
| 2614 | + xhl=Arith.add(xhl, d.getHd()); | |
| 2615 | + } | |
| 2616 | + } | |
| 2617 | + | |
| 2618 | + o.setJzl(String.valueOf(jzl)); | |
| 2619 | + o.setXhl(String.valueOf(xhl)); | |
| 2620 | + | |
| 2621 | + resList.add(o); | |
| 2622 | + } | |
| 2623 | + return resList; | |
| 2624 | + } | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + // 车辆加注 | |
| 2628 | + @Override | |
| 2629 | + public List<Vehicleloading> vehicleloading(String line, String date) { | |
| 2630 | + | |
| 2631 | + String sql="select r.s_gh,r.s_name, " | |
| 2632 | + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm" | |
| 2633 | + + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+date+"' " | |
| 2634 | + + " and r.xl_bm = '"+line+"' group by r.s_gh,r.s_name," | |
| 2635 | + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm"; | |
| 2636 | + | |
| 2637 | + List<Vehicleloading> list = jdbcTemplate.query(sql, new RowMapper<Vehicleloading>() { | |
| 2638 | + @Override | |
| 2639 | + public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 2640 | + Vehicleloading ve = new Vehicleloading(); | |
| 2641 | + ve.setgS(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs_bm")+"_"+arg0.getString("gs_bm"))); | |
| 2642 | + ve.setxL(arg0.getString("xl_name")); | |
| 2643 | + ve.setClzbh(arg0.getString("cl_zbh")); | |
| 2644 | + ve.setJgh(arg0.getString("j_gh").toString()); | |
| 2645 | + return ve; | |
| 2646 | + } | |
| 2647 | + }); | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + List<Ylb> listYlb= ylbRepository.obtainYl(date, "", "", line, "", "xlbm"); | |
| 2651 | + List<Dlb> listDlb= dlbRepository.obtainDl(date, "", "", line, "", "xlbm"); | |
| 2652 | + List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); | |
| 2653 | + for (int i = 0; i < list.size(); i++) { | |
| 2654 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | |
| 2655 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | |
| 2656 | + Vehicleloading sin=list.get(i); | |
| 2657 | + sin.setrQ(date); | |
| 2658 | + String jsy=sin.getJgh(); | |
| 2659 | + String clzbh=sin.getClzbh(); | |
| 2660 | + for (int j = 0; j < listReal.size(); j++) { | |
| 2661 | + ScheduleRealInfo s = listReal.get(j); | |
| 2662 | + if (s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)) { | |
| 2663 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 2664 | + if (cts != null && cts.size() > 0) { | |
| 2665 | + newList_.add(s); | |
| 2666 | + } else { | |
| 2667 | + if (s.getZdsjActual() != null && s.getFcsjActual() != null) { | |
| 2668 | + newList_.add(s); | |
| 2669 | + } | |
| 2670 | + } | |
| 2671 | + newList.add(s); | |
| 2672 | + } | |
| 2673 | + } | |
| 2674 | + | |
| 2675 | + int jhbc=culateMileageService.culateJhbc(newList, ""); | |
| 2676 | + int sjbc=culateMileageService.culateSjbc(newList_, ""); | |
| 2677 | + int ljbc=culateMileageService.culateLjbc(newList_, ""); | |
| 2678 | + double yygl=culateMileageService.culateSjgl(newList_); | |
| 2679 | + double ljgl=culateMileageService.culateLjgl(newList_); | |
| 2680 | + double ksgl=culateMileageService.culateKsgl(newList_); | |
| 2681 | + double jcgl=culateMileageService.culateJccgl(newList_); | |
| 2682 | + double zyygl=Arith.add(yygl, ljgl); | |
| 2683 | + double zksgl=Arith.add(ksgl, jcgl); | |
| 2684 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | |
| 2685 | + sin.setJhbc(String.valueOf(jhbc)); | |
| 2686 | + sin.setSjbc(String.valueOf(sjbc+ljbc)); | |
| 2687 | + double yhl=0.0; | |
| 2688 | + double jzl=0.0; | |
| 2689 | + double fyy=0.0; | |
| 2690 | + double ns=0.0; | |
| 2691 | + for (int j = 0; j < listYlb.size(); j++) { | |
| 2692 | + Ylb y=listYlb.get(j); | |
| 2693 | + if(y.getJsy().equals(jsy) && y.getNbbm().equals(clzbh)){ | |
| 2694 | + yhl=Arith.add(yhl, y.getYh()==null?0:y.getYh()); | |
| 2695 | + jzl=Arith.add(jzl, y.getJzl()==null?0:y.getJzl()); | |
| 2696 | + fyy=Arith.add(fyy, y.getSh()==null?0:y.getSh()); | |
| 2697 | + ns =Arith.add(ns, y.getNs()==null?0:y.getNs()); | |
| 2698 | + } | |
| 2699 | + } | |
| 2700 | + for (int j = 0; j < listDlb.size(); j++) { | |
| 2701 | + Dlb d=listDlb.get(j); | |
| 2702 | + if(d.getJsy().equals(jsy) && d.getNbbm().equals(clzbh)){ | |
| 2703 | + yhl=Arith.add(yhl, d.getHd()==null?0:d.getHd()); | |
| 2704 | + jzl=Arith.add(jzl, d.getCdl()==null?0:d.getCdl()); | |
| 2705 | + fyy=Arith.add(fyy, d.getSh()==null?0:d.getSh()); | |
| 2706 | + } | |
| 2707 | + } | |
| 2708 | + sin.setHyl(String.valueOf(yhl)); | |
| 2709 | + sin.setJzl(String.valueOf(jzl)); | |
| 2710 | + sin.setUnyyyl(String.valueOf(fyy)); | |
| 2711 | + sin.setLs(String.valueOf(ns)); | |
| 2712 | + } | |
| 2713 | + return list; | |
| 2714 | + } | |
| 2715 | + | |
| 2716 | + // 营运线路出车率统计表 | |
| 2717 | + @Override | |
| 2718 | + public List<Map<String, Object>> turnoutrate(Map<String, Object> map) { | |
| 2719 | + | |
| 2720 | + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); | |
| 2721 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 2722 | + Set<String> lineSet = new HashSet<String>(); | |
| 2723 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 2724 | + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日"); | |
| 2725 | + NumberFormat numberFormat = NumberFormat.getInstance(); | |
| 2726 | + numberFormat.setMaximumFractionDigits(2); | |
| 2727 | + Date d = null; | |
| 2728 | + Date d1 = null; | |
| 2729 | + try { | |
| 2730 | + d = sdf.parse(map.get("startDate").toString()); | |
| 2731 | + d1 = sdf.parse(map.get("endDate").toString()); | |
| 2732 | + } catch (ParseException e) { | |
| 2733 | + | |
| 2734 | + e.printStackTrace(); | |
| 2735 | + } | |
| 2736 | + String rq2 = sdf1.format(d); | |
| 2737 | + String rq3 = sdf1.format(d1); | |
| 2738 | + String company = "", subCompany = ""; | |
| 2739 | + if(map.get("gsdmTurn") != null){ | |
| 2740 | + company = map.get("gsdmTurn").toString(); | |
| 2741 | + } | |
| 2742 | + if(map.get("fgsdmTurn") != null){ | |
| 2743 | + subCompany = map.get("fgsdmTurn").toString(); | |
| 2744 | + } | |
| 2745 | + String line = map.get("line").toString(); | |
| 2746 | + String startDate = map.get("startDate").toString(); | |
| 2747 | + String endDate = map.get("endDate").toString(); | |
| 2748 | + if(line.trim().length() == 0){ | |
| 2749 | + line = ""; | |
| 2750 | + } | |
| 2751 | + | |
| 2752 | + rq = rq2 + "-" + rq3; | |
| 2753 | + | |
| 2754 | + List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, startDate, endDate, company, subCompany); | |
| 2755 | + List<Line> lineList = lineRepository.findLineBygsBm(company, subCompany, line.length()==0?"%"+line+"%":line); | |
| 2756 | + | |
| 2757 | + String sql = "select gs_name, fgs_name, cl_zbh, fcsj, bc_type, xl_bm, xl_name, schedule_date" | |
| 2758 | + + " from bsth_c_s_sp_info where " | |
| 2759 | + + "schedule_date >= '"+startDate+"' and schedule_date <= '"+endDate+"' "; | |
| 2760 | + if(line.trim().length() != 0){ | |
| 2761 | + sql += "and xl_bm = '"+line+"' "; | |
| 2762 | + } | |
| 2763 | + if(company.trim().length() != 0){ | |
| 2764 | + sql += "and gs_bm = '"+company+"' "; | |
| 2765 | + } | |
| 2766 | + if(subCompany.trim().length() != 0){ | |
| 2767 | + sql += "and fgs_bm = '"+subCompany+"' "; | |
| 2768 | + } | |
| 2769 | + List<SchedulePlanInfo> planList = jdbcTemplate.query(sql, new RowMapper<SchedulePlanInfo>() { | |
| 2770 | + | |
| 2771 | + @Override | |
| 2772 | + public SchedulePlanInfo mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 2773 | + SchedulePlanInfo schedule = new SchedulePlanInfo(); | |
| 2774 | + schedule.setGsName(arg0.getString("gs_name")); | |
| 2775 | + schedule.setFgsName(arg0.getString("fgs_name")); | |
| 2776 | + schedule.setClZbh(arg0.getString("cl_zbh")); | |
| 2777 | + schedule.setFcsj(arg0.getString("fcsj")); | |
| 2778 | + schedule.setBcType(arg0.getString("bc_type")); | |
| 2779 | + schedule.setXlBm(arg0.getString("xl_bm")); | |
| 2780 | + schedule.setXlName(arg0.getString("xl_name")); | |
| 2781 | + schedule.setScheduleDate(arg0.getDate("schedule_date")); | |
| 2782 | + return schedule; | |
| 2783 | + } | |
| 2784 | + | |
| 2785 | + }); | |
| 2786 | + sql = "select line_code from bsth_c_line where sfyy = 0"; | |
| 2787 | + List<String> strList = new ArrayList<>(); | |
| 2788 | + strList = jdbcTemplate.query(sql, | |
| 2789 | + new RowMapper<String>(){ | |
| 2790 | + @Override | |
| 2791 | + public String mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 2792 | + return rs.getString("line_code"); | |
| 2793 | + } | |
| 2794 | + }); | |
| 2795 | + lineSet.addAll(strList); | |
| 2796 | + | |
| 2797 | + for(Line line1 : lineList){ | |
| 2798 | + if(lineSet.contains(line1.getLineCode())){ | |
| 2799 | + continue; | |
| 2800 | + } | |
| 2801 | + if(line.trim().length() == 0 || line1.getLineCode().equals(line)){ | |
| 2802 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 2803 | + m.put("rq", rq); | |
| 2804 | + m.put("line", line1.getName()); | |
| 2805 | + m.put("xlBm", line1.getLineCode()); | |
| 2806 | + m.put("qz", line1.getWarrantCar()!=null?line1.getWarrantCar():0); | |
| 2807 | + m.put("sm", ""); | |
| 2808 | + tempList.add(m); | |
| 2809 | + } | |
| 2810 | + } | |
| 2811 | + for(Map<String, Object> m : tempList){ | |
| 2812 | + String xlBm = m.get("xlBm").toString(); | |
| 2813 | + List<ScheduleRealInfo> reals = new ArrayList<ScheduleRealInfo>(); | |
| 2814 | + List<SchedulePlanInfo> plans = new ArrayList<SchedulePlanInfo>(); | |
| 2815 | + for(ScheduleRealInfo schedule : list){ | |
| 2816 | + if(schedule.getXlBm().equals(xlBm)){ | |
| 2817 | + reals.add(schedule); | |
| 2818 | + } | |
| 2819 | + } | |
| 2820 | + for(SchedulePlanInfo schedule : planList){ | |
| 2821 | + if(schedule.getXlBm().equals(xlBm)){ | |
| 2822 | + plans.add(schedule); | |
| 2823 | + } | |
| 2824 | + } | |
| 2825 | + Set<String> jhcc = new HashSet<String>(); | |
| 2826 | + Set<String> sjcc = new HashSet<String>(); | |
| 2827 | + for(SchedulePlanInfo schedule : plans){ | |
| 2828 | + if(!m.containsKey("gsName") && schedule.getGsName()!=null && schedule.getGsName().trim().length()!=0){ | |
| 2829 | + m.put("gsName", schedule.getGsName()); | |
| 2830 | + } | |
| 2831 | + if(!m.containsKey("fgsName") && schedule.getFgsName()!=null && schedule.getFgsName().trim().length()!=0){ | |
| 2832 | + m.put("fgsName", schedule.getFgsName()); | |
| 2833 | + } | |
| 2834 | + jhcc.add(schedule.getClZbh() + sdf.format(schedule.getScheduleDate())); | |
| 2835 | + } | |
| 2836 | + for(ScheduleRealInfo schedule : reals){ | |
| 2837 | + if(!m.containsKey("gsName") && schedule.getGsName()!=null && schedule.getGsName().trim().length()!=0){ | |
| 2838 | + m.put("gsName", schedule.getGsName()); | |
| 2839 | + } | |
| 2840 | + if(!m.containsKey("fgsName") && schedule.getFgsName()!=null && schedule.getFgsName().trim().length()!=0){ | |
| 2841 | + m.put("fgsName", schedule.getFgsName()); | |
| 2842 | + } | |
| 2843 | + sjcc.add(schedule.getClZbh() + sdf.format(schedule.getScheduleDate())); | |
| 2844 | + } | |
| 2845 | + m.put("jhcc", jhcc.size()); | |
| 2846 | + m.put("sjcc", sjcc.size()); | |
| 2847 | + if(jhcc.size() != 0 && sjcc.size() != 0){ | |
| 2848 | + m.put("ccl", numberFormat.format(((float)sjcc.size() / jhcc.size())*100)+"%"); | |
| 2849 | + }else{ | |
| 2850 | + m.put("ccl", "--"); | |
| 2851 | + } | |
| 2852 | + int jhbc = culateMileageService.culateJhbc(reals, ""); | |
| 2853 | + int sjbc = culateMileageService.culateSjbc(reals, ""); | |
| 2854 | + m.put("jhbc", jhbc); | |
| 2855 | + m.put("sjbc", sjbc); | |
| 2856 | + if(jhbc != 0 && sjbc != 0){ | |
| 2857 | + m.put("zxl", numberFormat.format(((float)sjbc / jhbc)*100)+"%"); | |
| 2858 | + }else{ | |
| 2859 | + m.put("zxl", "--"); | |
| 2860 | + } | |
| 2861 | + if(jhbc != 0 && sjbc != 0){ | |
| 2862 | + resList.add(m); | |
| 2863 | + } | |
| 2864 | + } | |
| 2865 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | |
| 2866 | + int jhcc = 0, sjcc = 0; | |
| 2867 | + int jhbc = 0, sjbc = 0; | |
| 2868 | + int qz = 0; | |
| 2869 | + for(Map<String, Object> m : resList){ | |
| 2870 | + jhcc += Integer.valueOf(m.get("jhcc").toString()); | |
| 2871 | + sjcc += Integer.valueOf(m.get("sjcc").toString()); | |
| 2872 | + jhbc += Integer.valueOf(m.get("jhbc").toString()); | |
| 2873 | + sjbc += Integer.valueOf(m.get("sjbc").toString()); | |
| 2874 | + qz += Integer.valueOf(m.get("qz").toString()); | |
| 2875 | + } | |
| 2876 | + tempMap.put("rq", "分类汇总"); | |
| 2877 | + tempMap.put("line", "共" + resList.size() + "条线路"); | |
| 2878 | + tempMap.put("jhcc", jhcc); | |
| 2879 | + tempMap.put("sjcc", sjcc); | |
| 2880 | + tempMap.put("jhbc", jhbc); | |
| 2881 | + tempMap.put("sjbc", sjbc); | |
| 2882 | + tempMap.put("qz", qz); | |
| 2883 | + tempMap.put("sm", ""); | |
| 2884 | + if(jhcc != 0 && sjcc != 0){ | |
| 2885 | + tempMap.put("ccl", numberFormat.format(((float)sjcc / jhcc)*100)+"%"); | |
| 2886 | + }else{ | |
| 2887 | + tempMap.put("ccl", "--"); | |
| 2888 | + } | |
| 2889 | + if(jhbc != 0 && sjbc != 0){ | |
| 2890 | + tempMap.put("zxl", numberFormat.format(((float)sjbc / jhbc)*100)+"%"); | |
| 2891 | + }else{ | |
| 2892 | + tempMap.put("zxl", "--"); | |
| 2893 | + } | |
| 2894 | + resList.add(tempMap); | |
| 2895 | + | |
| 2896 | + return resList; | |
| 2897 | + } | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + //班次执行率统计表 | |
| 2901 | + @Override | |
| 2902 | + public List<Executionrate> executionrate(Map<String, Object> map) { | |
| 2903 | + List<Executionrate> resList = new ArrayList<Executionrate>(); | |
| 2904 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 2905 | + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日"); | |
| 2906 | + Date d = null; | |
| 2907 | + Date d1 = null; | |
| 2908 | + try { | |
| 2909 | + d = sdf.parse(map.get("startDate").toString()); | |
| 2910 | + d1 = sdf.parse(map.get("endDate").toString()); | |
| 2911 | + } catch (ParseException e) { | |
| 2912 | + | |
| 2913 | + e.printStackTrace(); | |
| 2914 | + } | |
| 2915 | + | |
| 2916 | + String gsbm = "", fgsbm = ""; | |
| 2917 | + if(map.get("gsdmEcecut")!=null){ | |
| 2918 | + gsbm = map.get("gsdmEcecut").toString(); | |
| 2919 | + } | |
| 2920 | + if(map.get("fgsdmEcecut")!=null){ | |
| 2921 | + fgsbm = map.get("fgsdmEcecut").toString(); | |
| 2922 | + } | |
| 2923 | + | |
| 2924 | + String rq2 = sdf1.format(d); | |
| 2925 | + String rq3 = sdf1.format(d1); | |
| 2926 | + | |
| 2927 | + rq = rq2 + "-" + rq3; | |
| 2928 | + | |
| 2929 | + String where = ""; | |
| 2930 | + if(gsbm.trim().length() != 0){ | |
| 2931 | + where += " and gs_bm = '" + gsbm + "'"; | |
| 2932 | + } | |
| 2933 | + if(fgsbm.trim().length() != 0){ | |
| 2934 | + where += " and fgs_bm = '" + fgsbm + "'"; | |
| 2935 | + } | |
| 2936 | + | |
| 2937 | + String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.xl_name,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm,a.bc_type from " | |
| 2938 | + + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl,bc_type" | |
| 2939 | + + " from bsth_c_s_sp_info" + " where schedule_date >= '" | |
| 2940 | + + map.get("startDate").toString() + "' and schedule_date <= '" + map.get("endDate").toString() + "' and xl_bm='" | |
| 2941 | + + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out')" | |
| 2942 | + + where | |
| 2943 | +// + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type " | |
| 2944 | + + " ) a left JOIN (" | |
| 2945 | + + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl " | |
| 2946 | + + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl,bc_type from bsth_c_s_sp_info_real " | |
| 2947 | + + "where schedule_date_str >= '" + map.get("startDate").toString() + "' and schedule_date_str <= '" | |
| 2948 | + + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString() | |
| 2949 | + + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out') " | |
| 2950 | +// + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type" | |
| 2951 | + + " ) b ON t.company=b.gs_bm and t.branche_company = b.fgs_bm) b on " | |
| 2952 | + + " a.gs_bm=b.gs_bm and a.fgs_bm=b.fgs_bm and a.xl_bm=b.xl_bm "; | |
| 2953 | + List<Executionrate> list = jdbcTemplate.query(sql, new RowMapper<Executionrate>() { | |
| 2954 | + | |
| 2955 | + @Override | |
| 2956 | + public Executionrate mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 2957 | + Executionrate tu = new Executionrate(); | |
| 2958 | + NumberFormat numberFormat = NumberFormat.getInstance(); | |
| 2959 | + numberFormat.setMaximumFractionDigits(2); | |
| 2960 | + int scl = arg0.getString("scl")!=null&&arg0.getString("scl").trim().length()!=0?Integer.parseInt(arg0.getString("scl")):0; | |
| 2961 | + int jcl = arg0.getString("jcl")!=null&&arg0.getString("jcl").trim().length()!=0?Integer.parseInt(arg0.getString("jcl")):0; | |
| 2962 | + int sbc = arg0.getString("sbc")!=null&&arg0.getString("sbc").trim().length()!=0?Integer.parseInt(arg0.getString("sbc")):0; | |
| 2963 | + int jbc = arg0.getString("jbc")!=null&&arg0.getString("jbc").trim().length()!=0?Integer.parseInt(arg0.getString("jbc")):0; | |
| 2964 | + String result1 = numberFormat.format((float) scl / (float) jcl * 100); | |
| 2965 | + String result2 = numberFormat.format((float) sbc / (float) jbc * 100); | |
| 2966 | + tu.setRq(rq); | |
| 2967 | + if(arg0.getString("gs_name") == null || arg0.getString("gs_name").trim().length() == 0) | |
| 2968 | + return tu; | |
| 2969 | + tu.setGs(arg0.getString("gs_name").toString()); | |
| 2970 | + tu.setZhgs(arg0.getString("fgs_name").toString()); | |
| 2971 | +// tu.setXl(arg0.getString("xlgs")!=null&&arg0.getString("xlgs").trim().length()!=0?arg0.getString("xlgs"):"0");//这个是根据公司判断线路有几条 | |
| 2972 | + tu.setXl(arg0.getString("jxl")!=null&&arg0.getString("jxl").trim().length()!=0?arg0.getString("jxl"):"0"); | |
| 2973 | + //tu.setXl(arg0.getString("sxl")); | |
| 2974 | + tu.setXlmc(arg0.getString("sxl")!=null&&arg0.getString("sxl").trim().length()!=0?arg0.getString("sxl"):"0"); | |
| 2975 | + tu.setCchjh("" + jcl); | |
| 2976 | + tu.setCchsj("" + scl); | |
| 2977 | + tu.setCchqz(arg0.getString("sxl")!=null&&arg0.getString("sxl").trim().length()!=0?arg0.getString("sxl"):"0"); | |
| 2978 | + tu.setChl(result1 + "%");// 出车率 | |
| 2979 | + tu.setBcjh("" + jbc); | |
| 2980 | + tu.setBcsj("" + sbc); | |
| 2981 | + tu.setBbzxl(result2 + "%");// 班次执行率 | |
| 2982 | + tu.setSm(arg0.getString("xl_name")); | |
| 2983 | + tu.setGsgs(arg0.getString("gslsbm").toString()); | |
| 2984 | + tu.setFgsgs(arg0.getString("fgsbm").toString()); | |
| 2985 | + return tu; | |
| 2986 | + } | |
| 2987 | + | |
| 2988 | + }); | |
| 2989 | + | |
| 2990 | + for(Executionrate e : list){ | |
| 2991 | + if(e.getGs() != null && e.getGs().trim().length() != 0) | |
| 2992 | + resList.add(e); | |
| 2993 | + } | |
| 2994 | + | |
| 2995 | + return resList; | |
| 2996 | + } | |
| 2997 | + | |
| 2998 | + // 营运线路名称统计表 | |
| 2999 | + @Override | |
| 3000 | + public List<Allline> allline(Map<String, Object> map) { | |
| 3001 | + List<Allline> resList = new ArrayList<Allline>(); | |
| 3002 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 3003 | + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日"); | |
| 3004 | + Date d = null; | |
| 3005 | + Date d1 = null; | |
| 3006 | + try { | |
| 3007 | + d = sdf.parse(map.get("startDate").toString()); | |
| 3008 | + d1 = sdf.parse(map.get("endDate").toString()); | |
| 3009 | + } catch (ParseException e) { | |
| 3010 | + | |
| 3011 | + e.printStackTrace(); | |
| 3012 | + } | |
| 3013 | + String rq2 = sdf1.format(d); | |
| 3014 | + String rq3 = sdf1.format(d1); | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + rq = rq2 + "-" + rq3; | |
| 3019 | + | |
| 3020 | + String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.xl_name,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm,a.bc_type from " | |
| 3021 | + + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl,bc_type" | |
| 3022 | + + " from bsth_c_s_sp_info" + " where schedule_date >= '" | |
| 3023 | + + map.get("startDate").toString() + "' and schedule_date <='" + map.get("endDate").toString() + "' and xl_bm='" | |
| 3024 | + + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out') " | |
| 3025 | + + " and gs_bm='"+ map.get("gsdmAllline").toString() + "'" | |
| 3026 | + + " and fgs_bm='"+ map.get("fgsdmAllline").toString() + "'" | |
| 3027 | +// + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type " | |
| 3028 | + + " ) a left JOIN (" | |
| 3029 | + + "SELECT COUNT(*" | |
| 3030 | + + ") as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b." | |
| 3031 | + + "xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl " | |
| 3032 | + + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl,bc_type from bsth_c_s_sp_info_real " | |
| 3033 | + + "where schedule_date_str >= '" + map.get("startDate").toString() + "' and schedule_date_str <= '" | |
| 3034 | + + map.get("endDate").toString() + "' and xl_bm='" + map.get | |
| 3035 | + ("line").toString() | |
| 3036 | + + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out')" | |
| 3037 | +// + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type" | |
| 3038 | + + " ) b ON t.company=b.gs_bm and t.branche_company = b.fgs_bm) b on " | |
| 3039 | + + " a.gs_bm=b.gs_bm and a.fgs_bm=b.fgs_bm and a.xl_bm=b.xl_bm "; | |
| 3040 | + List<Allline> list = jdbcTemplate.query(sql, new RowMapper<Allline>() { | |
| 3041 | + | |
| 3042 | + @Override | |
| 3043 | + public Allline mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 3044 | + Allline tu = new Allline(); | |
| 3045 | + NumberFormat numberFormat = NumberFormat.getInstance(); | |
| 3046 | + numberFormat.setMaximumFractionDigits(2); | |
| 3047 | + int scl = arg0.getString("scl")!=null&&arg0.getString("scl").trim().length()!=0?Integer.parseInt(arg0.getString("scl")):0; | |
| 3048 | + int jcl = arg0.getString("jcl")!=null&&arg0.getString("jcl").trim().length()!=0?Integer.parseInt(arg0.getString("jcl")):0; | |
| 3049 | + int sbc = arg0.getString("sbc")!=null&&arg0.getString("sbc").trim().length()!=0?Integer.parseInt(arg0.getString("sbc")):0; | |
| 3050 | + int jbc = arg0.getString("jbc")!=null&&arg0.getString("jbc").trim().length()!=0?Integer.parseInt(arg0.getString("jbc")):0; | |
| 3051 | + String result1 = numberFormat.format((float) scl / (float) jcl * 100); | |
| 3052 | + String result2 = numberFormat.format((float) sbc / (float) jbc * 100); | |
| 3053 | + tu.setRq(rq); | |
| 3054 | + if(arg0.getString("gs_name") == null || arg0.getString("gs_name").trim().length() == 0) | |
| 3055 | + return tu; | |
| 3056 | + tu.setGs(arg0.getString("gs_name").toString()); | |
| 3057 | + tu.setZhgs(arg0.getString("fgs_name").toString()); | |
| 3058 | + tu.setXl(arg0.getString("xl_name")); | |
| 3059 | + tu.setXlmc(arg0.getString("sxl")!=null&&arg0.getString("sxl").trim().length()!=0?arg0.getString("sxl"):"0"); | |
| 3060 | + tu.setCchjh("" + jcl); | |
| 3061 | + tu.setCchsj("" + scl); | |
| 3062 | + tu.setCchqz(arg0.getString("sxl")!=null&&arg0.getString("sxl").trim().length()!=0?arg0.getString("sxl"):"0"); | |
| 3063 | + tu.setChl(result1 + "%");// 出车率 | |
| 3064 | + tu.setBcjh("" + jbc); | |
| 3065 | + tu.setBcsj("" + sbc); | |
| 3066 | + tu.setBbzxl(result2 + "%");// 班次执行率 | |
| 3067 | + | |
| 3068 | + tu.setSm(arg0.getString("xl_name")); | |
| 3069 | + tu.setGsgs(arg0.getString("gslsbm").toString()); | |
| 3070 | + tu.setFgsgs(arg0.getString("fgsbm").toString()); | |
| 3071 | + return tu; | |
| 3072 | + } | |
| 3073 | + }); | |
| 3074 | + | |
| 3075 | + for(Allline a : list){ | |
| 3076 | + if(a.getGs() != null && a.getGs().trim().length() != 0) | |
| 3077 | + resList.add(a); | |
| 3078 | + } | |
| 3079 | + | |
| 3080 | + return resList; | |
| 3081 | + } | |
| 3082 | + | |
| 3083 | + @Override | |
| 3084 | + public List<Daily> daily(Map<String, Object> map) { | |
| 3085 | + String xlbm="";; | |
| 3086 | + if(map.get("line")!=null){ | |
| 3087 | + xlbm=map.get("line").toString().trim(); | |
| 3088 | + } | |
| 3089 | + String gsbm=""; | |
| 3090 | + if(map.get("gsdmDaily")!=null){ | |
| 3091 | + gsbm=map.get("gsdmDaily").toString(); | |
| 3092 | + } | |
| 3093 | + | |
| 3094 | + String fgsbm=""; | |
| 3095 | + if(map.get("fgsdmDaily")!=null){ | |
| 3096 | + fgsbm=map.get("fgsdmDaily").toString(); | |
| 3097 | + } | |
| 3098 | + | |
| 3099 | + /*String sql="select t.schedule_date_str," | |
| 3100 | + + " t.cl_zbh,t.j_gh,t.j_name,x.yh from (select r.schedule_date_str,r.xl_bm," | |
| 3101 | + + " r.cl_zbh,r.j_gh,r.j_name from bsth_c_s_sp_info_real r WHERE " | |
| 3102 | + + " r.xl_bm='" + map.get("line").toString() + "' " | |
| 3103 | + + " and to_days(r.schedule_date)=to_days('"+map.get("date").toString()+"') " | |
| 3104 | + + " and r.gs_bm like '%"+gsbm+"%' " | |
| 3105 | + + " and r.fgs_bm like '%"+fgsbm+"%' " | |
| 3106 | + + " GROUP BY r.schedule_date_str,r.xl_bm,r.cl_zbh,r.j_gh,r.j_name) t" | |
| 3107 | + + " left join (select * from bsth_c_ylb y where " | |
| 3108 | + + " to_days(y.rq)=to_days('"+map.get("date").toString()+"') " | |
| 3109 | + + " and y.xlbm= '" + map.get("line").toString() + "'" | |
| 3110 | + + " and y.ssgsdm like '%"+gsbm+"%' " | |
| 3111 | + + " and y.fgsdm like '%"+fgsbm+"%'" | |
| 3112 | + + " ) x" | |
| 3113 | + + " on t.cl_zbh = x.nbbm and t.j_gh=x.jsy";*/ | |
| 3114 | + | |
| 3115 | + String sql="select r.schedule_date_str, " | |
| 3116 | + + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm" | |
| 3117 | + + " from bsth_c_s_sp_info_real r where " | |
| 3118 | + + "r.schedule_date_str = '"+map.get("date").toString()+"'"; | |
| 3119 | + if(!xlbm.equals("")){ | |
| 3120 | + sql += " and r.xl_bm = '"+xlbm+"'"; | |
| 3121 | + } | |
| 3122 | + if(!gsbm.equals("")){ | |
| 3123 | + sql += " and r.gs_bm='"+gsbm+"'"; | |
| 3124 | + } | |
| 3125 | + if(!fgsbm.equals("")){ | |
| 3126 | + sql += " and r.fgs_bm='"+fgsbm+"'"; | |
| 3127 | + } | |
| 3128 | + sql += " group by r.schedule_date_str," | |
| 3129 | + + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | |
| 3130 | + | |
| 3131 | + List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() { | |
| 3132 | + @Override | |
| 3133 | + public Daily mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 3134 | + Daily daily = new Daily(); | |
| 3135 | + daily.setRq(arg0.getString("schedule_date_str")); | |
| 3136 | + daily.setZbh(arg0.getString("cl_zbh")); | |
| 3137 | + daily.setJgh(arg0.getString("j_gh")); | |
| 3138 | +// daily.setjName(arg0.getString("j_name")); | |
| 3139 | + return daily; | |
| 3140 | + } | |
| 3141 | + }); | |
| 3142 | + List<Ylb> listYlb= ylbRepository.obtainYl(map.get("date").toString(), "", "", xlbm, "", "xlbm"); | |
| 3143 | + List<Dlb> listDlb= dlbRepository.obtainDl(map.get("date").toString(), "", "", xlbm, "", "xlbm"); | |
| 3144 | + List<ScheduleRealInfo> sList; | |
| 3145 | + List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(map.get("line").toString(), map.get("date").toString()); | |
| 3146 | + for(int i=0;i<list.size();i++){ | |
| 3147 | + sList =new ArrayList<ScheduleRealInfo>(); | |
| 3148 | + Daily d=list.get(i); | |
| 3149 | + Double yh=0.0; | |
| 3150 | + for (int j = 0; j < listYlb.size(); j++) { | |
| 3151 | + Ylb y=listYlb.get(j); | |
| 3152 | + if(y.getNbbm().equals(d.getZbh())&& y.getJsy().equals(d.getJgh())){ | |
| 3153 | + yh=Arith.add(yh, y.getYh()); | |
| 3154 | + } | |
| 3155 | + } | |
| 3156 | + | |
| 3157 | + for (int j = 0; j < listDlb.size(); j++) { | |
| 3158 | + Dlb b=listDlb.get(j); | |
| 3159 | + if(b.getNbbm().equals(d.getZbh())&& b.getJsy().equals(d.getJgh())){ | |
| 3160 | + yh=Arith.add(yh, b.getHd()); | |
| 3161 | + } | |
| 3162 | + } | |
| 3163 | + d.setYh(String.valueOf(yh)); | |
| 3164 | + for (int j = 0; j < lists.size(); j++) { | |
| 3165 | + ScheduleRealInfo s=lists.get(j); | |
| 3166 | + if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){ | |
| 3167 | + Set<ChildTaskPlan> cts = s.getcTasks(); | |
| 3168 | + if(cts != null && cts.size() > 0){ | |
| 3169 | + sList.add(s); | |
| 3170 | + }else{ | |
| 3171 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | |
| 3172 | + sList.add(s); | |
| 3173 | + } | |
| 3174 | + } | |
| 3175 | + | |
| 3176 | + if((d.getjName() == null || d.getjName().trim().length() == 0) | |
| 3177 | + && s.getjName() != null && s.getjName().length() > 0){ | |
| 3178 | + d.setjName(s.getjName()); | |
| 3179 | + } | |
| 3180 | + } | |
| 3181 | + } | |
| 3182 | + | |
| 3183 | + | |
| 3184 | + double ksgl=culateMileageService.culateKsgl(sList); | |
| 3185 | + double jccgl=culateMileageService.culateJccgl(sList); | |
| 3186 | + double zksgl=Arith.add(ksgl, jccgl); | |
| 3187 | + double ljgl=culateMileageService.culateLjgl(sList); | |
| 3188 | + double sjgl=culateMileageService.culateSjgl(sList); | |
| 3189 | + double zyygl=Arith.add(ljgl, sjgl); | |
| 3190 | + | |
| 3191 | + d.setJzl1(String.valueOf(zksgl));//空驶公里 | |
| 3192 | + d.setZlc(String.valueOf(Arith.add(zksgl, zyygl))); | |
| 3193 | + d.setBc(String.valueOf(culateMileageService.culateSjbc(sList, "")+culateMileageService.culateLjbc(sList, ""))); | |
| 3194 | + } | |
| 3195 | + return list; | |
| 3196 | + } | |
| 3197 | + | |
| 3198 | + class SingledataByXlbm implements Comparator<Singledata>{ | |
| 3199 | + @Override | |
| 3200 | + public int compare(Singledata o1, Singledata o2) { | |
| 3201 | + // TODO Auto-generated method stub | |
| 3202 | + return (o1.getgS()+o1.getxL()+o1.getClzbh()).compareTo((o2.getgS()+o2.getxL()+o2.getClzbh())); | |
| 3203 | + } | |
| 3204 | + } | |
| 3205 | +} | ... | ... |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| ... | ... | @@ -639,6 +639,7 @@ public class GpsServiceImpl implements GpsService { |
| 639 | 639 | public Map<String, Object> search(Map<String, Object> map, int page, int size, String order, String direction) { |
| 640 | 640 | Map<String, Object> rsMap = new HashMap<>(); |
| 641 | 641 | try { |
| 642 | + | |
| 642 | 643 | //全量 |
| 643 | 644 | List<GpsEntity> list = new ArrayList<>(gpsRealData.all()); |
| 644 | 645 | //过滤后的 | ... | ... |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| ... | ... | @@ -576,7 +576,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 576 | 576 | public String setLDFile(){ |
| 577 | 577 | String result = "failure"; |
| 578 | 578 | try { |
| 579 | - String tmp = readXmlFromFile("E:/ld.txt"); | |
| 579 | + String tmp = readXmlFromFile("D:/ld.txt"); | |
| 580 | 580 | Results rss = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(tmp)); |
| 581 | 581 | if(rss.isSuccess()){ |
| 582 | 582 | result = "success"; | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -799,7 +799,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 799 | 799 | return rs; |
| 800 | 800 | } |
| 801 | 801 | |
| 802 | - sch.setId(dayOfSchedule.getId()); | |
| 802 | + //sch.setId(dayOfSchedule.getId()); | |
| 803 | 803 | //实时入库 |
| 804 | 804 | super.save(sch); |
| 805 | 805 | |
| ... | ... | @@ -6470,66 +6470,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 6470 | 6470 | exec.shutdown(); |
| 6471 | 6471 | } |
| 6472 | 6472 | |
| 6473 | - | |
| 6474 | - @Override | |
| 6475 | - public void afterPropertiesSet() throws Exception { | |
| 6476 | - // TODO Auto-generated method stub | |
| 6477 | - // 维修上报重发调度 | |
| 6478 | - exec.scheduleAtFixedRate(new Runnable() { | |
| 6479 | - | |
| 6480 | - @Override | |
| 6481 | - public void run() { | |
| 6482 | - // TODO Auto-generated method stub | |
| 6483 | - try { | |
| 6484 | - Iterator<RepairReport> it = queue.iterator(); | |
| 6485 | - while (it.hasNext()) { | |
| 6486 | - RepairReport rr = it.next(); | |
| 6487 | - repairReport(rr); | |
| 6488 | - if (rr.getReportState() == 1 || System.currentTimeMillis() - rr.getReportDate().getTime() > 86400000) queue.remove(rr); | |
| 6489 | - } | |
| 6490 | - } catch (Exception e) { | |
| 6491 | - logger.error("维修上报重发错误", e); | |
| 6492 | - } | |
| 6493 | - } | |
| 6494 | - }, 30, 30, TimeUnit.MINUTES); | |
| 6495 | - | |
| 6496 | - //// --- | |
| 6497 | - exec.scheduleWithFixedDelay(new Runnable() { | |
| 6498 | - @Override | |
| 6499 | - public void run() { | |
| 6500 | - Map<String, Object> res = new HashMap<>(); | |
| 6501 | - InputStream in = null; | |
| 6502 | - String url ="http://211.95.61.66:9008/modules/tSafedrivingCs/DSMBHforCLBH"; | |
| 6503 | - | |
| 6504 | - try { | |
| 6505 | - HttpURLConnection con = (HttpURLConnection)new URL(url.toString()).openConnection(); | |
| 6506 | - con.setDoInput(true); | |
| 6507 | - con.setRequestMethod("POST"); | |
| 6508 | - con.setConnectTimeout(5000); | |
| 6509 | - con.setReadTimeout(5000); | |
| 6510 | - con.setRequestProperty("keep-alive", "true"); | |
| 6511 | - con.setRequestProperty("accept", "*/*"); | |
| 6512 | - con.setRequestProperty("content-type", "application/x-www-form-urlencoded"); | |
| 6513 | - con.connect(); | |
| 6514 | - | |
| 6515 | - if (con.getResponseCode() == 200) { | |
| 6516 | - in = con.getInputStream(); | |
| 6517 | - ByteArrayOutputStream bout = new ByteArrayOutputStream(); | |
| 6518 | - IOUtils.copy(in, bout); | |
| 6519 | - DIRMAP = new ObjectMapper().readValue(bout.toByteArray(), Map.class); | |
| 6520 | - } | |
| 6521 | - logger.info("IP打电话接口查询完成"); | |
| 6522 | - } catch (MalformedURLException e) { | |
| 6523 | - // TODO Auto-generated catch block | |
| 6524 | - e.printStackTrace(); | |
| 6525 | - logger.error("IP打电话接口出错",e); | |
| 6526 | - } catch (IOException e) { | |
| 6527 | - // TODO Auto-generated catch block | |
| 6528 | - e.printStackTrace(); | |
| 6529 | - } | |
| 6530 | - | |
| 6531 | - } | |
| 6532 | - }, 0, 60 * 24, TimeUnit.MINUTES); | |
| 6473 | + @Override | |
| 6474 | + public void afterPropertiesSet() throws Exception { | |
| 6475 | + | |
| 6533 | 6476 | } |
| 6534 | 6477 | } |
| 6535 | 6478 | ... | ... |
src/main/java/com/bsth/util/FTPClientUtils.java
| ... | ... | @@ -369,7 +369,7 @@ public class FTPClientUtils { |
| 369 | 369 | |
| 370 | 370 | Test test= new Test(); |
| 371 | 371 | |
| 372 | - File[] sources = new File[] {new File("E:/20079.txt")}; | |
| 372 | + File[] sources = new File[] {new File("D:/20079.txt")}; | |
| 373 | 373 | |
| 374 | 374 | File target = new File("release_package.tar.gz"); |
| 375 | 375 | ... | ... |
src/main/resources/static/index.html
src/main/resources/static/login.html
| ... | ... | @@ -181,7 +181,7 @@ |
| 181 | 181 | <div class="wrapper ng-scope"> |
| 182 | 182 | <div id="loginPanel" class="dialog dialog-shadow"> |
| 183 | 183 | <br> |
| 184 | - <h3 class="logo-text">浦东公交调度系统</h3> | |
| 184 | + <h3 class="logo-text">集群调度培训系统</h3> | |
| 185 | 185 | <hr> |
| 186 | 186 | <form style="padding: 0px 35px;"> |
| 187 | 187 | <div class="form-group" style="margin-bottom: 0"> | ... | ... |
src/main/resources/static/pages/base/line/js/line-list-table.js
src/main/resources/static/pages/base/stationroute/editsection.html
src/main/resources/static/pages/base/stationroute/js/drawingManager.js
| ... | ... | @@ -51,7 +51,6 @@ var DrawingManagerObj = function () { |
| 51 | 51 | |
| 52 | 52 | var addStation = AddStationObj.getAddStation(); |
| 53 | 53 | |
| 54 | - debugger; | |
| 55 | 54 | GetAjaxData.getSectionRouteInfo(addLine.id,addStation.dir,function(data) { |
| 56 | 55 | |
| 57 | 56 | PublicFunctions.linePanlThree(addLine.id,data,addStation.dir); | ... | ... |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
| ... | ... | @@ -321,7 +321,6 @@ var PublicFunctions = function () { |
| 321 | 321 | // 弹出是否撤销提示框 |
| 322 | 322 | layer.confirm('你确定要撤销【'+obj[0].text+'】站点吗?', {btn : [ '确定撤销','返回' ],icon: 3, title:'提示' }, function(index){ |
| 323 | 323 | |
| 324 | - debugger; | |
| 325 | 324 | // 站点路由ID |
| 326 | 325 | var stationRouteId = obj[0].original.stationRouteId; |
| 327 | 326 | ... | ... |
src/main/resources/static/pages/base/timesmodel/edit-detail.html
| ... | ... | @@ -232,7 +232,6 @@ |
| 232 | 232 | * @params [obj--甘特图对象;d--当前修改班次对象数据] |
| 233 | 233 | */ |
| 234 | 234 | $('#editDetail_mobal').on('editDetailMobal.show', function(e,obj,nodeContext,bf,map){ |
| 235 | - debugger; | |
| 236 | 235 | // 定义当前班次数据. |
| 237 | 236 | var dqbcData = nodeContext.dqbcData; |
| 238 | 237 | var ddbcminztjx = isUpdsgbctzsj(dqbcData.bcType) || isUpdsgbctzsj(nodeContext.nextData.bcType) ? dqbcData.STOPTIME : obj.configuration.dataMap.minztjx,lastminztjx = 0; | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/gantt.js
| ... | ... | @@ -18,7 +18,6 @@ |
| 18 | 18 | }); |
| 19 | 19 | // 获取已存在的该时刻表明细数据. |
| 20 | 20 | var objD = window.localStorage.isDoDate; |
| 21 | - debugger; | |
| 22 | 21 | // 获取表单参数配置数据. |
| 23 | 22 | var map = JSON.parse(window.localStorage.Gantt_AgursData); |
| 24 | 23 | $('.skmxTitle').text( '【' + map.skbmc + '】' + '时刻表明细模型'); |
| ... | ... | @@ -62,7 +61,7 @@ |
| 62 | 61 | |
| 63 | 62 | // 创建ParameterObj |
| 64 | 63 | var _paramObj; |
| 65 | -debugger; | |
| 64 | + | |
| 66 | 65 | if(map.baseRes== '0') { |
| 67 | 66 | CSMap = getMaxCarAndStopSpace0(map,seMap); |
| 68 | 67 | // 发车间隙 |
| ... | ... | @@ -134,7 +133,7 @@ debugger; |
| 134 | 133 | } |
| 135 | 134 | data = {'json':rsjar,'bxrcgs':null}; |
| 136 | 135 | } |
| 137 | - debugger; | |
| 136 | + | |
| 138 | 137 | echartsDrawGTT.init(data.json,true,true); |
| 139 | 138 | // console.log(data.json); |
| 140 | 139 | // 创建甘特图对象. | ... | ... |
src/main/resources/static/pages/control/line/index.html
| ... | ... | @@ -18,7 +18,7 @@ |
| 18 | 18 | <div class="portlet-title banner" > |
| 19 | 19 | <div class="caption col_hide_1280" style="color: #FFF;"> |
| 20 | 20 | <i class="fa fa-life-ring" style="font-size: 22px;color: #FFF;"></i> <span |
| 21 | - class="caption-subject bold" style="font-size: 24px;">浦东公交线路调度系统</span> | |
| 21 | + class="caption-subject bold" style="font-size: 24px;">集群调度系统</span> | |
| 22 | 22 | </div> |
| 23 | 23 | <div class="col_hide_1440" style="color: white;font-size: 18px;position: absolute;right: 25px;top: 75px;"> |
| 24 | 24 | <span class="top_username"></span> <span class="operation_mode_text animated" ></span> | ... | ... |
src/main/resources/static/pages/control/lineallot_v2/main.html
| ... | ... | @@ -489,7 +489,6 @@ |
| 489 | 489 | |
| 490 | 490 | //进入线调 |
| 491 | 491 | var eq = EventProxy.create('cache_line_level', 'cache_mv_route', 'cache_route', 'check_line_config', function (lineLevel) { |
| 492 | - debugger; | |
| 493 | 492 | var newWinOpen = $('input','.new_window_open_label')[0].checked; |
| 494 | 493 | if(!newWinOpen) |
| 495 | 494 | top.window.location.href = "/real_control/v2"; | ... | ... |
src/main/resources/static/pages/ddexam/index.html
| ... | ... | @@ -9,68 +9,132 @@ |
| 9 | 9 | .at { |
| 10 | 10 | height: 100%; |
| 11 | 11 | text-align: center; |
| 12 | - padding-top: 300px; | |
| 13 | 12 | } |
| 14 | 13 | .tes{ |
| 15 | - padding-top: 300px; | |
| 14 | + padding-top: 40%; | |
| 16 | 15 | } |
| 17 | 16 | .nt{ |
| 18 | - padding-top: 50px; | |
| 17 | + padding-top: 40px; | |
| 19 | 18 | } |
| 20 | 19 | .scm{ |
| 20 | + padding-top:0px; | |
| 21 | 21 | padding-left: 30% |
| 22 | 22 | } |
| 23 | + .sct{ | |
| 24 | + padding-left: 75% | |
| 25 | + } | |
| 26 | + .sizell { | |
| 27 | + font-size: 15px; | |
| 28 | + } | |
| 29 | + .textk{ | |
| 30 | + border:none; | |
| 31 | + background-color : #18a8ee; | |
| 32 | + } | |
| 33 | + .img1{ | |
| 34 | + background-image: url(/real_control_v2/assets/imgs/bt1.png); | |
| 35 | + | |
| 36 | + } | |
| 37 | + .img2{ | |
| 38 | + background-image: url(/real_control_v2/assets/imgs/bt2.png); | |
| 39 | + | |
| 40 | + } | |
| 41 | + button{ | |
| 42 | + border:none | |
| 43 | + } | |
| 44 | + .row{ | |
| 45 | + overflow:scroll; | |
| 46 | + overflow-x:hidden; | |
| 47 | + overflow-y:hidden; | |
| 48 | + } | |
| 23 | 49 | </style> |
| 24 | 50 | |
| 25 | 51 | <div class="row"> |
| 26 | - <div class="col-md-12 st" > | |
| 27 | - <div class="portlet light porttlet-fit bordered at"> | |
| 52 | + <div class="col-md-12 st "> | |
| 53 | + <div class="portlet light porttlet-fit bordered at img1"> | |
| 28 | 54 | <div class="tes"> |
| 29 | - <label class="col-md-12">请输入考试人数:</label> | |
| 55 | + | |
| 56 | + <label class="col-md-12 sizell">请输入账号格式:</label> | |
| 30 | 57 | <div class="col-md-9 scm"> |
| 31 | - <input id="rnumber" type="text" class="form-control" name="rnumber" oninput="value=value.replace(/[^\d]/g,'')"/> | |
| 58 | + <input id="userName" type="text" class="form-control" name="rnumber" autocomplete="off" oninput="value=value.replace(/[^\d]/g,'')"/> | |
| 59 | + | |
| 60 | + </div> | |
| 61 | + | |
| 62 | + <label class="col-md-12 sizell">请输入考试人数:</label> | |
| 63 | + <div class="col-md-9 scm"> | |
| 64 | + | |
| 65 | + <input id="rnumber" type="text" class="form-control" name="rnumber" autocomplete="off" oninput="value=value.replace(/[^\d]/g,'')"/> | |
| 66 | + <h6>人数过大时,耗时较久,请耐心等待</h6> | |
| 32 | 67 | </div> |
| 33 | - <br><br> | |
| 68 | + | |
| 34 | 69 | <div class="col-md-12 nt" > |
| 35 | - <button type="button" class="btn btn-primary" id="onckil">确认</button> | |
| 70 | + <button type="button" class="btn btn-primary textk" id="onckil">创建账号</button> | |
| 71 | + <button type="button" class="btn btn-primary textk" id="onckil2">初始化当天排班</button> | |
| 72 | + </div> | |
| 73 | + <div class="col-md-12 nt" > | |
| 74 | + <div class="col-md-12 sct"> | |
| 75 | + <button type="button" class="btn btn-primary textk" id="onckilUserAll">查询考生账号</button> | |
| 76 | + </div> | |
| 36 | 77 | </div> |
| 37 | 78 | </div> |
| 38 | 79 | </div> |
| 39 | 80 | </div> |
| 40 | 81 | |
| 41 | 82 | <div class="col-md-12 st"> |
| 42 | - <div class="portlet light porttlet-fit bordered at"> | |
| 83 | + <div class="portlet light porttlet-fit bordered at img2"> | |
| 43 | 84 | <div class="tes"> |
| 44 | - <label class="col-md-12">请设置考试时间:</label> | |
| 85 | + <label class="col-md-12 sizell">请设置考试时间:</label> | |
| 86 | + | |
| 45 | 87 | <div class="col-md-9 scm"> |
| 46 | - <input type="text" class="form-control" name="starttime"/> | |
| 88 | + <input type="text" class="form-control" id="date" autocomplete="off" name="starttime"/> | |
| 47 | 89 | </div> |
| 48 | - <br><br> | |
| 49 | 90 | <div class="col-md-12 nt" > |
| 50 | - <button type="button" class="btn btn-primary" id="soukit">确认</button> | |
| 91 | + <button type="button" class="btn btn-primary textk" id="soukit">确认</button> | |
| 92 | + </div> | |
| 93 | + <div class="col-md-12 nt" > | |
| 94 | + | |
| 95 | + <div class="col-md-12 sct"> | |
| 96 | + <button type="button" class="btn btn-primary textk" id="hftime">恢复时间</button> | |
| 97 | + </div> | |
| 51 | 98 | </div> |
| 52 | 99 | </div> |
| 53 | 100 | </div> |
| 54 | 101 | |
| 55 | 102 | </div> |
| 56 | 103 | </div> |
| 57 | - | |
| 104 | +<script src="js/bootstrap-datetimepicker.js"></script> | |
| 58 | 105 | <script> |
| 59 | 106 | |
| 60 | 107 | $(function(){ |
| 61 | - | |
| 108 | + $("#date").datetimepicker({ | |
| 109 | + format : 'HH:mm:ss', | |
| 110 | + locale : 'zh-cn', | |
| 111 | + }); | |
| 62 | 112 | }) |
| 63 | 113 | |
| 64 | 114 | // 下一步点击事件 |
| 65 | 115 | $('#onckil').on('click', function() { |
| 66 | - | |
| 67 | 116 | onckil();// 表单提交 |
| 68 | 117 | }); |
| 69 | 118 | |
| 70 | 119 | // 下一步点击事件 |
| 120 | + $('#onckil2').on('click', function() { | |
| 121 | + onckil2();// 表单提交 | |
| 122 | + }); | |
| 123 | + // 下一步点击事件 | |
| 71 | 124 | $('#soukit').on('click', function() { |
| 72 | 125 | soukit();// 表单提交 |
| 73 | 126 | }); |
| 127 | + | |
| 128 | + // 下一步点击事件 | |
| 129 | + $('#hftime').on('click', function() { | |
| 130 | + hftime();// 表单提交 | |
| 131 | + }); | |
| 132 | + | |
| 133 | + $('#onckilUserAll').on('click', function() { | |
| 134 | + onckilUserAll();// 表单提交 | |
| 135 | + }); | |
| 136 | + | |
| 137 | + | |
| 74 | 138 | |
| 75 | 139 | function onckil(){ |
| 76 | 140 | if($("#rnumber").val() == undefined || $("#rnumber").val() == null || $("#rnumber").val() == "" || $("#rnumber").val() > 100){ |
| ... | ... | @@ -78,32 +142,76 @@ |
| 78 | 142 | return |
| 79 | 143 | } |
| 80 | 144 | var params ={ |
| 145 | + userName : $("#userName").val(), | |
| 81 | 146 | rs : $("#rnumber").val() |
| 82 | 147 | } |
| 83 | - $.post('/ddexam/initialization',params,function(status) { | |
| 84 | - if (status == 0) { | |
| 148 | + var i = layer.load(2); | |
| 149 | + $.post('/ddexam/initialization',params,function(data) { | |
| 150 | + | |
| 85 | 151 | // 弹出添加成功提示消息 |
| 86 | - layer.msg('修改成功...'); | |
| 87 | - /** 通知更新缓存区 */ | |
| 88 | - //$.post('http://192.168.168.171:8800/transport_server/basic/refresh',function(rs) {console.log(rs)}) | |
| 89 | - } else { | |
| 90 | - // 弹出添加失败提示消息 | |
| 91 | - layer.msg('修改失败...'); | |
| 92 | - } | |
| 93 | - initSearch(); | |
| 94 | - // 刷新左边树 | |
| 95 | - fun.resjtreeDate(line.id,delBatch.dir); | |
| 96 | - /** 查询路段信息 @param:<Line.id:线路Id;delBatch.dir:方向> @return:data:路段数据 */ | |
| 97 | - ajaxd.getSectionRouteInfo(line.id,delBatch.dir,function(data) { | |
| 98 | - /** 在地图上画出线路走向 @param:<Line.id:线路Id;delBatch.dir:方向;data:路段数据> */ | |
| 99 | - fun.linePanlThree(line.id,data,delBatch.dir); | |
| 100 | - }); | |
| 152 | + layer.msg( data.code+'...'); | |
| 153 | + layer.close(i); | |
| 154 | + }); | |
| 155 | + } | |
| 156 | + function onckil2(){ | |
| 157 | + | |
| 158 | + var params ={ | |
| 159 | + userName : $("#userName").val(), | |
| 160 | + } | |
| 161 | + var i = layer.load(2); | |
| 162 | + $.post('/ddexam/initialization2',params,function(data) { | |
| 163 | + | |
| 164 | + // 弹出添加成功提示消息 | |
| 165 | + layer.msg( data.code+'...'); | |
| 166 | + layer.close(i); | |
| 101 | 167 | }); |
| 102 | 168 | } |
| 103 | 169 | |
| 104 | 170 | function soukit(){ |
| 105 | - alert("2"); | |
| 171 | + | |
| 172 | + if($("#date").val() == undefined || $("#date").val() == null || $("#date").val() == ""){ | |
| 173 | + layer.msg('请正确输入...'); | |
| 174 | + return | |
| 175 | + } | |
| 176 | + var params ={ | |
| 177 | + date : $("#date").val() | |
| 178 | + } | |
| 179 | + var i = layer.load(2); | |
| 180 | + $.post('/ddexam/initDate',params,function(data) { | |
| 181 | + | |
| 182 | + if(data == 1){ | |
| 183 | + // 弹出添加成功提示消息 | |
| 184 | + layer.msg( '修改成功...'); | |
| 185 | + layer.close(i); | |
| 186 | + } | |
| 187 | + }); | |
| 188 | + } | |
| 189 | + function onckilUserAll(){ | |
| 190 | + | |
| 191 | + $.get('/pages/ddexam/list.html', function (content) { | |
| 192 | + layer.open({ | |
| 193 | + type: 1, | |
| 194 | + area: ['800px', '600px'], | |
| 195 | + content: content, | |
| 196 | + title: '考生明细', | |
| 197 | + shift: 5, | |
| 198 | + scrollbar: false, | |
| 199 | + success: function () { | |
| 200 | + | |
| 201 | + } | |
| 202 | + }); | |
| 203 | + }); | |
| 106 | 204 | } |
| 107 | 205 | |
| 108 | - | |
| 206 | + function hftime(){ | |
| 207 | + | |
| 208 | + $.get('/ddexam/hftime', function (date) { | |
| 209 | + if(date == 0){ | |
| 210 | + layer.msg("恢复成功"); | |
| 211 | + } | |
| 212 | + }) | |
| 213 | + } | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 109 | 217 | </script> |
| 110 | 218 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/ddexam/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 | + | |
| 18 | + .row{ | |
| 19 | + width: 99.8%; | |
| 20 | + padding-left: 4%; | |
| 21 | + overflow:auto; | |
| 22 | + } | |
| 23 | +</style> | |
| 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;"> | |
| 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 | + </tr> | |
| 38 | + </thead> | |
| 39 | + | |
| 40 | + <tbody> | |
| 41 | + | |
| 42 | + </tbody> | |
| 43 | + </table> | |
| 44 | + </div> | |
| 45 | + </div> | |
| 46 | + </div> | |
| 47 | + </div> | |
| 48 | +</div> | |
| 49 | +<script src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script> | |
| 50 | +<script> | |
| 51 | + $(function(){ | |
| 52 | + // 关闭左侧栏 | |
| 53 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 54 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 55 | + var no=""; | |
| 56 | + var params ={}; | |
| 57 | + $.post('/ddexam/userAll',params,function(result) { | |
| 58 | + | |
| 59 | + var onTime_2 = template('onTime_2',{list:result}); | |
| 60 | + $('#forms_2 tbody').html(onTime_2); | |
| 61 | + }); | |
| 62 | + }); | |
| 63 | +</script> | |
| 64 | +<script type="text/html" id="onTime_2"> | |
| 65 | + {{each list as obj i}} | |
| 66 | + <tr> | |
| 67 | + <td> | |
| 68 | + {{i+1}} | |
| 69 | + </td> | |
| 70 | + <td>{{obj.userName}}</td> | |
| 71 | + <td>123456</td> | |
| 72 | + <td> | |
| 73 | + {{if obj.ksstatus=="1"}}已初始化{{else}}未初始化{{/if}} | |
| 74 | + </td> | |
| 75 | + </tr> | |
| 76 | + {{/each}} | |
| 77 | + {{if list.length == 0}} | |
| 78 | + <tr> | |
| 79 | + <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td> | |
| 80 | + </tr> | |
| 81 | + {{/if}} | |
| 82 | +</script> | |
| 0 | 83 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forms/statement/waybill.html
| ... | ... | @@ -123,10 +123,9 @@ |
| 123 | 123 | var xlList; |
| 124 | 124 | $.get('/report/lineList',function(result){ |
| 125 | 125 | xlList=result; |
| 126 | - debugger | |
| 127 | 126 | |
| 128 | 127 | $.get('/user/companyData', function(result){ |
| 129 | - debugger | |
| 128 | + | |
| 130 | 129 | obj = result; |
| 131 | 130 | console.log(obj); |
| 132 | 131 | var options = ''; | ... | ... |
src/main/resources/static/pages/home.html
| ... | ... | @@ -59,20 +59,9 @@ |
| 59 | 59 | } |
| 60 | 60 | </style> |
| 61 | 61 | <div class="system_change_log"> |
| 62 | - <h2 style="text-indent: 35px;margin: 10px 0 5px;">2021-01-07 更新说明 Changelog</h2> | |
| 62 | + <h2 style="text-indent: 35px;margin: 10px 0 5px;">主页</h2> | |
| 63 | 63 | <br><br> |
| 64 | - <ul > | |
| 65 | - <li class="sub_title"><h6>报表</h6></li> | |
| 66 | - <li><span class="label s_c_change">修改</span>1.rfid线路签卡率报表中添加自编号和路牌字段</li> | |
| 67 | - <li><span class="label s_c_change">修改</span>2.烂班明细统计,增加直属公司所有分公司、烂班原因筛选条件</li> | |
| 68 | - <li class="sub_title"><h6>基础信息</h6></li> | |
| 69 | - <li><span class="label s_c_change">修改</span>1.基础信息->线路->站点详情,可查看历史版本,编辑当前和待更新版本</li> | |
| 70 | - <li class="sub_title"><h6>线调</h6></li> | |
| 71 | - <li><span class="label s_c_change">修改</span>1.线调->地图,点击某个设备"拨打电话"</li> | |
| 72 | - <li><span class="label s_c_change">修改</span>2.线调->实发调整,加入调整说明下拉框,调整说明进入备注信息</li> | |
| 73 | - <li><span class="label s_c_change">修改</span>3.烂班原因加入'路救'类型</li> | |
| 74 | - <li><span class="label s_c_change">新增</span>4.新增临时功能线路调度->临时节点->花博线计划班次导出,用于按日期导出花博线计划班次</li> | |
| 75 | - </ul> | |
| 64 | + <ul ></ul> | |
| 76 | 65 | |
| 77 | 66 | </div> |
| 78 | 67 | ... | ... |
src/main/resources/static/pages/permission/authorize_all/authorize.html
src/main/resources/static/real_control_v2/assets/imgs/bt1.png
0 → 100644
279 KB
src/main/resources/static/real_control_v2/assets/imgs/bt2.png
0 → 100644
285 KB
src/main/resources/static/real_control_v2/fragments/home/context_menu.html
| ... | ... | @@ -80,14 +80,14 @@ |
| 80 | 80 | <a href="" class="uk-modal-close uk-close"></a> |
| 81 | 81 | <h2 class="modal-title"><i class="uk-icon-spinner uk-icon-spin"></i> 正在发送...</h2> |
| 82 | 82 | <div class="uk-panel uk-panel-box">{{text}}</div> |
| 83 | - <ul class="uk-list uk-list-line"> | |
| 83 | + <!-- <ul class="uk-list uk-list-line"> | |
| 84 | 84 | {{each array as nbbm i}} |
| 85 | 85 | <li data-nbbm="{{nbbm}}"> |
| 86 | 86 | <span class="text-lg">{{nbbm}}</span> |
| 87 | 87 | <span class="text-grey wait-send">等待推送</span> |
| 88 | 88 | </li> |
| 89 | 89 | {{/each}} |
| 90 | - </ul> | |
| 90 | + </ul>--> | |
| 91 | 91 | </div> |
| 92 | 92 | </div> |
| 93 | 93 | </script> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sftz.html
| ... | ... | @@ -104,7 +104,6 @@ |
| 104 | 104 | $(modal).on('init', function(e, data) { |
| 105 | 105 | e.stopPropagation(); |
| 106 | 106 | sch = data.sch; |
| 107 | - debugger; | |
| 108 | 107 | var formHtml = template('schedule-sftz-form-temp', {sch: sch, adjustExps:adjustExps, reportTypes:reportTypes}); |
| 109 | 108 | $('form', modal).html(formHtml); |
| 110 | 109 | $('input:checkbox').click(function(){ | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/main.html
| ... | ... | @@ -233,7 +233,6 @@ |
| 233 | 233 | |
| 234 | 234 | var st_doms = gb_schedule_context_menu.get_st_doms(); |
| 235 | 235 | //普通 |
| 236 | - debugger | |
| 237 | 236 | $('.normalCont', modal).html(st_doms.custom_dom); |
| 238 | 237 | $('.add_custom_wrap', modal).trigger('init', data); |
| 239 | 238 | |
| ... | ... | @@ -652,7 +651,6 @@ |
| 652 | 651 | |
| 653 | 652 | //debugger |
| 654 | 653 | array.sort(function (a, b) { |
| 655 | - debugger | |
| 656 | 654 | if(a.code==information.carPark) |
| 657 | 655 | return -1; |
| 658 | 656 | if(b.code==information.carPark) | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/temp_sch/main.html
src/main/resources/static/real_control_v2/fragments/north/nav/directive_history.html
| ... | ... | @@ -39,10 +39,10 @@ |
| 39 | 39 | <thead> |
| 40 | 40 | <tr> |
| 41 | 41 | <th style="width: 6%;">时间</th> |
| 42 | - <th style="width: 8%;">车辆</th> | |
| 43 | - <th style="width: 44%;">指令内容</th> | |
| 42 | + <th style="width: 17%;">车辆</th> | |
| 43 | + <th style="width: 40%;">指令内容</th> | |
| 44 | 44 | <th style="width: 7%;">发送人</th> |
| 45 | - <th style="width: 15%;">状态</th> | |
| 45 | + <th style="width: 10%;">状态</th> | |
| 46 | 46 | </tr> |
| 47 | 47 | </thead> |
| 48 | 48 | <tbody> |
| ... | ... | @@ -120,7 +120,7 @@ |
| 120 | 120 | for(var i=0,n;n=nbbmArray[i++];){ |
| 121 | 121 | data.nbbms+=n+','; |
| 122 | 122 | } |
| 123 | - data.nbbms=data.nbbms.substr(0, data.nbbms.length-1); | |
| 123 | + //data.nbbms=data.nbbms.substr(0, data.nbbms.length-1); | |
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | ... | ... |
src/main/resources/static/real_control_v2/js/data/json/north_toolbar.json
| 1 | 1 | [ |
| 2 | - { | |
| 3 | - "id": 1, | |
| 4 | - "text": "数据&统计", | |
| 5 | - "children": [ | |
| 6 | - { | |
| 7 | - "id": 1.1, | |
| 8 | - "text": "数据管理", | |
| 9 | - "header": 1 | |
| 10 | - }, | |
| 11 | - { | |
| 12 | - "id": 1.2, | |
| 13 | - "text": "当日计划排班", | |
| 14 | - "event": "curr_date_schedule" | |
| 15 | - }, | |
| 16 | - { | |
| 17 | - "id": 1.3, | |
| 18 | - "text": "缓存数据管理", | |
| 19 | - "event": "cache_data_manage" | |
| 20 | - }, | |
| 21 | - { | |
| 22 | - "id": 1.4, | |
| 23 | - "text": "历史路单维护", | |
| 24 | - "event": "history_sch_maintain" | |
| 25 | - }, | |
| 26 | - { | |
| 27 | - "id": 1.41, | |
| 28 | - "text": "班次修正日志", | |
| 29 | - "event": "sch_edit_info" | |
| 30 | - } | |
| 31 | - ] | |
| 32 | - }, | |
| 2 | + | |
| 33 | 3 | { |
| 34 | 4 | "id": 2, |
| 35 | 5 | "text": "报表管理", |
| ... | ... | @@ -44,25 +14,8 @@ |
| 44 | 14 | "text": "行车路单", |
| 45 | 15 | "event": "form_waybill", |
| 46 | 16 | "icon": "uk-icon-table" |
| 47 | - }, | |
| 48 | - { | |
| 49 | - "id": 2.8, | |
| 50 | - "text": "调度历史消息", | |
| 51 | - "event": "form_history_message", | |
| 52 | - "icon": "uk-icon-table" | |
| 53 | - }, | |
| 54 | - { | |
| 55 | - "id": 2.9, | |
| 56 | - "text": "驾驶员请求台账", | |
| 57 | - "event": "form_account", | |
| 58 | - "icon": "uk-icon-table" | |
| 59 | - }, | |
| 60 | - { | |
| 61 | - "id": 2.91, | |
| 62 | - "text": "修正报表", | |
| 63 | - "event": "form_correctForm", | |
| 64 | - "icon": "uk-icon-table" | |
| 65 | - }, | |
| 17 | + }, | |
| 18 | + | |
| 66 | 19 | { |
| 67 | 20 | "id": 2.92, |
| 68 | 21 | "text": "统计日报", |
| ... | ... | @@ -75,135 +28,26 @@ |
| 75 | 28 | "event": "form_scheduleDaily", |
| 76 | 29 | "icon": "uk-icon-table" |
| 77 | 30 | }, |
| 78 | - { | |
| 79 | - "id": 2.94, | |
| 80 | - "text": "工作汇总", | |
| 81 | - "event": "form_jobSummary", | |
| 82 | - "icon": "uk-icon-table" | |
| 83 | - }, | |
| 31 | + | |
| 84 | 32 | { |
| 85 | 33 | "id": 2.941, |
| 86 | 34 | "text": "班次日报表", |
| 87 | 35 | "event": "form_daily", |
| 88 | 36 | "icon": "uk-icon-table" |
| 89 | - }, | |
| 90 | - { | |
| 91 | - "id": 2.95, | |
| 92 | - "text": "班次到离站", | |
| 93 | - "event": "form_inoutstation", | |
| 94 | - "icon": "uk-icon-table" | |
| 95 | - }, | |
| 96 | - { | |
| 97 | - "id": 2.2, | |
| 98 | - "text": "月存油报表", | |
| 99 | - "event": "form_oilListMonth", | |
| 100 | - "icon": "uk-icon-table" | |
| 101 | - }, | |
| 102 | - { | |
| 103 | - "id": 2.3, | |
| 104 | - "text": "时刻表分析", | |
| 105 | - "event": "form_scheduleAnaly", | |
| 106 | - "icon": "uk-icon-table" | |
| 107 | - }, | |
| 108 | - { | |
| 109 | - "id": 2.4, | |
| 110 | - "text": "调度消息分析", | |
| 111 | - "event": "form_message", | |
| 112 | - "icon": "uk-icon-table" | |
| 113 | - }, | |
| 114 | - { | |
| 115 | - "id": 2.5, | |
| 116 | - "text": "换人换车情况统计表", | |
| 117 | - "event": "form_changetochange", | |
| 118 | - "icon": "uk-icon-table" | |
| 119 | - }, | |
| 120 | - { | |
| 121 | - "id": 2.6, | |
| 122 | - "text": "班次车辆人员日统计", | |
| 123 | - "event": "form_shifday", | |
| 124 | - "icon": "uk-icon-table" | |
| 125 | - }, | |
| 126 | - { | |
| 127 | - "id": 2.96, | |
| 128 | - "text": "维修上报记录", | |
| 129 | - "event": "form_repairReport", | |
| 130 | - "icon": "uk-icon-table" | |
| 131 | - } | |
| 37 | + } | |
| 132 | 38 | ] |
| 133 | 39 | }, |
| 134 | 40 | { |
| 135 | 41 | "id": 3, |
| 136 | 42 | "text": "车载设备", |
| 137 | 43 | "children": [ |
| 138 | - { | |
| 139 | - "id": 3.1, | |
| 140 | - "text": "设备管理", | |
| 141 | - "event": "all_devices" | |
| 142 | - }, | |
| 44 | + | |
| 143 | 45 | { |
| 144 | 46 | "id": 3.2, |
| 145 | 47 | "text": "指令下发记录", |
| 146 | 48 | "event": "directive_history" |
| 147 | - }, | |
| 148 | - { | |
| 149 | - "id": 3.3, | |
| 150 | - "text": "设备上报记录", | |
| 151 | - "event": "device_report" | |
| 152 | - }, | |
| 153 | - { | |
| 154 | - "id": 3.4, | |
| 155 | - "text": "轨迹回放", | |
| 156 | - "event": "gps_play_back" | |
| 157 | - }, | |
| 158 | - { | |
| 159 | - "id": 3.5, | |
| 160 | - "text": "安全驾驶(图像)", | |
| 161 | - "event": "safe_driving" | |
| 162 | - } | |
| 163 | - ] | |
| 164 | - }, | |
| 165 | - { | |
| 166 | - "id": 4, | |
| 167 | - "text": "系统设置", | |
| 168 | - "children": [ | |
| 169 | - { | |
| 170 | - "id": 4.1, | |
| 171 | - "text": "线路配置", | |
| 172 | - "event": "line_config" | |
| 173 | - }, | |
| 174 | - { | |
| 175 | - "id": 4.2, | |
| 176 | - "text": "TTS", | |
| 177 | - "event": "tts_config" | |
| 178 | - }, | |
| 179 | - { | |
| 180 | - "id": 4.3, | |
| 181 | - "text": "信号标记", | |
| 182 | - "event": "signal_state" | |
| 183 | - }, | |
| 184 | - { | |
| 185 | - "id": 4.4, | |
| 186 | - "text": "翻班与自动执行", | |
| 187 | - "event": "fbzdzx_config" | |
| 188 | - } | |
| 189 | - | |
| 190 | - ] | |
| 191 | - }, | |
| 192 | - { | |
| 193 | - "id": 5, | |
| 194 | - "text": "服务热线系统", | |
| 195 | - "children": [ | |
| 196 | - { | |
| 197 | - "id": 5.1, | |
| 198 | - "text": "报备登记", | |
| 199 | - "event": "report_register" | |
| 200 | - }, | |
| 201 | - { | |
| 202 | - "id": 5.2, | |
| 203 | - "text": "报备登记报表", | |
| 204 | - "event": "form_report_register", | |
| 205 | - "icon": "uk-icon-table" | |
| 206 | 49 | } |
| 207 | 50 | ] |
| 208 | 51 | } |
| 52 | + | |
| 209 | 53 | ] |
| 210 | 54 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/js/home/context_menu.js
| ... | ... | @@ -199,7 +199,7 @@ var gb_home_context_menu = (function() { |
| 199 | 199 | return; |
| 200 | 200 | } |
| 201 | 201 | var f = arguments.callee, |
| 202 | - rsText = $('li[data-nbbm=' + nbbmArray[i] + '] .wait-send', modal); | |
| 202 | + rsText = $('li[data-nbbm=' + nbbmArray[i].substring(0,7) + '] .wait-send', modal); | |
| 203 | 203 | |
| 204 | 204 | rsText.text('正在发送...').css('color', '#FF9800'); |
| 205 | 205 | ajaxPostPhrase({ |
| ... | ... | @@ -309,32 +309,7 @@ var gb_home_context_menu = (function() { |
| 309 | 309 | 'send_phrase_multi': { |
| 310 | 310 | name: '群发消息短语' |
| 311 | 311 | }, |
| 312 | - 'sep1': '---------', | |
| 313 | - 'fold_state': { | |
| 314 | - name: '状态切换', | |
| 315 | - items: { | |
| 316 | - 'state_up_1': { | |
| 317 | - 'name': '上行非营运' | |
| 318 | - }, | |
| 319 | - 'state_down_1': { | |
| 320 | - 'name': '下行非营运' | |
| 321 | - }, | |
| 322 | - 'sep3_2': '---------', | |
| 323 | - 'state_up_0': { | |
| 324 | - 'name': '上行营运' | |
| 325 | - }, | |
| 326 | - 'state_down_0': { | |
| 327 | - 'name': '下行营运' | |
| 328 | - } | |
| 329 | - } | |
| 330 | - }, | |
| 331 | - 'line_change': { | |
| 332 | - name: '线路切换' | |
| 333 | - }, | |
| 334 | - 'sep2': '---------', | |
| 335 | - 'C0_A3': { | |
| 336 | - name: '设备参数管理' | |
| 337 | - } | |
| 312 | + | |
| 338 | 313 | } |
| 339 | 314 | }); |
| 340 | 315 | ... | ... |
src/main/resources/static/real_control_v2/js/north/second_timer.js
| ... | ... | @@ -8,31 +8,37 @@ var gb_second_timer = (function () { |
| 8 | 8 | var _this; |
| 9 | 9 | var secondTimer; |
| 10 | 10 | var contextFlag; |
| 11 | - | |
| 11 | + var t = 0; | |
| 12 | 12 | var init = function () { |
| 13 | 13 | _this = $('.op-beijingtime-time>span')[0]; |
| 14 | 14 | getServerTime(function (time) { |
| 15 | - now = time; | |
| 15 | + $.get('/ddexam/getTime', function(ds){ | |
| 16 | + now = new Date(ds); | |
| 17 | + | |
| 18 | + | |
| 16 | 19 | $('div.north').bind("contextmenu", function () { |
| 17 | 20 | contextFlag = true; |
| 18 | 21 | }); |
| 19 | 22 | setTime(); |
| 20 | - | |
| 23 | + | |
| 21 | 24 | secondTimer = window.setInterval(function () { |
| 22 | - if (0 == now.getSeconds() || true == contextFlag) { | |
| 25 | + /* if (0 == now.getSeconds() || true == contextFlag) { | |
| 23 | 26 | minuteTimer(); |
| 24 | 27 | contextFlag = false; |
| 25 | - } | |
| 28 | + }*/ | |
| 26 | 29 | |
| 27 | 30 | now = new Date(now.getTime() + 1e3); |
| 28 | 31 | setTime(); |
| 29 | 32 | }, 1e3); |
| 33 | + }); | |
| 30 | 34 | }); |
| 31 | 35 | }; |
| 36 | + | |
| 37 | + | |
| 32 | 38 | |
| 33 | 39 | var getServerTime = function (callback) { |
| 34 | 40 | function oncallback(jqXHR) { |
| 35 | - var time = jqXHR && jqXHR.getResponseHeader("Date"); | |
| 41 | + var time = jqXHR && jqXHR.getResponseHeader("Date"); | |
| 36 | 42 | if (time) |
| 37 | 43 | callback(new Date(time)) |
| 38 | 44 | } | ... | ... |
src/main/resources/static/real_control_v2/main.html
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v3/right.html