Commit 4de38ce85bd3e0c3443c3f803d0341d821998975
Merge branch 'pudong_jdk8' of 192.168.168.201:panzhaov5/bsth_control into pudong_jdk8
Showing
69 changed files
with
7065 additions
and
3049 deletions
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| 1 | -package com.bsth.controller.realcontrol; | ||
| 2 | - | ||
| 3 | -import java.io.ByteArrayOutputStream; | ||
| 4 | -import java.io.IOException; | ||
| 5 | -import java.io.InputStream; | ||
| 6 | -import java.io.OutputStream; | ||
| 7 | -import java.net.HttpURLConnection; | ||
| 8 | -import java.net.MalformedURLException; | ||
| 9 | -import java.net.URL; | ||
| 10 | -import java.net.URLEncoder; | ||
| 11 | -import java.sql.Connection; | ||
| 12 | -import java.sql.Date; | ||
| 13 | -import java.sql.PreparedStatement; | ||
| 14 | -import java.sql.ResultSet; | ||
| 15 | -import java.util.*; | ||
| 16 | - | ||
| 17 | -import com.bsth.data.forecast.entity.ArrivalEntity; | ||
| 18 | -import com.bsth.entity.sys.SysUser; | ||
| 19 | -import com.bsth.security.util.SecurityUtils; | ||
| 20 | -import com.bsth.util.ReportUtils; | ||
| 21 | -import com.bsth.util.db.DBUtils_MS; | ||
| 22 | -import com.bsth.util.db.DBUtils_control; | ||
| 23 | -import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 24 | -import org.apache.commons.io.IOUtils; | ||
| 25 | -import org.apache.commons.lang3.StringEscapeUtils; | ||
| 26 | -import org.joda.time.DateTime; | ||
| 27 | -import org.joda.time.format.DateTimeFormat; | ||
| 28 | -import org.joda.time.format.DateTimeFormatter; | ||
| 29 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 30 | -import org.springframework.web.bind.annotation.*; | ||
| 31 | - | ||
| 32 | -import com.alibaba.fastjson.JSONArray; | ||
| 33 | -import com.bsth.common.ResponseCode; | ||
| 34 | -import com.bsth.controller.BaseController; | ||
| 35 | -import com.bsth.controller.realcontrol.dto.ChangePersonCar; | ||
| 36 | -import com.bsth.controller.realcontrol.dto.DfsjChange; | ||
| 37 | -import com.bsth.data.BasicData; | ||
| 38 | -import com.bsth.data.schedule.DayOfSchedule; | ||
| 39 | -import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; | ||
| 40 | -import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 41 | -import com.bsth.entity.report.RepairReport; | ||
| 42 | -import com.bsth.entity.schedule.SchedulePlanInfo; | ||
| 43 | -import com.bsth.service.realcontrol.ScheduleRealInfoService; | ||
| 44 | - | ||
| 45 | -@RestController | ||
| 46 | -@RequestMapping("/realSchedule") | ||
| 47 | -public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, Long> { | ||
| 48 | - | ||
| 49 | - @Autowired | ||
| 50 | - ScheduleRealInfoService scheduleRealInfoService; | ||
| 51 | - | ||
| 52 | - @Autowired | ||
| 53 | - DayOfSchedule dayOfSchedule; | ||
| 54 | - | ||
| 55 | - @RequestMapping(value = "check_fgs_ascription", method = RequestMethod.POST) | ||
| 56 | - public Map<String, Object> checkPCFgsAscription(@RequestParam Long schId, String jGh, String sGh, String nbbm){ | ||
| 57 | - return scheduleRealInfoService.checkPCFgsAscription(schId, jGh, sGh, nbbm); | ||
| 58 | - } | ||
| 59 | - | ||
| 60 | - @RequestMapping(value = "/lines") | ||
| 61 | - public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines) { | ||
| 62 | - return scheduleRealInfoService.findByLines(lines); | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - @RequestMapping(value = "/car") | ||
| 66 | - public List<ScheduleRealInfo> findByCar(String nbbm){ | ||
| 67 | - return dayOfSchedule.findByNbbm(nbbm); | ||
| 68 | - } | ||
| 69 | - | ||
| 70 | - /** | ||
| 71 | - * | ||
| 72 | - * @Title: outgoAdjust @Description: TODO(待发调整) @param @param id | ||
| 73 | - * 主键 @param @param remarks 备注 @param @param dfsj 待发时间(HH:mm) @throws | ||
| 74 | - */ | ||
| 75 | - @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST) | ||
| 76 | - public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks, | ||
| 77 | - @RequestParam String dfsj,String bcType, | ||
| 78 | - @RequestParam(defaultValue = "") String opType) { | ||
| 79 | - return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType, opType, null); | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - /** | ||
| 83 | - * | ||
| 84 | - * @Title: destroy @Description: TODO(销毁,烂班) @param @param idsStr 要烂掉的班次ID ,分隔 | ||
| 85 | - */ | ||
| 86 | - @RequestMapping(value = "/destroy", method = RequestMethod.POST) | ||
| 87 | - public Map<String, Object> destroy(@RequestParam String idsStr | ||
| 88 | - /*, @RequestParam(defaultValue = "-1") int spaceAdjust*/, | ||
| 89 | - @RequestParam String remarks, @RequestParam String adjustExps/*, @RequestParam(defaultValue = "0") int spaceNum*/) { | ||
| 90 | - return scheduleRealInfoService.destroy(idsStr, remarks, adjustExps, null); | ||
| 91 | - } | ||
| 92 | - | ||
| 93 | - /** | ||
| 94 | - * | ||
| 95 | - * @Title: carDeviceMapp @Description: TODO(获取车辆自编号和设备号对照,从缓存取) @throws | ||
| 96 | - */ | ||
| 97 | - @RequestMapping(value = "/carDeviceMapp", method = RequestMethod.GET) | ||
| 98 | - public Map<String, String> carDeviceMapp() { | ||
| 99 | - return BasicData.deviceId2NbbmMap.inverse(); | ||
| 100 | - } | ||
| 101 | - | ||
| 102 | - /** | ||
| 103 | - * | ||
| 104 | - * @Title: findPersionByLine @Description: TODO(根据线路主键获取驾驶员) @param @param | ||
| 105 | - * lineId @throws | ||
| 106 | - */ | ||
| 107 | - @RequestMapping(value = "/driver", method = RequestMethod.GET) | ||
| 108 | - public List<Map<String, String>> findDriverByLine(@RequestParam String lineCode) { | ||
| 109 | - return scheduleRealInfoService.findDriverByLine(lineCode); | ||
| 110 | - } | ||
| 111 | - | ||
| 112 | - /** | ||
| 113 | - * | ||
| 114 | - * @Title: findPersionByLine @Description: TODO(根据线路主键获取售票员) @param @param | ||
| 115 | - * lineId @throws | ||
| 116 | - */ | ||
| 117 | - @RequestMapping(value = "/conductor", method = RequestMethod.GET) | ||
| 118 | - public List<Map<String, String>> findConductorByLine(@RequestParam String lineCode) { | ||
| 119 | - return scheduleRealInfoService.findConductorByLine(lineCode); | ||
| 120 | - } | ||
| 121 | - | ||
| 122 | - /** | ||
| 123 | - * | ||
| 124 | - * @Title: findPersionByLine @Description: TODO(根据线路主键获取车辆) @param @param | ||
| 125 | - * lineId @throws | ||
| 126 | - */ | ||
| 127 | - @RequestMapping(value = "/cars", method = RequestMethod.GET) | ||
| 128 | - public List<Map<String, String>> findCarByLine(@RequestParam String lineCode) { | ||
| 129 | - return scheduleRealInfoService.findCarByLine(lineCode); | ||
| 130 | - } | ||
| 131 | - | ||
| 132 | - /** | ||
| 133 | - * | ||
| 134 | - * @Title: sreachNbbm @Description: TODO(搜索车辆内部编码) @throws | ||
| 135 | - */ | ||
| 136 | - @RequestMapping(value = "/sreachVehic", method = RequestMethod.GET) | ||
| 137 | - public List<Map<String, String>> sreachVehic(@RequestParam String nbbm) { | ||
| 138 | - return scheduleRealInfoService.sreachVehic(nbbm); | ||
| 139 | - } | ||
| 140 | - /** | ||
| 141 | - * | ||
| 142 | - * @Title: realOutAdjust | ||
| 143 | - * @Description: TODO(实发调整) | ||
| 144 | - * @param @param id 班次ID | ||
| 145 | - * @param @param fcsjActual 实际发车时间 HH:mm | ||
| 146 | - * @param @param remarks 备注 | ||
| 147 | - * @throws | ||
| 148 | - */ | ||
| 149 | - @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST) | ||
| 150 | - public Map<String, Object> realOutAdjust(@RequestParam Map<String, String> map) { | ||
| 151 | - return scheduleRealInfoService.realOutAdjust(map); | ||
| 152 | - } | ||
| 153 | - | ||
| 154 | - /** | ||
| 155 | - * | ||
| 156 | - * @Title: revokeDestroy | ||
| 157 | - * @Description: TODO(撤销烂班) | ||
| 158 | - * @param @param id | ||
| 159 | - * @throws | ||
| 160 | - */ | ||
| 161 | - @RequestMapping(value = "/revokeDestroy", method = RequestMethod.POST) | ||
| 162 | - public Map<String, Object> revokeDestroy(@RequestParam Long id){ | ||
| 163 | - return scheduleRealInfoService.revokeDestroy(id); | ||
| 164 | - } | ||
| 165 | - | ||
| 166 | - /** | ||
| 167 | - * | ||
| 168 | - * @Title: revokeRealOutgo | ||
| 169 | - * @Description: TODO(撤销实发) | ||
| 170 | - * @param @param id | ||
| 171 | - * @throws | ||
| 172 | - */ | ||
| 173 | - @RequestMapping(value = "/revokeRealOutgo", method = RequestMethod.POST) | ||
| 174 | - public Map<String, Object> revokeRealOutgo(@RequestParam Long id){ | ||
| 175 | - return scheduleRealInfoService.revokeRealOutgo(id); | ||
| 176 | - } | ||
| 177 | - | ||
| 178 | - /** | ||
| 179 | - * 撤销执行 | ||
| 180 | - * @param id | ||
| 181 | - * @return | ||
| 182 | - */ | ||
| 183 | - @RequestMapping(value = "/revokeRealArrive", method = RequestMethod.POST) | ||
| 184 | - public Map<String, Object> revokeRealArrive(@RequestParam Long id){ | ||
| 185 | - return scheduleRealInfoService.revokeRealArrive(id); | ||
| 186 | - } | ||
| 187 | - | ||
| 188 | - /** | ||
| 189 | - * | ||
| 190 | - * @Title: spaceAdjust | ||
| 191 | - * @Description: TODO(间隔调整) | ||
| 192 | - * @param @param ids 要调整的班次数组ID | ||
| 193 | - * @param @param space 间隔 | ||
| 194 | - * @throws | ||
| 195 | - */ | ||
| 196 | - @RequestMapping(value = "/spaceAdjust", method = RequestMethod.POST) | ||
| 197 | - public Map<String, Object> spaceAdjust(Long[] ids, Integer space){ | ||
| 198 | - return scheduleRealInfoService.spaceAdjust(ids, space); | ||
| 199 | - } | ||
| 200 | - | ||
| 201 | - /** | ||
| 202 | - * | ||
| 203 | - * @Title: schInfoFineTune | ||
| 204 | - * @Description: TODO(发车信息微调) | ||
| 205 | - * @param @param map | ||
| 206 | - * @throws | ||
| 207 | - */ | ||
| 208 | - @RequestMapping(value = "/schInfoFineTune", method = RequestMethod.POST) | ||
| 209 | - public Map<String, Object> schInfoFineTune(@RequestParam Map<String, String> map){ | ||
| 210 | - return scheduleRealInfoService.schInfoFineTune(map); | ||
| 211 | - } | ||
| 212 | - | ||
| 213 | - /** | ||
| 214 | - * | ||
| 215 | - * @Title: outgoAdjustAll | ||
| 216 | - * @Description: TODO(批量待发调整) | ||
| 217 | - * @param @param list | ||
| 218 | - * @throws | ||
| 219 | - */ | ||
| 220 | - @RequestMapping(value = "/outgoAdjustAll", method = RequestMethod.POST) | ||
| 221 | - public Map<String, Object> outgoAdjustAll(@RequestParam String params){ | ||
| 222 | - //反转义 | ||
| 223 | - params = StringEscapeUtils.unescapeHtml4(params); | ||
| 224 | - return scheduleRealInfoService.outgoAdjustAll(params); | ||
| 225 | - } | ||
| 226 | - | ||
| 227 | - /** | ||
| 228 | - * | ||
| 229 | - * @Title: findByLineAndUpDown | ||
| 230 | - * @Description: TODO(根据线路和走向获取班次) | ||
| 231 | - * @param @param line | ||
| 232 | - * @param @param upDown | ||
| 233 | - */ | ||
| 234 | - @RequestMapping(value = "/findByLineAndUpDown") | ||
| 235 | - public List<ScheduleRealInfo> findByLineAndUpDown(@RequestParam String line,@RequestParam Integer upDown){ | ||
| 236 | - return dayOfSchedule.findByLineAndUpDown(line, upDown); | ||
| 237 | - } | ||
| 238 | - | ||
| 239 | - /** | ||
| 240 | - * | ||
| 241 | - * @Title: findRouteByLine | ||
| 242 | - * @Description: TODO(获取线路的站点,路段路由) | ||
| 243 | - * @param @param lineCode | ||
| 244 | - * @throws | ||
| 245 | - */ | ||
| 246 | - @RequestMapping(value = "/findRouteByLine") | ||
| 247 | - public Map<String, Object> findRouteByLine(@RequestParam String lineCode){ | ||
| 248 | - return scheduleRealInfoService.findRouteByLine(lineCode); | ||
| 249 | - } | ||
| 250 | - | ||
| 251 | - /** | ||
| 252 | - * | ||
| 253 | - * @Title: removeChildTask | ||
| 254 | - * @Description: TODO(删除子任务) | ||
| 255 | - * @param @param taskId 子任务ID | ||
| 256 | - * @throws | ||
| 257 | - */ | ||
| 258 | - @RequestMapping(value = "/childTask/{taskId}", method = RequestMethod.DELETE) | ||
| 259 | - public Map<String, Object> removeChildTask(@PathVariable("taskId") Long taskId){ | ||
| 260 | - return scheduleRealInfoService.removeChildTask(taskId); | ||
| 261 | - } | ||
| 262 | - | ||
| 263 | - /** | ||
| 264 | - * | ||
| 265 | - * @Title: findByLineCode | ||
| 266 | - * @Description: TODO(根据线路获取班次信息) | ||
| 267 | - * @param @param lineCode | ||
| 268 | - */ | ||
| 269 | - @RequestMapping(value = "/lineCode/{lineCode}") | ||
| 270 | - public List<ScheduleRealInfo> findByLineCode(@PathVariable("lineCode") String lineCode){ | ||
| 271 | - return dayOfSchedule.findByLineCode(lineCode); | ||
| 272 | - } | ||
| 273 | - | ||
| 274 | - @RequestMapping(value = "/queryUserInfo") | ||
| 275 | - public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line, | ||
| 276 | - @RequestParam String date,@RequestParam String state) { | ||
| 277 | - return scheduleRealInfoService.queryUserInfo(line, date,state); | ||
| 278 | - } | ||
| 279 | - | ||
| 280 | - @RequestMapping(value = "/queryUserInfoPx") | ||
| 281 | - public List<ScheduleRealInfo> queryUserInfoPx(@RequestParam String line, | ||
| 282 | - @RequestParam String date,@RequestParam String state,@RequestParam String type) { | ||
| 283 | - return scheduleRealInfoService.queryUserInfoPx(line, date,state,type); | ||
| 284 | - } | ||
| 285 | - | ||
| 286 | - @RequestMapping(value = "/exportWaybill",method = RequestMethod.GET) | ||
| 287 | - public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName,@RequestParam String jGh, @RequestParam String clZbh, | ||
| 288 | - @RequestParam String lpName,@RequestParam String date,@RequestParam String line) { | ||
| 289 | - return scheduleRealInfoService.exportWaybill(jName,jGh, clZbh, lpName,date,line); | ||
| 290 | - } | ||
| 291 | - | ||
| 292 | - @RequestMapping(value = "/exportWaybillQp",method = RequestMethod.GET) | ||
| 293 | - public List<ScheduleRealInfo> exportWaybillQp(@RequestParam String clZbh | ||
| 294 | - ,@RequestParam String date,@RequestParam String line) { | ||
| 295 | - return scheduleRealInfoService.exportWaybillQp( clZbh, date,line); | ||
| 296 | - } | ||
| 297 | - | ||
| 298 | - | ||
| 299 | - @RequestMapping(value = "/dailyInfo") | ||
| 300 | - public List<Map<String, Object>> dailyInfo(@RequestParam String line, @RequestParam String date,@RequestParam String type) { | ||
| 301 | - return scheduleRealInfoService.dailyInfo(line, date, type); | ||
| 302 | - } | ||
| 303 | - | ||
| 304 | - @RequestMapping(value = "/historyMessage") | ||
| 305 | - public List<Object[]> historyMessage(@RequestParam String line, @RequestParam String date, | ||
| 306 | - @RequestParam String code, @RequestParam String type) { | ||
| 307 | - return scheduleRealInfoService.historyMessage(line, date, code, type); | ||
| 308 | - } | ||
| 309 | - | ||
| 310 | - @RequestMapping(value="/findLine") | ||
| 311 | - public List<Map<String,String>> findLine(@RequestParam String line){ | ||
| 312 | - return scheduleRealInfoService.findLine(line); | ||
| 313 | - } | ||
| 314 | - | ||
| 315 | - @RequestMapping(value="/findKMBC",method = RequestMethod.GET) | ||
| 316 | - public Map<String,Object> findKMBC(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName | ||
| 317 | - ,@RequestParam String date,@RequestParam String line){ | ||
| 318 | - return scheduleRealInfoService.findKMBC(jGh, clZbh,lpName,date,line); | ||
| 319 | - } | ||
| 320 | - | ||
| 321 | - /** | ||
| 322 | - * 路单公里统计 (闵行审计专用) | ||
| 323 | - * @param jGh | ||
| 324 | - * @param clZbh | ||
| 325 | - * @param lpName | ||
| 326 | - * @param date | ||
| 327 | - * @param line | ||
| 328 | - * @return | ||
| 329 | - */ | ||
| 330 | - @RequestMapping(value="/findKMBC_mh_2",method = RequestMethod.GET) | ||
| 331 | - public Map<String,Object> findKMBC_mh_2(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName | ||
| 332 | - ,@RequestParam String date,@RequestParam String line){ | ||
| 333 | - return scheduleRealInfoService.findKMBC_mh_2(jGh, clZbh,lpName,date,line); | ||
| 334 | - } | ||
| 335 | - | ||
| 336 | - @RequestMapping(value="/findKMBCQp",method = RequestMethod.GET) | ||
| 337 | - public Map<String,Object> findKMBCQp(@RequestParam String clZbh | ||
| 338 | - ,@RequestParam String date,@RequestParam String line){ | ||
| 339 | - return scheduleRealInfoService.findKMBCQp(clZbh,date,line); | ||
| 340 | - } | ||
| 341 | - | ||
| 342 | - @RequestMapping(value="/findLpName") | ||
| 343 | - public List<Map<String,String>> findLpName(@RequestParam String lpName){ | ||
| 344 | - return scheduleRealInfoService.findLpName(lpName); | ||
| 345 | - } | ||
| 346 | - | ||
| 347 | - @RequestMapping(value = "/account") | ||
| 348 | - public List<Map<String,Object>> account(@RequestParam String line, @RequestParam String date, | ||
| 349 | - @RequestParam String code,@RequestParam String xlName, @RequestParam String type) { | ||
| 350 | - return scheduleRealInfoService.account(line, date, code, xlName, type); | ||
| 351 | - } | ||
| 352 | - | ||
| 353 | - @RequestMapping(value = "/accountPx") | ||
| 354 | - public List<Map<String,Object>> accountPx(@RequestParam String line, @RequestParam String date, | ||
| 355 | - @RequestParam String code,@RequestParam String xlName, @RequestParam String px) { | ||
| 356 | - return scheduleRealInfoService.accountPx(line, date, code, xlName, px); | ||
| 357 | - } | ||
| 358 | - | ||
| 359 | - @RequestMapping(value = "/correctForm") | ||
| 360 | - public List<SchEditInfoDto> correctForm(@RequestParam String line, @RequestParam String date, | ||
| 361 | - @RequestParam String endDate, | ||
| 362 | - @RequestParam String lpName, @RequestParam String code, | ||
| 363 | - @RequestParam String type,@RequestParam String changType) { | ||
| 364 | - return scheduleRealInfoService.correctForm(line, date, endDate, lpName, code, type,changType); | ||
| 365 | - } | ||
| 366 | - /** | ||
| 367 | - * @Title queryListWaybill | ||
| 368 | - * @Description 查询行车路单列表 | ||
| 369 | - * @param jGh 驾驶员名字 | ||
| 370 | - * @param clZbh 车辆自编号(内部编号) | ||
| 371 | - * @param lpName 路牌 | ||
| 372 | - * @return | ||
| 373 | - */ | ||
| 374 | - @RequestMapping(value="/queryListWaybill",method = RequestMethod.GET) | ||
| 375 | - public List<ScheduleRealInfo> queryListWaybill(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName | ||
| 376 | - ,@RequestParam String date,@RequestParam String line){ | ||
| 377 | - return scheduleRealInfoService.queryListWaybill(jGh, clZbh,lpName,date,line); | ||
| 378 | - } | ||
| 379 | - | ||
| 380 | - /** | ||
| 381 | - * @Title queryListWaybill | ||
| 382 | - * @Description 查询行车路单列表(闵行审计专用路单) | ||
| 383 | - * @param jName 驾驶员名字 | ||
| 384 | - * @param clZbh 车辆自编号(内部编号) | ||
| 385 | - * @param lpName 路牌 | ||
| 386 | - * @return | ||
| 387 | - */ | ||
| 388 | - @RequestMapping(value="/queryListWaybill_mh_2",method = RequestMethod.GET) | ||
| 389 | - public List<ScheduleRealInfo> queryListWaybill_mh_2(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName | ||
| 390 | - ,@RequestParam String date,@RequestParam String line){ | ||
| 391 | - return scheduleRealInfoService.queryListWaybill2(jName, clZbh,lpName,date,line); | ||
| 392 | - } | ||
| 393 | - | ||
| 394 | - @RequestMapping(value="/queryListWaybillQp",method = RequestMethod.GET) | ||
| 395 | - public List<ScheduleRealInfo> queryListWaybillQp(@RequestParam String clZbh, | ||
| 396 | - @RequestParam String date,@RequestParam String line){ | ||
| 397 | - return scheduleRealInfoService.queryListWaybillQp(clZbh,date,line); | ||
| 398 | - } | ||
| 399 | - | ||
| 400 | - @RequestMapping(value="/statisticsDaily") | ||
| 401 | - public List<Map<String,Object>> statisticsDaily(@RequestParam String line, @RequestParam String date, | ||
| 402 | - @RequestParam String xlName, @RequestParam String type){ | ||
| 403 | - return scheduleRealInfoService.statisticsDaily(line, date, xlName, type); | ||
| 404 | - } | ||
| 405 | - | ||
| 406 | - @RequestMapping(value="/statisticsDaily_mh_2") | ||
| 407 | - public List<Map<String,Object>> statisticsDaily_mh_2(@RequestParam String line, @RequestParam String date, | ||
| 408 | - @RequestParam String xlName, @RequestParam String type){ | ||
| 409 | - return scheduleRealInfoService.statisticsDaily_mh_2(line, date, xlName, type); | ||
| 410 | - } | ||
| 411 | - | ||
| 412 | - @RequestMapping(value="/statisticsDailyTj") | ||
| 413 | - public List<Map<String,Object>> statisticsDailyTj(@RequestParam Map<String, Object> map){ | ||
| 414 | - String gsdm=""; | ||
| 415 | - if(map.get("gsdm")!=null){ | ||
| 416 | - gsdm=map.get("gsdm").toString(); | ||
| 417 | - } | ||
| 418 | - String fgsdm=""; | ||
| 419 | - if(map.get("fgsdm")!=null){ | ||
| 420 | - fgsdm=map.get("fgsdm").toString(); | ||
| 421 | - } | ||
| 422 | - String line=""; | ||
| 423 | - if(map.get("line")!=null){ | ||
| 424 | - line=map.get("line").toString(); | ||
| 425 | - } | ||
| 426 | - String date=""; | ||
| 427 | - if(map.get("date")!=null){ | ||
| 428 | - date=map.get("date").toString(); | ||
| 429 | - } | ||
| 430 | - String date2=""; | ||
| 431 | - if(map.get("date2")!=null){ | ||
| 432 | - date2=map.get("date2").toString(); | ||
| 433 | - } | ||
| 434 | - String xlName=""; | ||
| 435 | - if(map.get("xlName")!=null){ | ||
| 436 | - xlName=map.get("xlName").toString(); | ||
| 437 | - } | ||
| 438 | - String type=""; | ||
| 439 | - if(map.get("type")!=null){ | ||
| 440 | - type=map.get("type").toString(); | ||
| 441 | - } | ||
| 442 | - String nature="0"; | ||
| 443 | - if(map.get("nature")!=null){ | ||
| 444 | - nature=map.get("nature").toString(); | ||
| 445 | - } | ||
| 446 | - return scheduleRealInfoService.statisticsDailyTj(gsdm,fgsdm,line, date,date2, xlName, type,nature); | ||
| 447 | - } | ||
| 448 | - | ||
| 449 | - /* | ||
| 450 | - * 公里修正报表 | ||
| 451 | - */ | ||
| 452 | - @RequestMapping(value="/mileageReportTj") | ||
| 453 | - public List<Map<String,Object>> mileageReport(@RequestParam Map<String, Object> map){ | ||
| 454 | - String gsdm=""; | ||
| 455 | - if(map.get("gsdm")!=null){ | ||
| 456 | - gsdm=map.get("gsdm").toString(); | ||
| 457 | - } | ||
| 458 | - String fgsdm=""; | ||
| 459 | - if(map.get("fgsdm")!=null){ | ||
| 460 | - fgsdm=map.get("fgsdm").toString(); | ||
| 461 | - } | ||
| 462 | - String line=""; | ||
| 463 | - if(map.get("line")!=null){ | ||
| 464 | - line=map.get("line").toString(); | ||
| 465 | - } | ||
| 466 | - String date=""; | ||
| 467 | - if(map.get("date")!=null){ | ||
| 468 | - date=map.get("date").toString(); | ||
| 469 | - } | ||
| 470 | - String date2=""; | ||
| 471 | - if(map.get("date2")!=null){ | ||
| 472 | - date2=map.get("date2").toString(); | ||
| 473 | - } | ||
| 474 | - String xlName=""; | ||
| 475 | - if(map.get("xlName")!=null){ | ||
| 476 | - xlName=map.get("xlName").toString(); | ||
| 477 | - } | ||
| 478 | - return scheduleRealInfoService.mileageReport(gsdm,fgsdm,line, date,date2); | ||
| 479 | - } | ||
| 480 | - | ||
| 481 | - /* | ||
| 482 | - * 班次修正报表 | ||
| 483 | - */ | ||
| 484 | - @RequestMapping(value="/scheduleCorrectionReport") | ||
| 485 | - public List<Map<String,Object>> scheduleCorrectionReport(@RequestParam Map<String, Object> map){ | ||
| 486 | - String gsdm=""; | ||
| 487 | - if(map.get("gsdm")!=null){ | ||
| 488 | - gsdm=map.get("gsdm").toString(); | ||
| 489 | - } | ||
| 490 | - String fgsdm=""; | ||
| 491 | - if(map.get("fgsdm")!=null){ | ||
| 492 | - fgsdm=map.get("fgsdm").toString(); | ||
| 493 | - } | ||
| 494 | - String line=""; | ||
| 495 | - if(map.get("line")!=null){ | ||
| 496 | - line=map.get("line").toString(); | ||
| 497 | - } | ||
| 498 | - String date=""; | ||
| 499 | - if(map.get("date")!=null){ | ||
| 500 | - date=map.get("date").toString(); | ||
| 501 | - } | ||
| 502 | - String date2=""; | ||
| 503 | - if(map.get("date2")!=null){ | ||
| 504 | - date2=map.get("date2").toString(); | ||
| 505 | - } | ||
| 506 | - String xlName=""; | ||
| 507 | - if(map.get("xlName")!=null){ | ||
| 508 | - xlName=map.get("xlName").toString(); | ||
| 509 | - } | ||
| 510 | - return scheduleRealInfoService.scheduleCorrectionReport(gsdm,fgsdm,line, date,date2); | ||
| 511 | - } | ||
| 512 | - | ||
| 513 | - @RequestMapping(value="/MapById",method = RequestMethod.GET) | ||
| 514 | - public Map<String, Object> MapById(@RequestParam("id") Long id){ | ||
| 515 | - return scheduleRealInfoService.MapById(id); | ||
| 516 | - } | ||
| 517 | - | ||
| 518 | - @RequestMapping(value="/MapByIdQp",method = RequestMethod.GET) | ||
| 519 | - public Map<String, Object> MapByIdQp(@RequestParam("id") Long id){ | ||
| 520 | - return scheduleRealInfoService.MapByIdQp(id); | ||
| 521 | - } | ||
| 522 | - | ||
| 523 | - /** | ||
| 524 | - * @Title: scheduleDaily | ||
| 525 | - * @Description: TODO(调度日报表) | ||
| 526 | - * @param line 线路 | ||
| 527 | - * @param date 时间 | ||
| 528 | - * @return | ||
| 529 | - */ | ||
| 530 | - @RequestMapping(value="/scheduleDaily") | ||
| 531 | - public Map<String,Object> scheduleDaily(@RequestParam String line,@RequestParam String date){ | ||
| 532 | - return scheduleRealInfoService.scheduleDaily(line,date); | ||
| 533 | - } | ||
| 534 | - | ||
| 535 | - @RequestMapping(value="/realScheduleList") | ||
| 536 | - public List<ScheduleRealInfo> realScheduleList(@RequestParam String line,@RequestParam String date){ | ||
| 537 | - return scheduleRealInfoService.realScheduleList(line,date); | ||
| 538 | - } | ||
| 539 | - | ||
| 540 | - @RequestMapping(value="/realScheduleList_zrw") | ||
| 541 | - public List<ScheduleRealInfo> realScheduleList_zrw(@RequestParam String line,@RequestParam String date){ | ||
| 542 | - return scheduleRealInfoService.realScheduleList_zrw(line,date); | ||
| 543 | - } | ||
| 544 | - | ||
| 545 | - @RequestMapping(value="/realScheduleList_mh_2") | ||
| 546 | - public List<ScheduleRealInfo> realScheduleList_mh_2(@RequestParam String line,@RequestParam String date){ | ||
| 547 | - return scheduleRealInfoService.realScheduleList_mh_2(line,date); | ||
| 548 | - } | ||
| 549 | - | ||
| 550 | - @RequestMapping(value="/realScheduleListQp") | ||
| 551 | - public List<ScheduleRealInfo> realScheduleListQp(@RequestParam String line,@RequestParam String date){ | ||
| 552 | - return scheduleRealInfoService.realScheduleListQp(line,date); | ||
| 553 | - } | ||
| 554 | - | ||
| 555 | - @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST) | ||
| 556 | - public synchronized Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){ | ||
| 557 | - cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson); | ||
| 558 | - List<ChangePersonCar> cpcs = JSONArray.parseArray(cpcsJson, ChangePersonCar.class); | ||
| 559 | - return scheduleRealInfoService.multi_tzrc(cpcs, null); | ||
| 560 | - } | ||
| 561 | - | ||
| 562 | - @RequestMapping(value="/multi_dftz", method=RequestMethod.POST) | ||
| 563 | - public Map<String, Object> multi_dftz(@RequestParam String dcsJson){ | ||
| 564 | - dcsJson = StringEscapeUtils.unescapeHtml4(dcsJson); | ||
| 565 | - List<DfsjChange> dfsjcs = JSONArray.parseArray(dcsJson, DfsjChange.class); | ||
| 566 | - return scheduleRealInfoService.multi_dftz(dfsjcs); | ||
| 567 | - } | ||
| 568 | - | ||
| 569 | - @RequestMapping(value="/changeBcType/{id}", method=RequestMethod.POST) | ||
| 570 | - public Map<String, Object> changeBcType(@PathVariable("id") Long id, String bcType, String remarks, String majorStationName){ | ||
| 571 | - return scheduleRealInfoService.changeBcType(id, bcType, remarks, majorStationName); | ||
| 572 | - } | ||
| 573 | - | ||
| 574 | - @RequestMapping(value="/history", method=RequestMethod.POST) | ||
| 575 | - public Map<String,Object> historySave(ScheduleRealInfo sch){ | ||
| 576 | - return scheduleRealInfoService.historySave(sch); | ||
| 577 | - } | ||
| 578 | - | ||
| 579 | - | ||
| 580 | - private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"); | ||
| 581 | - private final static long ONE_DAY = 1000 * 60 * 60 * 24; | ||
| 582 | - /** | ||
| 583 | - * 获取可编辑的历史班次日期 | ||
| 584 | - * @return | ||
| 585 | - */ | ||
| 586 | - @RequestMapping("dateArray") | ||
| 587 | - public List<String> dateArray(@RequestParam(defaultValue = "0") int c){ | ||
| 588 | - List<String> rs = new ArrayList<>(); | ||
| 589 | - | ||
| 590 | - long t = System.currentTimeMillis(); | ||
| 591 | - if(c != 1) | ||
| 592 | - t -= (ONE_DAY + (1000 * 60 * 60 * 6)); | ||
| 593 | - for(int i = 0; i < 3; i ++){ | ||
| 594 | - rs.add(fmtyyyyMMdd.print(t)); | ||
| 595 | - t -= ONE_DAY; | ||
| 596 | - } | ||
| 597 | - return rs; | ||
| 598 | - } | ||
| 599 | - | ||
| 600 | - @RequestMapping(value = "svgAttr", method = RequestMethod.POST) | ||
| 601 | - public Map<String, Object> svgAttr(@RequestParam String jsonStr){ | ||
| 602 | - return scheduleRealInfoService.svgAttr(jsonStr); | ||
| 603 | - } | ||
| 604 | - | ||
| 605 | - @RequestMapping(value = "svgAttr", method = RequestMethod.GET) | ||
| 606 | - public Map<String, Object> findSvgAttr(@RequestParam String idx){ | ||
| 607 | - return scheduleRealInfoService.findSvgAttr(idx); | ||
| 608 | - } | ||
| 609 | - | ||
| 610 | - @RequestMapping(value = "addRemarks", method = RequestMethod.POST) | ||
| 611 | - public Map<String, Object> addRemarks(@RequestParam Long id, @RequestParam String remarks){ | ||
| 612 | - return scheduleRealInfoService.addRemarks(id, remarks); | ||
| 613 | - } | ||
| 614 | - | ||
| 615 | - @RequestMapping(value = "scheduleDailyQp", method = RequestMethod.GET) | ||
| 616 | - public List<Map<String, Object>> scheduleDailyQp(@RequestParam String line,@RequestParam String date){ | ||
| 617 | - return scheduleRealInfoService.scheduleDailyQp(line,date); | ||
| 618 | - } | ||
| 619 | - | ||
| 620 | - @RequestMapping(value = "scheduleDailyExport", method = RequestMethod.GET) | ||
| 621 | - public List<Map<String, Object>> scheduleDailyExport(@RequestParam Map<String, Object> map){ | ||
| 622 | - return scheduleRealInfoService.scheduleDailyExport(map); | ||
| 623 | - } | ||
| 624 | - | ||
| 625 | - @RequestMapping(value = "exportWaybillMore", method = RequestMethod.GET) | ||
| 626 | - public Map<String, Object> exportWaybillMore(@RequestParam Map<String, Object> map){ | ||
| 627 | - return scheduleRealInfoService.exportWaybillMore(map); | ||
| 628 | - } | ||
| 629 | - | ||
| 630 | - /** | ||
| 631 | - * 获取当日计划排班 , 从计划表抓取数据 | ||
| 632 | - * @return | ||
| 633 | - */ | ||
| 634 | - @RequestMapping(value = "currSchedulePlanByLineCode", method = RequestMethod.GET) | ||
| 635 | - public List<SchedulePlanInfo> currentSchedulePlan(@RequestParam String lineCode){ | ||
| 636 | - return scheduleRealInfoService.currentSchedulePlan(lineCode); | ||
| 637 | - } | ||
| 638 | - | ||
| 639 | - @RequestMapping(value = "lpChangeMulti", method = RequestMethod.POST) | ||
| 640 | - public Map<String, Object> lpChangeMulti(@RequestParam String leftIdx, @RequestParam String rightIdx,@RequestParam int type){ | ||
| 641 | - return scheduleRealInfoService.lpChangeMulti(leftIdx, rightIdx, type); | ||
| 642 | - } | ||
| 643 | - | ||
| 644 | - /** | ||
| 645 | - * 删除当日实际排班 | ||
| 646 | - * @return | ||
| 647 | - */ | ||
| 648 | - @RequestMapping(value = "deleteRealSchedule", method = RequestMethod.POST) | ||
| 649 | - public Map<String, Object> deleteRealSchedule(@RequestParam String lineCode){ | ||
| 650 | - return dayOfSchedule.deleteRealSchedule(lineCode); | ||
| 651 | - } | ||
| 652 | - | ||
| 653 | - /** | ||
| 654 | - * 从计划表重新加载当日排班 | ||
| 655 | - * @param lineCode | ||
| 656 | - * @return | ||
| 657 | - */ | ||
| 658 | - @RequestMapping(value = "reLoadRealSchedule", method = RequestMethod.POST) | ||
| 659 | - public Map<String, Object> reLoadRealSchedule(@RequestParam String lineCode){ | ||
| 660 | - Map<String, Object> rs = new HashMap<>(); | ||
| 661 | - List<ScheduleRealInfo> list = dayOfSchedule.findByLineCode(lineCode); | ||
| 662 | - if(list != null && list.size() > 0){ | ||
| 663 | - rs.put("status", ResponseCode.ERROR); | ||
| 664 | - rs.put("msg", "失败," + list.get(0).getXlName() + "当日存在实际排班,无法重新加载。"); | ||
| 665 | - return rs; | ||
| 666 | - } | ||
| 667 | - | ||
| 668 | - int code = dayOfSchedule.reloadSch(lineCode); | ||
| 669 | - | ||
| 670 | - //重新按公司编码索引数据 | ||
| 671 | - dayOfSchedule.groupByGsbm(); | ||
| 672 | - rs.put("status", code==0? ResponseCode.SUCCESS: ResponseCode.ERROR); | ||
| 673 | - return rs; | ||
| 674 | - } | ||
| 675 | - | ||
| 676 | - /** | ||
| 677 | - * 误点调整 | ||
| 678 | - * @param idx | ||
| 679 | - * @param minute | ||
| 680 | - * @return | ||
| 681 | - */ | ||
| 682 | - @RequestMapping(value = "lateAdjust", method = RequestMethod.POST) | ||
| 683 | - public Map<String, Object> lateAdjust(@RequestParam String idx,@RequestParam float minute ){ | ||
| 684 | - return scheduleRealInfoService.lateAdjust(idx, minute); | ||
| 685 | - } | ||
| 686 | - | ||
| 687 | - /** | ||
| 688 | - * 获取所有应发未到的班次 | ||
| 689 | - * @param idx | ||
| 690 | - * @return | ||
| 691 | - */ | ||
| 692 | - @RequestMapping(value = "allLate2") | ||
| 693 | - public List<ScheduleRealInfo> allLate2(@RequestParam String idx){ | ||
| 694 | - return scheduleRealInfoService.allLate2(idx); | ||
| 695 | - } | ||
| 696 | - | ||
| 697 | - /** | ||
| 698 | - * 添加一个临加到历史库 | ||
| 699 | - * @param sch | ||
| 700 | - * @return | ||
| 701 | - */ | ||
| 702 | - @RequestMapping(value = "history/add", method = RequestMethod.POST) | ||
| 703 | - public Map<String, Object> addToHistory(ScheduleRealInfo sch){ | ||
| 704 | - return scheduleRealInfoService.addToHistory(sch); | ||
| 705 | - } | ||
| 706 | - | ||
| 707 | - /** | ||
| 708 | - * 从历史库里删除临加班次 | ||
| 709 | - * @param id | ||
| 710 | - * @return | ||
| 711 | - */ | ||
| 712 | - @RequestMapping(value = "history/{id}", method = RequestMethod.DELETE) | ||
| 713 | - public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){ | ||
| 714 | - return scheduleRealInfoService.deleteToHistory(id); | ||
| 715 | - } | ||
| 716 | - | ||
| 717 | - @RequestMapping(value = "isCircleQdz", method = RequestMethod.POST) | ||
| 718 | - public Map<String, Object> isCircleQdz(@RequestParam String line, String nbbm, String ts, String qdzCode){ | ||
| 719 | - Map<String, Object> map =new HashMap<>(); | ||
| 720 | - map.put("isExist",scheduleRealInfoService.isCircleQdz(nbbm, ts, line, qdzCode)); | ||
| 721 | - return map; | ||
| 722 | - } | ||
| 723 | - | ||
| 724 | - /** | ||
| 725 | - * 从历史库里删除临加班次 | ||
| 726 | - * @param param | ||
| 727 | - * @return | ||
| 728 | - */ | ||
| 729 | - @RequestMapping(value = "wxsb", method = RequestMethod.POST) | ||
| 730 | - public Map<String, Object> repairReport(@RequestParam Map<String, Object> param){ | ||
| 731 | - return scheduleRealInfoService.repairReport(param, true); | ||
| 732 | - } | ||
| 733 | - | ||
| 734 | - @RequestMapping(value = "wxsb", method = RequestMethod.GET) | ||
| 735 | - public List<RepairReport> repairReportList(@RequestParam String line, @RequestParam String date, @RequestParam String code, @RequestParam String type){ | ||
| 736 | - return scheduleRealInfoService.repairReportList(line, date, code, type); | ||
| 737 | - } | ||
| 738 | - | ||
| 739 | - @RequestMapping(value = "lineLevel", method = RequestMethod.GET) | ||
| 740 | - public Map<String, String> lineLevel(@RequestParam String idx){ | ||
| 741 | - return scheduleRealInfoService.getLevelsByLines(Arrays.asList(idx.split(","))); | ||
| 742 | - } | ||
| 743 | - | ||
| 744 | - /** | ||
| 745 | - * 反馈安全驾驶系统 | ||
| 746 | - * @param param | ||
| 747 | - * @return | ||
| 748 | - */ | ||
| 749 | - @RequestMapping(value = "ackDsm", method = RequestMethod.POST) | ||
| 750 | - public Map<String, Object> ackDsm(@RequestParam Map<String, Object> param){ | ||
| 751 | - Map<String, Object> res = new HashMap<>(); | ||
| 752 | - InputStream in = null; | ||
| 753 | - SysUser user = SecurityUtils.getCurrentUser(); | ||
| 754 | - DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"); | ||
| 755 | - StringBuilder url = new StringBuilder("http://211.95.61.66:9008/modules/dsmCheckTheRecord/addDsm?"), uri = new StringBuilder(); | ||
| 756 | - HttpURLConnection con = null; | ||
| 757 | - try { | ||
| 758 | - uri.append("ddyName=").append(URLEncoder.encode(user == null ? "admin" : user.getUserName(), "UTF-8")); | ||
| 759 | - uri.append("&checkTime=").append(URLEncoder.encode(fmt.print(System.currentTimeMillis()), "UTF-8")); | ||
| 760 | - uri.append("&nbbm=").append(URLEncoder.encode(param.get("nbbm").toString(), "UTF-8")); | ||
| 761 | - uri.append("&starttime=").append(URLEncoder.encode(fmt.print(Long.parseLong(param.get("ts").toString())), "UTF-8")); | ||
| 762 | - url.append(uri); | ||
| 763 | - con = (HttpURLConnection)new URL(url.toString()).openConnection(); | ||
| 764 | - con.setDoInput(true); | ||
| 765 | - con.setRequestMethod("POST"); | ||
| 766 | - con.setConnectTimeout(5000); | ||
| 767 | - con.setReadTimeout(5000); | ||
| 768 | - con.setRequestProperty("keep-alive", "true"); | ||
| 769 | - con.setRequestProperty("accept", "*/*"); | ||
| 770 | - con.setRequestProperty("content-type", "application/x-www-form-urlencoded"); | ||
| 771 | - con.connect(); | ||
| 772 | - | ||
| 773 | - if (con.getResponseCode() == 200) { | ||
| 774 | - in = con.getInputStream(); | ||
| 775 | - ByteArrayOutputStream bout = new ByteArrayOutputStream(); | ||
| 776 | - IOUtils.copy(in, bout); | ||
| 777 | - Map<String, Object> map = new ObjectMapper().readValue(bout.toByteArray(), Map.class); | ||
| 778 | - System.out.println(map); | ||
| 779 | - } | ||
| 780 | - } catch (MalformedURLException e) { | ||
| 781 | - // TODO Auto-generated catch block | ||
| 782 | - e.printStackTrace(); | ||
| 783 | - } catch (IOException e) { | ||
| 784 | - // TODO Auto-generated catch block | ||
| 785 | - e.printStackTrace(); | ||
| 786 | - } finally { | ||
| 787 | - if (con != null) { | ||
| 788 | - con.disconnect(); | ||
| 789 | - } | ||
| 790 | - } | ||
| 791 | - | ||
| 792 | - return res; | ||
| 793 | - } | ||
| 794 | - | ||
| 795 | - @RequestMapping(value = "exportPlan", method = RequestMethod.GET) | ||
| 796 | - public Map<String, Object> exportPlan(@RequestParam String date){ | ||
| 797 | - Map<String, Object> res = new HashMap<>(); | ||
| 798 | - DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm"); | ||
| 799 | - Connection conn = null; | ||
| 800 | - PreparedStatement ps = null; | ||
| 801 | - ResultSet rs = null; | ||
| 802 | - | ||
| 803 | - List<Map<String, Object>> list = new ArrayList<>(); | ||
| 804 | - String sql = "select xl_name,xl_dir,schedule_date,fcsj,cl_zbh,j_name,bcsj from bsth_c_s_sp_info where schedule_date = ? and xl_bm in (22205, 202104, 202105, 202106, 202107, 210415) and bc_type = 'normal'"; | ||
| 805 | - try{ | ||
| 806 | - conn = DBUtils_control.getConnection(); | ||
| 807 | - ps = conn.prepareStatement(sql); | ||
| 808 | - ps.setString(1, date); | ||
| 809 | - rs = ps.executeQuery(); | ||
| 810 | - ObjectMapper mapper = new ObjectMapper(); | ||
| 811 | - | ||
| 812 | - while (rs.next()) { | ||
| 813 | - SchedulePlan schedulePlan = new SchedulePlan(); | ||
| 814 | - schedulePlan.setXlName(rs.getString("xl_name")); | ||
| 815 | - schedulePlan.setXlDir(rs.getInt("xl_dir")); | ||
| 816 | - Date scheduleDate = rs.getDate("schedule_date"); | ||
| 817 | - schedulePlan.setScheduleDate(new DateTime(scheduleDate.getTime()).toString("yyyy-MM-dd")); | ||
| 818 | - String fcsj = rs.getString("fcsj"); | ||
| 819 | - int bcsj = rs.getInt("bcsj"); | ||
| 820 | - DateTime fcsjDt = dateTimeFormatter.parseDateTime(schedulePlan.getScheduleDate() + " " + fcsj); | ||
| 821 | - schedulePlan.setFcsj(fcsjDt.toString("HH:mm:00")); | ||
| 822 | - DateTime ddsjDt = fcsjDt.plusMinutes(bcsj); | ||
| 823 | - schedulePlan.setDdsj(ddsjDt.toString("HH:mm:00")); | ||
| 824 | - schedulePlan.setSjdStart(fcsjDt.toString("HH:00:00")); | ||
| 825 | - DateTime endDt = fcsjDt.plusHours(1); | ||
| 826 | - schedulePlan.setSjdEnd(endDt.toString("HH:00:00")); | ||
| 827 | - schedulePlan.setClZbh(rs.getString("cl_zbh")); | ||
| 828 | - schedulePlan.setJsy(rs.getString("j_name")); | ||
| 829 | - schedulePlan.setBcsj(bcsj); | ||
| 830 | - | ||
| 831 | - list.add(mapper.readValue(mapper.writeValueAsString(schedulePlan), HashMap.class)); | ||
| 832 | - } | ||
| 833 | - List<Iterator<?>> iterators = new ArrayList<Iterator<?>>(); | ||
| 834 | - iterators.add(list.iterator()); | ||
| 835 | - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 836 | - String sourcePath = path + "mould/schedulePlan.xls"; | ||
| 837 | - | ||
| 838 | - new ReportUtils().excelReplace(iterators, new Object[]{}, sourcePath, path + "export/" + date + "-花博会专线班次.xls"); | ||
| 839 | - | ||
| 840 | - res.put("status", ResponseCode.SUCCESS); | ||
| 841 | - res.put("msg", "成功"); | ||
| 842 | - } catch (Exception e) { | ||
| 843 | - res.put("status", ResponseCode.ERROR); | ||
| 844 | - res.put("msg", e.getMessage()); | ||
| 845 | - } finally { | ||
| 846 | - DBUtils_control.close(rs, ps, conn); | ||
| 847 | - } | ||
| 848 | - | ||
| 849 | - return res; | ||
| 850 | - } | ||
| 851 | - | ||
| 852 | - public final static class SchedulePlan { | ||
| 853 | - private String company = "浦东公司[46]"; | ||
| 854 | - | ||
| 855 | - private String xlName = ""; | ||
| 856 | - | ||
| 857 | - private int xlDir; | ||
| 858 | - | ||
| 859 | - private String xlDirStr = ""; | ||
| 860 | - | ||
| 861 | - private String scheduleDate = ""; | ||
| 862 | - | ||
| 863 | - private String sjdStart = ""; | ||
| 864 | - | ||
| 865 | - private String sjdEnd = ""; | ||
| 866 | - | ||
| 867 | - private String fcsj = ""; | ||
| 868 | - | ||
| 869 | - private int bcsj; | ||
| 870 | - | ||
| 871 | - private String ddsj = ""; | ||
| 872 | - | ||
| 873 | - private int yys = 25; | ||
| 874 | - | ||
| 875 | - private String clZbh = ""; | ||
| 876 | - | ||
| 877 | - private String cph = ""; | ||
| 878 | - | ||
| 879 | - private String color = "绿牌"; | ||
| 880 | - | ||
| 881 | - private String jsy = ""; | ||
| 882 | - | ||
| 883 | - private String jsydh = ""; | ||
| 884 | - | ||
| 885 | - private int pj = 10; | ||
| 886 | - | ||
| 887 | - public String getCompany() { | ||
| 888 | - return company; | ||
| 889 | - } | ||
| 890 | - | ||
| 891 | - public void setCompany(String company) { | ||
| 892 | - this.company = company; | ||
| 893 | - } | ||
| 894 | - | ||
| 895 | - public String getXlName() { | ||
| 896 | - return xlName; | ||
| 897 | - } | ||
| 898 | - | ||
| 899 | - public void setXlName(String xlName) { | ||
| 900 | - this.xlName = xlName; | ||
| 901 | - } | ||
| 902 | - | ||
| 903 | - public int getXlDir() { | ||
| 904 | - return xlDir; | ||
| 905 | - } | ||
| 906 | - | ||
| 907 | - public void setXlDir(int xlDir) { | ||
| 908 | - this.xlDir = xlDir; | ||
| 909 | - } | ||
| 910 | - | ||
| 911 | - public String getXlDirStr() { | ||
| 912 | - xlDirStr = ""; | ||
| 913 | - if (xlDir == 0) { | ||
| 914 | - xlDirStr = "上行"; | ||
| 915 | - } else if (xlDir == 1) { | ||
| 916 | - xlDirStr = "下行"; | ||
| 917 | - } | ||
| 918 | - return xlDirStr; | ||
| 919 | - } | ||
| 920 | - | ||
| 921 | - public void setXlDirStr(String xlDirStr) { | ||
| 922 | - this.xlDirStr = xlDirStr; | ||
| 923 | - } | ||
| 924 | - | ||
| 925 | - public String getScheduleDate() { | ||
| 926 | - return scheduleDate; | ||
| 927 | - } | ||
| 928 | - | ||
| 929 | - public void setScheduleDate(String scheduleDate) { | ||
| 930 | - this.scheduleDate = scheduleDate; | ||
| 931 | - } | ||
| 932 | - | ||
| 933 | - public String getSjdStart() { | ||
| 934 | - return sjdStart; | ||
| 935 | - } | ||
| 936 | - | ||
| 937 | - public void setSjdStart(String sjdStart) { | ||
| 938 | - this.sjdStart = sjdStart; | ||
| 939 | - } | ||
| 940 | - | ||
| 941 | - public String getSjdEnd() { | ||
| 942 | - return sjdEnd; | ||
| 943 | - } | ||
| 944 | - | ||
| 945 | - public void setSjdEnd(String sjdEnd) { | ||
| 946 | - this.sjdEnd = sjdEnd; | ||
| 947 | - } | ||
| 948 | - | ||
| 949 | - public String getFcsj() { | ||
| 950 | - return fcsj; | ||
| 951 | - } | ||
| 952 | - | ||
| 953 | - public void setFcsj(String fcsj) { | ||
| 954 | - this.fcsj = fcsj; | ||
| 955 | - } | ||
| 956 | - | ||
| 957 | - public int getBcsj() { | ||
| 958 | - return bcsj; | ||
| 959 | - } | ||
| 960 | - | ||
| 961 | - public void setBcsj(int bcsj) { | ||
| 962 | - this.bcsj = bcsj; | ||
| 963 | - } | ||
| 964 | - | ||
| 965 | - public String getDdsj() { | ||
| 966 | - return ddsj; | ||
| 967 | - } | ||
| 968 | - | ||
| 969 | - public void setDdsj(String ddsj) { | ||
| 970 | - this.ddsj = ddsj; | ||
| 971 | - } | ||
| 972 | - | ||
| 973 | - public int getYys() { | ||
| 974 | - return yys; | ||
| 975 | - } | ||
| 976 | - | ||
| 977 | - public void setYys(int yys) { | ||
| 978 | - this.yys = yys; | ||
| 979 | - } | ||
| 980 | - | ||
| 981 | - public String getClZbh() { | ||
| 982 | - return clZbh; | ||
| 983 | - } | ||
| 984 | - | ||
| 985 | - public void setClZbh(String clZbh) { | ||
| 986 | - this.clZbh = clZbh; | ||
| 987 | - } | ||
| 988 | - | ||
| 989 | - public String getCph() { | ||
| 990 | - cph = BasicData.nbbmCompanyPlateMap.get(clZbh); | ||
| 991 | - if (cph == null) { | ||
| 992 | - cph = ""; | ||
| 993 | - } | ||
| 994 | - return cph; | ||
| 995 | - } | ||
| 996 | - | ||
| 997 | - public void setCph(String cph) { | ||
| 998 | - this.cph = cph; | ||
| 999 | - } | ||
| 1000 | - | ||
| 1001 | - public String getColor() { | ||
| 1002 | - return color; | ||
| 1003 | - } | ||
| 1004 | - | ||
| 1005 | - public void setColor(String color) { | ||
| 1006 | - this.color = color; | ||
| 1007 | - } | ||
| 1008 | - | ||
| 1009 | - public String getJsy() { | ||
| 1010 | - return jsy; | ||
| 1011 | - } | ||
| 1012 | - | ||
| 1013 | - public void setJsy(String jsy) { | ||
| 1014 | - this.jsy = jsy; | ||
| 1015 | - } | ||
| 1016 | - | ||
| 1017 | - public String getJsydh() { | ||
| 1018 | - return jsydh; | ||
| 1019 | - } | ||
| 1020 | - | ||
| 1021 | - public void setJsydh(String jsydh) { | ||
| 1022 | - this.jsydh = jsydh; | ||
| 1023 | - } | ||
| 1024 | - | ||
| 1025 | - public int getPj() { | ||
| 1026 | - return pj; | ||
| 1027 | - } | ||
| 1028 | - | ||
| 1029 | - public void setPj(int pj) { | ||
| 1030 | - this.pj = pj; | ||
| 1031 | - } | ||
| 1032 | - } | ||
| 1033 | -} | 1 | +package com.bsth.controller.realcontrol; |
| 2 | + | ||
| 3 | +import java.io.ByteArrayOutputStream; | ||
| 4 | +import java.io.IOException; | ||
| 5 | +import java.io.InputStream; | ||
| 6 | +import java.io.OutputStream; | ||
| 7 | +import java.net.HttpURLConnection; | ||
| 8 | +import java.net.MalformedURLException; | ||
| 9 | +import java.net.URL; | ||
| 10 | +import java.net.URLEncoder; | ||
| 11 | +import java.sql.Connection; | ||
| 12 | +import java.sql.Date; | ||
| 13 | +import java.sql.PreparedStatement; | ||
| 14 | +import java.sql.ResultSet; | ||
| 15 | +import java.util.*; | ||
| 16 | + | ||
| 17 | +import com.bsth.data.forecast.entity.ArrivalEntity; | ||
| 18 | +import com.bsth.entity.sys.SysUser; | ||
| 19 | +import com.bsth.security.util.SecurityUtils; | ||
| 20 | +import com.bsth.util.ReportUtils; | ||
| 21 | +import com.bsth.util.db.DBUtils_MS; | ||
| 22 | +import com.bsth.util.db.DBUtils_control; | ||
| 23 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 24 | +import org.apache.commons.io.IOUtils; | ||
| 25 | +import org.apache.commons.lang3.StringEscapeUtils; | ||
| 26 | +import org.joda.time.DateTime; | ||
| 27 | +import org.joda.time.format.DateTimeFormat; | ||
| 28 | +import org.joda.time.format.DateTimeFormatter; | ||
| 29 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 30 | +import org.springframework.web.bind.annotation.*; | ||
| 31 | + | ||
| 32 | +import com.alibaba.fastjson.JSONArray; | ||
| 33 | +import com.bsth.common.ResponseCode; | ||
| 34 | +import com.bsth.controller.BaseController; | ||
| 35 | +import com.bsth.controller.realcontrol.dto.ChangePersonCar; | ||
| 36 | +import com.bsth.controller.realcontrol.dto.DfsjChange; | ||
| 37 | +import com.bsth.data.BasicData; | ||
| 38 | +import com.bsth.data.schedule.DayOfSchedule; | ||
| 39 | +import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; | ||
| 40 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 41 | +import com.bsth.entity.report.RepairReport; | ||
| 42 | +import com.bsth.entity.schedule.SchedulePlanInfo; | ||
| 43 | +import com.bsth.service.realcontrol.ScheduleRealInfoService; | ||
| 44 | + | ||
| 45 | +@RestController | ||
| 46 | +@RequestMapping("/realSchedule") | ||
| 47 | +public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, Long> { | ||
| 48 | + | ||
| 49 | + @Autowired | ||
| 50 | + ScheduleRealInfoService scheduleRealInfoService; | ||
| 51 | + | ||
| 52 | + @Autowired | ||
| 53 | + DayOfSchedule dayOfSchedule; | ||
| 54 | + | ||
| 55 | + @RequestMapping(value = "check_fgs_ascription", method = RequestMethod.POST) | ||
| 56 | + public Map<String, Object> checkPCFgsAscription(@RequestParam Long schId, String jGh, String sGh, String nbbm){ | ||
| 57 | + return scheduleRealInfoService.checkPCFgsAscription(schId, jGh, sGh, nbbm); | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + @RequestMapping(value = "/lines") | ||
| 61 | + public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines) { | ||
| 62 | + return scheduleRealInfoService.findByLines(lines); | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + @RequestMapping(value = "/car") | ||
| 66 | + public List<ScheduleRealInfo> findByCar(String nbbm){ | ||
| 67 | + return dayOfSchedule.findByNbbm(nbbm); | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + /** | ||
| 71 | + * | ||
| 72 | + * @Title: outgoAdjust @Description: TODO(待发调整) @param @param id | ||
| 73 | + * 主键 @param @param remarks 备注 @param @param dfsj 待发时间(HH:mm) @throws | ||
| 74 | + */ | ||
| 75 | + @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST) | ||
| 76 | + public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks, | ||
| 77 | + @RequestParam String dfsj,String bcType, | ||
| 78 | + @RequestParam(defaultValue = "") String opType) { | ||
| 79 | + return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType, opType, null); | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + /** | ||
| 83 | + * | ||
| 84 | + * @Title: destroy @Description: TODO(销毁,烂班) @param @param idsStr 要烂掉的班次ID ,分隔 | ||
| 85 | + */ | ||
| 86 | + @RequestMapping(value = "/destroy", method = RequestMethod.POST) | ||
| 87 | + public Map<String, Object> destroy(@RequestParam String idsStr | ||
| 88 | + /*, @RequestParam(defaultValue = "-1") int spaceAdjust*/, | ||
| 89 | + @RequestParam String remarks, @RequestParam String adjustExps/*, @RequestParam(defaultValue = "0") int spaceNum*/) { | ||
| 90 | + return scheduleRealInfoService.destroy(idsStr, remarks, adjustExps, null); | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + /** | ||
| 94 | + * | ||
| 95 | + * @Title: carDeviceMapp @Description: TODO(获取车辆自编号和设备号对照,从缓存取) @throws | ||
| 96 | + */ | ||
| 97 | + @RequestMapping(value = "/carDeviceMapp", method = RequestMethod.GET) | ||
| 98 | + public Map<String, String> carDeviceMapp() { | ||
| 99 | + return BasicData.deviceId2NbbmMap.inverse(); | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + /** | ||
| 103 | + * | ||
| 104 | + * @Title: findPersionByLine @Description: TODO(根据线路主键获取驾驶员) @param @param | ||
| 105 | + * lineId @throws | ||
| 106 | + */ | ||
| 107 | + @RequestMapping(value = "/driver", method = RequestMethod.GET) | ||
| 108 | + public List<Map<String, String>> findDriverByLine(@RequestParam String lineCode) { | ||
| 109 | + return scheduleRealInfoService.findDriverByLine(lineCode); | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + /** | ||
| 113 | + * | ||
| 114 | + * @Title: findPersionByLine @Description: TODO(根据线路主键获取售票员) @param @param | ||
| 115 | + * lineId @throws | ||
| 116 | + */ | ||
| 117 | + @RequestMapping(value = "/conductor", method = RequestMethod.GET) | ||
| 118 | + public List<Map<String, String>> findConductorByLine(@RequestParam String lineCode) { | ||
| 119 | + return scheduleRealInfoService.findConductorByLine(lineCode); | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + /** | ||
| 123 | + * | ||
| 124 | + * @Title: findPersionByLine @Description: TODO(根据线路主键获取车辆) @param @param | ||
| 125 | + * lineId @throws | ||
| 126 | + */ | ||
| 127 | + @RequestMapping(value = "/cars", method = RequestMethod.GET) | ||
| 128 | + public List<Map<String, String>> findCarByLine(@RequestParam String lineCode) { | ||
| 129 | + return scheduleRealInfoService.findCarByLine(lineCode); | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + /** | ||
| 133 | + * | ||
| 134 | + * @Title: sreachNbbm @Description: TODO(搜索车辆内部编码) @throws | ||
| 135 | + */ | ||
| 136 | + @RequestMapping(value = "/sreachVehic", method = RequestMethod.GET) | ||
| 137 | + public List<Map<String, String>> sreachVehic(@RequestParam String nbbm) { | ||
| 138 | + return scheduleRealInfoService.sreachVehic(nbbm); | ||
| 139 | + } | ||
| 140 | + /** | ||
| 141 | + * | ||
| 142 | + * @Title: realOutAdjust | ||
| 143 | + * @Description: TODO(实发调整) | ||
| 144 | + * @param @param id 班次ID | ||
| 145 | + * @param @param fcsjActual 实际发车时间 HH:mm | ||
| 146 | + * @param @param remarks 备注 | ||
| 147 | + * @throws | ||
| 148 | + */ | ||
| 149 | + @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST) | ||
| 150 | + public Map<String, Object> realOutAdjust(@RequestParam Map<String, String> map) { | ||
| 151 | + return scheduleRealInfoService.realOutAdjust(map); | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + /** | ||
| 155 | + * | ||
| 156 | + * @Title: revokeDestroy | ||
| 157 | + * @Description: TODO(撤销烂班) | ||
| 158 | + * @param @param id | ||
| 159 | + * @throws | ||
| 160 | + */ | ||
| 161 | + @RequestMapping(value = "/revokeDestroy", method = RequestMethod.POST) | ||
| 162 | + public Map<String, Object> revokeDestroy(@RequestParam Long id){ | ||
| 163 | + return scheduleRealInfoService.revokeDestroy(id); | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + /** | ||
| 167 | + * | ||
| 168 | + * @Title: revokeRealOutgo | ||
| 169 | + * @Description: TODO(撤销实发) | ||
| 170 | + * @param @param id | ||
| 171 | + * @throws | ||
| 172 | + */ | ||
| 173 | + @RequestMapping(value = "/revokeRealOutgo", method = RequestMethod.POST) | ||
| 174 | + public Map<String, Object> revokeRealOutgo(@RequestParam Long id){ | ||
| 175 | + return scheduleRealInfoService.revokeRealOutgo(id); | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + /** | ||
| 179 | + * 撤销执行 | ||
| 180 | + * @param id | ||
| 181 | + * @return | ||
| 182 | + */ | ||
| 183 | + @RequestMapping(value = "/revokeRealArrive", method = RequestMethod.POST) | ||
| 184 | + public Map<String, Object> revokeRealArrive(@RequestParam Long id){ | ||
| 185 | + return scheduleRealInfoService.revokeRealArrive(id); | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + /** | ||
| 189 | + * | ||
| 190 | + * @Title: spaceAdjust | ||
| 191 | + * @Description: TODO(间隔调整) | ||
| 192 | + * @param @param ids 要调整的班次数组ID | ||
| 193 | + * @param @param space 间隔 | ||
| 194 | + * @throws | ||
| 195 | + */ | ||
| 196 | + @RequestMapping(value = "/spaceAdjust", method = RequestMethod.POST) | ||
| 197 | + public Map<String, Object> spaceAdjust(Long[] ids, Integer space){ | ||
| 198 | + return scheduleRealInfoService.spaceAdjust(ids, space); | ||
| 199 | + } | ||
| 200 | + | ||
| 201 | + /** | ||
| 202 | + * | ||
| 203 | + * @Title: schInfoFineTune | ||
| 204 | + * @Description: TODO(发车信息微调) | ||
| 205 | + * @param @param map | ||
| 206 | + * @throws | ||
| 207 | + */ | ||
| 208 | + @RequestMapping(value = "/schInfoFineTune", method = RequestMethod.POST) | ||
| 209 | + public Map<String, Object> schInfoFineTune(@RequestParam Map<String, String> map){ | ||
| 210 | + return scheduleRealInfoService.schInfoFineTune(map); | ||
| 211 | + } | ||
| 212 | + | ||
| 213 | + /** | ||
| 214 | + * | ||
| 215 | + * @Title: outgoAdjustAll | ||
| 216 | + * @Description: TODO(批量待发调整) | ||
| 217 | + * @param @param list | ||
| 218 | + * @throws | ||
| 219 | + */ | ||
| 220 | + @RequestMapping(value = "/outgoAdjustAll", method = RequestMethod.POST) | ||
| 221 | + public Map<String, Object> outgoAdjustAll(@RequestParam String params){ | ||
| 222 | + //反转义 | ||
| 223 | + params = StringEscapeUtils.unescapeHtml4(params); | ||
| 224 | + return scheduleRealInfoService.outgoAdjustAll(params); | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + /** | ||
| 228 | + * | ||
| 229 | + * @Title: findByLineAndUpDown | ||
| 230 | + * @Description: TODO(根据线路和走向获取班次) | ||
| 231 | + * @param @param line | ||
| 232 | + * @param @param upDown | ||
| 233 | + */ | ||
| 234 | + @RequestMapping(value = "/findByLineAndUpDown") | ||
| 235 | + public List<ScheduleRealInfo> findByLineAndUpDown(@RequestParam String line,@RequestParam Integer upDown){ | ||
| 236 | + return dayOfSchedule.findByLineAndUpDown(line, upDown); | ||
| 237 | + } | ||
| 238 | + | ||
| 239 | + /** | ||
| 240 | + * | ||
| 241 | + * @Title: findRouteByLine | ||
| 242 | + * @Description: TODO(获取线路的站点,路段路由) | ||
| 243 | + * @param @param lineCode | ||
| 244 | + * @throws | ||
| 245 | + */ | ||
| 246 | + @RequestMapping(value = "/findRouteByLine") | ||
| 247 | + public Map<String, Object> findRouteByLine(@RequestParam String lineCode){ | ||
| 248 | + return scheduleRealInfoService.findRouteByLine(lineCode); | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + /** | ||
| 252 | + * | ||
| 253 | + * @Title: removeChildTask | ||
| 254 | + * @Description: TODO(删除子任务) | ||
| 255 | + * @param @param taskId 子任务ID | ||
| 256 | + * @throws | ||
| 257 | + */ | ||
| 258 | + @RequestMapping(value = "/childTask/{taskId}", method = RequestMethod.DELETE) | ||
| 259 | + public Map<String, Object> removeChildTask(@PathVariable("taskId") Long taskId){ | ||
| 260 | + return scheduleRealInfoService.removeChildTask(taskId); | ||
| 261 | + } | ||
| 262 | + | ||
| 263 | + /** | ||
| 264 | + * | ||
| 265 | + * @Title: findByLineCode | ||
| 266 | + * @Description: TODO(根据线路获取班次信息) | ||
| 267 | + * @param @param lineCode | ||
| 268 | + */ | ||
| 269 | + @RequestMapping(value = "/lineCode/{lineCode}") | ||
| 270 | + public List<ScheduleRealInfo> findByLineCode(@PathVariable("lineCode") String lineCode){ | ||
| 271 | + return dayOfSchedule.findByLineCode(lineCode); | ||
| 272 | + } | ||
| 273 | + | ||
| 274 | + @RequestMapping(value = "/queryUserInfo") | ||
| 275 | + public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line, | ||
| 276 | + @RequestParam String date,@RequestParam String state) { | ||
| 277 | + return scheduleRealInfoService.queryUserInfo(line, date,state); | ||
| 278 | + } | ||
| 279 | + | ||
| 280 | + @RequestMapping(value = "/queryUserInfoPx") | ||
| 281 | + public List<ScheduleRealInfo> queryUserInfoPx(@RequestParam String line, | ||
| 282 | + @RequestParam String date,@RequestParam String state,@RequestParam String type) { | ||
| 283 | + return scheduleRealInfoService.queryUserInfoPx(line, date,state,type); | ||
| 284 | + } | ||
| 285 | + | ||
| 286 | + @RequestMapping(value = "/exportWaybill",method = RequestMethod.GET) | ||
| 287 | + public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName,@RequestParam String jGh, @RequestParam String clZbh, | ||
| 288 | + @RequestParam String lpName,@RequestParam String date,@RequestParam String line) { | ||
| 289 | + return scheduleRealInfoService.exportWaybill(jName,jGh, clZbh, lpName,date,line); | ||
| 290 | + } | ||
| 291 | + | ||
| 292 | + @RequestMapping(value = "/exportWaybillQp",method = RequestMethod.GET) | ||
| 293 | + public List<ScheduleRealInfo> exportWaybillQp(@RequestParam String clZbh | ||
| 294 | + ,@RequestParam String date,@RequestParam String line) { | ||
| 295 | + return scheduleRealInfoService.exportWaybillQp( clZbh, date,line); | ||
| 296 | + } | ||
| 297 | + | ||
| 298 | + | ||
| 299 | + @RequestMapping(value = "/dailyInfo") | ||
| 300 | + public List<Map<String, Object>> dailyInfo(@RequestParam String line, @RequestParam String date,@RequestParam String type) { | ||
| 301 | + return scheduleRealInfoService.dailyInfo(line, date, type); | ||
| 302 | + } | ||
| 303 | + | ||
| 304 | + @RequestMapping(value = "/historyMessage") | ||
| 305 | + public List<Object[]> historyMessage(@RequestParam String line, @RequestParam String date, | ||
| 306 | + @RequestParam String code, @RequestParam String type) { | ||
| 307 | + return scheduleRealInfoService.historyMessage(line, date, code, type); | ||
| 308 | + } | ||
| 309 | + | ||
| 310 | + @RequestMapping(value="/findLine") | ||
| 311 | + public List<Map<String,String>> findLine(@RequestParam String line){ | ||
| 312 | + return scheduleRealInfoService.findLine(line); | ||
| 313 | + } | ||
| 314 | + | ||
| 315 | + @RequestMapping(value="/findKMBC",method = RequestMethod.GET) | ||
| 316 | + public Map<String,Object> findKMBC(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName | ||
| 317 | + ,@RequestParam String date,@RequestParam String line){ | ||
| 318 | + return scheduleRealInfoService.findKMBC(jGh, clZbh,lpName,date,line); | ||
| 319 | + } | ||
| 320 | + | ||
| 321 | + /** | ||
| 322 | + * 路单公里统计 (闵行审计专用) | ||
| 323 | + * @param jGh | ||
| 324 | + * @param clZbh | ||
| 325 | + * @param lpName | ||
| 326 | + * @param date | ||
| 327 | + * @param line | ||
| 328 | + * @return | ||
| 329 | + */ | ||
| 330 | + @RequestMapping(value="/findKMBC_mh_2",method = RequestMethod.GET) | ||
| 331 | + public Map<String,Object> findKMBC_mh_2(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName | ||
| 332 | + ,@RequestParam String date,@RequestParam String line){ | ||
| 333 | + return scheduleRealInfoService.findKMBC_mh_2(jGh, clZbh,lpName,date,line); | ||
| 334 | + } | ||
| 335 | + | ||
| 336 | + @RequestMapping(value="/findKMBCQp",method = RequestMethod.GET) | ||
| 337 | + public Map<String,Object> findKMBCQp(@RequestParam String clZbh | ||
| 338 | + ,@RequestParam String date,@RequestParam String line){ | ||
| 339 | + return scheduleRealInfoService.findKMBCQp(clZbh,date,line); | ||
| 340 | + } | ||
| 341 | + | ||
| 342 | + @RequestMapping(value="/findLpName") | ||
| 343 | + public List<Map<String,String>> findLpName(@RequestParam String lpName){ | ||
| 344 | + return scheduleRealInfoService.findLpName(lpName); | ||
| 345 | + } | ||
| 346 | + | ||
| 347 | + @RequestMapping(value = "/account") | ||
| 348 | + public List<Map<String,Object>> account(@RequestParam String line, @RequestParam String date, | ||
| 349 | + @RequestParam String code,@RequestParam String xlName, @RequestParam String type) { | ||
| 350 | + return scheduleRealInfoService.account(line, date, code, xlName, type); | ||
| 351 | + } | ||
| 352 | + | ||
| 353 | + @RequestMapping(value = "/accountPx") | ||
| 354 | + public List<Map<String,Object>> accountPx(@RequestParam String line, @RequestParam String date, | ||
| 355 | + @RequestParam String code,@RequestParam String xlName, @RequestParam String px) { | ||
| 356 | + return scheduleRealInfoService.accountPx(line, date, code, xlName, px); | ||
| 357 | + } | ||
| 358 | + | ||
| 359 | + @RequestMapping(value = "/correctForm") | ||
| 360 | + public List<SchEditInfoDto> correctForm(@RequestParam String line, @RequestParam String date, | ||
| 361 | + @RequestParam String endDate, | ||
| 362 | + @RequestParam String lpName, @RequestParam String code, | ||
| 363 | + @RequestParam String type,@RequestParam String changType) { | ||
| 364 | + return scheduleRealInfoService.correctForm(line, date, endDate, lpName, code, type,changType); | ||
| 365 | + } | ||
| 366 | + /** | ||
| 367 | + * @Title queryListWaybill | ||
| 368 | + * @Description 查询行车路单列表 | ||
| 369 | + * @param jGh 驾驶员名字 | ||
| 370 | + * @param clZbh 车辆自编号(内部编号) | ||
| 371 | + * @param lpName 路牌 | ||
| 372 | + * @return | ||
| 373 | + */ | ||
| 374 | + @RequestMapping(value="/queryListWaybill",method = RequestMethod.GET) | ||
| 375 | + public List<ScheduleRealInfo> queryListWaybill(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName | ||
| 376 | + ,@RequestParam String date,@RequestParam String line){ | ||
| 377 | + return scheduleRealInfoService.queryListWaybill(jGh, clZbh,lpName,date,line); | ||
| 378 | + } | ||
| 379 | + | ||
| 380 | + /** | ||
| 381 | + * @Title queryListWaybill | ||
| 382 | + * @Description 查询行车路单列表(闵行审计专用路单) | ||
| 383 | + * @param jName 驾驶员名字 | ||
| 384 | + * @param clZbh 车辆自编号(内部编号) | ||
| 385 | + * @param lpName 路牌 | ||
| 386 | + * @return | ||
| 387 | + */ | ||
| 388 | + @RequestMapping(value="/queryListWaybill_mh_2",method = RequestMethod.GET) | ||
| 389 | + public List<ScheduleRealInfo> queryListWaybill_mh_2(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName | ||
| 390 | + ,@RequestParam String date,@RequestParam String line){ | ||
| 391 | + return scheduleRealInfoService.queryListWaybill2(jName, clZbh,lpName,date,line); | ||
| 392 | + } | ||
| 393 | + | ||
| 394 | + @RequestMapping(value="/queryListWaybillQp",method = RequestMethod.GET) | ||
| 395 | + public List<ScheduleRealInfo> queryListWaybillQp(@RequestParam String clZbh, | ||
| 396 | + @RequestParam String date,@RequestParam String line){ | ||
| 397 | + return scheduleRealInfoService.queryListWaybillQp(clZbh,date,line); | ||
| 398 | + } | ||
| 399 | + | ||
| 400 | + @RequestMapping(value="/statisticsDaily") | ||
| 401 | + public List<Map<String,Object>> statisticsDaily(@RequestParam String line, @RequestParam String date, | ||
| 402 | + @RequestParam String xlName, @RequestParam String type){ | ||
| 403 | + return scheduleRealInfoService.statisticsDaily(line, date, xlName, type); | ||
| 404 | + } | ||
| 405 | + | ||
| 406 | + @RequestMapping(value="/statisticsDaily_mh_2") | ||
| 407 | + public List<Map<String,Object>> statisticsDaily_mh_2(@RequestParam String line, @RequestParam String date, | ||
| 408 | + @RequestParam String xlName, @RequestParam String type){ | ||
| 409 | + return scheduleRealInfoService.statisticsDaily_mh_2(line, date, xlName, type); | ||
| 410 | + } | ||
| 411 | + | ||
| 412 | + @RequestMapping(value="/dispatchDailySum") | ||
| 413 | + public List<Map<String,Object>> dispatchDailySum(@RequestParam Map<String, Object> map){ | ||
| 414 | + String date=""; | ||
| 415 | + if(map.get("date")!=null){ | ||
| 416 | + date=map.get("date").toString(); | ||
| 417 | + } | ||
| 418 | + String date2=""; | ||
| 419 | + if(map.get("date2")!=null){ | ||
| 420 | + date2=map.get("date2").toString(); | ||
| 421 | + } | ||
| 422 | + String nature="0"; | ||
| 423 | + if(map.get("nature")!=null){ | ||
| 424 | + nature=map.get("nature").toString(); | ||
| 425 | + } | ||
| 426 | + String type=""; | ||
| 427 | + if(map.get("type")!=null){ | ||
| 428 | + type=map.get("type").toString(); | ||
| 429 | + } | ||
| 430 | + return scheduleRealInfoService.dispatchDailySum(date, date2, nature, type); | ||
| 431 | + } | ||
| 432 | + | ||
| 433 | + @RequestMapping(value="/statisticsDailyTj") | ||
| 434 | + public List<Map<String,Object>> statisticsDailyTj(@RequestParam Map<String, Object> map){ | ||
| 435 | + String gsdm=""; | ||
| 436 | + if(map.get("gsdm")!=null){ | ||
| 437 | + gsdm=map.get("gsdm").toString(); | ||
| 438 | + } | ||
| 439 | + String fgsdm=""; | ||
| 440 | + if(map.get("fgsdm")!=null){ | ||
| 441 | + fgsdm=map.get("fgsdm").toString(); | ||
| 442 | + } | ||
| 443 | + String line=""; | ||
| 444 | + if(map.get("line")!=null){ | ||
| 445 | + line=map.get("line").toString(); | ||
| 446 | + } | ||
| 447 | + String date=""; | ||
| 448 | + if(map.get("date")!=null){ | ||
| 449 | + date=map.get("date").toString(); | ||
| 450 | + } | ||
| 451 | + String date2=""; | ||
| 452 | + if(map.get("date2")!=null){ | ||
| 453 | + date2=map.get("date2").toString(); | ||
| 454 | + } | ||
| 455 | + String xlName=""; | ||
| 456 | + if(map.get("xlName")!=null){ | ||
| 457 | + xlName=map.get("xlName").toString(); | ||
| 458 | + } | ||
| 459 | + String type=""; | ||
| 460 | + if(map.get("type")!=null){ | ||
| 461 | + type=map.get("type").toString(); | ||
| 462 | + } | ||
| 463 | + String nature="0"; | ||
| 464 | + if(map.get("nature")!=null){ | ||
| 465 | + nature=map.get("nature").toString(); | ||
| 466 | + } | ||
| 467 | + return scheduleRealInfoService.statisticsDailyTj(gsdm,fgsdm,line, date,date2, xlName, type,nature); | ||
| 468 | + } | ||
| 469 | + | ||
| 470 | + /* | ||
| 471 | + * 公里修正报表 | ||
| 472 | + */ | ||
| 473 | + @RequestMapping(value="/mileageReportTj") | ||
| 474 | + public List<Map<String,Object>> mileageReport(@RequestParam Map<String, Object> map){ | ||
| 475 | + String gsdm=""; | ||
| 476 | + if(map.get("gsdm")!=null){ | ||
| 477 | + gsdm=map.get("gsdm").toString(); | ||
| 478 | + } | ||
| 479 | + String fgsdm=""; | ||
| 480 | + if(map.get("fgsdm")!=null){ | ||
| 481 | + fgsdm=map.get("fgsdm").toString(); | ||
| 482 | + } | ||
| 483 | + String line=""; | ||
| 484 | + if(map.get("line")!=null){ | ||
| 485 | + line=map.get("line").toString(); | ||
| 486 | + } | ||
| 487 | + String date=""; | ||
| 488 | + if(map.get("date")!=null){ | ||
| 489 | + date=map.get("date").toString(); | ||
| 490 | + } | ||
| 491 | + String date2=""; | ||
| 492 | + if(map.get("date2")!=null){ | ||
| 493 | + date2=map.get("date2").toString(); | ||
| 494 | + } | ||
| 495 | + String xlName=""; | ||
| 496 | + if(map.get("xlName")!=null){ | ||
| 497 | + xlName=map.get("xlName").toString(); | ||
| 498 | + } | ||
| 499 | + return scheduleRealInfoService.mileageReport(gsdm,fgsdm,line, date,date2); | ||
| 500 | + } | ||
| 501 | + | ||
| 502 | + /* | ||
| 503 | + * 班次修正报表 | ||
| 504 | + */ | ||
| 505 | + @RequestMapping(value="/scheduleCorrectionReport") | ||
| 506 | + public List<Map<String,Object>> scheduleCorrectionReport(@RequestParam Map<String, Object> map){ | ||
| 507 | + String gsdm=""; | ||
| 508 | + if(map.get("gsdm")!=null){ | ||
| 509 | + gsdm=map.get("gsdm").toString(); | ||
| 510 | + } | ||
| 511 | + String fgsdm=""; | ||
| 512 | + if(map.get("fgsdm")!=null){ | ||
| 513 | + fgsdm=map.get("fgsdm").toString(); | ||
| 514 | + } | ||
| 515 | + String line=""; | ||
| 516 | + if(map.get("line")!=null){ | ||
| 517 | + line=map.get("line").toString(); | ||
| 518 | + } | ||
| 519 | + String date=""; | ||
| 520 | + if(map.get("date")!=null){ | ||
| 521 | + date=map.get("date").toString(); | ||
| 522 | + } | ||
| 523 | + String date2=""; | ||
| 524 | + if(map.get("date2")!=null){ | ||
| 525 | + date2=map.get("date2").toString(); | ||
| 526 | + } | ||
| 527 | + String xlName=""; | ||
| 528 | + if(map.get("xlName")!=null){ | ||
| 529 | + xlName=map.get("xlName").toString(); | ||
| 530 | + } | ||
| 531 | + return scheduleRealInfoService.scheduleCorrectionReport(gsdm,fgsdm,line, date,date2); | ||
| 532 | + } | ||
| 533 | + | ||
| 534 | + @RequestMapping(value="/MapById",method = RequestMethod.GET) | ||
| 535 | + public Map<String, Object> MapById(@RequestParam("id") Long id){ | ||
| 536 | + return scheduleRealInfoService.MapById(id); | ||
| 537 | + } | ||
| 538 | + | ||
| 539 | + @RequestMapping(value="/MapByIdQp",method = RequestMethod.GET) | ||
| 540 | + public Map<String, Object> MapByIdQp(@RequestParam("id") Long id){ | ||
| 541 | + return scheduleRealInfoService.MapByIdQp(id); | ||
| 542 | + } | ||
| 543 | + | ||
| 544 | + /** | ||
| 545 | + * @Title: scheduleDaily | ||
| 546 | + * @Description: TODO(调度日报表) | ||
| 547 | + * @param line 线路 | ||
| 548 | + * @param date 时间 | ||
| 549 | + * @return | ||
| 550 | + */ | ||
| 551 | + @RequestMapping(value="/scheduleDaily") | ||
| 552 | + public Map<String,Object> scheduleDaily(@RequestParam String line,@RequestParam String date){ | ||
| 553 | + return scheduleRealInfoService.scheduleDaily(line,date); | ||
| 554 | + } | ||
| 555 | + | ||
| 556 | + @RequestMapping(value="/realScheduleList") | ||
| 557 | + public List<ScheduleRealInfo> realScheduleList(@RequestParam String line,@RequestParam String date){ | ||
| 558 | + return scheduleRealInfoService.realScheduleList(line,date); | ||
| 559 | + } | ||
| 560 | + | ||
| 561 | + @RequestMapping(value="/realScheduleList_zrw") | ||
| 562 | + public List<ScheduleRealInfo> realScheduleList_zrw(@RequestParam String line,@RequestParam String date){ | ||
| 563 | + return scheduleRealInfoService.realScheduleList_zrw(line,date); | ||
| 564 | + } | ||
| 565 | + | ||
| 566 | + @RequestMapping(value="/realScheduleList_mh_2") | ||
| 567 | + public List<ScheduleRealInfo> realScheduleList_mh_2(@RequestParam String line,@RequestParam String date){ | ||
| 568 | + return scheduleRealInfoService.realScheduleList_mh_2(line,date); | ||
| 569 | + } | ||
| 570 | + | ||
| 571 | + @RequestMapping(value="/realScheduleListQp") | ||
| 572 | + public List<ScheduleRealInfo> realScheduleListQp(@RequestParam String line,@RequestParam String date){ | ||
| 573 | + return scheduleRealInfoService.realScheduleListQp(line,date); | ||
| 574 | + } | ||
| 575 | + | ||
| 576 | + @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST) | ||
| 577 | + public synchronized Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){ | ||
| 578 | + cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson); | ||
| 579 | + List<ChangePersonCar> cpcs = JSONArray.parseArray(cpcsJson, ChangePersonCar.class); | ||
| 580 | + return scheduleRealInfoService.multi_tzrc(cpcs, null); | ||
| 581 | + } | ||
| 582 | + | ||
| 583 | + @RequestMapping(value="/multi_dftz", method=RequestMethod.POST) | ||
| 584 | + public Map<String, Object> multi_dftz(@RequestParam String dcsJson){ | ||
| 585 | + dcsJson = StringEscapeUtils.unescapeHtml4(dcsJson); | ||
| 586 | + List<DfsjChange> dfsjcs = JSONArray.parseArray(dcsJson, DfsjChange.class); | ||
| 587 | + return scheduleRealInfoService.multi_dftz(dfsjcs); | ||
| 588 | + } | ||
| 589 | + | ||
| 590 | + @RequestMapping(value="/changeBcType/{id}", method=RequestMethod.POST) | ||
| 591 | + public Map<String, Object> changeBcType(@PathVariable("id") Long id, String bcType, String remarks, String majorStationName){ | ||
| 592 | + return scheduleRealInfoService.changeBcType(id, bcType, remarks, majorStationName); | ||
| 593 | + } | ||
| 594 | + | ||
| 595 | + @RequestMapping(value="/history", method=RequestMethod.POST) | ||
| 596 | + public Map<String,Object> historySave(ScheduleRealInfo sch){ | ||
| 597 | + return scheduleRealInfoService.historySave(sch); | ||
| 598 | + } | ||
| 599 | + | ||
| 600 | + | ||
| 601 | + private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"); | ||
| 602 | + private final static long ONE_DAY = 1000 * 60 * 60 * 24; | ||
| 603 | + /** | ||
| 604 | + * 获取可编辑的历史班次日期 | ||
| 605 | + * @return | ||
| 606 | + */ | ||
| 607 | + @RequestMapping("dateArray") | ||
| 608 | + public List<String> dateArray(@RequestParam(defaultValue = "0") int c){ | ||
| 609 | + List<String> rs = new ArrayList<>(); | ||
| 610 | + | ||
| 611 | + long t = System.currentTimeMillis(); | ||
| 612 | + if(c != 1) | ||
| 613 | + t -= (ONE_DAY + (1000 * 60 * 60 * 6)); | ||
| 614 | + for(int i = 0; i < 3; i ++){ | ||
| 615 | + rs.add(fmtyyyyMMdd.print(t)); | ||
| 616 | + t -= ONE_DAY; | ||
| 617 | + } | ||
| 618 | + return rs; | ||
| 619 | + } | ||
| 620 | + | ||
| 621 | + @RequestMapping(value = "svgAttr", method = RequestMethod.POST) | ||
| 622 | + public Map<String, Object> svgAttr(@RequestParam String jsonStr){ | ||
| 623 | + return scheduleRealInfoService.svgAttr(jsonStr); | ||
| 624 | + } | ||
| 625 | + | ||
| 626 | + @RequestMapping(value = "svgAttr", method = RequestMethod.GET) | ||
| 627 | + public Map<String, Object> findSvgAttr(@RequestParam String idx){ | ||
| 628 | + return scheduleRealInfoService.findSvgAttr(idx); | ||
| 629 | + } | ||
| 630 | + | ||
| 631 | + @RequestMapping(value = "addRemarks", method = RequestMethod.POST) | ||
| 632 | + public Map<String, Object> addRemarks(@RequestParam Long id, @RequestParam String remarks){ | ||
| 633 | + return scheduleRealInfoService.addRemarks(id, remarks); | ||
| 634 | + } | ||
| 635 | + | ||
| 636 | + @RequestMapping(value = "scheduleDailyQp", method = RequestMethod.GET) | ||
| 637 | + public List<Map<String, Object>> scheduleDailyQp(@RequestParam String line,@RequestParam String date){ | ||
| 638 | + return scheduleRealInfoService.scheduleDailyQp(line,date); | ||
| 639 | + } | ||
| 640 | + | ||
| 641 | + @RequestMapping(value = "scheduleDailyExport", method = RequestMethod.GET) | ||
| 642 | + public List<Map<String, Object>> scheduleDailyExport(@RequestParam Map<String, Object> map){ | ||
| 643 | + return scheduleRealInfoService.scheduleDailyExport(map); | ||
| 644 | + } | ||
| 645 | + | ||
| 646 | + @RequestMapping(value = "exportWaybillMore", method = RequestMethod.GET) | ||
| 647 | + public Map<String, Object> exportWaybillMore(@RequestParam Map<String, Object> map){ | ||
| 648 | + return scheduleRealInfoService.exportWaybillMore(map); | ||
| 649 | + } | ||
| 650 | + | ||
| 651 | + /** | ||
| 652 | + * 获取当日计划排班 , 从计划表抓取数据 | ||
| 653 | + * @return | ||
| 654 | + */ | ||
| 655 | + @RequestMapping(value = "currSchedulePlanByLineCode", method = RequestMethod.GET) | ||
| 656 | + public List<SchedulePlanInfo> currentSchedulePlan(@RequestParam String lineCode){ | ||
| 657 | + return scheduleRealInfoService.currentSchedulePlan(lineCode); | ||
| 658 | + } | ||
| 659 | + | ||
| 660 | + @RequestMapping(value = "lpChangeMulti", method = RequestMethod.POST) | ||
| 661 | + public Map<String, Object> lpChangeMulti(@RequestParam String leftIdx, @RequestParam String rightIdx,@RequestParam int type){ | ||
| 662 | + return scheduleRealInfoService.lpChangeMulti(leftIdx, rightIdx, type); | ||
| 663 | + } | ||
| 664 | + | ||
| 665 | + /** | ||
| 666 | + * 删除当日实际排班 | ||
| 667 | + * @return | ||
| 668 | + */ | ||
| 669 | + @RequestMapping(value = "deleteRealSchedule", method = RequestMethod.POST) | ||
| 670 | + public Map<String, Object> deleteRealSchedule(@RequestParam String lineCode){ | ||
| 671 | + return dayOfSchedule.deleteRealSchedule(lineCode); | ||
| 672 | + } | ||
| 673 | + | ||
| 674 | + /** | ||
| 675 | + * 从计划表重新加载当日排班 | ||
| 676 | + * @param lineCode | ||
| 677 | + * @return | ||
| 678 | + */ | ||
| 679 | + @RequestMapping(value = "reLoadRealSchedule", method = RequestMethod.POST) | ||
| 680 | + public Map<String, Object> reLoadRealSchedule(@RequestParam String lineCode){ | ||
| 681 | + Map<String, Object> rs = new HashMap<>(); | ||
| 682 | + List<ScheduleRealInfo> list = dayOfSchedule.findByLineCode(lineCode); | ||
| 683 | + if(list != null && list.size() > 0){ | ||
| 684 | + rs.put("status", ResponseCode.ERROR); | ||
| 685 | + rs.put("msg", "失败," + list.get(0).getXlName() + "当日存在实际排班,无法重新加载。"); | ||
| 686 | + return rs; | ||
| 687 | + } | ||
| 688 | + | ||
| 689 | + int code = dayOfSchedule.reloadSch(lineCode); | ||
| 690 | + | ||
| 691 | + //重新按公司编码索引数据 | ||
| 692 | + dayOfSchedule.groupByGsbm(); | ||
| 693 | + rs.put("status", code==0? ResponseCode.SUCCESS: ResponseCode.ERROR); | ||
| 694 | + return rs; | ||
| 695 | + } | ||
| 696 | + | ||
| 697 | + /** | ||
| 698 | + * 误点调整 | ||
| 699 | + * @param idx | ||
| 700 | + * @param minute | ||
| 701 | + * @return | ||
| 702 | + */ | ||
| 703 | + @RequestMapping(value = "lateAdjust", method = RequestMethod.POST) | ||
| 704 | + public Map<String, Object> lateAdjust(@RequestParam String idx,@RequestParam float minute ){ | ||
| 705 | + return scheduleRealInfoService.lateAdjust(idx, minute); | ||
| 706 | + } | ||
| 707 | + | ||
| 708 | + /** | ||
| 709 | + * 获取所有应发未到的班次 | ||
| 710 | + * @param idx | ||
| 711 | + * @return | ||
| 712 | + */ | ||
| 713 | + @RequestMapping(value = "allLate2") | ||
| 714 | + public List<ScheduleRealInfo> allLate2(@RequestParam String idx){ | ||
| 715 | + return scheduleRealInfoService.allLate2(idx); | ||
| 716 | + } | ||
| 717 | + | ||
| 718 | + /** | ||
| 719 | + * 添加一个临加到历史库 | ||
| 720 | + * @param sch | ||
| 721 | + * @return | ||
| 722 | + */ | ||
| 723 | + @RequestMapping(value = "history/add", method = RequestMethod.POST) | ||
| 724 | + public Map<String, Object> addToHistory(ScheduleRealInfo sch){ | ||
| 725 | + return scheduleRealInfoService.addToHistory(sch); | ||
| 726 | + } | ||
| 727 | + | ||
| 728 | + /** | ||
| 729 | + * 从历史库里删除临加班次 | ||
| 730 | + * @param id | ||
| 731 | + * @return | ||
| 732 | + */ | ||
| 733 | + @RequestMapping(value = "history/{id}", method = RequestMethod.DELETE) | ||
| 734 | + public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){ | ||
| 735 | + return scheduleRealInfoService.deleteToHistory(id); | ||
| 736 | + } | ||
| 737 | + | ||
| 738 | + @RequestMapping(value = "isCircleQdz", method = RequestMethod.POST) | ||
| 739 | + public Map<String, Object> isCircleQdz(@RequestParam String line, String nbbm, String ts, String qdzCode){ | ||
| 740 | + Map<String, Object> map =new HashMap<>(); | ||
| 741 | + map.put("isExist",scheduleRealInfoService.isCircleQdz(nbbm, ts, line, qdzCode)); | ||
| 742 | + return map; | ||
| 743 | + } | ||
| 744 | + | ||
| 745 | + /** | ||
| 746 | + * 从历史库里删除临加班次 | ||
| 747 | + * @param param | ||
| 748 | + * @return | ||
| 749 | + */ | ||
| 750 | + @RequestMapping(value = "wxsb", method = RequestMethod.POST) | ||
| 751 | + public Map<String, Object> repairReport(@RequestParam Map<String, Object> param){ | ||
| 752 | + return scheduleRealInfoService.repairReport(param, true); | ||
| 753 | + } | ||
| 754 | + | ||
| 755 | + @RequestMapping(value = "wxsb", method = RequestMethod.GET) | ||
| 756 | + public List<RepairReport> repairReportList(@RequestParam String line, @RequestParam String date, @RequestParam String code, @RequestParam String type){ | ||
| 757 | + return scheduleRealInfoService.repairReportList(line, date, code, type); | ||
| 758 | + } | ||
| 759 | + | ||
| 760 | + @RequestMapping(value = "lineLevel", method = RequestMethod.GET) | ||
| 761 | + public Map<String, String> lineLevel(@RequestParam String idx){ | ||
| 762 | + return scheduleRealInfoService.getLevelsByLines(Arrays.asList(idx.split(","))); | ||
| 763 | + } | ||
| 764 | + | ||
| 765 | + /** | ||
| 766 | + * 反馈安全驾驶系统 | ||
| 767 | + * @param param | ||
| 768 | + * @return | ||
| 769 | + */ | ||
| 770 | + @RequestMapping(value = "ackDsm", method = RequestMethod.POST) | ||
| 771 | + public Map<String, Object> ackDsm(@RequestParam Map<String, Object> param){ | ||
| 772 | + Map<String, Object> res = new HashMap<>(); | ||
| 773 | + InputStream in = null; | ||
| 774 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 775 | + DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"); | ||
| 776 | + StringBuilder url = new StringBuilder("http://211.95.61.66:9008/modules/dsmCheckTheRecord/addDsm?"), uri = new StringBuilder(); | ||
| 777 | + HttpURLConnection con = null; | ||
| 778 | + try { | ||
| 779 | + uri.append("ddyName=").append(URLEncoder.encode(user == null ? "admin" : user.getUserName(), "UTF-8")); | ||
| 780 | + uri.append("&checkTime=").append(URLEncoder.encode(fmt.print(System.currentTimeMillis()), "UTF-8")); | ||
| 781 | + uri.append("&nbbm=").append(URLEncoder.encode(param.get("nbbm").toString(), "UTF-8")); | ||
| 782 | + uri.append("&starttime=").append(URLEncoder.encode(fmt.print(Long.parseLong(param.get("ts").toString())), "UTF-8")); | ||
| 783 | + url.append(uri); | ||
| 784 | + con = (HttpURLConnection)new URL(url.toString()).openConnection(); | ||
| 785 | + con.setDoInput(true); | ||
| 786 | + con.setRequestMethod("POST"); | ||
| 787 | + con.setConnectTimeout(5000); | ||
| 788 | + con.setReadTimeout(5000); | ||
| 789 | + con.setRequestProperty("keep-alive", "true"); | ||
| 790 | + con.setRequestProperty("accept", "*/*"); | ||
| 791 | + con.setRequestProperty("content-type", "application/x-www-form-urlencoded"); | ||
| 792 | + con.connect(); | ||
| 793 | + | ||
| 794 | + if (con.getResponseCode() == 200) { | ||
| 795 | + in = con.getInputStream(); | ||
| 796 | + ByteArrayOutputStream bout = new ByteArrayOutputStream(); | ||
| 797 | + IOUtils.copy(in, bout); | ||
| 798 | + Map<String, Object> map = new ObjectMapper().readValue(bout.toByteArray(), Map.class); | ||
| 799 | + System.out.println(map); | ||
| 800 | + } | ||
| 801 | + } catch (MalformedURLException e) { | ||
| 802 | + // TODO Auto-generated catch block | ||
| 803 | + e.printStackTrace(); | ||
| 804 | + } catch (IOException e) { | ||
| 805 | + // TODO Auto-generated catch block | ||
| 806 | + e.printStackTrace(); | ||
| 807 | + } finally { | ||
| 808 | + if (con != null) { | ||
| 809 | + con.disconnect(); | ||
| 810 | + } | ||
| 811 | + } | ||
| 812 | + | ||
| 813 | + return res; | ||
| 814 | + } | ||
| 815 | + | ||
| 816 | + @RequestMapping(value = "exportPlan", method = RequestMethod.GET) | ||
| 817 | + public Map<String, Object> exportPlan(@RequestParam String date){ | ||
| 818 | + Map<String, Object> res = new HashMap<>(); | ||
| 819 | + DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm"); | ||
| 820 | + Connection conn = null; | ||
| 821 | + PreparedStatement ps = null; | ||
| 822 | + ResultSet rs = null; | ||
| 823 | + | ||
| 824 | + List<Map<String, Object>> list = new ArrayList<>(); | ||
| 825 | + String sql = "select xl_name,xl_dir,schedule_date,fcsj,cl_zbh,j_name,bcsj from bsth_c_s_sp_info where schedule_date = ? and xl_bm in (22205, 202104, 202105, 202106, 202107, 210415) and bc_type = 'normal'"; | ||
| 826 | + try{ | ||
| 827 | + conn = DBUtils_control.getConnection(); | ||
| 828 | + ps = conn.prepareStatement(sql); | ||
| 829 | + ps.setString(1, date); | ||
| 830 | + rs = ps.executeQuery(); | ||
| 831 | + ObjectMapper mapper = new ObjectMapper(); | ||
| 832 | + | ||
| 833 | + while (rs.next()) { | ||
| 834 | + SchedulePlan schedulePlan = new SchedulePlan(); | ||
| 835 | + schedulePlan.setXlName(rs.getString("xl_name")); | ||
| 836 | + schedulePlan.setXlDir(rs.getInt("xl_dir")); | ||
| 837 | + Date scheduleDate = rs.getDate("schedule_date"); | ||
| 838 | + schedulePlan.setScheduleDate(new DateTime(scheduleDate.getTime()).toString("yyyy-MM-dd")); | ||
| 839 | + String fcsj = rs.getString("fcsj"); | ||
| 840 | + int bcsj = rs.getInt("bcsj"); | ||
| 841 | + DateTime fcsjDt = dateTimeFormatter.parseDateTime(schedulePlan.getScheduleDate() + " " + fcsj); | ||
| 842 | + schedulePlan.setFcsj(fcsjDt.toString("HH:mm:00")); | ||
| 843 | + DateTime ddsjDt = fcsjDt.plusMinutes(bcsj); | ||
| 844 | + schedulePlan.setDdsj(ddsjDt.toString("HH:mm:00")); | ||
| 845 | + schedulePlan.setSjdStart(fcsjDt.toString("HH:00:00")); | ||
| 846 | + DateTime endDt = fcsjDt.plusHours(1); | ||
| 847 | + schedulePlan.setSjdEnd(endDt.toString("HH:00:00")); | ||
| 848 | + schedulePlan.setClZbh(rs.getString("cl_zbh")); | ||
| 849 | + schedulePlan.setJsy(rs.getString("j_name")); | ||
| 850 | + schedulePlan.setBcsj(bcsj); | ||
| 851 | + | ||
| 852 | + list.add(mapper.readValue(mapper.writeValueAsString(schedulePlan), HashMap.class)); | ||
| 853 | + } | ||
| 854 | + List<Iterator<?>> iterators = new ArrayList<Iterator<?>>(); | ||
| 855 | + iterators.add(list.iterator()); | ||
| 856 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 857 | + String sourcePath = path + "mould/schedulePlan.xls"; | ||
| 858 | + | ||
| 859 | + new ReportUtils().excelReplace(iterators, new Object[]{}, sourcePath, path + "export/" + date + "-花博会专线班次.xls"); | ||
| 860 | + | ||
| 861 | + res.put("status", ResponseCode.SUCCESS); | ||
| 862 | + res.put("msg", "成功"); | ||
| 863 | + } catch (Exception e) { | ||
| 864 | + res.put("status", ResponseCode.ERROR); | ||
| 865 | + res.put("msg", e.getMessage()); | ||
| 866 | + } finally { | ||
| 867 | + DBUtils_control.close(rs, ps, conn); | ||
| 868 | + } | ||
| 869 | + | ||
| 870 | + return res; | ||
| 871 | + } | ||
| 872 | + | ||
| 873 | + public final static class SchedulePlan { | ||
| 874 | + private String company = "浦东公司[46]"; | ||
| 875 | + | ||
| 876 | + private String xlName = ""; | ||
| 877 | + | ||
| 878 | + private int xlDir; | ||
| 879 | + | ||
| 880 | + private String xlDirStr = ""; | ||
| 881 | + | ||
| 882 | + private String scheduleDate = ""; | ||
| 883 | + | ||
| 884 | + private String sjdStart = ""; | ||
| 885 | + | ||
| 886 | + private String sjdEnd = ""; | ||
| 887 | + | ||
| 888 | + private String fcsj = ""; | ||
| 889 | + | ||
| 890 | + private int bcsj; | ||
| 891 | + | ||
| 892 | + private String ddsj = ""; | ||
| 893 | + | ||
| 894 | + private int yys = 25; | ||
| 895 | + | ||
| 896 | + private String clZbh = ""; | ||
| 897 | + | ||
| 898 | + private String cph = ""; | ||
| 899 | + | ||
| 900 | + private String color = "绿牌"; | ||
| 901 | + | ||
| 902 | + private String jsy = ""; | ||
| 903 | + | ||
| 904 | + private String jsydh = ""; | ||
| 905 | + | ||
| 906 | + private int pj = 10; | ||
| 907 | + | ||
| 908 | + public String getCompany() { | ||
| 909 | + return company; | ||
| 910 | + } | ||
| 911 | + | ||
| 912 | + public void setCompany(String company) { | ||
| 913 | + this.company = company; | ||
| 914 | + } | ||
| 915 | + | ||
| 916 | + public String getXlName() { | ||
| 917 | + return xlName; | ||
| 918 | + } | ||
| 919 | + | ||
| 920 | + public void setXlName(String xlName) { | ||
| 921 | + this.xlName = xlName; | ||
| 922 | + } | ||
| 923 | + | ||
| 924 | + public int getXlDir() { | ||
| 925 | + return xlDir; | ||
| 926 | + } | ||
| 927 | + | ||
| 928 | + public void setXlDir(int xlDir) { | ||
| 929 | + this.xlDir = xlDir; | ||
| 930 | + } | ||
| 931 | + | ||
| 932 | + public String getXlDirStr() { | ||
| 933 | + xlDirStr = ""; | ||
| 934 | + if (xlDir == 0) { | ||
| 935 | + xlDirStr = "上行"; | ||
| 936 | + } else if (xlDir == 1) { | ||
| 937 | + xlDirStr = "下行"; | ||
| 938 | + } | ||
| 939 | + return xlDirStr; | ||
| 940 | + } | ||
| 941 | + | ||
| 942 | + public void setXlDirStr(String xlDirStr) { | ||
| 943 | + this.xlDirStr = xlDirStr; | ||
| 944 | + } | ||
| 945 | + | ||
| 946 | + public String getScheduleDate() { | ||
| 947 | + return scheduleDate; | ||
| 948 | + } | ||
| 949 | + | ||
| 950 | + public void setScheduleDate(String scheduleDate) { | ||
| 951 | + this.scheduleDate = scheduleDate; | ||
| 952 | + } | ||
| 953 | + | ||
| 954 | + public String getSjdStart() { | ||
| 955 | + return sjdStart; | ||
| 956 | + } | ||
| 957 | + | ||
| 958 | + public void setSjdStart(String sjdStart) { | ||
| 959 | + this.sjdStart = sjdStart; | ||
| 960 | + } | ||
| 961 | + | ||
| 962 | + public String getSjdEnd() { | ||
| 963 | + return sjdEnd; | ||
| 964 | + } | ||
| 965 | + | ||
| 966 | + public void setSjdEnd(String sjdEnd) { | ||
| 967 | + this.sjdEnd = sjdEnd; | ||
| 968 | + } | ||
| 969 | + | ||
| 970 | + public String getFcsj() { | ||
| 971 | + return fcsj; | ||
| 972 | + } | ||
| 973 | + | ||
| 974 | + public void setFcsj(String fcsj) { | ||
| 975 | + this.fcsj = fcsj; | ||
| 976 | + } | ||
| 977 | + | ||
| 978 | + public int getBcsj() { | ||
| 979 | + return bcsj; | ||
| 980 | + } | ||
| 981 | + | ||
| 982 | + public void setBcsj(int bcsj) { | ||
| 983 | + this.bcsj = bcsj; | ||
| 984 | + } | ||
| 985 | + | ||
| 986 | + public String getDdsj() { | ||
| 987 | + return ddsj; | ||
| 988 | + } | ||
| 989 | + | ||
| 990 | + public void setDdsj(String ddsj) { | ||
| 991 | + this.ddsj = ddsj; | ||
| 992 | + } | ||
| 993 | + | ||
| 994 | + public int getYys() { | ||
| 995 | + return yys; | ||
| 996 | + } | ||
| 997 | + | ||
| 998 | + public void setYys(int yys) { | ||
| 999 | + this.yys = yys; | ||
| 1000 | + } | ||
| 1001 | + | ||
| 1002 | + public String getClZbh() { | ||
| 1003 | + return clZbh; | ||
| 1004 | + } | ||
| 1005 | + | ||
| 1006 | + public void setClZbh(String clZbh) { | ||
| 1007 | + this.clZbh = clZbh; | ||
| 1008 | + } | ||
| 1009 | + | ||
| 1010 | + public String getCph() { | ||
| 1011 | + cph = BasicData.nbbmCompanyPlateMap.get(clZbh); | ||
| 1012 | + if (cph == null) { | ||
| 1013 | + cph = ""; | ||
| 1014 | + } | ||
| 1015 | + return cph; | ||
| 1016 | + } | ||
| 1017 | + | ||
| 1018 | + public void setCph(String cph) { | ||
| 1019 | + this.cph = cph; | ||
| 1020 | + } | ||
| 1021 | + | ||
| 1022 | + public String getColor() { | ||
| 1023 | + return color; | ||
| 1024 | + } | ||
| 1025 | + | ||
| 1026 | + public void setColor(String color) { | ||
| 1027 | + this.color = color; | ||
| 1028 | + } | ||
| 1029 | + | ||
| 1030 | + public String getJsy() { | ||
| 1031 | + return jsy; | ||
| 1032 | + } | ||
| 1033 | + | ||
| 1034 | + public void setJsy(String jsy) { | ||
| 1035 | + this.jsy = jsy; | ||
| 1036 | + } | ||
| 1037 | + | ||
| 1038 | + public String getJsydh() { | ||
| 1039 | + return jsydh; | ||
| 1040 | + } | ||
| 1041 | + | ||
| 1042 | + public void setJsydh(String jsydh) { | ||
| 1043 | + this.jsydh = jsydh; | ||
| 1044 | + } | ||
| 1045 | + | ||
| 1046 | + public int getPj() { | ||
| 1047 | + return pj; | ||
| 1048 | + } | ||
| 1049 | + | ||
| 1050 | + public void setPj(int pj) { | ||
| 1051 | + this.pj = pj; | ||
| 1052 | + } | ||
| 1053 | + } | ||
| 1054 | +} |
src/main/java/com/bsth/controller/report/ReportController.java
| @@ -304,6 +304,12 @@ public class ReportController { | @@ -304,6 +304,12 @@ public class ReportController { | ||
| 304 | return service.userList(map); | 304 | return service.userList(map); |
| 305 | } | 305 | } |
| 306 | 306 | ||
| 307 | + @RequestMapping(value="/countMileageSum") | ||
| 308 | + public List<Map<String,Object>> countMileageSum(@RequestParam Map<String, Object> map){ | ||
| 309 | + | ||
| 310 | + return service.countMileageSum(map); | ||
| 311 | + } | ||
| 312 | + | ||
| 307 | @RequestMapping(value="/countLineMileage") | 313 | @RequestMapping(value="/countLineMileage") |
| 308 | public List<Map<String,Object>> countLineMileage(@RequestParam Map<String, Object> map){ | 314 | public List<Map<String,Object>> countLineMileage(@RequestParam Map<String, Object> map){ |
| 309 | 315 |
src/main/java/com/bsth/controller/schedule/core/legacy/EmployeeConfigInfoController.java
| @@ -61,13 +61,10 @@ public class EmployeeConfigInfoController extends BController<EmployeeConfigInfo | @@ -61,13 +61,10 @@ public class EmployeeConfigInfoController extends BController<EmployeeConfigInfo | ||
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | @RequestMapping(value = "/validate_get_destroy_info", method = RequestMethod.GET) | 63 | @RequestMapping(value = "/validate_get_destroy_info", method = RequestMethod.GET) |
| 64 | - public Map<String, Object> validate_get_destroy_info(HttpServletRequest request) { | ||
| 65 | - HttpSession session = request.getSession(); | ||
| 66 | - List<CompanyAuthority> cmyAuths = (List<CompanyAuthority>) session.getAttribute(Constants.COMPANY_AUTHORITYS); | ||
| 67 | - | 64 | + public Map<String, Object> validate_get_destroy_info() { |
| 68 | Map<String, Object> rtn = new HashMap<>(); | 65 | Map<String, Object> rtn = new HashMap<>(); |
| 69 | try { | 66 | try { |
| 70 | - rtn.put("data", this.employeeConfigInfoService.validate_get_destroy_info(cmyAuths)); | 67 | + rtn.put("data", this.employeeConfigInfoService.validate_get_destory_info()); |
| 71 | rtn.put("status", ResponseCode.SUCCESS); | 68 | rtn.put("status", ResponseCode.SUCCESS); |
| 72 | } catch (Exception exp) { | 69 | } catch (Exception exp) { |
| 73 | rtn.put("status", ResponseCode.ERROR); | 70 | rtn.put("status", ResponseCode.ERROR); |
| @@ -77,21 +74,17 @@ public class EmployeeConfigInfoController extends BController<EmployeeConfigInfo | @@ -77,21 +74,17 @@ public class EmployeeConfigInfoController extends BController<EmployeeConfigInfo | ||
| 77 | return rtn; | 74 | return rtn; |
| 78 | } | 75 | } |
| 79 | @GetMapping(value = "/validate_get_destroy_info/download") | 76 | @GetMapping(value = "/validate_get_destroy_info/download") |
| 80 | - public void exportValidateGetDestroyInfo( | ||
| 81 | - HttpServletRequest request, | ||
| 82 | - HttpServletResponse response) throws Exception { | 77 | + public void exportValidateGetDestroyInfo(HttpServletResponse response) throws Exception { |
| 83 | // 流输出导出文件 | 78 | // 流输出导出文件 |
| 84 | response.setHeader("content-type", "application/octet-stream"); | 79 | response.setHeader("content-type", "application/octet-stream"); |
| 85 | - response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("人员配置停用信息.txt", "UTF-8")); | 80 | + response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("排班人员停用信息.txt", "UTF-8")); |
| 86 | response.setContentType("application/octet-stream"); | 81 | response.setContentType("application/octet-stream"); |
| 87 | 82 | ||
| 88 | try ( | 83 | try ( |
| 89 | OutputStream os = response.getOutputStream(); | 84 | OutputStream os = response.getOutputStream(); |
| 90 | PrintWriter printWriter = new PrintWriter(os); | 85 | PrintWriter printWriter = new PrintWriter(os); |
| 91 | ) { | 86 | ) { |
| 92 | - HttpSession session = request.getSession(); | ||
| 93 | - List<CompanyAuthority> cmyAuths = (List<CompanyAuthority>) session.getAttribute(Constants.COMPANY_AUTHORITYS); | ||
| 94 | - List<String> infos = this.employeeConfigInfoService.validate_get_destroy_info(cmyAuths); | 87 | + List<String> infos = this.employeeConfigInfoService.validate_get_destory_info(); |
| 95 | for (String info : infos) { | 88 | for (String info : infos) { |
| 96 | printWriter.println(info); | 89 | printWriter.println(info); |
| 97 | } | 90 | } |
src/main/java/com/bsth/controller/schedule/core/legacy/TTInfoDetailController.java
| @@ -10,6 +10,7 @@ import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData; | @@ -10,6 +10,7 @@ import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData; | ||
| 10 | import com.bsth.service.schedule.timetable.ExcelFormatType; | 10 | import com.bsth.service.schedule.timetable.ExcelFormatType; |
| 11 | import com.bsth.service.schedule.utils.DataToolsFile; | 11 | import com.bsth.service.schedule.utils.DataToolsFile; |
| 12 | import com.bsth.service.schedule.utils.DataToolsFileType; | 12 | import com.bsth.service.schedule.utils.DataToolsFileType; |
| 13 | +import com.bsth.service.schedule.utils.MyHttpUtils; | ||
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | 15 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
| 15 | import org.springframework.web.bind.annotation.*; | 16 | import org.springframework.web.bind.annotation.*; |
| @@ -118,12 +119,12 @@ public class TTInfoDetailController extends BController<TTInfoDetail, Long> { | @@ -118,12 +119,12 @@ public class TTInfoDetailController extends BController<TTInfoDetail, Long> { | ||
| 118 | } | 119 | } |
| 119 | return rtn; | 120 | return rtn; |
| 120 | } | 121 | } |
| 121 | - | 122 | + |
| 122 | /** | 123 | /** |
| 123 | * 时刻表明细批量插入 | 124 | * 时刻表明细批量插入 |
| 124 | - * | 125 | + * |
| 125 | * @param entities | 126 | * @param entities |
| 126 | - * | 127 | + * |
| 127 | * @return | 128 | * @return |
| 128 | */ | 129 | */ |
| 129 | @RequestMapping(value = "/skbDetailMxSave" ,method = RequestMethod.POST) | 130 | @RequestMapping(value = "/skbDetailMxSave" ,method = RequestMethod.POST) |
| @@ -131,6 +132,60 @@ public class TTInfoDetailController extends BController<TTInfoDetail, Long> { | @@ -131,6 +132,60 @@ public class TTInfoDetailController extends BController<TTInfoDetail, Long> { | ||
| 131 | return ttInfoDetailService.skbDetailMxSave(entities); | 132 | return ttInfoDetailService.skbDetailMxSave(entities); |
| 132 | } | 133 | } |
| 133 | 134 | ||
| 135 | + // 导出预览视图数据 | ||
| 136 | + @GetMapping(value = "/exportPvInfo/{id}") | ||
| 137 | + public void exportPvInfo(@PathVariable("id") Long ttInfoId, HttpServletResponse response) throws Exception { | ||
| 138 | + DataToolsFile dataToolsFile = this.ttInfoDetailService.exportPvInfo(ttInfoId); | ||
| 139 | + MyHttpUtils.responseStreamFile(response, dataToolsFile.getFile()); | ||
| 140 | + } | ||
| 141 | + // 添加路牌 | ||
| 142 | + @GetMapping(value = "/addLp/{ttInfoId}/{lpId}") | ||
| 143 | + public Map<String, Object> addLp(@PathVariable("ttInfoId") Long ttInfoId, @PathVariable("lpId") Long lpId) { | ||
| 144 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 145 | + try { | ||
| 146 | + this.ttInfoDetailService.addLp(ttInfoId, lpId); | ||
| 147 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 148 | + rtn.put("data", "添加路牌成功!"); | ||
| 149 | + } catch (Exception exp) { | ||
| 150 | + exp.printStackTrace(); | ||
| 151 | + rtn.put("status", ResponseCode.ERROR); | ||
| 152 | + rtn.put("msg", "添加路牌失败:" + exp.getMessage()); | ||
| 153 | + } | ||
| 154 | + return rtn; | ||
| 155 | + } | ||
| 156 | + // 删除路牌 | ||
| 157 | + @GetMapping(value = "/removeLp/{ttInfoId}/{lpId}") | ||
| 158 | + public Map<String, Object> removeLp(@PathVariable("ttInfoId") Long ttInfoId, @PathVariable("lpId") Long lpId) { | ||
| 159 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 160 | + try { | ||
| 161 | + this.ttInfoDetailService.removeBcByLp(ttInfoId, lpId); | ||
| 162 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 163 | + rtn.put("data", "删除路牌成功!"); | ||
| 164 | + } catch (Exception exp) { | ||
| 165 | + exp.printStackTrace(); | ||
| 166 | + rtn.put("status", ResponseCode.ERROR); | ||
| 167 | + rtn.put("msg", "删除路牌失败:" + exp.getMessage()); | ||
| 168 | + } | ||
| 169 | + return rtn; | ||
| 170 | + } | ||
| 171 | + // 调换路牌 | ||
| 172 | + @GetMapping(value = "/switchLp/{ttInfoId}/{lpAId}/{lpBId}") | ||
| 173 | + public Map<String, Object> switchLp(@PathVariable("ttInfoId") Long ttInfoId, | ||
| 174 | + @PathVariable("lpAId") Long lpAId, | ||
| 175 | + @PathVariable("lpBId") Long lpBId) { | ||
| 176 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 177 | + try { | ||
| 178 | + this.ttInfoDetailService.switchBcByLp(ttInfoId, lpAId, lpBId); | ||
| 179 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 180 | + rtn.put("data", "调换路牌成功!"); | ||
| 181 | + } catch (Exception exp) { | ||
| 182 | + exp.printStackTrace(); | ||
| 183 | + rtn.put("status", ResponseCode.ERROR); | ||
| 184 | + rtn.put("msg", "调换路牌失败:" + exp.getMessage()); | ||
| 185 | + } | ||
| 186 | + return rtn; | ||
| 187 | + } | ||
| 188 | + | ||
| 134 | 189 | ||
| 135 | @RequestMapping(value = "/exportDTDFile/{type}", method = RequestMethod.POST) | 190 | @RequestMapping(value = "/exportDTDFile/{type}", method = RequestMethod.POST) |
| 136 | public void exportFile( | 191 | public void exportFile( |
src/main/java/com/bsth/controller/schedule/datasync/VehicleDataSyncController.java
| @@ -6,13 +6,12 @@ import com.bsth.controller.schedule.datasync.request.VehicleDataSyncTaskRequest; | @@ -6,13 +6,12 @@ import com.bsth.controller.schedule.datasync.request.VehicleDataSyncTaskRequest; | ||
| 6 | import com.bsth.entity.schedule.datasync.VehicleDataSyncTask; | 6 | import com.bsth.entity.schedule.datasync.VehicleDataSyncTask; |
| 7 | import com.bsth.entity.schedule.datasync.VehicleDataSyncTaskTypeEnum; | 7 | import com.bsth.entity.schedule.datasync.VehicleDataSyncTaskTypeEnum; |
| 8 | import com.bsth.service.schedule.datasync.VehicleDataSyncTaskService; | 8 | import com.bsth.service.schedule.datasync.VehicleDataSyncTaskService; |
| 9 | -import com.bsth.service.schedule.utils.MyStringUtils; | 9 | +import com.bsth.service.schedule.utils.MyHttpUtils; |
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | import org.springframework.web.bind.annotation.*; | 11 | import org.springframework.web.bind.annotation.*; |
| 12 | 12 | ||
| 13 | import javax.servlet.http.HttpServletResponse; | 13 | import javax.servlet.http.HttpServletResponse; |
| 14 | -import java.io.*; | ||
| 15 | -import java.net.URLEncoder; | 14 | +import java.io.File; |
| 16 | import java.util.Date; | 15 | import java.util.Date; |
| 17 | 16 | ||
| 18 | @RestController | 17 | @RestController |
| @@ -107,38 +106,11 @@ public class VehicleDataSyncController extends BController<VehicleDataSyncTask, | @@ -107,38 +106,11 @@ public class VehicleDataSyncController extends BController<VehicleDataSyncTask, | ||
| 107 | } | 106 | } |
| 108 | 107 | ||
| 109 | try { | 108 | try { |
| 110 | - responseStreamFile(response, file); | 109 | + MyHttpUtils.responseStreamFile(response, file); |
| 111 | } catch (Exception exp) { | 110 | } catch (Exception exp) { |
| 112 | exp.printStackTrace(); | 111 | exp.printStackTrace(); |
| 113 | throw new RuntimeException("获取同步日志文件错误:" + exp.getMessage()); | 112 | throw new RuntimeException("获取同步日志文件错误:" + exp.getMessage()); |
| 114 | } | 113 | } |
| 115 | } | 114 | } |
| 116 | 115 | ||
| 117 | - // 流输出文件 | ||
| 118 | - private void responseStreamFile(HttpServletResponse response, File file) throws IOException { | ||
| 119 | - // 流输出导出文件 | ||
| 120 | - response.setHeader("content-type", "application/octet-stream"); | ||
| 121 | - String fileName = file.getName(); | ||
| 122 | - if (MyStringUtils.isContainChinese(fileName)) { | ||
| 123 | - response.setHeader("Content-Disposition", "attachment; filename*=" + URLEncoder.encode(fileName, "UTF-8")); | ||
| 124 | - } else { | ||
| 125 | - response.setHeader("Content-Disposition", "attachment; filename=" + fileName); | ||
| 126 | - } | ||
| 127 | - response.setContentType("application/octet-stream"); | ||
| 128 | - | ||
| 129 | - try ( | ||
| 130 | - OutputStream os = response.getOutputStream(); | ||
| 131 | - BufferedOutputStream bos = new BufferedOutputStream(os); | ||
| 132 | - InputStream is = new FileInputStream(file); | ||
| 133 | - BufferedInputStream bis = new BufferedInputStream(is) | ||
| 134 | - ) { | ||
| 135 | - int length; | ||
| 136 | - byte[] temp = new byte[1024 * 10]; | ||
| 137 | - while ((length = bis.read(temp)) != -1) { | ||
| 138 | - bos.write(temp, 0, length); | ||
| 139 | - } | ||
| 140 | - bos.flush(); | ||
| 141 | - } | ||
| 142 | - } | ||
| 143 | - | ||
| 144 | } | 116 | } |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| @@ -25,6 +25,7 @@ import org.joda.time.format.DateTimeFormatter; | @@ -25,6 +25,7 @@ import org.joda.time.format.DateTimeFormatter; | ||
| 25 | import org.slf4j.Logger; | 25 | import org.slf4j.Logger; |
| 26 | import org.slf4j.LoggerFactory; | 26 | import org.slf4j.LoggerFactory; |
| 27 | import org.springframework.beans.factory.annotation.Autowired; | 27 | import org.springframework.beans.factory.annotation.Autowired; |
| 28 | +import org.springframework.beans.factory.annotation.Value; | ||
| 28 | import org.springframework.dao.DataIntegrityViolationException; | 29 | import org.springframework.dao.DataIntegrityViolationException; |
| 29 | import org.springframework.jdbc.core.BatchPreparedStatementSetter; | 30 | import org.springframework.jdbc.core.BatchPreparedStatementSetter; |
| 30 | import org.springframework.jdbc.core.JdbcTemplate; | 31 | import org.springframework.jdbc.core.JdbcTemplate; |
| @@ -52,6 +53,9 @@ import java.util.concurrent.ConcurrentMap; | @@ -52,6 +53,9 @@ import java.util.concurrent.ConcurrentMap; | ||
| 52 | @Component | 53 | @Component |
| 53 | public class DayOfSchedule { | 54 | public class DayOfSchedule { |
| 54 | 55 | ||
| 56 | + @Value("${ms.fl.generate}") | ||
| 57 | + private boolean generate; | ||
| 58 | + | ||
| 55 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 59 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 56 | 60 | ||
| 57 | //按线路分组的 “原始计划” 排班数据 | 61 | //按线路分组的 “原始计划” 排班数据 |
| @@ -203,7 +207,9 @@ public class DayOfSchedule { | @@ -203,7 +207,9 @@ public class DayOfSchedule { | ||
| 203 | putAll(list); | 207 | putAll(list); |
| 204 | 208 | ||
| 205 | //标记首末班 | 209 | //标记首末班 |
| 206 | - FirstAndLastHandler.marks(list); | 210 | + if (generate) { |
| 211 | + FirstAndLastHandler.marks(list); | ||
| 212 | + } | ||
| 207 | 213 | ||
| 208 | Set<String> lps = searchAllLP(list); | 214 | Set<String> lps = searchAllLP(list); |
| 209 | for (String lp : lps) { | 215 | for (String lp : lps) { |
src/main/java/com/bsth/entity/calc/CalcStatistics.java
| 1 | -package com.bsth.entity.calc; | ||
| 2 | - | ||
| 3 | -import java.util.Date; | ||
| 4 | - | ||
| 5 | -import javax.persistence.*; | ||
| 6 | - | ||
| 7 | -@Entity | ||
| 8 | -@Table(name = "calc_statistics") | ||
| 9 | -public class CalcStatistics { | ||
| 10 | - /* 主键*/ | ||
| 11 | - @Id | ||
| 12 | - @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 13 | - private Long id; | ||
| 14 | - /* 日期*/ | ||
| 15 | - private Date date; | ||
| 16 | - /* 日期字符串*/ | ||
| 17 | - private String dateStr; | ||
| 18 | - /* 线路编码*/ | ||
| 19 | - private String xl; | ||
| 20 | - /* 线路名称*/ | ||
| 21 | - private String xlName; | ||
| 22 | - /* 公司代码*/ | ||
| 23 | - private String gsdm; | ||
| 24 | - /* 分公司代码*/ | ||
| 25 | - private String fgsdm; | ||
| 26 | - /* 计划总公里*/ | ||
| 27 | - private Double jhzlc; | ||
| 28 | - /* 计划营运公里*/ | ||
| 29 | - private Double jhyylc; | ||
| 30 | - /* 计划空驶公里*/ | ||
| 31 | - private Double jhkslc; | ||
| 32 | - /* 实际总公里*/ | ||
| 33 | - private Double sjzlc; | ||
| 34 | - /* 实际营运公里*/ | ||
| 35 | - private Double sjyylc; | ||
| 36 | - /* 实际空驶公里*/ | ||
| 37 | - private Double sjkslc; | ||
| 38 | - /* 少驶公里*/ | ||
| 39 | - private Double sslc; | ||
| 40 | - /* 少驶班次*/ | ||
| 41 | - private int ssbc; | ||
| 42 | - /* 路阻公里*/ | ||
| 43 | - private Double lzlc; | ||
| 44 | - /* 吊慢公里*/ | ||
| 45 | - private Double dmlc; | ||
| 46 | - /* 故障公里*/ | ||
| 47 | - private Double gzlc; | ||
| 48 | - /* 纠纷公里*/ | ||
| 49 | - private Double jflc; | ||
| 50 | - /* 肇事公里*/ | ||
| 51 | - private Double zslc; | ||
| 52 | - /* 缺人公里*/ | ||
| 53 | - private Double qrlc; | ||
| 54 | - /* 缺车公里*/ | ||
| 55 | - private Double qclc; | ||
| 56 | - /* 客稀公里*/ | ||
| 57 | - private Double kxlc; | ||
| 58 | - /* 气候公里*/ | ||
| 59 | - private Double qhlc; | ||
| 60 | - /* 援外公里*/ | ||
| 61 | - private Double ywlc; | ||
| 62 | - /* 其他公里*/ | ||
| 63 | - private Double qtlc; | ||
| 64 | - /* 临加公里*/ | ||
| 65 | - private Double ljlc; | ||
| 66 | - /* 临加空驶公里*/ | ||
| 67 | - private Double ljkslc; | ||
| 68 | - /* 计划班次*/ | ||
| 69 | - private int jhbcq; | ||
| 70 | - /* 计划班次(早高峰)*/ | ||
| 71 | - private int jhbcz; | ||
| 72 | - /* 计划班次(晚高峰)*/ | ||
| 73 | - private int jhbcw; | ||
| 74 | - /* 实际班次*/ | ||
| 75 | - private int sjbcq; | ||
| 76 | - /* 实际班次(早高峰)*/ | ||
| 77 | - private int sjbcz; | ||
| 78 | - /* 实际班次(晚高峰)*/ | ||
| 79 | - private int sjbcw; | ||
| 80 | - /* 临加班次*/ | ||
| 81 | - private int ljbcq; | ||
| 82 | - /* 临加班次(早高峰)*/ | ||
| 83 | - private int ljbcz; | ||
| 84 | - /* 临加班次(晚高峰)*/ | ||
| 85 | - private int ljbcw; | ||
| 86 | - /* 放站班次*/ | ||
| 87 | - private int fzbcq; | ||
| 88 | - /* 放站班次(早高峰)*/ | ||
| 89 | - private int fzbcz; | ||
| 90 | - /* 放站班次(晚高峰)*/ | ||
| 91 | - private int fzbcw; | ||
| 92 | - /* 调头班次*/ | ||
| 93 | - private int dtbcq; | ||
| 94 | - /* 调头班次(早高峰)*/ | ||
| 95 | - private int dtbcz; | ||
| 96 | - /* 调头班次(晚高峰)*/ | ||
| 97 | - private int dtbcw; | ||
| 98 | - /* 大间隔次数*/ | ||
| 99 | - private int djgq; | ||
| 100 | - /* 大间隔次数(早高峰)*/ | ||
| 101 | - private int djgz; | ||
| 102 | - /* 大间隔次数(晚高峰)*/ | ||
| 103 | - private int djgw; | ||
| 104 | - /* 最大大间隔时间*/ | ||
| 105 | - private int djgsj; | ||
| 106 | - /* 备注*/ | ||
| 107 | - private String remark; | ||
| 108 | - /*分公司名字*/ | ||
| 109 | - @Transient | ||
| 110 | - private String fgsName; | ||
| 111 | - public Long getId() { | ||
| 112 | - return id; | ||
| 113 | - } | ||
| 114 | - public void setId(Long id) { | ||
| 115 | - this.id = id; | ||
| 116 | - } | ||
| 117 | - public Date getDate() { | ||
| 118 | - return date; | ||
| 119 | - } | ||
| 120 | - public void setDate(Date date) { | ||
| 121 | - this.date = date; | ||
| 122 | - } | ||
| 123 | - public String getDateStr() { | ||
| 124 | - return dateStr; | ||
| 125 | - } | ||
| 126 | - public void setDateStr(String dateStr) { | ||
| 127 | - this.dateStr = dateStr; | ||
| 128 | - } | ||
| 129 | - public String getXl() { | ||
| 130 | - return xl; | ||
| 131 | - } | ||
| 132 | - public void setXl(String xl) { | ||
| 133 | - this.xl = xl; | ||
| 134 | - } | ||
| 135 | - public String getXlName() { | ||
| 136 | - return xlName; | ||
| 137 | - } | ||
| 138 | - public void setXlName(String xlName) { | ||
| 139 | - this.xlName = xlName; | ||
| 140 | - } | ||
| 141 | - public String getGsdm() { | ||
| 142 | - return gsdm; | ||
| 143 | - } | ||
| 144 | - public void setGsdm(String gsdm) { | ||
| 145 | - this.gsdm = gsdm; | ||
| 146 | - } | ||
| 147 | - public String getFgsdm() { | ||
| 148 | - return fgsdm; | ||
| 149 | - } | ||
| 150 | - public void setFgsdm(String fgsdm) { | ||
| 151 | - this.fgsdm = fgsdm; | ||
| 152 | - } | ||
| 153 | - public Double getJhzlc() { | ||
| 154 | - return jhzlc; | ||
| 155 | - } | ||
| 156 | - public void setJhzlc(Double jhzlc) { | ||
| 157 | - this.jhzlc = jhzlc; | ||
| 158 | - } | ||
| 159 | - public Double getJhyylc() { | ||
| 160 | - return jhyylc; | ||
| 161 | - } | ||
| 162 | - public void setJhyylc(Double jhyylc) { | ||
| 163 | - this.jhyylc = jhyylc; | ||
| 164 | - } | ||
| 165 | - public Double getJhkslc() { | ||
| 166 | - return jhkslc; | ||
| 167 | - } | ||
| 168 | - public void setJhkslc(Double jhkslc) { | ||
| 169 | - this.jhkslc = jhkslc; | ||
| 170 | - } | ||
| 171 | - public Double getSjzlc() { | ||
| 172 | - return sjzlc; | ||
| 173 | - } | ||
| 174 | - public void setSjzlc(Double sjzlc) { | ||
| 175 | - this.sjzlc = sjzlc; | ||
| 176 | - } | ||
| 177 | - public Double getSjyylc() { | ||
| 178 | - return sjyylc; | ||
| 179 | - } | ||
| 180 | - public void setSjyylc(Double sjyylc) { | ||
| 181 | - this.sjyylc = sjyylc; | ||
| 182 | - } | ||
| 183 | - public Double getSjkslc() { | ||
| 184 | - return sjkslc; | ||
| 185 | - } | ||
| 186 | - public void setSjkslc(Double sjkslc) { | ||
| 187 | - this.sjkslc = sjkslc; | ||
| 188 | - } | ||
| 189 | - public Double getSslc() { | ||
| 190 | - return sslc; | ||
| 191 | - } | ||
| 192 | - public void setSslc(Double sslc) { | ||
| 193 | - this.sslc = sslc; | ||
| 194 | - } | ||
| 195 | - public int getSsbc() { | ||
| 196 | - return ssbc; | ||
| 197 | - } | ||
| 198 | - public void setSsbc(int ssbc) { | ||
| 199 | - this.ssbc = ssbc; | ||
| 200 | - } | ||
| 201 | - public Double getLzlc() { | ||
| 202 | - return lzlc; | ||
| 203 | - } | ||
| 204 | - public void setLzlc(Double lzlc) { | ||
| 205 | - this.lzlc = lzlc; | ||
| 206 | - } | ||
| 207 | - public Double getDmlc() { | ||
| 208 | - return dmlc; | ||
| 209 | - } | ||
| 210 | - public void setDmlc(Double dmlc) { | ||
| 211 | - this.dmlc = dmlc; | ||
| 212 | - } | ||
| 213 | - public Double getGzlc() { | ||
| 214 | - return gzlc; | ||
| 215 | - } | ||
| 216 | - public void setGzlc(Double gzlc) { | ||
| 217 | - this.gzlc = gzlc; | ||
| 218 | - } | ||
| 219 | - public Double getJflc() { | ||
| 220 | - return jflc; | ||
| 221 | - } | ||
| 222 | - public void setJflc(Double jflc) { | ||
| 223 | - this.jflc = jflc; | ||
| 224 | - } | ||
| 225 | - public Double getZslc() { | ||
| 226 | - return zslc; | ||
| 227 | - } | ||
| 228 | - public void setZslc(Double zslc) { | ||
| 229 | - this.zslc = zslc; | ||
| 230 | - } | ||
| 231 | - public Double getQrlc() { | ||
| 232 | - return qrlc; | ||
| 233 | - } | ||
| 234 | - public void setQrlc(Double qrlc) { | ||
| 235 | - this.qrlc = qrlc; | ||
| 236 | - } | ||
| 237 | - public Double getQclc() { | ||
| 238 | - return qclc; | ||
| 239 | - } | ||
| 240 | - public void setQclc(Double qclc) { | ||
| 241 | - this.qclc = qclc; | ||
| 242 | - } | ||
| 243 | - public Double getKxlc() { | ||
| 244 | - return kxlc; | ||
| 245 | - } | ||
| 246 | - public void setKxlc(Double kxlc) { | ||
| 247 | - this.kxlc = kxlc; | ||
| 248 | - } | ||
| 249 | - public Double getQhlc() { | ||
| 250 | - return qhlc; | ||
| 251 | - } | ||
| 252 | - public void setQhlc(Double qhlc) { | ||
| 253 | - this.qhlc = qhlc; | ||
| 254 | - } | ||
| 255 | - public Double getYwlc() { | ||
| 256 | - return ywlc; | ||
| 257 | - } | ||
| 258 | - public void setYwlc(Double ywlc) { | ||
| 259 | - this.ywlc = ywlc; | ||
| 260 | - } | ||
| 261 | - public Double getQtlc() { | ||
| 262 | - return qtlc; | ||
| 263 | - } | ||
| 264 | - public void setQtlc(Double qtlc) { | ||
| 265 | - this.qtlc = qtlc; | ||
| 266 | - } | ||
| 267 | - public Double getLjlc() { | ||
| 268 | - return ljlc; | ||
| 269 | - } | ||
| 270 | - public void setLjlc(Double ljlc) { | ||
| 271 | - this.ljlc = ljlc; | ||
| 272 | - } | ||
| 273 | - public Double getLjkslc() { | ||
| 274 | - return ljkslc; | ||
| 275 | - } | ||
| 276 | - public void setLjkslc(Double ljkslc) { | ||
| 277 | - this.ljkslc = ljkslc; | ||
| 278 | - } | ||
| 279 | - public int getJhbcq() { | ||
| 280 | - return jhbcq; | ||
| 281 | - } | ||
| 282 | - public void setJhbcq(int jhbcq) { | ||
| 283 | - this.jhbcq = jhbcq; | ||
| 284 | - } | ||
| 285 | - public int getJhbcz() { | ||
| 286 | - return jhbcz; | ||
| 287 | - } | ||
| 288 | - public void setJhbcz(int jhbcz) { | ||
| 289 | - this.jhbcz = jhbcz; | ||
| 290 | - } | ||
| 291 | - public int getJhbcw() { | ||
| 292 | - return jhbcw; | ||
| 293 | - } | ||
| 294 | - public void setJhbcw(int jhbcw) { | ||
| 295 | - this.jhbcw = jhbcw; | ||
| 296 | - } | ||
| 297 | - public int getSjbcq() { | ||
| 298 | - return sjbcq; | ||
| 299 | - } | ||
| 300 | - public void setSjbcq(int sjbcq) { | ||
| 301 | - this.sjbcq = sjbcq; | ||
| 302 | - } | ||
| 303 | - public int getSjbcz() { | ||
| 304 | - return sjbcz; | ||
| 305 | - } | ||
| 306 | - public void setSjbcz(int sjbcz) { | ||
| 307 | - this.sjbcz = sjbcz; | ||
| 308 | - } | ||
| 309 | - public int getSjbcw() { | ||
| 310 | - return sjbcw; | ||
| 311 | - } | ||
| 312 | - public void setSjbcw(int sjbcw) { | ||
| 313 | - this.sjbcw = sjbcw; | ||
| 314 | - } | ||
| 315 | - public int getLjbcq() { | ||
| 316 | - return ljbcq; | ||
| 317 | - } | ||
| 318 | - public void setLjbcq(int ljbcq) { | ||
| 319 | - this.ljbcq = ljbcq; | ||
| 320 | - } | ||
| 321 | - public int getLjbcz() { | ||
| 322 | - return ljbcz; | ||
| 323 | - } | ||
| 324 | - public void setLjbcz(int ljbcz) { | ||
| 325 | - this.ljbcz = ljbcz; | ||
| 326 | - } | ||
| 327 | - public int getLjbcw() { | ||
| 328 | - return ljbcw; | ||
| 329 | - } | ||
| 330 | - public void setLjbcw(int ljbcw) { | ||
| 331 | - this.ljbcw = ljbcw; | ||
| 332 | - } | ||
| 333 | - public int getFzbcq() { | ||
| 334 | - return fzbcq; | ||
| 335 | - } | ||
| 336 | - public void setFzbcq(int fzbcq) { | ||
| 337 | - this.fzbcq = fzbcq; | ||
| 338 | - } | ||
| 339 | - public int getFzbcz() { | ||
| 340 | - return fzbcz; | ||
| 341 | - } | ||
| 342 | - public void setFzbcz(int fzbcz) { | ||
| 343 | - this.fzbcz = fzbcz; | ||
| 344 | - } | ||
| 345 | - public int getFzbcw() { | ||
| 346 | - return fzbcw; | ||
| 347 | - } | ||
| 348 | - public void setFzbcw(int fzbcw) { | ||
| 349 | - this.fzbcw = fzbcw; | ||
| 350 | - } | ||
| 351 | - public int getDtbcq() { | ||
| 352 | - return dtbcq; | ||
| 353 | - } | ||
| 354 | - public void setDtbcq(int dtbcq) { | ||
| 355 | - this.dtbcq = dtbcq; | ||
| 356 | - } | ||
| 357 | - public int getDtbcz() { | ||
| 358 | - return dtbcz; | ||
| 359 | - } | ||
| 360 | - public void setDtbcz(int dtbcz) { | ||
| 361 | - this.dtbcz = dtbcz; | ||
| 362 | - } | ||
| 363 | - public int getDtbcw() { | ||
| 364 | - return dtbcw; | ||
| 365 | - } | ||
| 366 | - public void setDtbcw(int dtbcw) { | ||
| 367 | - this.dtbcw = dtbcw; | ||
| 368 | - } | ||
| 369 | - public int getDjgq() { | ||
| 370 | - return djgq; | ||
| 371 | - } | ||
| 372 | - public void setDjgq(int djgq) { | ||
| 373 | - this.djgq = djgq; | ||
| 374 | - } | ||
| 375 | - public int getDjgz() { | ||
| 376 | - return djgz; | ||
| 377 | - } | ||
| 378 | - public void setDjgz(int djgz) { | ||
| 379 | - this.djgz = djgz; | ||
| 380 | - } | ||
| 381 | - public int getDjgw() { | ||
| 382 | - return djgw; | ||
| 383 | - } | ||
| 384 | - public void setDjgw(int djgw) { | ||
| 385 | - this.djgw = djgw; | ||
| 386 | - } | ||
| 387 | - public int getDjgsj() { | ||
| 388 | - return djgsj; | ||
| 389 | - } | ||
| 390 | - public void setDjgsj(int djgsj) { | ||
| 391 | - this.djgsj = djgsj; | ||
| 392 | - } | ||
| 393 | - public String getRemark() { | ||
| 394 | - return remark; | ||
| 395 | - } | ||
| 396 | - public void setRemark(String remark) { | ||
| 397 | - this.remark = remark; | ||
| 398 | - } | ||
| 399 | - public String getFgsName() { | ||
| 400 | - return fgsName; | ||
| 401 | - } | ||
| 402 | - public void setFgsName(String fgsName) { | ||
| 403 | - this.fgsName = fgsName; | ||
| 404 | - } | ||
| 405 | - | ||
| 406 | -} | 1 | +package com.bsth.entity.calc; |
| 2 | + | ||
| 3 | +import java.util.Date; | ||
| 4 | + | ||
| 5 | +import javax.persistence.*; | ||
| 6 | + | ||
| 7 | +@Entity | ||
| 8 | +@Table(name = "calc_statistics") | ||
| 9 | +public class CalcStatistics { | ||
| 10 | + /* 主键*/ | ||
| 11 | + @Id | ||
| 12 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 13 | + private Long id; | ||
| 14 | + /* 日期*/ | ||
| 15 | + private Date date; | ||
| 16 | + /* 日期字符串*/ | ||
| 17 | + private String dateStr; | ||
| 18 | + /* 线路编码*/ | ||
| 19 | + private String xl; | ||
| 20 | + /* 线路名称*/ | ||
| 21 | + private String xlName; | ||
| 22 | + /* 公司代码*/ | ||
| 23 | + private String gsdm; | ||
| 24 | + /* 分公司代码*/ | ||
| 25 | + private String fgsdm; | ||
| 26 | + /* 计划总公里*/ | ||
| 27 | + private Double jhzlc; | ||
| 28 | + /* 计划营运公里*/ | ||
| 29 | + private Double jhyylc; | ||
| 30 | + /* 计划空驶公里*/ | ||
| 31 | + private Double jhkslc; | ||
| 32 | + /* 实际总公里*/ | ||
| 33 | + private Double sjzlc; | ||
| 34 | + /* 实际营运公里*/ | ||
| 35 | + private Double sjyylc; | ||
| 36 | + /* 实际空驶公里*/ | ||
| 37 | + private Double sjkslc; | ||
| 38 | + /* 少驶公里*/ | ||
| 39 | + private Double sslc; | ||
| 40 | + /* 少驶班次*/ | ||
| 41 | + private int ssbc; | ||
| 42 | + /* 路阻公里*/ | ||
| 43 | + private Double lzlc; | ||
| 44 | + /* 吊慢公里*/ | ||
| 45 | + private Double dmlc; | ||
| 46 | + /* 故障公里*/ | ||
| 47 | + private Double gzlc; | ||
| 48 | + /* 纠纷公里*/ | ||
| 49 | + private Double jflc; | ||
| 50 | + /* 肇事公里*/ | ||
| 51 | + private Double zslc; | ||
| 52 | + /* 缺人公里*/ | ||
| 53 | + private Double qrlc; | ||
| 54 | + /* 缺车公里*/ | ||
| 55 | + private Double qclc; | ||
| 56 | + /* 客稀公里*/ | ||
| 57 | + private Double kxlc; | ||
| 58 | + /* 气候公里*/ | ||
| 59 | + private Double qhlc; | ||
| 60 | + /* 援外公里*/ | ||
| 61 | + private Double ywlc; | ||
| 62 | + /* 其他公里*/ | ||
| 63 | + private Double qtlc; | ||
| 64 | + /* 临加公里*/ | ||
| 65 | + private Double ljlc; | ||
| 66 | + /* 临加空驶公里*/ | ||
| 67 | + private Double ljkslc; | ||
| 68 | + /* 计划班次*/ | ||
| 69 | + private int jhbcq; | ||
| 70 | + /* 计划班次(早高峰)*/ | ||
| 71 | + private int jhbcz; | ||
| 72 | + /* 计划班次(晚高峰)*/ | ||
| 73 | + private int jhbcw; | ||
| 74 | + /* 实际班次*/ | ||
| 75 | + private int sjbcq; | ||
| 76 | + /* 实际班次(早高峰)*/ | ||
| 77 | + private int sjbcz; | ||
| 78 | + /* 实际班次(晚高峰)*/ | ||
| 79 | + private int sjbcw; | ||
| 80 | + /* 临加班次*/ | ||
| 81 | + private int ljbcq; | ||
| 82 | + /* 临加班次(早高峰)*/ | ||
| 83 | + private int ljbcz; | ||
| 84 | + /* 临加班次(晚高峰)*/ | ||
| 85 | + private int ljbcw; | ||
| 86 | + /* 放站班次*/ | ||
| 87 | + private int fzbcq; | ||
| 88 | + /* 放站班次(早高峰)*/ | ||
| 89 | + private int fzbcz; | ||
| 90 | + /* 放站班次(晚高峰)*/ | ||
| 91 | + private int fzbcw; | ||
| 92 | + /* 调头班次*/ | ||
| 93 | + private int dtbcq; | ||
| 94 | + /* 调头班次(早高峰)*/ | ||
| 95 | + private int dtbcz; | ||
| 96 | + /* 调头班次(晚高峰)*/ | ||
| 97 | + private int dtbcw; | ||
| 98 | + /* 大间隔次数*/ | ||
| 99 | + private int djgq; | ||
| 100 | + /* 大间隔次数(早高峰)*/ | ||
| 101 | + private int djgz; | ||
| 102 | + /* 大间隔次数(晚高峰)*/ | ||
| 103 | + private int djgw; | ||
| 104 | + /* 最大大间隔时间*/ | ||
| 105 | + private int djgsj; | ||
| 106 | + /* 备注*/ | ||
| 107 | + private String remark; | ||
| 108 | + | ||
| 109 | + /*公司名字*/ | ||
| 110 | + @Transient | ||
| 111 | + private String gsName; | ||
| 112 | + /*分公司名字*/ | ||
| 113 | + @Transient | ||
| 114 | + private String fgsName; | ||
| 115 | + public Long getId() { | ||
| 116 | + return id; | ||
| 117 | + } | ||
| 118 | + public void setId(Long id) { | ||
| 119 | + this.id = id; | ||
| 120 | + } | ||
| 121 | + public Date getDate() { | ||
| 122 | + return date; | ||
| 123 | + } | ||
| 124 | + public void setDate(Date date) { | ||
| 125 | + this.date = date; | ||
| 126 | + } | ||
| 127 | + public String getDateStr() { | ||
| 128 | + return dateStr; | ||
| 129 | + } | ||
| 130 | + public void setDateStr(String dateStr) { | ||
| 131 | + this.dateStr = dateStr; | ||
| 132 | + } | ||
| 133 | + public String getXl() { | ||
| 134 | + return xl; | ||
| 135 | + } | ||
| 136 | + public void setXl(String xl) { | ||
| 137 | + this.xl = xl; | ||
| 138 | + } | ||
| 139 | + public String getXlName() { | ||
| 140 | + return xlName; | ||
| 141 | + } | ||
| 142 | + public void setXlName(String xlName) { | ||
| 143 | + this.xlName = xlName; | ||
| 144 | + } | ||
| 145 | + public String getGsdm() { | ||
| 146 | + return gsdm; | ||
| 147 | + } | ||
| 148 | + public void setGsdm(String gsdm) { | ||
| 149 | + this.gsdm = gsdm; | ||
| 150 | + } | ||
| 151 | + public String getFgsdm() { | ||
| 152 | + return fgsdm; | ||
| 153 | + } | ||
| 154 | + public void setFgsdm(String fgsdm) { | ||
| 155 | + this.fgsdm = fgsdm; | ||
| 156 | + } | ||
| 157 | + public Double getJhzlc() { | ||
| 158 | + return jhzlc; | ||
| 159 | + } | ||
| 160 | + public void setJhzlc(Double jhzlc) { | ||
| 161 | + this.jhzlc = jhzlc; | ||
| 162 | + } | ||
| 163 | + public Double getJhyylc() { | ||
| 164 | + return jhyylc; | ||
| 165 | + } | ||
| 166 | + public void setJhyylc(Double jhyylc) { | ||
| 167 | + this.jhyylc = jhyylc; | ||
| 168 | + } | ||
| 169 | + public Double getJhkslc() { | ||
| 170 | + return jhkslc; | ||
| 171 | + } | ||
| 172 | + public void setJhkslc(Double jhkslc) { | ||
| 173 | + this.jhkslc = jhkslc; | ||
| 174 | + } | ||
| 175 | + public Double getSjzlc() { | ||
| 176 | + return sjzlc; | ||
| 177 | + } | ||
| 178 | + public void setSjzlc(Double sjzlc) { | ||
| 179 | + this.sjzlc = sjzlc; | ||
| 180 | + } | ||
| 181 | + public Double getSjyylc() { | ||
| 182 | + return sjyylc; | ||
| 183 | + } | ||
| 184 | + public void setSjyylc(Double sjyylc) { | ||
| 185 | + this.sjyylc = sjyylc; | ||
| 186 | + } | ||
| 187 | + public Double getSjkslc() { | ||
| 188 | + return sjkslc; | ||
| 189 | + } | ||
| 190 | + public void setSjkslc(Double sjkslc) { | ||
| 191 | + this.sjkslc = sjkslc; | ||
| 192 | + } | ||
| 193 | + public Double getSslc() { | ||
| 194 | + return sslc; | ||
| 195 | + } | ||
| 196 | + public void setSslc(Double sslc) { | ||
| 197 | + this.sslc = sslc; | ||
| 198 | + } | ||
| 199 | + public int getSsbc() { | ||
| 200 | + return ssbc; | ||
| 201 | + } | ||
| 202 | + public void setSsbc(int ssbc) { | ||
| 203 | + this.ssbc = ssbc; | ||
| 204 | + } | ||
| 205 | + public Double getLzlc() { | ||
| 206 | + return lzlc; | ||
| 207 | + } | ||
| 208 | + public void setLzlc(Double lzlc) { | ||
| 209 | + this.lzlc = lzlc; | ||
| 210 | + } | ||
| 211 | + public Double getDmlc() { | ||
| 212 | + return dmlc; | ||
| 213 | + } | ||
| 214 | + public void setDmlc(Double dmlc) { | ||
| 215 | + this.dmlc = dmlc; | ||
| 216 | + } | ||
| 217 | + public Double getGzlc() { | ||
| 218 | + return gzlc; | ||
| 219 | + } | ||
| 220 | + public void setGzlc(Double gzlc) { | ||
| 221 | + this.gzlc = gzlc; | ||
| 222 | + } | ||
| 223 | + public Double getJflc() { | ||
| 224 | + return jflc; | ||
| 225 | + } | ||
| 226 | + public void setJflc(Double jflc) { | ||
| 227 | + this.jflc = jflc; | ||
| 228 | + } | ||
| 229 | + public Double getZslc() { | ||
| 230 | + return zslc; | ||
| 231 | + } | ||
| 232 | + public void setZslc(Double zslc) { | ||
| 233 | + this.zslc = zslc; | ||
| 234 | + } | ||
| 235 | + public Double getQrlc() { | ||
| 236 | + return qrlc; | ||
| 237 | + } | ||
| 238 | + public void setQrlc(Double qrlc) { | ||
| 239 | + this.qrlc = qrlc; | ||
| 240 | + } | ||
| 241 | + public Double getQclc() { | ||
| 242 | + return qclc; | ||
| 243 | + } | ||
| 244 | + public void setQclc(Double qclc) { | ||
| 245 | + this.qclc = qclc; | ||
| 246 | + } | ||
| 247 | + public Double getKxlc() { | ||
| 248 | + return kxlc; | ||
| 249 | + } | ||
| 250 | + public void setKxlc(Double kxlc) { | ||
| 251 | + this.kxlc = kxlc; | ||
| 252 | + } | ||
| 253 | + public Double getQhlc() { | ||
| 254 | + return qhlc; | ||
| 255 | + } | ||
| 256 | + public void setQhlc(Double qhlc) { | ||
| 257 | + this.qhlc = qhlc; | ||
| 258 | + } | ||
| 259 | + public Double getYwlc() { | ||
| 260 | + return ywlc; | ||
| 261 | + } | ||
| 262 | + public void setYwlc(Double ywlc) { | ||
| 263 | + this.ywlc = ywlc; | ||
| 264 | + } | ||
| 265 | + public Double getQtlc() { | ||
| 266 | + return qtlc; | ||
| 267 | + } | ||
| 268 | + public void setQtlc(Double qtlc) { | ||
| 269 | + this.qtlc = qtlc; | ||
| 270 | + } | ||
| 271 | + public Double getLjlc() { | ||
| 272 | + return ljlc; | ||
| 273 | + } | ||
| 274 | + public void setLjlc(Double ljlc) { | ||
| 275 | + this.ljlc = ljlc; | ||
| 276 | + } | ||
| 277 | + public Double getLjkslc() { | ||
| 278 | + return ljkslc; | ||
| 279 | + } | ||
| 280 | + public void setLjkslc(Double ljkslc) { | ||
| 281 | + this.ljkslc = ljkslc; | ||
| 282 | + } | ||
| 283 | + public int getJhbcq() { | ||
| 284 | + return jhbcq; | ||
| 285 | + } | ||
| 286 | + public void setJhbcq(int jhbcq) { | ||
| 287 | + this.jhbcq = jhbcq; | ||
| 288 | + } | ||
| 289 | + public int getJhbcz() { | ||
| 290 | + return jhbcz; | ||
| 291 | + } | ||
| 292 | + public void setJhbcz(int jhbcz) { | ||
| 293 | + this.jhbcz = jhbcz; | ||
| 294 | + } | ||
| 295 | + public int getJhbcw() { | ||
| 296 | + return jhbcw; | ||
| 297 | + } | ||
| 298 | + public void setJhbcw(int jhbcw) { | ||
| 299 | + this.jhbcw = jhbcw; | ||
| 300 | + } | ||
| 301 | + public int getSjbcq() { | ||
| 302 | + return sjbcq; | ||
| 303 | + } | ||
| 304 | + public void setSjbcq(int sjbcq) { | ||
| 305 | + this.sjbcq = sjbcq; | ||
| 306 | + } | ||
| 307 | + public int getSjbcz() { | ||
| 308 | + return sjbcz; | ||
| 309 | + } | ||
| 310 | + public void setSjbcz(int sjbcz) { | ||
| 311 | + this.sjbcz = sjbcz; | ||
| 312 | + } | ||
| 313 | + public int getSjbcw() { | ||
| 314 | + return sjbcw; | ||
| 315 | + } | ||
| 316 | + public void setSjbcw(int sjbcw) { | ||
| 317 | + this.sjbcw = sjbcw; | ||
| 318 | + } | ||
| 319 | + public int getLjbcq() { | ||
| 320 | + return ljbcq; | ||
| 321 | + } | ||
| 322 | + public void setLjbcq(int ljbcq) { | ||
| 323 | + this.ljbcq = ljbcq; | ||
| 324 | + } | ||
| 325 | + public int getLjbcz() { | ||
| 326 | + return ljbcz; | ||
| 327 | + } | ||
| 328 | + public void setLjbcz(int ljbcz) { | ||
| 329 | + this.ljbcz = ljbcz; | ||
| 330 | + } | ||
| 331 | + public int getLjbcw() { | ||
| 332 | + return ljbcw; | ||
| 333 | + } | ||
| 334 | + public void setLjbcw(int ljbcw) { | ||
| 335 | + this.ljbcw = ljbcw; | ||
| 336 | + } | ||
| 337 | + public int getFzbcq() { | ||
| 338 | + return fzbcq; | ||
| 339 | + } | ||
| 340 | + public void setFzbcq(int fzbcq) { | ||
| 341 | + this.fzbcq = fzbcq; | ||
| 342 | + } | ||
| 343 | + public int getFzbcz() { | ||
| 344 | + return fzbcz; | ||
| 345 | + } | ||
| 346 | + public void setFzbcz(int fzbcz) { | ||
| 347 | + this.fzbcz = fzbcz; | ||
| 348 | + } | ||
| 349 | + public int getFzbcw() { | ||
| 350 | + return fzbcw; | ||
| 351 | + } | ||
| 352 | + public void setFzbcw(int fzbcw) { | ||
| 353 | + this.fzbcw = fzbcw; | ||
| 354 | + } | ||
| 355 | + public int getDtbcq() { | ||
| 356 | + return dtbcq; | ||
| 357 | + } | ||
| 358 | + public void setDtbcq(int dtbcq) { | ||
| 359 | + this.dtbcq = dtbcq; | ||
| 360 | + } | ||
| 361 | + public int getDtbcz() { | ||
| 362 | + return dtbcz; | ||
| 363 | + } | ||
| 364 | + public void setDtbcz(int dtbcz) { | ||
| 365 | + this.dtbcz = dtbcz; | ||
| 366 | + } | ||
| 367 | + public int getDtbcw() { | ||
| 368 | + return dtbcw; | ||
| 369 | + } | ||
| 370 | + public void setDtbcw(int dtbcw) { | ||
| 371 | + this.dtbcw = dtbcw; | ||
| 372 | + } | ||
| 373 | + public int getDjgq() { | ||
| 374 | + return djgq; | ||
| 375 | + } | ||
| 376 | + public void setDjgq(int djgq) { | ||
| 377 | + this.djgq = djgq; | ||
| 378 | + } | ||
| 379 | + public int getDjgz() { | ||
| 380 | + return djgz; | ||
| 381 | + } | ||
| 382 | + public void setDjgz(int djgz) { | ||
| 383 | + this.djgz = djgz; | ||
| 384 | + } | ||
| 385 | + public int getDjgw() { | ||
| 386 | + return djgw; | ||
| 387 | + } | ||
| 388 | + public void setDjgw(int djgw) { | ||
| 389 | + this.djgw = djgw; | ||
| 390 | + } | ||
| 391 | + public int getDjgsj() { | ||
| 392 | + return djgsj; | ||
| 393 | + } | ||
| 394 | + public void setDjgsj(int djgsj) { | ||
| 395 | + this.djgsj = djgsj; | ||
| 396 | + } | ||
| 397 | + public String getRemark() { | ||
| 398 | + return remark; | ||
| 399 | + } | ||
| 400 | + public void setRemark(String remark) { | ||
| 401 | + this.remark = remark; | ||
| 402 | + } | ||
| 403 | + public String getGsName() { | ||
| 404 | + return gsName; | ||
| 405 | + } | ||
| 406 | + public void setGsName(String gsName) { | ||
| 407 | + this.gsName = gsName; | ||
| 408 | + } | ||
| 409 | + public String getFgsName() { | ||
| 410 | + return fgsName; | ||
| 411 | + } | ||
| 412 | + public void setFgsName(String fgsName) { | ||
| 413 | + this.fgsName = fgsName; | ||
| 414 | + } | ||
| 415 | + | ||
| 416 | +} |
src/main/java/com/bsth/entity/schedule/EmployeeConfigInfo.java
| @@ -54,6 +54,22 @@ public class EmployeeConfigInfo extends BEntity implements Serializable { | @@ -54,6 +54,22 @@ public class EmployeeConfigInfo extends BEntity implements Serializable { | ||
| 54 | @Column(nullable = false) | 54 | @Column(nullable = false) |
| 55 | private Boolean isCancel = false; | 55 | private Boolean isCancel = false; |
| 56 | 56 | ||
| 57 | + /** 驾驶员停用信息 */ | ||
| 58 | + @Formula("(" + | ||
| 59 | + "(select IFNULL(t2.destroy, 0) from bsth_c_s_ecinfo t1 left join bsth_c_personnel t2 on t1.jsy = t2.id where t1.id = id)" + | ||
| 60 | + "+" + | ||
| 61 | + "(select IFNULL(t2.destroy, 0) from bsth_c_s_ecinfo t1 left join bsth_c_personnel t2 on t1.spy = t2.id where t1.id = id)" + | ||
| 62 | + ")") | ||
| 63 | + private Integer ryDestroyStatus; | ||
| 64 | + | ||
| 65 | + public Integer getRyDestroyStatus() { | ||
| 66 | + return ryDestroyStatus; | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + public void setRyDestroyStatus(Integer ryDestroyStatus) { | ||
| 70 | + this.ryDestroyStatus = ryDestroyStatus; | ||
| 71 | + } | ||
| 72 | + | ||
| 57 | public EmployeeConfigInfo() {} | 73 | public EmployeeConfigInfo() {} |
| 58 | 74 | ||
| 59 | public EmployeeConfigInfo(Object id, Object xlid, Object xlname, Object jsyid, Object spyid) { | 75 | public EmployeeConfigInfo(Object id, Object xlid, Object xlname, Object jsyid, Object spyid) { |
src/main/java/com/bsth/repository/calc/CalcIntervalRepository.java
| @@ -33,6 +33,12 @@ public interface CalcIntervalRepository extends BaseRepository<CalcInterval, Int | @@ -33,6 +33,12 @@ public interface CalcIntervalRepository extends BaseRepository<CalcInterval, Int | ||
| 33 | @Query(value="select DISTINCT c from CalcInterval c where c.xlBm = ?1 and c.date = ?2 and c.level like %?3% order by c.xlBm") | 33 | @Query(value="select DISTINCT c from CalcInterval c where c.xlBm = ?1 and c.date = ?2 and c.level like %?3% order by c.xlBm") |
| 34 | List<CalcInterval> selectByDateAndLine(String line,String date,String level); | 34 | List<CalcInterval> selectByDateAndLine(String line,String date,String level); |
| 35 | 35 | ||
| 36 | + //按照时间段统计 | ||
| 37 | + @Query(value="select gsbm,fgsbm,xl_bm,SUM(djg_all) as djgAll,SUM(djg_gf) as djgGf,SUM(djg_dg) as djgDg,SUM(djg_zgf) as djgZgf,SUM(djg_wgf) as djgWgf,MAX(djg_time) as djgTime " | ||
| 38 | + + " from bsth_c_calc_interval where date >=?1 and date <=?2 " | ||
| 39 | + + " group by xl_bm,gsbm,fgsbm",nativeQuery=true) | ||
| 40 | + List<Object[]> countByDate(String date,String date2); | ||
| 41 | + | ||
| 36 | //按照时间段,公司统计 | 42 | //按照时间段,公司统计 |
| 37 | @Query(value="select gsbm,fgsbm,xl_bm,SUM(djg_all) as djgAll,SUM(djg_gf) as djgGf,SUM(djg_dg) as djgDg,SUM(djg_zgf) as djgZgf,SUM(djg_wgf) as djgWgf,MAX(djg_time) as djgTime " | 43 | @Query(value="select gsbm,fgsbm,xl_bm,SUM(djg_all) as djgAll,SUM(djg_gf) as djgGf,SUM(djg_dg) as djgDg,SUM(djg_zgf) as djgZgf,SUM(djg_wgf) as djgWgf,MAX(djg_time) as djgTime " |
| 38 | + " from bsth_c_calc_interval where gsbm like %?1% and fgsbm like %?2% and date >=?3 and date <=?4 " | 44 | + " from bsth_c_calc_interval where gsbm like %?1% and fgsbm like %?2% and date >=?3 and date <=?4 " |
src/main/java/com/bsth/repository/calc/CalcLineMileageRepository.java
| @@ -25,6 +25,10 @@ public interface CalcLineMileageRepository extends BaseRepository<CalcLineMileag | @@ -25,6 +25,10 @@ public interface CalcLineMileageRepository extends BaseRepository<CalcLineMileag | ||
| 25 | @Query(value="select DISTINCT c from CalcLineMileage c where c.xl = ?1 and c.dateStr between ?2 and ?3 order by c.id") | 25 | @Query(value="select DISTINCT c from CalcLineMileage c where c.xl = ?1 and c.dateStr between ?2 and ?3 order by c.id") |
| 26 | List<CalcLineMileage> selectByDateAndLineTj2(String line,String date,String date2); | 26 | List<CalcLineMileage> selectByDateAndLineTj2(String line,String date,String date2); |
| 27 | 27 | ||
| 28 | + //按照时间段统计,全部线路 | ||
| 29 | + @Query(value="select DISTINCT c from CalcLineMileage c where c.dateStr between ?1 and ?2 order by c.id") | ||
| 30 | + List<CalcLineMileage> selectByDateAndLineTj3(String date,String date2); | ||
| 31 | + | ||
| 28 | //按照日期和线路删除数据 | 32 | //按照日期和线路删除数据 |
| 29 | @Modifying | 33 | @Modifying |
| 30 | @Transactional | 34 | @Transactional |
src/main/java/com/bsth/repository/calc/CalcStatisticsRepository.java
| @@ -28,6 +28,10 @@ public interface CalcStatisticsRepository extends BaseRepository<CalcStatistics, | @@ -28,6 +28,10 @@ public interface CalcStatisticsRepository extends BaseRepository<CalcStatistics, | ||
| 28 | @Query(value="select DISTINCT c from CalcStatistics c where c.xl = ?1 and c.dateStr between ?2 and ?3 order by c.fgsdm,c.xl") | 28 | @Query(value="select DISTINCT c from CalcStatistics c where c.xl = ?1 and c.dateStr between ?2 and ?3 order by c.fgsdm,c.xl") |
| 29 | List<CalcStatistics> selectByDateAndLineTj2(String line,String date,String date2); | 29 | List<CalcStatistics> selectByDateAndLineTj2(String line,String date,String date2); |
| 30 | 30 | ||
| 31 | + //按照时间段统计 | ||
| 32 | + @Query(value="select DISTINCT c from CalcStatistics c where c.dateStr between ?1 and ?2 order by c.gsdm,c.fgsdm,c.xl") | ||
| 33 | + List<CalcStatistics> selectByDateAndLineTj3(String date,String date2); | ||
| 34 | + | ||
| 31 | //按照日期和线路删除数据 | 35 | //按照日期和线路删除数据 |
| 32 | @Modifying | 36 | @Modifying |
| 33 | @Transactional | 37 | @Transactional |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| @@ -188,6 +188,11 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -188,6 +188,11 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 188 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 188 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 189 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr >= ?2 and s.scheduleDateStr<= ?3 order by s.fgsBm,s.xlBm") | 189 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr >= ?2 and s.scheduleDateStr<= ?3 order by s.fgsBm,s.xlBm") |
| 190 | List<ScheduleRealInfo> scheduleByDateAndLineTj2(String line,String date,String date2); | 190 | List<ScheduleRealInfo> scheduleByDateAndLineTj2(String line,String date,String date2); |
| 191 | + | ||
| 192 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | ||
| 193 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr >= ?1 and s.scheduleDateStr<= ?2 order by s.gsBm,s.fgsBm,s.xlBm") | ||
| 194 | + List<ScheduleRealInfo> scheduleByDateAndLineTj3(String date,String date2); | ||
| 195 | + | ||
| 191 | //月报表 | 196 | //月报表 |
| 192 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 197 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 193 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr >= ?2 and s.scheduleDateStr<= ?3 order by s.xlBm") | 198 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr >= ?2 and s.scheduleDateStr<= ?3 order by s.xlBm") |
src/main/java/com/bsth/repository/schedule/TTInfoDetailRepository.java
| 1 | package com.bsth.repository.schedule; | 1 | package com.bsth.repository.schedule; |
| 2 | 2 | ||
| 3 | -import com.bsth.entity.schedule.CarConfigInfo; | ||
| 4 | import com.bsth.entity.schedule.TTInfoDetail; | 3 | import com.bsth.entity.schedule.TTInfoDetail; |
| 5 | import com.bsth.repository.BaseRepository; | 4 | import com.bsth.repository.BaseRepository; |
| 6 | import org.springframework.data.domain.Page; | 5 | import org.springframework.data.domain.Page; |
| @@ -10,9 +9,6 @@ import org.springframework.data.jpa.repository.EntityGraph; | @@ -10,9 +9,6 @@ import org.springframework.data.jpa.repository.EntityGraph; | ||
| 10 | import org.springframework.data.jpa.repository.Modifying; | 9 | import org.springframework.data.jpa.repository.Modifying; |
| 11 | import org.springframework.data.jpa.repository.Query; | 10 | import org.springframework.data.jpa.repository.Query; |
| 12 | import org.springframework.stereotype.Repository; | 11 | import org.springframework.stereotype.Repository; |
| 13 | -import org.springframework.transaction.annotation.Isolation; | ||
| 14 | -import org.springframework.transaction.annotation.Propagation; | ||
| 15 | -import org.springframework.transaction.annotation.Transactional; | ||
| 16 | 12 | ||
| 17 | import java.util.List; | 13 | import java.util.List; |
| 18 | 14 | ||
| @@ -42,9 +38,15 @@ public interface TTInfoDetailRepository extends BaseRepository<TTInfoDetail, Lon | @@ -42,9 +38,15 @@ public interface TTInfoDetailRepository extends BaseRepository<TTInfoDetail, Lon | ||
| 42 | @Query(value = "select max(tt.fcno) as mx from bsth_c_s_ttinfo_detail tt where tt.xl =?1 and tt.ttinfo =?2", nativeQuery = true) | 38 | @Query(value = "select max(tt.fcno) as mx from bsth_c_s_ttinfo_detail tt where tt.xl =?1 and tt.ttinfo =?2", nativeQuery = true) |
| 43 | Long findMaxFcno(Integer xlid, Long ttinfoid); | 39 | Long findMaxFcno(Integer xlid, Long ttinfoid); |
| 44 | 40 | ||
| 41 | + @Query(value = "select max(tt.bcs) as mx from bsth_c_s_ttinfo_detail tt where tt.ttinfo =?1", nativeQuery = true) | ||
| 42 | + Long findMaxBcs(Long ttinfoid); | ||
| 43 | + | ||
| 45 | @Query(value = "select tt from TTInfoDetail tt where tt.xl.id = ?1 and tt.ttinfo.id = ?2 and tt.lp.id = ?3 order by tt.fcno asc") | 44 | @Query(value = "select tt from TTInfoDetail tt where tt.xl.id = ?1 and tt.ttinfo.id = ?2 and tt.lp.id = ?3 order by tt.fcno asc") |
| 46 | List<TTInfoDetail> findBcdetails(Integer xlId, Long ttinfoId, Long lpId); | 45 | List<TTInfoDetail> findBcdetails(Integer xlId, Long ttinfoId, Long lpId); |
| 47 | 46 | ||
| 47 | + @Query(value = "select tt from TTInfoDetail tt where tt.ttinfo.id = ?1 and tt.lp.id = ?2 order by tt.fcno asc") | ||
| 48 | + List<TTInfoDetail> findBcdetails(Long ttinfoId, Long lpId); | ||
| 49 | + | ||
| 48 | List<TTInfoDetail> findByTtinfoId(Long id); | 50 | List<TTInfoDetail> findByTtinfoId(Long id); |
| 49 | 51 | ||
| 50 | @Modifying | 52 | @Modifying |
| @@ -52,6 +54,10 @@ public interface TTInfoDetailRepository extends BaseRepository<TTInfoDetail, Lon | @@ -52,6 +54,10 @@ public interface TTInfoDetailRepository extends BaseRepository<TTInfoDetail, Lon | ||
| 52 | void deleteByTtinfoIdWithModify(Long ttinfoid); | 54 | void deleteByTtinfoIdWithModify(Long ttinfoid); |
| 53 | 55 | ||
| 54 | @Modifying | 56 | @Modifying |
| 57 | + @Query(value = "delete from TTInfoDetail t where t.ttinfo.id = ?1 and t.lp.id = ?2") | ||
| 58 | + void deleteByTtinfoIdAndLpidWithModify(Long ttinfoid, Long lpid); | ||
| 59 | + | ||
| 60 | + @Modifying | ||
| 55 | @Query(value = "delete from TTInfoDetail t where t.xl.id=?1 and t.ttinfo.id = ?2") | 61 | @Query(value = "delete from TTInfoDetail t where t.xl.id=?1 and t.ttinfo.id = ?2") |
| 56 | void deltidc(int xl , Long ttinfoid ); | 62 | void deltidc(int xl , Long ttinfoid ); |
| 57 | } | 63 | } |
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
| @@ -47,6 +47,8 @@ import org.springframework.jdbc.core.RowMapper; | @@ -47,6 +47,8 @@ import org.springframework.jdbc.core.RowMapper; | ||
| 47 | import org.springframework.stereotype.Service; | 47 | import org.springframework.stereotype.Service; |
| 48 | 48 | ||
| 49 | import javax.transaction.Transactional; | 49 | import javax.transaction.Transactional; |
| 50 | + | ||
| 51 | +import java.math.BigDecimal; | ||
| 50 | import java.sql.ResultSet; | 52 | import java.sql.ResultSet; |
| 51 | import java.sql.SQLException; | 53 | import java.sql.SQLException; |
| 52 | import java.text.DecimalFormat; | 54 | import java.text.DecimalFormat; |
| @@ -738,7 +740,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -738,7 +740,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 738 | String line, String date, String date2, String xlName, String type,String nature) { | 740 | String line, String date, String date2, String xlName, String type,String nature) { |
| 739 | // TODO Auto-generated method stub | 741 | // TODO Auto-generated method stub |
| 740 | List<CalcStatistics> listAll = new ArrayList<CalcStatistics>(); | 742 | List<CalcStatistics> listAll = new ArrayList<CalcStatistics>(); |
| 741 | - if(line.length() > 0){ | 743 | + if(gsdm.equals("") && fgsdm.equals("") && line.equals("")){ |
| 744 | + listAll = calcStatisticsRepository.selectByDateAndLineTj3(date, date2); | ||
| 745 | + } else if(line.length() > 0){ | ||
| 742 | listAll = calcStatisticsRepository.selectByDateAndLineTj2(line, date, date2); | 746 | listAll = calcStatisticsRepository.selectByDateAndLineTj2(line, date, date2); |
| 743 | } else { | 747 | } else { |
| 744 | listAll = calcStatisticsRepository.selectByDateAndLineTj(line, date, date2, gsdm, fgsdm); | 748 | listAll = calcStatisticsRepository.selectByDateAndLineTj(line, date, date2, gsdm, fgsdm); |
| @@ -767,13 +771,8 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -767,13 +771,8 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 767 | 771 | ||
| 768 | for(CalcStatistics s : list){ | 772 | for(CalcStatistics s : list){ |
| 769 | try { | 773 | try { |
| 770 | -// String key = PinyinHelper.convertToPinyinString(s.getXl(), "" , PinyinFormat.WITHOUT_TONE); | ||
| 771 | - String key =s.getFgsdm()+s.getXl(); | ||
| 772 | -// if(line.equals("")){ | ||
| 773 | -// key =s.getFgsdm()+s.getXl(); | ||
| 774 | -// }else{ | ||
| 775 | -// key =s.getXl(); | ||
| 776 | -// } | 774 | +// String key =s.getGsdm()+"/"+s.getFgsdm()+"/"+s.getXl(); |
| 775 | + String key = PinyinHelper.convertToPinyinString(s.getGsdm()+s.getFgsdm()+s.getXlName(), "", PinyinFormat.WITHOUT_TONE); | ||
| 777 | if(!keyMap.containsKey(key)){ | 776 | if(!keyMap.containsKey(key)){ |
| 778 | keyMap.put(key, new ArrayList<CalcStatistics>()); | 777 | keyMap.put(key, new ArrayList<CalcStatistics>()); |
| 779 | keyList.add(key); | 778 | keyList.add(key); |
| @@ -789,18 +788,14 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -789,18 +788,14 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 789 | for(String key : keyList){ | 788 | for(String key : keyList){ |
| 790 | if(keyMap.get(key).size() > 0){ | 789 | if(keyMap.get(key).size() > 0){ |
| 791 | CalcStatistics s = keyMap.get(key).get(0); | 790 | CalcStatistics s = keyMap.get(key).get(0); |
| 792 | - if(keyMap.get(key).size() > 1) | 791 | + if(keyMap.get(key).size() > 1){ |
| 793 | for(int i = 1; i < keyMap.get(key).size(); i++){ | 792 | for(int i = 1; i < keyMap.get(key).size(); i++){ |
| 794 | CalcStatistics s_ = keyMap.get(key).get(i); | 793 | CalcStatistics s_ = keyMap.get(key).get(i); |
| 795 | s = addStatistics(s, s_); | 794 | s = addStatistics(s, s_); |
| 796 | } | 795 | } |
| 797 | -// if(line.equals("")){ | ||
| 798 | - s.setFgsName(BasicData.businessFgsCodeNameMap.get(s.getFgsdm()+"_"+s.getGsdm())); | ||
| 799 | - /*}else{ | ||
| 800 | - List<Line> l=lineRepository.findLineByCode(line); | ||
| 801 | - if(l.size()>0) | ||
| 802 | - s.setFgsName(BasicData.businessFgsCodeNameMap.get(l.get(0).getBrancheCompany()+"_"+l.get(0).getCompany())); | ||
| 803 | - }*/ | 796 | + } |
| 797 | + s.setGsName(BasicData.businessCodeNameMap.get(s.getGsdm())); | ||
| 798 | + s.setFgsName(BasicData.businessFgsCodeNameMap.get(s.getFgsdm()+"_"+s.getGsdm())); | ||
| 804 | resList.add(s); | 799 | resList.add(s); |
| 805 | } | 800 | } |
| 806 | } | 801 | } |
| @@ -809,6 +804,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -809,6 +804,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 809 | CalcStatistics temp = new CalcStatistics(); | 804 | CalcStatistics temp = new CalcStatistics(); |
| 810 | temp.setXlName("合计"); | 805 | temp.setXlName("合计"); |
| 811 | temp.setFgsName(""); | 806 | temp.setFgsName(""); |
| 807 | + temp.setGsName(""); | ||
| 812 | for(CalcStatistics s : resList){ | 808 | for(CalcStatistics s : resList){ |
| 813 | temp = addStatistics(temp, s); | 809 | temp = addStatistics(temp, s); |
| 814 | } | 810 | } |
| @@ -818,6 +814,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -818,6 +814,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 818 | List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>(); | 814 | List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>(); |
| 819 | for(CalcStatistics c : resList){ | 815 | for(CalcStatistics c : resList){ |
| 820 | Map<String, Object> m = new HashMap<String, Object>(); | 816 | Map<String, Object> m = new HashMap<String, Object>(); |
| 817 | + m.put("gsName", c.getGsName()); | ||
| 821 | m.put("fgsName", c.getFgsName()); | 818 | m.put("fgsName", c.getFgsName()); |
| 822 | m.put("xlName", c.getXlName()); | 819 | m.put("xlName", c.getXlName()); |
| 823 | m.put("jhzlc", c.getJhzlc()); | 820 | m.put("jhzlc", c.getJhzlc()); |
| @@ -888,6 +885,69 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -888,6 +885,69 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 888 | logger.info("" , e); | 885 | logger.info("" , e); |
| 889 | } | 886 | } |
| 890 | } | 887 | } |
| 888 | + | ||
| 889 | + if (type != null && type.length() != 0 && type.equals("exportAll")) { | ||
| 890 | + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); | ||
| 891 | + Map<String, Map<String, Object>> tempMap = new HashMap<String, Map<String, Object>>(); | ||
| 892 | + List<Map<String, Object>> removeList = new ArrayList<Map<String, Object>>(); | ||
| 893 | + for(Map<String, Object> m : mapList){ | ||
| 894 | + if(m.get("gsName") != null && m.get("gsName").toString().trim().length() > 0 | ||
| 895 | + && m.get("gsName").toString().trim().contains("临港")){ | ||
| 896 | + removeList.add(m); | ||
| 897 | + } | ||
| 898 | + } | ||
| 899 | + for(Map<String, Object> m : removeList){ | ||
| 900 | + mapList.remove(m); | ||
| 901 | + } | ||
| 902 | + for(Map<String, Object> m : mapList){ | ||
| 903 | + if(m.get("gsName") != null && m.get("gsName").toString().trim().length() > 0){ | ||
| 904 | + String gsName = m.get("gsName").toString().trim(); | ||
| 905 | + Map<String, Object> temp = new HashMap<String, Object>(); | ||
| 906 | + if(tempMap.get(gsName) != null){ | ||
| 907 | + temp = tempMap.get(gsName); | ||
| 908 | + } else { | ||
| 909 | + temp.put("gsName", gsName); | ||
| 910 | + temp.put("fgsName", "小计"); | ||
| 911 | + temp.put("xlName", ""); | ||
| 912 | + tempList.add(temp); | ||
| 913 | + tempMap.put(gsName, temp); | ||
| 914 | + } | ||
| 915 | + for(String key : m.keySet()){ | ||
| 916 | + try { | ||
| 917 | + temp.put(key, new BigDecimal(m.get(key).toString()).add( | ||
| 918 | + new BigDecimal(temp.get(key)!=null?temp.get(key).toString():"0"))); | ||
| 919 | + } catch (Exception e) { | ||
| 920 | + // TODO: handle exception | ||
| 921 | + } | ||
| 922 | + } | ||
| 923 | + } | ||
| 924 | + } | ||
| 925 | + mapList.addAll(mapList.size()>0?mapList.size()-1:0, tempList); | ||
| 926 | + | ||
| 927 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 928 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 929 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 930 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 931 | + m.put("date", date + "至" + date2); | ||
| 932 | + ReportUtils ee = new ReportUtils(); | ||
| 933 | + try { | ||
| 934 | + String dateTime = ""; | ||
| 935 | + if (date.equals(date2)) { | ||
| 936 | + dateTime = sdfSimple.format(sdfMonth.parse(date)); | ||
| 937 | + } else { | ||
| 938 | + dateTime = sdfSimple.format(sdfMonth.parse(date)) | ||
| 939 | + + "-" + sdfSimple.format(sdfMonth.parse(date2)); | ||
| 940 | + } | ||
| 941 | + listI.add(mapList.iterator()); | ||
| 942 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 943 | + ee.excelReplace(listI, new Object[]{m}, path + "mould/statisticsDaily_4.xls", | ||
| 944 | + path + "export/" + dateTime + "-全部公司-统计日报.xls"); | ||
| 945 | + } catch (Exception e) { | ||
| 946 | + // TODO: handle exception | ||
| 947 | + //e.printStackTrace(); | ||
| 948 | + logger.info("", e); | ||
| 949 | + } | ||
| 950 | + } | ||
| 891 | 951 | ||
| 892 | return resList; | 952 | return resList; |
| 893 | } | 953 | } |
| @@ -1512,7 +1572,11 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -1512,7 +1572,11 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 1512 | List<String> keyList = new ArrayList<String>(); | 1572 | List<String> keyList = new ArrayList<String>(); |
| 1513 | Map<String, List<CalcLineMileage>> keyMap = new HashMap<String, List<CalcLineMileage>>(); | 1573 | Map<String, List<CalcLineMileage>> keyMap = new HashMap<String, List<CalcLineMileage>>(); |
| 1514 | 1574 | ||
| 1515 | - if(line == null || line.trim().length() == 0){ | 1575 | + if((line == null || line.trim().length() == 0) |
| 1576 | + && (gsdm == null || gsdm.trim().length() == 0) | ||
| 1577 | + && (fgsdm == null || fgsdm.trim().length() == 0)){ | ||
| 1578 | + list = calcLineMileageRepository.selectByDateAndLineTj3(date, date2); | ||
| 1579 | + } else if(line == null || line.trim().length() == 0){ | ||
| 1516 | list = calcLineMileageRepository.selectByDateAndLineTj(line, date, date2, gsdm, fgsdm); | 1580 | list = calcLineMileageRepository.selectByDateAndLineTj(line, date, date2, gsdm, fgsdm); |
| 1517 | } else { | 1581 | } else { |
| 1518 | list = calcLineMileageRepository.selectByDateAndLineTj2(line, date, date2); | 1582 | list = calcLineMileageRepository.selectByDateAndLineTj2(line, date, date2); |
| @@ -1558,6 +1622,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -1558,6 +1622,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 1558 | m.put("fgsdm", c.getFgsdm()); | 1622 | m.put("fgsdm", c.getFgsdm()); |
| 1559 | m.put("fgs", c.getFgsName()); | 1623 | m.put("fgs", c.getFgsName()); |
| 1560 | } | 1624 | } |
| 1625 | + m.put("xl", c.getXl()); | ||
| 1561 | m.put("xlName", c.getXlName()); | 1626 | m.put("xlName", c.getXlName()); |
| 1562 | m.put("jhzlc", c.getJhzlc()); | 1627 | m.put("jhzlc", c.getJhzlc()); |
| 1563 | m.put("jhlc", c.getJhlc()); | 1628 | m.put("jhlc", c.getJhlc()); |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| @@ -118,6 +118,8 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | @@ -118,6 +118,8 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | ||
| 118 | 118 | ||
| 119 | List<Map<String,Object>> statisticsDaily(String line, String date, String xlName, String type); | 119 | List<Map<String,Object>> statisticsDaily(String line, String date, String xlName, String type); |
| 120 | 120 | ||
| 121 | + List<Map<String,Object>> dispatchDailySum(String date, String date2, String nature, String type); | ||
| 122 | + | ||
| 121 | List<Map<String,Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2, String xlName, String type,String nature); | 123 | List<Map<String,Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2, String xlName, String type,String nature); |
| 122 | 124 | ||
| 123 | //用于实时数据与统计数据合并查询 | 125 | //用于实时数据与统计数据合并查询 |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| 1 | package com.bsth.service.realcontrol.impl; | 1 | package com.bsth.service.realcontrol.impl; |
| 2 | 2 | ||
| 3 | import java.io.*; | 3 | import java.io.*; |
| 4 | +import java.lang.reflect.Field; | ||
| 5 | +import java.math.BigDecimal; | ||
| 4 | import java.net.HttpURLConnection; | 6 | import java.net.HttpURLConnection; |
| 5 | import java.net.MalformedURLException; | 7 | import java.net.MalformedURLException; |
| 6 | import java.net.URL; | 8 | import java.net.URL; |
| @@ -69,6 +71,7 @@ import com.bsth.entity.Cars; | @@ -69,6 +71,7 @@ import com.bsth.entity.Cars; | ||
| 69 | import com.bsth.entity.Line; | 71 | import com.bsth.entity.Line; |
| 70 | import com.bsth.entity.Personnel; | 72 | import com.bsth.entity.Personnel; |
| 71 | import com.bsth.entity.calc.CalcInterval; | 73 | import com.bsth.entity.calc.CalcInterval; |
| 74 | +import com.bsth.entity.calc.CalcStatistics; | ||
| 72 | import com.bsth.entity.oil.Dlb; | 75 | import com.bsth.entity.oil.Dlb; |
| 73 | import com.bsth.entity.oil.Ylb; | 76 | import com.bsth.entity.oil.Ylb; |
| 74 | import com.bsth.entity.oil.Ylxxb; | 77 | import com.bsth.entity.oil.Ylxxb; |
| @@ -103,6 +106,7 @@ import com.bsth.repository.schedule.GuideboardInfoRepository; | @@ -103,6 +106,7 @@ import com.bsth.repository.schedule.GuideboardInfoRepository; | ||
| 103 | import com.bsth.security.util.SecurityUtils; | 106 | import com.bsth.security.util.SecurityUtils; |
| 104 | import com.bsth.service.LineService; | 107 | import com.bsth.service.LineService; |
| 105 | import com.bsth.service.SectionRouteService; | 108 | import com.bsth.service.SectionRouteService; |
| 109 | +import com.bsth.service.calc.CalcWaybillService; | ||
| 106 | import com.bsth.service.directive.DirectiveService; | 110 | import com.bsth.service.directive.DirectiveService; |
| 107 | import com.bsth.service.impl.BaseServiceImpl; | 111 | import com.bsth.service.impl.BaseServiceImpl; |
| 108 | import com.bsth.service.realcontrol.ScheduleRealInfoService; | 112 | import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| @@ -155,6 +159,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -155,6 +159,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 155 | DictionaryService dictionaryService; | 159 | DictionaryService dictionaryService; |
| 156 | 160 | ||
| 157 | @Autowired | 161 | @Autowired |
| 162 | + CalcWaybillService calcWaybillService; | ||
| 163 | + | ||
| 164 | + @Autowired | ||
| 158 | CalcIntervalRepository calcIntervalRepository; | 165 | CalcIntervalRepository calcIntervalRepository; |
| 159 | /*@Autowired | 166 | /*@Autowired |
| 160 | BorrowCenter borrowCenter;*/ | 167 | BorrowCenter borrowCenter;*/ |
| @@ -2863,12 +2870,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2863,12 +2870,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2863 | } | 2870 | } |
| 2864 | Map<String, Object> map = new HashMap<String, Object>(); | 2871 | Map<String, Object> map = new HashMap<String, Object>(); |
| 2865 | if (list.size() > 0) { | 2872 | if (list.size() > 0) { |
| 2873 | + map.put("gsBm", list.get(0).getGsBm()); | ||
| 2866 | map.put("fgsBm", list.get(0).getFgsBm()); | 2874 | map.put("fgsBm", list.get(0).getFgsBm()); |
| 2867 | map.put("xlBm", list.get(0).getXlBm()); | 2875 | map.put("xlBm", list.get(0).getXlBm()); |
| 2868 | map.put("xlName", list.get(0).getXlName()); | 2876 | map.put("xlName", list.get(0).getXlName()); |
| 2869 | map.put("fgsName", list.get(0).getFgsName()); | 2877 | map.put("fgsName", list.get(0).getFgsName()); |
| 2878 | + map.put("gsName", list.get(0).getGsName()); | ||
| 2879 | + | ||
| 2870 | try { | 2880 | try { |
| 2871 | - map.put("xlNamePy", PinyinHelper.convertToPinyinString(list.get(0).getFgsBm()+list.get(0).getXlName(), "", PinyinFormat.WITHOUT_TONE)); | 2881 | + map.put("xlNamePy", PinyinHelper.convertToPinyinString(list.get(0).getGsBm()+list.get(0).getFgsBm()+list.get(0).getXlName(), "", PinyinFormat.WITHOUT_TONE)); |
| 2872 | } catch (PinyinException e) { | 2882 | } catch (PinyinException e) { |
| 2873 | // TODO Auto-generated catch block | 2883 | // TODO Auto-generated catch block |
| 2874 | e.printStackTrace(); | 2884 | e.printStackTrace(); |
| @@ -2948,6 +2958,250 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2948,6 +2958,250 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2948 | } | 2958 | } |
| 2949 | return map; | 2959 | return map; |
| 2950 | } | 2960 | } |
| 2961 | + | ||
| 2962 | + @Override | ||
| 2963 | + public List<Map<String, Object>> dispatchDailySum(String date, String date2, String nature, String type) { | ||
| 2964 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 2965 | + | ||
| 2966 | +// List<Map<String, Object>> list = statisticsDailyTj("", "", "", date, date2, "", "query", nature); | ||
| 2967 | + List<CalcStatistics> calc = calcWaybillService.calcStatisticsDaily("", "", "", date, date2, "", "query", nature); | ||
| 2968 | + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); | ||
| 2969 | + try { | ||
| 2970 | + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); | ||
| 2971 | + for(CalcStatistics c : calc){ | ||
| 2972 | + Map<String, Object> m = new HashMap<>(); | ||
| 2973 | + Field[] fields = c.getClass().getDeclaredFields(); | ||
| 2974 | + for(Field f : fields){ | ||
| 2975 | + f.setAccessible(true); | ||
| 2976 | + String key = new String(f.getName()); | ||
| 2977 | + m.put(key, f.get(c)); | ||
| 2978 | + } | ||
| 2979 | + tempList.add(m); | ||
| 2980 | + } | ||
| 2981 | + list = tempList; | ||
| 2982 | + } catch (Exception e) { | ||
| 2983 | + // TODO: handle exception | ||
| 2984 | + e.printStackTrace(); | ||
| 2985 | + } | ||
| 2986 | + | ||
| 2987 | + Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>(); | ||
| 2988 | + Map<String, Object> temp = new HashMap<String, Object>(); | ||
| 2989 | + temp.put("gsName", "杨高");temp.put("fgsName", "杨高分");temp.put("key", "05_5"); | ||
| 2990 | + resList.add(temp);keyMap.put("05_5", temp); | ||
| 2991 | + temp = new HashMap<String, Object>(); | ||
| 2992 | + temp.put("gsName", "杨高");temp.put("fgsName", "金桥分");temp.put("key", "05_2"); | ||
| 2993 | + resList.add(temp);keyMap.put("05_2", temp); | ||
| 2994 | + temp = new HashMap<String, Object>(); | ||
| 2995 | + temp.put("gsName", "杨高");temp.put("fgsName", "川沙分");temp.put("key", "05_1"); | ||
| 2996 | + resList.add(temp);keyMap.put("05_1", temp); | ||
| 2997 | + temp = new HashMap<String, Object>(); | ||
| 2998 | + temp.put("gsName", "杨高");temp.put("fgsName", "周浦分");temp.put("key", "05_6"); | ||
| 2999 | + resList.add(temp);keyMap.put("05_6", temp); | ||
| 3000 | + temp = new HashMap<String, Object>(); | ||
| 3001 | + temp.put("gsName", "杨高");temp.put("fgsName", "小计");temp.put("key", "05_sum"); | ||
| 3002 | + resList.add(temp);keyMap.put("05_sum", temp); | ||
| 3003 | + | ||
| 3004 | + temp = new HashMap<String, Object>(); | ||
| 3005 | + temp.put("gsName", "上南");temp.put("fgsName", "一分");temp.put("key", "55_4"); | ||
| 3006 | + resList.add(temp);keyMap.put("55_4", temp); | ||
| 3007 | + temp = new HashMap<String, Object>(); | ||
| 3008 | + temp.put("gsName", "上南");temp.put("fgsName", "二分");temp.put("key", "55_1"); | ||
| 3009 | + resList.add(temp);keyMap.put("55_1", temp); | ||
| 3010 | + temp = new HashMap<String, Object>(); | ||
| 3011 | + temp.put("gsName", "上南");temp.put("fgsName", "三分");temp.put("key", "55_2"); | ||
| 3012 | + resList.add(temp);keyMap.put("55_2", temp); | ||
| 3013 | + temp = new HashMap<String, Object>(); | ||
| 3014 | + temp.put("gsName", "上南");temp.put("fgsName", "六分");temp.put("key", "55_3"); | ||
| 3015 | + resList.add(temp);keyMap.put("55_3", temp); | ||
| 3016 | + temp = new HashMap<String, Object>(); | ||
| 3017 | + temp.put("gsName", "上南");temp.put("fgsName", "小计");temp.put("key", "55_sum"); | ||
| 3018 | + resList.add(temp);keyMap.put("55_sum", temp); | ||
| 3019 | + | ||
| 3020 | + temp = new HashMap<String, Object>(); | ||
| 3021 | + temp.put("gsName", "金高");temp.put("fgsName", "一分");temp.put("key", "22_5"); | ||
| 3022 | + resList.add(temp);keyMap.put("22_5", temp); | ||
| 3023 | + temp = new HashMap<String, Object>(); | ||
| 3024 | + temp.put("gsName", "金高");temp.put("fgsName", "二分");temp.put("key", "22_2"); | ||
| 3025 | + resList.add(temp);keyMap.put("22_2", temp); | ||
| 3026 | + temp = new HashMap<String, Object>(); | ||
| 3027 | + temp.put("gsName", "金高");temp.put("fgsName", "三分");temp.put("key", "22_3"); | ||
| 3028 | + resList.add(temp);keyMap.put("22_3", temp); | ||
| 3029 | + temp = new HashMap<String, Object>(); | ||
| 3030 | + temp.put("gsName", "金高");temp.put("fgsName", "四分");temp.put("key", "22_1"); | ||
| 3031 | + resList.add(temp);keyMap.put("22_1", temp); | ||
| 3032 | + temp = new HashMap<String, Object>(); | ||
| 3033 | + temp.put("gsName", "金高");temp.put("fgsName", "小计");temp.put("key", "22_sum"); | ||
| 3034 | + resList.add(temp);keyMap.put("22_sum", temp); | ||
| 3035 | + | ||
| 3036 | + temp = new HashMap<String, Object>(); | ||
| 3037 | + temp.put("gsName", "南汇");temp.put("fgsName", "一分");temp.put("key", "26_1"); | ||
| 3038 | + resList.add(temp);keyMap.put("26_1", temp); | ||
| 3039 | + temp = new HashMap<String, Object>(); | ||
| 3040 | + temp.put("gsName", "南汇");temp.put("fgsName", "二分");temp.put("key", "26_2"); | ||
| 3041 | + resList.add(temp);keyMap.put("26_2", temp); | ||
| 3042 | + temp = new HashMap<String, Object>(); | ||
| 3043 | + temp.put("gsName", "南汇");temp.put("fgsName", "三分");temp.put("key", "26_3"); | ||
| 3044 | + resList.add(temp);keyMap.put("26_3", temp); | ||
| 3045 | + temp = new HashMap<String, Object>(); | ||
| 3046 | + temp.put("gsName", "南汇");temp.put("fgsName", "六分");temp.put("key", "26_6"); | ||
| 3047 | + resList.add(temp);keyMap.put("26_6", temp); | ||
| 3048 | + temp = new HashMap<String, Object>(); | ||
| 3049 | + temp.put("gsName", "南汇");temp.put("fgsName", "小计");temp.put("key", "26_sum"); | ||
| 3050 | + resList.add(temp);keyMap.put("26_sum", temp); | ||
| 3051 | + | ||
| 3052 | + temp = new HashMap<String, Object>(); | ||
| 3053 | + temp.put("gsName", "浦交");temp.put("fgsName", " ");temp.put("key", "88"); | ||
| 3054 | + resList.add(temp);keyMap.put("88", temp); | ||
| 3055 | + | ||
| 3056 | + for(Map<String, Object> m : list){ | ||
| 3057 | + m.put("gsBm", m.get("gsdm")); | ||
| 3058 | + m.put("fgsBm", m.get("fgsdm")); | ||
| 3059 | + if(m.get("gsBm") != null && m.get("fgsBm") != null | ||
| 3060 | + && m.get("gsBm").toString().trim().length() > 0 | ||
| 3061 | + && m.get("fgsBm").toString().trim().length() > 0){ | ||
| 3062 | + String gsBm = m.get("gsBm").toString().trim(); | ||
| 3063 | + String fgsBm = m.get("fgsBm").toString().trim(); | ||
| 3064 | + String key = gsBm + "_" + fgsBm; | ||
| 3065 | + if(keyMap.containsKey(key)){ | ||
| 3066 | + Map<String, Object> t = keyMap.get(key); | ||
| 3067 | + for(String s : m.keySet()){ | ||
| 3068 | + if("gsName,fgsName,key".contains(s)){ | ||
| 3069 | + continue; | ||
| 3070 | + } | ||
| 3071 | + try { | ||
| 3072 | + if(t.containsKey(s)){ | ||
| 3073 | + t.put(s, new BigDecimal(t.get(s).toString()).add(new BigDecimal(m.get(s).toString()))); | ||
| 3074 | + } else { | ||
| 3075 | + t.put(s, m.get(s).toString()); | ||
| 3076 | + } | ||
| 3077 | + } catch (Exception e) { | ||
| 3078 | + // TODO: handle exception | ||
| 3079 | + continue; | ||
| 3080 | + } | ||
| 3081 | + } | ||
| 3082 | + } | ||
| 3083 | + } | ||
| 3084 | + } | ||
| 3085 | + | ||
| 3086 | + for(Map<String, Object> m : resList){ | ||
| 3087 | + String key = m.get("key").toString(); | ||
| 3088 | + if(key.contains("_sum") || key.equals("88")){ | ||
| 3089 | + continue; | ||
| 3090 | + } | ||
| 3091 | + | ||
| 3092 | + Map<String, Object> t = keyMap.get(key.split("_")[0] + "_sum"); | ||
| 3093 | + for(String s : m.keySet()){ | ||
| 3094 | + if("gsName,fgsName,key".contains(s)){ | ||
| 3095 | + continue; | ||
| 3096 | + } | ||
| 3097 | + try { | ||
| 3098 | + if(t.containsKey(s)){ | ||
| 3099 | + t.put(s, new BigDecimal(t.get(s).toString()).add(new BigDecimal(m.get(s).toString()))); | ||
| 3100 | + } else { | ||
| 3101 | + t.put(s, m.get(s).toString()); | ||
| 3102 | + } | ||
| 3103 | + } catch (Exception e) { | ||
| 3104 | + // TODO: handle exception | ||
| 3105 | + continue; | ||
| 3106 | + } | ||
| 3107 | + } | ||
| 3108 | + | ||
| 3109 | + t = keyMap.get("88"); | ||
| 3110 | + for(String s : m.keySet()){ | ||
| 3111 | + if("gsName,fgsName,key".contains(s)){ | ||
| 3112 | + continue; | ||
| 3113 | + } | ||
| 3114 | + try { | ||
| 3115 | + if(t.containsKey(s)){ | ||
| 3116 | + t.put(s, new BigDecimal(t.get(s).toString()).add(new BigDecimal(m.get(s).toString()))); | ||
| 3117 | + } else { | ||
| 3118 | + t.put(s, m.get(s).toString()); | ||
| 3119 | + } | ||
| 3120 | + } catch (Exception e) { | ||
| 3121 | + // TODO: handle exception | ||
| 3122 | + continue; | ||
| 3123 | + } | ||
| 3124 | + } | ||
| 3125 | + } | ||
| 3126 | + | ||
| 3127 | + for(Map<String, Object> m : resList){ | ||
| 3128 | + try { | ||
| 3129 | + m.put("jhzlc", m.get("jhzlc")); | ||
| 3130 | + m.put("jhlc", m.get("jhyylc")); | ||
| 3131 | + m.put("jcclc", m.get("jhkslc")); | ||
| 3132 | + m.put("sjzgl", m.get("sjzlc")); | ||
| 3133 | + m.put("sjgl", m.get("sjyylc")); | ||
| 3134 | + m.put("sjksgl", m.get("sjkslc")); | ||
| 3135 | + m.put("ssbc", m.get("ssbc")); | ||
| 3136 | + m.put("ssgl", m.get("sslc")); | ||
| 3137 | + m.put("ssgl_lz", m.get("lzlc")); | ||
| 3138 | + m.put("ssgl_dm", m.get("dmlc")); | ||
| 3139 | + m.put("ssgl_gz", m.get("gzlc")); | ||
| 3140 | + m.put("ssgl_jf", m.get("jflc")); | ||
| 3141 | + m.put("ssgl_zs", m.get("zslc")); | ||
| 3142 | + m.put("ssgl_qr", m.get("qrlc")); | ||
| 3143 | + m.put("ssgl_qc", m.get("qclc")); | ||
| 3144 | + m.put("ssgl_kx", m.get("kxlc")); | ||
| 3145 | + m.put("ssgl_qh", m.get("qhlc")); | ||
| 3146 | + m.put("ssgl_yw", m.get("ywlc")); | ||
| 3147 | + m.put("ssgl_other", m.get("qtlc")); | ||
| 3148 | + m.put("ljgl", m.get("ljlc")); | ||
| 3149 | + m.put("ljks", m.get("ljkslc")); | ||
| 3150 | + m.put("jhbc", m.get("jhbcq")); | ||
| 3151 | + m.put("jhbc_m", m.get("jhbcz")); | ||
| 3152 | + m.put("jhbc_a", m.get("jhbcw")); | ||
| 3153 | + m.put("sjbc", m.get("sjbcq")); | ||
| 3154 | + m.put("sjbc_m", m.get("sjbcz")); | ||
| 3155 | + m.put("sjbc_a", m.get("sjbcw")); | ||
| 3156 | + m.put("ljbc", m.get("ljbcq")); | ||
| 3157 | + m.put("ljbc_m", m.get("ljbcz")); | ||
| 3158 | + m.put("ljbc_a", m.get("ljbcw")); | ||
| 3159 | + m.put("fzbc", m.get("fzbcq")); | ||
| 3160 | + m.put("fzbc_m", m.get("fzbcz")); | ||
| 3161 | + m.put("fzbc_a", m.get("fzbcw")); | ||
| 3162 | + m.put("dtbc", m.get("dtbcq")); | ||
| 3163 | + m.put("dtbc_m", m.get("dtbcz")); | ||
| 3164 | + m.put("dtbc_a", m.get("dtbcw")); | ||
| 3165 | + m.put("djg", m.get("djgq")); | ||
| 3166 | + m.put("djg_m", m.get("djgz")); | ||
| 3167 | + m.put("djg_a", m.get("djgw")); | ||
| 3168 | + m.put("djg_time", m.get("djgsj")); | ||
| 3169 | + m.put("ljzgl", new BigDecimal(m.get("ljgl").toString()).add(new BigDecimal(m.get("ljks").toString()))); | ||
| 3170 | + } catch (Exception e) { | ||
| 3171 | + // TODO: handle exception | ||
| 3172 | + m.put("ljzgl", ""); | ||
| 3173 | + continue; | ||
| 3174 | + } | ||
| 3175 | + } | ||
| 3176 | + | ||
| 3177 | + if (type != null && type.length() != 0 && type.equals("export")) { | ||
| 3178 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 3179 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 3180 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 3181 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 3182 | + m.put("date", date); | ||
| 3183 | + ReportUtils ee = new ReportUtils(); | ||
| 3184 | + try { | ||
| 3185 | + String dateTime = ""; | ||
| 3186 | + if (date.equals(date2)) { | ||
| 3187 | + dateTime = sdfSimple.format(sdfMonth.parse(date)); | ||
| 3188 | + } else { | ||
| 3189 | + dateTime = sdfSimple.format(sdfMonth.parse(date)) | ||
| 3190 | + + "-" + sdfSimple.format(sdfMonth.parse(date2)); | ||
| 3191 | + } | ||
| 3192 | + listI.add(resList.iterator()); | ||
| 3193 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 3194 | + ee.excelReplace(listI, new Object[]{m}, path + "mould/dispatchDailySum.xls", | ||
| 3195 | + path + "export/" + dateTime + "-调度日报汇总表.xls"); | ||
| 3196 | + } catch (Exception e) { | ||
| 3197 | + // TODO: handle exception | ||
| 3198 | + //e.printStackTrace(); | ||
| 3199 | + logger.info("", e); | ||
| 3200 | + } | ||
| 3201 | + } | ||
| 3202 | + | ||
| 3203 | + return resList; | ||
| 3204 | + } | ||
| 2951 | 3205 | ||
| 2952 | @Override | 3206 | @Override |
| 2953 | public List<Map<String, Object>> statisticsDailyTj(String gsdm, String fgsdm, String line, String date, String date2, | 3207 | public List<Map<String, Object>> statisticsDailyTj(String gsdm, String fgsdm, String line, String date, String date2, |
| @@ -2957,7 +3211,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2957,7 +3211,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2957 | List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); | 3211 | List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); |
| 2958 | List<Object[]> listInterval=new ArrayList<Object[]>(); | 3212 | List<Object[]> listInterval=new ArrayList<Object[]>(); |
| 2959 | line = line.trim(); | 3213 | line = line.trim(); |
| 2960 | - if (line.equals("")) { | 3214 | + if(gsdm.equals("") && fgsdm.equals("") && line.equals("")){ |
| 3215 | + //查询所有公司 | ||
| 3216 | + listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj3(date, date2); | ||
| 3217 | + listInterval = calcIntervalRepository.countByDate(date, date2); | ||
| 3218 | + } else if (line.equals("")) { | ||
| 2961 | //查询所有线路 | 3219 | //查询所有线路 |
| 2962 | listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date, date2, gsdm, fgsdm); | 3220 | listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date, date2, gsdm, fgsdm); |
| 2963 | listInterval = calcIntervalRepository.countByDateAndLine(gsdm, fgsdm, date, date2); | 3221 | listInterval = calcIntervalRepository.countByDateAndLine(gsdm, fgsdm, date, date2); |
| @@ -3012,7 +3270,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3012,7 +3270,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3012 | List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>(); | 3270 | List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>(); |
| 3013 | for (int i = 0; i < list.size(); i++) { | 3271 | for (int i = 0; i < list.size(); i++) { |
| 3014 | if (i < list.size() - 1) { | 3272 | if (i < list.size() - 1) { |
| 3015 | - if ((list.get(i+1).getFgsBm()+list.get(i + 1).getXlBm()).equals(list.get(i).getFgsBm()+list.get(i).getXlBm())) { | 3273 | + if ((list.get(i+1).getGsBm()+"/"+list.get(i+1).getFgsBm()+"/"+list.get(i+1).getXlBm()).equals( |
| 3274 | + list.get(i).getGsBm()+"/"+list.get(i).getFgsBm()+"/"+list.get(i).getXlBm())) { | ||
| 3016 | lists.add(list.get(i)); | 3275 | lists.add(list.get(i)); |
| 3017 | } else { | 3276 | } else { |
| 3018 | lists.add(list.get(i)); | 3277 | lists.add(list.get(i)); |
| @@ -3025,7 +3284,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3025,7 +3284,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3025 | lists = new ArrayList<ScheduleRealInfo>(); | 3284 | lists = new ArrayList<ScheduleRealInfo>(); |
| 3026 | } | 3285 | } |
| 3027 | } else { | 3286 | } else { |
| 3028 | - if ((list.get(i).getFgsBm()+list.get(i).getXlBm()).equals(list.get(i - 1).getFgsBm()+list.get(i - 1).getXlBm())) { | 3287 | + if ((list.get(i).getGsBm()+"/"+list.get(i).getFgsBm()+"/"+list.get(i).getXlBm()).equals( |
| 3288 | + list.get(i-1).getGsBm()+"/"+list.get(i-1).getFgsBm()+"/"+list.get(i-1).getXlBm())) { | ||
| 3029 | lists.add(list.get(i)); | 3289 | lists.add(list.get(i)); |
| 3030 | Map<String, Object> mm=new HashMap<String,Object>(); | 3290 | Map<String, Object> mm=new HashMap<String,Object>(); |
| 3031 | if(mapInterval.get(lists.get(0).getGsBm()+"-"+lists.get(0).getFgsBm()+"-"+lists.get(0).getXlBm())!=null){ | 3291 | if(mapInterval.get(lists.get(0).getGsBm()+"-"+lists.get(0).getFgsBm()+"-"+lists.get(0).getXlBm())!=null){ |
| @@ -3045,15 +3305,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3045,15 +3305,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3045 | } | 3305 | } |
| 3046 | } | 3306 | } |
| 3047 | } | 3307 | } |
| 3048 | - /*if(!line.equals("")){ | ||
| 3049 | - List<Line> l=lineRepository.findLineByCode(line); | ||
| 3050 | - if(l.size()>0) | ||
| 3051 | - lMap.get(0).put("fgsName", BasicData.businessFgsCodeNameMap.get(l.get(0).getBrancheCompany()+"_"+l.get(0).getCompany())); | ||
| 3052 | - }*/ | 3308 | + |
| 3053 | Collections.sort(lMap, new AccountXlbm()); | 3309 | Collections.sort(lMap, new AccountXlbm()); |
| 3054 | Map<String, Object> map = new HashMap<String, Object>(); | 3310 | Map<String, Object> map = new HashMap<String, Object>(); |
| 3055 | map.put("xlName", "合计"); | 3311 | map.put("xlName", "合计"); |
| 3056 | map.put("fgsName", ""); | 3312 | map.put("fgsName", ""); |
| 3313 | + map.put("gsName", ""); | ||
| 3057 | double jhyygl = culateService.culateJhgl(list);//计划营运公里 | 3314 | double jhyygl = culateService.culateJhgl(list);//计划营运公里 |
| 3058 | double jhjcclc = culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里) | 3315 | double jhjcclc = culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里) |
| 3059 | map.put("jhlc", jhyygl); | 3316 | map.put("jhlc", jhyygl); |
| @@ -3145,6 +3402,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3145,6 +3402,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3145 | map.put("djg_time", "0"); | 3402 | map.put("djg_time", "0"); |
| 3146 | } | 3403 | } |
| 3147 | lMap.add(map); | 3404 | lMap.add(map); |
| 3405 | + | ||
| 3148 | if (type != null && type.length() != 0 && type.equals("export")) { | 3406 | if (type != null && type.length() != 0 && type.equals("export")) { |
| 3149 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 3407 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 3150 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 3408 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| @@ -3170,8 +3428,71 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3170,8 +3428,71 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3170 | logger.info("", e); | 3428 | logger.info("", e); |
| 3171 | } | 3429 | } |
| 3172 | } | 3430 | } |
| 3173 | - | ||
| 3174 | - return lMap; | 3431 | + |
| 3432 | + if (type != null && type.length() != 0 && type.equals("exportAll")) { | ||
| 3433 | + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); | ||
| 3434 | + Map<String, Map<String, Object>> tempMap = new HashMap<String, Map<String, Object>>(); | ||
| 3435 | + List<Map<String, Object>> removeList = new ArrayList<Map<String, Object>>(); | ||
| 3436 | + for(Map<String, Object> m : lMap){ | ||
| 3437 | + if(m.get("gsName") != null && m.get("gsName").toString().trim().length() > 0 | ||
| 3438 | + && m.get("gsName").toString().trim().contains("临港")){ | ||
| 3439 | + removeList.add(m); | ||
| 3440 | + } | ||
| 3441 | + } | ||
| 3442 | + for(Map<String, Object> m : removeList){ | ||
| 3443 | + lMap.remove(m); | ||
| 3444 | + } | ||
| 3445 | + for(Map<String, Object> m : lMap){ | ||
| 3446 | + if(m.get("gsName") != null && m.get("gsName").toString().trim().length() > 0){ | ||
| 3447 | + String gsName = m.get("gsName").toString().trim(); | ||
| 3448 | + Map<String, Object> temp = new HashMap<String, Object>(); | ||
| 3449 | + if(tempMap.get(gsName) != null){ | ||
| 3450 | + temp = tempMap.get(gsName); | ||
| 3451 | + } else { | ||
| 3452 | + temp.put("gsName", gsName); | ||
| 3453 | + temp.put("fgsName", "小计"); | ||
| 3454 | + temp.put("xlName", ""); | ||
| 3455 | + tempList.add(temp); | ||
| 3456 | + tempMap.put(gsName, temp); | ||
| 3457 | + } | ||
| 3458 | + for(String key : m.keySet()){ | ||
| 3459 | + try { | ||
| 3460 | + temp.put(key, new BigDecimal(m.get(key).toString()).add( | ||
| 3461 | + new BigDecimal(temp.get(key)!=null?temp.get(key).toString():"0"))); | ||
| 3462 | + } catch (Exception e) { | ||
| 3463 | + // TODO: handle exception | ||
| 3464 | + } | ||
| 3465 | + } | ||
| 3466 | + } | ||
| 3467 | + } | ||
| 3468 | + lMap.addAll(lMap.size()>0?lMap.size()-1:0, tempList); | ||
| 3469 | + | ||
| 3470 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 3471 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 3472 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 3473 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 3474 | + m.put("date", date + "至" + date2); | ||
| 3475 | + ReportUtils ee = new ReportUtils(); | ||
| 3476 | + try { | ||
| 3477 | + String dateTime = ""; | ||
| 3478 | + if (date.equals(date2)) { | ||
| 3479 | + dateTime = sdfSimple.format(sdfMonth.parse(date)); | ||
| 3480 | + } else { | ||
| 3481 | + dateTime = sdfSimple.format(sdfMonth.parse(date)) | ||
| 3482 | + + "-" + sdfSimple.format(sdfMonth.parse(date2)); | ||
| 3483 | + } | ||
| 3484 | + listI.add(lMap.iterator()); | ||
| 3485 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 3486 | + ee.excelReplace(listI, new Object[]{m}, path + "mould/statisticsDaily_4.xls", | ||
| 3487 | + path + "export/" + dateTime + "-全部公司-统计日报.xls"); | ||
| 3488 | + } catch (Exception e) { | ||
| 3489 | + // TODO: handle exception | ||
| 3490 | + //e.printStackTrace(); | ||
| 3491 | + logger.info("", e); | ||
| 3492 | + } | ||
| 3493 | + } | ||
| 3494 | + | ||
| 3495 | + return lMap; | ||
| 3175 | } | 3496 | } |
| 3176 | 3497 | ||
| 3177 | @Override | 3498 | @Override |
src/main/java/com/bsth/service/report/ReportService.java
| @@ -49,6 +49,8 @@ public interface ReportService { | @@ -49,6 +49,8 @@ public interface ReportService { | ||
| 49 | 49 | ||
| 50 | List<Map<String, String>> userList(Map<String, Object> map); | 50 | List<Map<String, String>> userList(Map<String, Object> map); |
| 51 | 51 | ||
| 52 | + List<Map<String, Object>> countMileageSum(Map<String, Object> map); | ||
| 53 | + | ||
| 52 | List<Map<String, Object>> countByList(Map<String, Object> map); | 54 | List<Map<String, Object>> countByList(Map<String, Object> map); |
| 53 | List<Map<String, Object>> countByList2(Map<String, Object> map); | 55 | List<Map<String, Object>> countByList2(Map<String, Object> map); |
| 54 | 56 |
src/main/java/com/bsth/service/report/impl/CalcSheetServiceImpl.java
| @@ -124,6 +124,33 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | @@ -124,6 +124,33 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | ||
| 124 | } | 124 | } |
| 125 | } | 125 | } |
| 126 | } | 126 | } |
| 127 | + | ||
| 128 | + CalcSheet temp = new CalcSheet(); | ||
| 129 | + temp.setGsname(""); | ||
| 130 | + temp.setFgsname(""); | ||
| 131 | + temp.setXlName("合计"); | ||
| 132 | + for(CalcSheet s : list){ | ||
| 133 | + temp.setJhszfcs(Long.valueOf(s.getJhszfcs()!=null?s.getJhszfcs():"0") | ||
| 134 | + + Long.valueOf(temp.getJhszfcs()!=null?temp.getJhszfcs():"0") + ""); | ||
| 135 | + temp.setSjszfczds(Long.valueOf(s.getSjszfczds()!=null?s.getSjszfczds():"0") | ||
| 136 | + + Long.valueOf(temp.getSjszfczds()!=null?temp.getSjszfczds():"0") + ""); | ||
| 137 | + temp.setSjszddzds(Long.valueOf(s.getSjszddzds()!=null?s.getSjszddzds():"0") | ||
| 138 | + + Long.valueOf(temp.getSjszddzds()!=null?temp.getSjszddzds():"0") + ""); | ||
| 139 | + } | ||
| 140 | + Long jhfc = Long.valueOf(temp.getJhszfcs()!=null?temp.getJhszfcs():"0"); | ||
| 141 | + Long zdfc = Long.valueOf(temp.getSjszfczds()!=null?temp.getSjszfczds():"0"); | ||
| 142 | + Long zddd = Long.valueOf(temp.getSjszddzds()!=null?temp.getSjszddzds():"0"); | ||
| 143 | + if(jhfc > 0l){ | ||
| 144 | + double zdl = (zdfc*1.0)/(jhfc*1.0)*100; | ||
| 145 | + temp.setSzfczdl(df.format(zdl)+"%"); | ||
| 146 | + zdl = (zddd*1.0)/(jhfc*1.0)*100; | ||
| 147 | + temp.setSzddzdl(df.format(zdl)+"%"); | ||
| 148 | + }else{ | ||
| 149 | + temp.setSzfczdl("0.0%"); | ||
| 150 | + temp.setSzddzdl("0.0%"); | ||
| 151 | + } | ||
| 152 | + list.add(temp); | ||
| 153 | + | ||
| 127 | if(map.get("type").equals("export")){ | 154 | if(map.get("type").equals("export")){ |
| 128 | String lineName=""; | 155 | String lineName=""; |
| 129 | if(!line.equals("")){ | 156 | if(!line.equals("")){ |
| @@ -137,9 +164,9 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | @@ -137,9 +164,9 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | ||
| 137 | for (int i = 0; i < list.size(); i++) { | 164 | for (int i = 0; i < list.size(); i++) { |
| 138 | CalcSheet c=list.get(i); | 165 | CalcSheet c=list.get(i); |
| 139 | Map<String, Object> m=new HashMap<String,Object>(); | 166 | Map<String, Object> m=new HashMap<String,Object>(); |
| 140 | - m.put("gs", c.getGsname()); | ||
| 141 | - m.put("fgs", c.getFgsname()); | ||
| 142 | - m.put("line", c.getXlName()); | 167 | + m.put("gs", c.getGsname()!=null?c.getGsname():""); |
| 168 | + m.put("fgs", c.getFgsname()!=null?c.getFgsname():""); | ||
| 169 | + m.put("line", c.getXlName()!=null?c.getXlName():""); | ||
| 143 | m.put("bcs", c.getJhszfcs()); | 170 | m.put("bcs", c.getJhszfcs()); |
| 144 | m.put("zdbcs", c.getSjszfczds()); | 171 | m.put("zdbcs", c.getSjszfczds()); |
| 145 | m.put("zdlv", c.getSzfczdl()); | 172 | m.put("zdlv", c.getSzfczdl()); |
| @@ -1021,21 +1048,30 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | @@ -1021,21 +1048,30 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | ||
| 1021 | String type=map.get("type").toString(); | 1048 | String type=map.get("type").toString(); |
| 1022 | final String dates=date; | 1049 | final String dates=date; |
| 1023 | String sql_=""; | 1050 | String sql_=""; |
| 1024 | - if(line.equals("")){ | ||
| 1025 | - sql_= " and gsdm ='"+gs+"' and fgsdm like '%"+fgs+"%'"; | 1051 | + List<String> objList = new ArrayList<String>(); |
| 1052 | + objList.add(startDate); | ||
| 1053 | + objList.add(endDate); | ||
| 1054 | + if("".equals(gs.trim()) && "".equals(fgs.trim()) && "".equals(line.trim())){ | ||
| 1055 | + | ||
| 1056 | + } else if(line.equals("")){ | ||
| 1057 | + sql_= " and gsdm = ? and fgsdm like CONCAT('%',?,'%') "; | ||
| 1058 | + objList.add(gs); | ||
| 1059 | + objList.add(fgs); | ||
| 1026 | }else{ | 1060 | }else{ |
| 1027 | - sql_=" and xl='"+line+"'"; | 1061 | + sql_=" and xl = ? "; |
| 1062 | + objList.add(line); | ||
| 1028 | } | 1063 | } |
| 1029 | String sql="select t.*,y.warrant_car as qzpcs from (" | 1064 | String sql="select t.*,y.warrant_car as qzpcs from (" |
| 1030 | + " select gsdm,fgsdm,xl,xl_name,sum(jhcc) as jhcc,sum(sjcc) as sjcc," | 1065 | + " select gsdm,fgsdm,xl,xl_name,sum(jhcc) as jhcc,sum(sjcc) as sjcc," |
| 1031 | + " sum(sjcczgf) as sjcczgf,sum(jhbcs) as jhbcs,sum(sjbcs) as sjbcs " | 1066 | + " sum(sjcczgf) as sjcczgf,sum(jhbcs) as jhbcs,sum(sjbcs) as sjbcs " |
| 1032 | - + " from bsth_c_calc_sheet where date >='"+startDate+"' and date <='"+endDate+"'" | 1067 | + + " from bsth_c_calc_sheet where date >= ? and date <= ? " |
| 1033 | + sql_ | 1068 | + sql_ |
| 1034 | + " group by gsdm,fgsdm,xl,xl_name ) " | 1069 | + " group by gsdm,fgsdm,xl,xl_name ) " |
| 1035 | + " t LEFT JOIN bsth_c_line y " | 1070 | + " t LEFT JOIN bsth_c_line y " |
| 1036 | - + " on t.xl=y.line_code order by fgsdm,xl_name"; | ||
| 1037 | - List<Map<String, Object>> lists=jdbcTemplate.query(sql, | ||
| 1038 | - new RowMapper<Map<String, Object>>(){ | 1071 | + + " on t.xl=y.line_code order by gsdm,fgsdm,xl_name"; |
| 1072 | + List<Map<String, Object>> lists=jdbcTemplate.query(sql, | ||
| 1073 | + objList.toArray(), | ||
| 1074 | + new RowMapper<Map<String, Object>>(){ | ||
| 1039 | @Override | 1075 | @Override |
| 1040 | public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | 1076 | public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { |
| 1041 | Map<String, Object> s=new HashMap<String,Object>(); | 1077 | Map<String, Object> s=new HashMap<String,Object>(); |
| @@ -1124,7 +1160,7 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | @@ -1124,7 +1160,7 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | ||
| 1124 | Map<String, Object> tempMap=new HashMap<String,Object>(); | 1160 | Map<String, Object> tempMap=new HashMap<String,Object>(); |
| 1125 | tempMap.put("rq", "分类汇总"); | 1161 | tempMap.put("rq", "分类汇总"); |
| 1126 | tempMap.put("line_", "共" + list.size() + "条线路"); | 1162 | tempMap.put("line_", "共" + list.size() + "条线路"); |
| 1127 | - tempMap.put("xlName", "共" +count + "条线路"); | 1163 | + tempMap.put("xlName", "共" + count + "条线路"); |
| 1128 | tempMap.put("jhcc", jhcc); | 1164 | tempMap.put("jhcc", jhcc); |
| 1129 | tempMap.put("sjcc", sjcc); | 1165 | tempMap.put("sjcc", sjcc); |
| 1130 | tempMap.put("sjcczgf", sjcczgf); | 1166 | tempMap.put("sjcczgf", sjcczgf); |
| @@ -1144,6 +1180,7 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | @@ -1144,6 +1180,7 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | ||
| 1144 | }else{ | 1180 | }else{ |
| 1145 | tempMap.put("zxl", "0.00%"); | 1181 | tempMap.put("zxl", "0.00%"); |
| 1146 | } | 1182 | } |
| 1183 | + | ||
| 1147 | if (type.equals("export")) { | 1184 | if (type.equals("export")) { |
| 1148 | String lineName=map.get("lineName").toString(); | 1185 | String lineName=map.get("lineName").toString(); |
| 1149 | ReportUtils ee = new ReportUtils(); | 1186 | ReportUtils ee = new ReportUtils(); |
| @@ -1152,6 +1189,82 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | @@ -1152,6 +1189,82 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | ||
| 1152 | ee.excelReplace(listI, new Object[] { tempMap }, path + "mould/calcTurnoutrate.xls", path + "export/" | 1189 | ee.excelReplace(listI, new Object[] { tempMap }, path + "mould/calcTurnoutrate.xls", path + "export/" |
| 1153 | + dates + "-" + lineName + "-营运线路出车率统计表.xls"); | 1190 | + dates + "-" + lineName + "-营运线路出车率统计表.xls"); |
| 1154 | } | 1191 | } |
| 1192 | + | ||
| 1193 | + if (type.equals("exportAll")) { | ||
| 1194 | + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); | ||
| 1195 | + Map<String, Map<String, Object>> tempKeyMap = new HashMap<String, Map<String, Object>>(); | ||
| 1196 | + List<Map<String, Object>> removeList = new ArrayList<Map<String, Object>>(); | ||
| 1197 | + for(Map<String, Object> m : list){ | ||
| 1198 | + if(m.get("gsName") != null && m.get("gsName").toString().trim().length() > 0 | ||
| 1199 | + && m.get("gsName").toString().trim().contains("临港")){ | ||
| 1200 | + removeList.add(m); | ||
| 1201 | + } | ||
| 1202 | + } | ||
| 1203 | + for(Map<String, Object> m : removeList){ | ||
| 1204 | + list.remove(m); | ||
| 1205 | + } | ||
| 1206 | + for(Map<String, Object> m : list){ | ||
| 1207 | + if(m.get("gsName")!=null && m.get("gsName").toString().trim().length() > 0){ | ||
| 1208 | + Map<String, Object> temp = new HashMap<String, Object>(); | ||
| 1209 | + String gsName = m.get("gsName").toString().trim(); | ||
| 1210 | + if(tempKeyMap.containsKey(gsName)){ | ||
| 1211 | + temp = tempKeyMap.get(gsName); | ||
| 1212 | + temp.put("count", Long.valueOf(temp.get("count").toString()) + 1); | ||
| 1213 | + temp.put("jhcc", Long.valueOf(m.get("jhcc")!=null?m.get("jhcc").toString():"0") | ||
| 1214 | + + Long.valueOf(temp.get("jhcc")!=null?temp.get("jhcc").toString():"0")); | ||
| 1215 | + temp.put("sjcc", Long.valueOf(m.get("sjcc")!=null?m.get("sjcc").toString():"0") | ||
| 1216 | + + Long.valueOf(temp.get("sjcc")!=null?temp.get("sjcc").toString():"0")); | ||
| 1217 | + temp.put("sjcczgf", Long.valueOf(m.get("sjcczgf")!=null?m.get("sjcczgf").toString():"0") | ||
| 1218 | + + Long.valueOf(temp.get("sjcczgf")!=null?temp.get("sjcczgf").toString():"0")); | ||
| 1219 | + temp.put("jhbc", Long.valueOf(m.get("jhbc")!=null?m.get("jhbc").toString():"0") | ||
| 1220 | + + Long.valueOf(temp.get("jhbc")!=null?temp.get("jhbc").toString():"0")); | ||
| 1221 | + temp.put("sjbc", Long.valueOf(m.get("sjbc")!=null?m.get("sjbc").toString():"0") | ||
| 1222 | + + Long.valueOf(temp.get("sjbc")!=null?temp.get("sjbc").toString():"0")); | ||
| 1223 | + temp.put("qzpcs", Long.valueOf(m.get("qzpcs")!=null?m.get("qzpcs").toString():"0") | ||
| 1224 | + + Long.valueOf(temp.get("qzpcs")!=null?temp.get("qzpcs").toString():"0")); | ||
| 1225 | + } else { | ||
| 1226 | + temp.put("rq", ""); | ||
| 1227 | + temp.put("gsName", gsName); | ||
| 1228 | + temp.put("fgsName", "小计"); | ||
| 1229 | + temp.put("count", 1); | ||
| 1230 | + temp.put("jhcc", m.get("jhcc")!=null?m.get("jhcc").toString()+"":"0"); | ||
| 1231 | + temp.put("sjcc", m.get("sjcc")!=null?m.get("sjcc").toString()+"":"0"); | ||
| 1232 | + temp.put("sjcczgf", m.get("sjcczgf")!=null?m.get("sjcczgf").toString()+"":"0"); | ||
| 1233 | + temp.put("jhbc", m.get("jhbc")!=null?m.get("jhbc").toString()+"":"0"); | ||
| 1234 | + temp.put("sjbc", m.get("sjbc")!=null?m.get("sjbc").toString()+"":"0"); | ||
| 1235 | + temp.put("qzpcs", m.get("qzpcs")!=null?m.get("qzpcs").toString()+"":"0"); | ||
| 1236 | + temp.put("sm", ""); | ||
| 1237 | + tempList.add(temp); | ||
| 1238 | + tempKeyMap.put(gsName, temp); | ||
| 1239 | + } | ||
| 1240 | + } | ||
| 1241 | + } | ||
| 1242 | + | ||
| 1243 | + for(Map<String, Object> m : tempList){ | ||
| 1244 | + m.put("line_", "共" + m.get("count").toString() + "条线路"); | ||
| 1245 | + m.put("xlName", "共" + m.get("count").toString() + "条线路"); | ||
| 1246 | + if(m.get("jhcc")!=null && Long.valueOf(m.get("jhcc").toString()) > 0l){ | ||
| 1247 | + m.put("ccl", df.format((Float.valueOf(m.get("sjcc").toString()) / Long.valueOf(m.get("jhcc").toString()))*100)+"%"); | ||
| 1248 | + m.put("cclzgf", df.format((Float.valueOf(m.get("sjcczgf").toString()) / Long.valueOf(m.get("jhcc").toString()))*100)+"%"); | ||
| 1249 | + }else{ | ||
| 1250 | + m.put("ccl", "0.00%"); | ||
| 1251 | + m.put("cclzgf", "0.00%"); | ||
| 1252 | + } | ||
| 1253 | + if(m.get("jhbc")!=null && Long.valueOf(m.get("jhbc").toString()) > 0l){ | ||
| 1254 | + m.put("zxl", df.format((Float.valueOf(m.get("sjbc").toString()) / Long.valueOf(m.get("jhbc").toString()))*100)+"%"); | ||
| 1255 | + }else{ | ||
| 1256 | + m.put("zxl", "0.00%"); | ||
| 1257 | + } | ||
| 1258 | + list.add(m); | ||
| 1259 | + } | ||
| 1260 | + | ||
| 1261 | + ReportUtils ee = new ReportUtils(); | ||
| 1262 | + listI.add(list.iterator()); | ||
| 1263 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 1264 | + ee.excelReplace(listI, new Object[] { tempMap }, path + "mould/calcTurnoutrate.xls", path + "export/" | ||
| 1265 | + + dates + "-全部公司-营运线路出车率统计表.xls"); | ||
| 1266 | + } | ||
| 1267 | + | ||
| 1155 | list.add(tempMap); | 1268 | list.add(tempMap); |
| 1156 | return list; | 1269 | return list; |
| 1157 | } | 1270 | } |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| 1 | package com.bsth.service.report.impl; | 1 | package com.bsth.service.report.impl; |
| 2 | import com.bsth.common.ResponseCode; | 2 | import com.bsth.common.ResponseCode; |
| 3 | import com.bsth.data.BasicData; | 3 | import com.bsth.data.BasicData; |
| 4 | -import com.bsth.entity.CarDevice; | ||
| 5 | import com.bsth.entity.Line; | 4 | import com.bsth.entity.Line; |
| 6 | import com.bsth.entity.Personnel; | 5 | import com.bsth.entity.Personnel; |
| 7 | import com.bsth.entity.StationRoute; | 6 | import com.bsth.entity.StationRoute; |
| 7 | +import com.bsth.entity.calc.CalcStatistics; | ||
| 8 | import com.bsth.entity.excep.ArrivalInfo; | 8 | import com.bsth.entity.excep.ArrivalInfo; |
| 9 | -import com.bsth.entity.mcy_forms.Daily; | ||
| 10 | import com.bsth.entity.mcy_forms.Singledata; | 9 | import com.bsth.entity.mcy_forms.Singledata; |
| 11 | import com.bsth.entity.oil.Dlb; | 10 | import com.bsth.entity.oil.Dlb; |
| 12 | import com.bsth.entity.oil.Ylb; | 11 | import com.bsth.entity.oil.Ylb; |
| @@ -17,6 +16,7 @@ import com.bsth.entity.sys.Interval; | @@ -17,6 +16,7 @@ import com.bsth.entity.sys.Interval; | ||
| 17 | import com.bsth.repository.LineRepository; | 16 | import com.bsth.repository.LineRepository; |
| 18 | import com.bsth.repository.StationRouteRepository; | 17 | import com.bsth.repository.StationRouteRepository; |
| 19 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 18 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 19 | +import com.bsth.service.LineService; | ||
| 20 | import com.bsth.service.calc.CalcWaybillService; | 20 | import com.bsth.service.calc.CalcWaybillService; |
| 21 | import com.bsth.service.report.CulateMileageService; | 21 | import com.bsth.service.report.CulateMileageService; |
| 22 | import com.bsth.service.report.ReportService; | 22 | import com.bsth.service.report.ReportService; |
| @@ -26,10 +26,8 @@ import com.bsth.util.ComparableChild; | @@ -26,10 +26,8 @@ import com.bsth.util.ComparableChild; | ||
| 26 | import com.bsth.util.ComparableJob; | 26 | import com.bsth.util.ComparableJob; |
| 27 | import com.bsth.util.ReportUtils; | 27 | import com.bsth.util.ReportUtils; |
| 28 | import com.bsth.util.db.DBUtils_MS; | 28 | import com.bsth.util.db.DBUtils_MS; |
| 29 | -import com.google.protobuf.StringValue; | ||
| 30 | 29 | ||
| 31 | import org.apache.commons.lang.StringUtils; | 30 | import org.apache.commons.lang.StringUtils; |
| 32 | -import org.apache.poi.hssf.usermodel.HSSFWorkbook; | ||
| 33 | import org.slf4j.Logger; | 31 | import org.slf4j.Logger; |
| 34 | import org.slf4j.LoggerFactory; | 32 | import org.slf4j.LoggerFactory; |
| 35 | import org.springframework.beans.factory.annotation.Autowired; | 33 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -37,7 +35,7 @@ import org.springframework.jdbc.core.JdbcTemplate; | @@ -37,7 +35,7 @@ import org.springframework.jdbc.core.JdbcTemplate; | ||
| 37 | import org.springframework.jdbc.core.RowMapper; | 35 | import org.springframework.jdbc.core.RowMapper; |
| 38 | import org.springframework.stereotype.Service; | 36 | import org.springframework.stereotype.Service; |
| 39 | 37 | ||
| 40 | -import java.io.FileOutputStream; | 38 | +import java.math.BigDecimal; |
| 41 | import java.sql.Connection; | 39 | import java.sql.Connection; |
| 42 | import java.sql.PreparedStatement; | 40 | import java.sql.PreparedStatement; |
| 43 | import java.sql.ResultSet; | 41 | import java.sql.ResultSet; |
| @@ -47,8 +45,6 @@ import java.text.ParseException; | @@ -47,8 +45,6 @@ import java.text.ParseException; | ||
| 47 | import java.text.SimpleDateFormat; | 45 | import java.text.SimpleDateFormat; |
| 48 | import java.util.*; | 46 | import java.util.*; |
| 49 | 47 | ||
| 50 | -import javax.persistence.criteria.CriteriaBuilder.In; | ||
| 51 | - | ||
| 52 | @Service | 48 | @Service |
| 53 | public class ReportServiceImpl implements ReportService{ | 49 | public class ReportServiceImpl implements ReportService{ |
| 54 | 50 | ||
| @@ -72,6 +68,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -72,6 +68,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 72 | @Autowired | 68 | @Autowired |
| 73 | CulateMileageService culateService; | 69 | CulateMileageService culateService; |
| 74 | @Autowired | 70 | @Autowired |
| 71 | + LineService lineService; | ||
| 72 | + @Autowired | ||
| 75 | LineRepository lineRepository; | 73 | LineRepository lineRepository; |
| 76 | @Autowired | 74 | @Autowired |
| 77 | StationRouteRepository stationRouteRepository; | 75 | StationRouteRepository stationRouteRepository; |
| @@ -2509,6 +2507,222 @@ public class ReportServiceImpl implements ReportService{ | @@ -2509,6 +2507,222 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2509 | List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd); | 2507 | List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd); |
| 2510 | return listStation; | 2508 | return listStation; |
| 2511 | } | 2509 | } |
| 2510 | + | ||
| 2511 | + @Override | ||
| 2512 | + public List<Map<String, Object>> countMileageSum(Map<String, Object> map) { | ||
| 2513 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 2514 | + | ||
| 2515 | + String date="", date2=""; | ||
| 2516 | + if(map.get("date")!=null){ | ||
| 2517 | + date=map.get("date").toString(); | ||
| 2518 | + } | ||
| 2519 | + if(map.get("date2")!=null){ | ||
| 2520 | + date2=map.get("date2").toString(); | ||
| 2521 | + } | ||
| 2522 | + String nature="0"; | ||
| 2523 | + if(map.get("nature")!=null){ | ||
| 2524 | + nature=map.get("nature").toString(); | ||
| 2525 | + } | ||
| 2526 | + String type=""; | ||
| 2527 | + if(map.get("type")!=null){ | ||
| 2528 | + type=map.get("type").toString(); | ||
| 2529 | + } | ||
| 2530 | +// Map<String, Object> param = new HashMap<String, Object>(); | ||
| 2531 | +// param.put("date", date); | ||
| 2532 | +// param.put("date2", date2); | ||
| 2533 | +// param.put("nature", nature); | ||
| 2534 | +// param.put("type", "query"); | ||
| 2535 | +// List<Map<String, Object>> list = countByList(param); | ||
| 2536 | + List<Map<String, Object>> listAll = calcWaybillService.getLineMileage("", "", "", date, date2, "", "", "", "query"); | ||
| 2537 | + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); | ||
| 2538 | + Map<String, Boolean> lineMap=lineService.lineNature(); | ||
| 2539 | + if(nature.equals("0")){ | ||
| 2540 | + list=listAll; | ||
| 2541 | + }else{ | ||
| 2542 | + for (Map<String, Object> m : listAll) { | ||
| 2543 | + if(m.get("xl") != null && m.get("xl").toString().trim().length() > 0){ | ||
| 2544 | + if(nature.equals("1")){ | ||
| 2545 | + if(lineMap.get(m.get("xl").toString())){ | ||
| 2546 | + list.add(m); | ||
| 2547 | + } | ||
| 2548 | + }else{ | ||
| 2549 | + if(!lineMap.get(m.get("xl").toString())){ | ||
| 2550 | + list.add(m); | ||
| 2551 | + } | ||
| 2552 | + } | ||
| 2553 | + } | ||
| 2554 | + } | ||
| 2555 | + } | ||
| 2556 | + | ||
| 2557 | + Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>(); | ||
| 2558 | + Map<String, Object> temp = new HashMap<String, Object>(); | ||
| 2559 | + temp.put("gsName", "杨高");temp.put("fgsName", "杨高分");temp.put("key", "05_5"); | ||
| 2560 | + resList.add(temp);keyMap.put("05_5", temp); | ||
| 2561 | + temp = new HashMap<String, Object>(); | ||
| 2562 | + temp.put("gsName", "杨高");temp.put("fgsName", "金桥分");temp.put("key", "05_2"); | ||
| 2563 | + resList.add(temp);keyMap.put("05_2", temp); | ||
| 2564 | + temp = new HashMap<String, Object>(); | ||
| 2565 | + temp.put("gsName", "杨高");temp.put("fgsName", "川沙分");temp.put("key", "05_1"); | ||
| 2566 | + resList.add(temp);keyMap.put("05_1", temp); | ||
| 2567 | + temp = new HashMap<String, Object>(); | ||
| 2568 | + temp.put("gsName", "杨高");temp.put("fgsName", "周浦分");temp.put("key", "05_6"); | ||
| 2569 | + resList.add(temp);keyMap.put("05_6", temp); | ||
| 2570 | + temp = new HashMap<String, Object>(); | ||
| 2571 | + temp.put("gsName", "杨高");temp.put("fgsName", "小计");temp.put("key", "05_sum"); | ||
| 2572 | + resList.add(temp);keyMap.put("05_sum", temp); | ||
| 2573 | + | ||
| 2574 | + temp = new HashMap<String, Object>(); | ||
| 2575 | + temp.put("gsName", "上南");temp.put("fgsName", "一分");temp.put("key", "55_4"); | ||
| 2576 | + resList.add(temp);keyMap.put("55_4", temp); | ||
| 2577 | + temp = new HashMap<String, Object>(); | ||
| 2578 | + temp.put("gsName", "上南");temp.put("fgsName", "二分");temp.put("key", "55_1"); | ||
| 2579 | + resList.add(temp);keyMap.put("55_1", temp); | ||
| 2580 | + temp = new HashMap<String, Object>(); | ||
| 2581 | + temp.put("gsName", "上南");temp.put("fgsName", "三分");temp.put("key", "55_2"); | ||
| 2582 | + resList.add(temp);keyMap.put("55_2", temp); | ||
| 2583 | + temp = new HashMap<String, Object>(); | ||
| 2584 | + temp.put("gsName", "上南");temp.put("fgsName", "六分");temp.put("key", "55_3"); | ||
| 2585 | + resList.add(temp);keyMap.put("55_3", temp); | ||
| 2586 | + temp = new HashMap<String, Object>(); | ||
| 2587 | + temp.put("gsName", "上南");temp.put("fgsName", "小计");temp.put("key", "55_sum"); | ||
| 2588 | + resList.add(temp);keyMap.put("55_sum", temp); | ||
| 2589 | + | ||
| 2590 | + temp = new HashMap<String, Object>(); | ||
| 2591 | + temp.put("gsName", "金高");temp.put("fgsName", "一分");temp.put("key", "22_5"); | ||
| 2592 | + resList.add(temp);keyMap.put("22_5", temp); | ||
| 2593 | + temp = new HashMap<String, Object>(); | ||
| 2594 | + temp.put("gsName", "金高");temp.put("fgsName", "二分");temp.put("key", "22_2"); | ||
| 2595 | + resList.add(temp);keyMap.put("22_2", temp); | ||
| 2596 | + temp = new HashMap<String, Object>(); | ||
| 2597 | + temp.put("gsName", "金高");temp.put("fgsName", "三分");temp.put("key", "22_3"); | ||
| 2598 | + resList.add(temp);keyMap.put("22_3", temp); | ||
| 2599 | + temp = new HashMap<String, Object>(); | ||
| 2600 | + temp.put("gsName", "金高");temp.put("fgsName", "四分");temp.put("key", "22_1"); | ||
| 2601 | + resList.add(temp);keyMap.put("22_1", temp); | ||
| 2602 | + temp = new HashMap<String, Object>(); | ||
| 2603 | + temp.put("gsName", "金高");temp.put("fgsName", "小计");temp.put("key", "22_sum"); | ||
| 2604 | + resList.add(temp);keyMap.put("22_sum", temp); | ||
| 2605 | + | ||
| 2606 | + temp = new HashMap<String, Object>(); | ||
| 2607 | + temp.put("gsName", "南汇");temp.put("fgsName", "一分");temp.put("key", "26_1"); | ||
| 2608 | + resList.add(temp);keyMap.put("26_1", temp); | ||
| 2609 | + temp = new HashMap<String, Object>(); | ||
| 2610 | + temp.put("gsName", "南汇");temp.put("fgsName", "二分");temp.put("key", "26_2"); | ||
| 2611 | + resList.add(temp);keyMap.put("26_2", temp); | ||
| 2612 | + temp = new HashMap<String, Object>(); | ||
| 2613 | + temp.put("gsName", "南汇");temp.put("fgsName", "三分");temp.put("key", "26_3"); | ||
| 2614 | + resList.add(temp);keyMap.put("26_3", temp); | ||
| 2615 | + temp = new HashMap<String, Object>(); | ||
| 2616 | + temp.put("gsName", "南汇");temp.put("fgsName", "六分");temp.put("key", "26_6"); | ||
| 2617 | + resList.add(temp);keyMap.put("26_6", temp); | ||
| 2618 | + temp = new HashMap<String, Object>(); | ||
| 2619 | + temp.put("gsName", "南汇");temp.put("fgsName", "小计");temp.put("key", "26_sum"); | ||
| 2620 | + resList.add(temp);keyMap.put("26_sum", temp); | ||
| 2621 | + | ||
| 2622 | + temp = new HashMap<String, Object>(); | ||
| 2623 | + temp.put("gsName", "浦交");temp.put("fgsName", " ");temp.put("key", "88"); | ||
| 2624 | + resList.add(temp);keyMap.put("88", temp); | ||
| 2625 | + | ||
| 2626 | + for(Map<String, Object> m : list){ | ||
| 2627 | + m.put("gsBm", m.get("gsdm")); | ||
| 2628 | + m.put("fgsBm", m.get("fgsdm")); | ||
| 2629 | + if(m.get("gsBm") != null && m.get("fgsBm") != null | ||
| 2630 | + && m.get("gsBm").toString().trim().length() > 0 | ||
| 2631 | + && m.get("fgsBm").toString().trim().length() > 0){ | ||
| 2632 | + String gsBm = m.get("gsBm").toString().trim(); | ||
| 2633 | + String fgsBm = m.get("fgsBm").toString().trim(); | ||
| 2634 | + String key = gsBm + "_" + fgsBm; | ||
| 2635 | + if(keyMap.containsKey(key)){ | ||
| 2636 | + Map<String, Object> t = keyMap.get(key); | ||
| 2637 | + for(String s : m.keySet()){ | ||
| 2638 | + if("gsName,fgsName,key".contains(s)){ | ||
| 2639 | + continue; | ||
| 2640 | + } | ||
| 2641 | + try { | ||
| 2642 | + if(t.containsKey(s)){ | ||
| 2643 | + t.put(s, new BigDecimal(t.get(s).toString()).add(new BigDecimal(m.get(s).toString()))); | ||
| 2644 | + } else { | ||
| 2645 | + t.put(s, m.get(s).toString()); | ||
| 2646 | + } | ||
| 2647 | + } catch (Exception e) { | ||
| 2648 | + // TODO: handle exception | ||
| 2649 | + continue; | ||
| 2650 | + } | ||
| 2651 | + } | ||
| 2652 | + } | ||
| 2653 | + } | ||
| 2654 | + } | ||
| 2655 | + | ||
| 2656 | + for(Map<String, Object> m : resList){ | ||
| 2657 | + String key = m.get("key").toString(); | ||
| 2658 | + if(key.contains("_sum") || key.equals("88")){ | ||
| 2659 | + continue; | ||
| 2660 | + } | ||
| 2661 | + | ||
| 2662 | + Map<String, Object> t = keyMap.get(key.split("_")[0] + "_sum"); | ||
| 2663 | + for(String s : m.keySet()){ | ||
| 2664 | + if("gsName,fgsName,key".contains(s)){ | ||
| 2665 | + continue; | ||
| 2666 | + } | ||
| 2667 | + try { | ||
| 2668 | + if(t.containsKey(s)){ | ||
| 2669 | + t.put(s, new BigDecimal(t.get(s).toString()).add(new BigDecimal(m.get(s).toString()))); | ||
| 2670 | + } else { | ||
| 2671 | + t.put(s, m.get(s).toString()); | ||
| 2672 | + } | ||
| 2673 | + } catch (Exception e) { | ||
| 2674 | + // TODO: handle exception | ||
| 2675 | + continue; | ||
| 2676 | + } | ||
| 2677 | + } | ||
| 2678 | + | ||
| 2679 | + t = keyMap.get("88"); | ||
| 2680 | + for(String s : m.keySet()){ | ||
| 2681 | + if("gsName,fgsName,key".contains(s)){ | ||
| 2682 | + continue; | ||
| 2683 | + } | ||
| 2684 | + try { | ||
| 2685 | + if(t.containsKey(s)){ | ||
| 2686 | + t.put(s, new BigDecimal(t.get(s).toString()).add(new BigDecimal(m.get(s).toString()))); | ||
| 2687 | + } else { | ||
| 2688 | + t.put(s, m.get(s).toString()); | ||
| 2689 | + } | ||
| 2690 | + } catch (Exception e) { | ||
| 2691 | + // TODO: handle exception | ||
| 2692 | + continue; | ||
| 2693 | + } | ||
| 2694 | + } | ||
| 2695 | + } | ||
| 2696 | + | ||
| 2697 | + if(type.equals("export")){ | ||
| 2698 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 2699 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 2700 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 2701 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 2702 | + m.put("date", date); | ||
| 2703 | + String xls="countMileageSum.xls"; | ||
| 2704 | + ReportUtils ee = new ReportUtils(); | ||
| 2705 | + try { | ||
| 2706 | + String dateTime = ""; | ||
| 2707 | + if(date.equals(date2)){ | ||
| 2708 | + dateTime = sdfSimple.format(sdfMonth.parse(date)); | ||
| 2709 | + } else { | ||
| 2710 | + dateTime = sdfSimple.format(sdfMonth.parse(date)) | ||
| 2711 | + +"-"+sdfSimple.format(sdfMonth.parse(date2)); | ||
| 2712 | + } | ||
| 2713 | + listI.add(resList.iterator()); | ||
| 2714 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 2715 | + ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls, | ||
| 2716 | + path + "export/"+dateTime+"-审计公里汇总表.xls"); | ||
| 2717 | + } catch (Exception e) { | ||
| 2718 | + // TODO: handle exception | ||
| 2719 | + e.printStackTrace(); | ||
| 2720 | + } | ||
| 2721 | + } | ||
| 2722 | + | ||
| 2723 | + return resList; | ||
| 2724 | + } | ||
| 2725 | + | ||
| 2512 | @Override | 2726 | @Override |
| 2513 | public List<Map<String, Object>> countByList(Map<String, Object> map) { | 2727 | public List<Map<String, Object>> countByList(Map<String, Object> map) { |
| 2514 | // TODO Auto-generated method stub | 2728 | // TODO Auto-generated method stub |
| @@ -2538,6 +2752,10 @@ public class ReportServiceImpl implements ReportService{ | @@ -2538,6 +2752,10 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2538 | if(map.get("xlName")!=null){ | 2752 | if(map.get("xlName")!=null){ |
| 2539 | xlName=map.get("xlName").toString(); | 2753 | xlName=map.get("xlName").toString(); |
| 2540 | } | 2754 | } |
| 2755 | + String nature="0"; | ||
| 2756 | + if(map.get("nature")!=null){ | ||
| 2757 | + nature=map.get("nature").toString(); | ||
| 2758 | + } | ||
| 2541 | String type=""; | 2759 | String type=""; |
| 2542 | if(map.get("type")!=null){ | 2760 | if(map.get("type")!=null){ |
| 2543 | type=map.get("type").toString(); | 2761 | type=map.get("type").toString(); |
| @@ -2545,7 +2763,9 @@ public class ReportServiceImpl implements ReportService{ | @@ -2545,7 +2763,9 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2545 | //所有班次信息 | 2763 | //所有班次信息 |
| 2546 | List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | 2764 | List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); |
| 2547 | line =line.trim(); | 2765 | line =line.trim(); |
| 2548 | - if(line.equals("")){ | 2766 | + if(gsdm.equals("") && fgsdm.equals("") && line.equals("")){ |
| 2767 | + list = scheduleRealInfoRepository.scheduleByDateAndLineTj3(date, date2); | ||
| 2768 | + } else if(line.equals("")){ | ||
| 2549 | //查询所有线路 | 2769 | //查询所有线路 |
| 2550 | list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm); | 2770 | list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm); |
| 2551 | }else{ | 2771 | }else{ |
| @@ -2553,20 +2773,28 @@ public class ReportServiceImpl implements ReportService{ | @@ -2553,20 +2773,28 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2553 | list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2); | 2773 | list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2); |
| 2554 | } | 2774 | } |
| 2555 | 2775 | ||
| 2776 | + Map<String, Boolean> lineMap = lineService.lineNature(); | ||
| 2777 | + | ||
| 2778 | + List<String> objList = new ArrayList<String>(); | ||
| 2556 | String sql="select r.xl_bm" | 2779 | String sql="select r.xl_bm" |
| 2557 | + " from bsth_c_s_sp_info_real r where" | 2780 | + " from bsth_c_s_sp_info_real r where" |
| 2558 | - + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'"; | ||
| 2559 | - | ||
| 2560 | - | ||
| 2561 | - if(line.equals("")){ | ||
| 2562 | - sql +="and r.gs_bm='"+gsdm+"' " | ||
| 2563 | - + " and r.fgs_bm='"+fgsdm+"'"; | 2781 | + + " r.schedule_date_str BETWEEN ? and ?"; |
| 2782 | + objList.add(date); | ||
| 2783 | + objList.add(date2); | ||
| 2784 | + if("".equals(gsdm.trim()) && "".equals(fgsdm.trim()) && "".equals(line.trim())){ | ||
| 2785 | + | ||
| 2786 | + } else if(line.equals("")){ | ||
| 2787 | + sql +=" and r.gs_bm=?" | ||
| 2788 | + + " and r.fgs_bm like CONCAT('%',?,'%')"; | ||
| 2789 | + objList.add(gsdm); | ||
| 2790 | + objList.add(fgsdm); | ||
| 2564 | }else{ | 2791 | }else{ |
| 2565 | - sql += " and r.xl_bm = '"+line+"'"; | 2792 | + sql += " and r.xl_bm = ?"; |
| 2793 | + objList.add(line); | ||
| 2566 | } | 2794 | } |
| 2567 | sql += " group by r.xl_bm"; | 2795 | sql += " group by r.xl_bm"; |
| 2568 | 2796 | ||
| 2569 | - List<String> listLine=jdbcTemplate.query(sql, new RowMapper<String>() { | 2797 | + List<String> listLine=jdbcTemplate.query(sql, objList.toArray(), new RowMapper<String>() { |
| 2570 | @Override | 2798 | @Override |
| 2571 | public String mapRow(ResultSet arg0, int arg1) throws SQLException { | 2799 | public String mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 2572 | String ve = arg0.getString("xl_bm"); | 2800 | String ve = arg0.getString("xl_bm"); |
| @@ -2576,6 +2804,18 @@ public class ReportServiceImpl implements ReportService{ | @@ -2576,6 +2804,18 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2576 | for (int i = 0; i < listLine.size(); i++) { | 2804 | for (int i = 0; i < listLine.size(); i++) { |
| 2577 | List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); | 2805 | List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); |
| 2578 | String lineStr=listLine.get(i); | 2806 | String lineStr=listLine.get(i); |
| 2807 | + if("0".equals(nature)){ // 全部 | ||
| 2808 | + | ||
| 2809 | + } else if("1".equals(nature)){ // 营运 | ||
| 2810 | + if(!(lineMap.containsKey(lineStr) && lineMap.get(lineStr))){ | ||
| 2811 | + continue; | ||
| 2812 | + } | ||
| 2813 | + } else { // 非营运 | ||
| 2814 | + if(lineMap.containsKey(lineStr) && lineMap.get(lineStr)){ | ||
| 2815 | + continue; | ||
| 2816 | + } | ||
| 2817 | + } | ||
| 2818 | + | ||
| 2579 | for (int j = 0; j < list.size(); j++) { | 2819 | for (int j = 0; j < list.size(); j++) { |
| 2580 | ScheduleRealInfo s=list.get(j); | 2820 | ScheduleRealInfo s=list.get(j); |
| 2581 | if(s.getXlBm().equals(lineStr)){ | 2821 | if(s.getXlBm().equals(lineStr)){ |
| @@ -2756,6 +2996,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -2756,6 +2996,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2756 | map.put("fgs", ""); | 2996 | map.put("fgs", ""); |
| 2757 | }else{ | 2997 | }else{ |
| 2758 | map.put("xlName", list.get(0).getXlName()); | 2998 | map.put("xlName", list.get(0).getXlName()); |
| 2999 | + map.put("gsBm", list.get(0).getGsBm()); | ||
| 3000 | + map.put("fgsBm", list.get(0).getFgsBm()); | ||
| 2759 | map.put("gs", list.get(0).getGsName()); | 3001 | map.put("gs", list.get(0).getGsName()); |
| 2760 | map.put("fgs", list.get(0).getFgsName()); | 3002 | map.put("fgs", list.get(0).getFgsName()); |
| 2761 | map.put("jGh", list.get(0).getjGh()); | 3003 | map.put("jGh", list.get(0).getjGh()); |
src/main/java/com/bsth/service/schedule/EmployeeConfigInfoService.java
| @@ -30,8 +30,8 @@ public interface EmployeeConfigInfoService extends BService<EmployeeConfigInfo, | @@ -30,8 +30,8 @@ public interface EmployeeConfigInfoService extends BService<EmployeeConfigInfo, | ||
| 30 | void validate_jsy_destroy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException; | 30 | void validate_jsy_destroy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException; |
| 31 | // 验证售票员是否停用 | 31 | // 验证售票员是否停用 |
| 32 | void validate_spy_destroy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException; | 32 | void validate_spy_destroy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException; |
| 33 | - // 获取线路人员配置停用信息描述 | ||
| 34 | - List<String> validate_get_destroy_info(List<CompanyAuthority> companyAuthorityList); | 33 | + // 获取人员停用信息(使用排班信息辅助判定) |
| 34 | + List<String> validate_get_destory_info(); | ||
| 35 | 35 | ||
| 36 | void toggleCancel(Long id) throws ScheduleException; | 36 | void toggleCancel(Long id) throws ScheduleException; |
| 37 | Long getMaxDbbm(Integer xlId); | 37 | Long getMaxDbbm(Integer xlId); |
src/main/java/com/bsth/service/schedule/TTInfoDetailService.java
| @@ -34,6 +34,36 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { | @@ -34,6 +34,36 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { | ||
| 34 | DataToolsFile exportDynamicTTinfo(TTinfoDetailDynamicData.DTInfos dtInfos, DataToolsFileType type) throws ScheduleException; | 34 | DataToolsFile exportDynamicTTinfo(TTinfoDetailDynamicData.DTInfos dtInfos, DataToolsFileType type) throws ScheduleException; |
| 35 | 35 | ||
| 36 | /** | 36 | /** |
| 37 | + * 导出时刻表预览视图信息。 | ||
| 38 | + * @param ttInfoId 时刻表Id | ||
| 39 | + * @return | ||
| 40 | + * @throws ScheduleException | ||
| 41 | + */ | ||
| 42 | + DataToolsFile exportPvInfo(Long ttInfoId) throws ScheduleException; | ||
| 43 | + | ||
| 44 | + /** | ||
| 45 | + * 添加路牌(默认添加一个班次)。 | ||
| 46 | + * @param ttInfoId 时刻表Id | ||
| 47 | + * @param lpId 路牌Id | ||
| 48 | + */ | ||
| 49 | + void addLp(Long ttInfoId, Long lpId); | ||
| 50 | + | ||
| 51 | + /** | ||
| 52 | + * 删除指定路牌的所有班次。 | ||
| 53 | + * @param ttInfoId 时刻表Id | ||
| 54 | + * @param lpId 路牌Id | ||
| 55 | + */ | ||
| 56 | + void removeBcByLp(Long ttInfoId, Long lpId); | ||
| 57 | + | ||
| 58 | + /** | ||
| 59 | + * 将路牌A的班次和路牌B的班次调换。 | ||
| 60 | + * @param ttInfoId 时刻表Id | ||
| 61 | + * @param lpAId 路牌AId | ||
| 62 | + * @param lpBId 路牌BId | ||
| 63 | + */ | ||
| 64 | + void switchBcByLp(Long ttInfoId, Long lpAId, Long lpBId); | ||
| 65 | + | ||
| 66 | + /** | ||
| 37 | * 获取时刻表最大发车顺序号 | 67 | * 获取时刻表最大发车顺序号 |
| 38 | * @param xlid 线路id | 68 | * @param xlid 线路id |
| 39 | * @param ttinfoid 时刻表id | 69 | * @param ttinfoid 时刻表id |
src/main/java/com/bsth/service/schedule/impl/EmployeeConfigInfoServiceImpl.java
| @@ -4,6 +4,7 @@ import com.bsth.entity.Personnel; | @@ -4,6 +4,7 @@ import com.bsth.entity.Personnel; | ||
| 4 | import com.bsth.entity.schedule.EmployeeConfigInfo; | 4 | import com.bsth.entity.schedule.EmployeeConfigInfo; |
| 5 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | 5 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; |
| 6 | import com.bsth.entity.sys.CompanyAuthority; | 6 | import com.bsth.entity.sys.CompanyAuthority; |
| 7 | +import com.bsth.entity.sys.Module; | ||
| 7 | import com.bsth.repository.PersonnelRepository; | 8 | import com.bsth.repository.PersonnelRepository; |
| 8 | import com.bsth.service.schedule.EmployeeConfigInfoService; | 9 | import com.bsth.service.schedule.EmployeeConfigInfoService; |
| 9 | import com.bsth.service.schedule.EmployeeService; | 10 | import com.bsth.service.schedule.EmployeeService; |
| @@ -11,11 +12,15 @@ import com.bsth.service.schedule.ScheduleRule1FlatService; | @@ -11,11 +12,15 @@ import com.bsth.service.schedule.ScheduleRule1FlatService; | ||
| 11 | import com.bsth.service.schedule.exception.ScheduleException; | 12 | import com.bsth.service.schedule.exception.ScheduleException; |
| 12 | import com.bsth.service.schedule.utils.DataToolsFile; | 13 | import com.bsth.service.schedule.utils.DataToolsFile; |
| 13 | import com.bsth.service.schedule.utils.DataToolsService; | 14 | import com.bsth.service.schedule.utils.DataToolsService; |
| 15 | +import com.bsth.service.sys.ModuleService; | ||
| 16 | +import com.bsth.util.DateUtils; | ||
| 17 | +import org.apache.commons.lang3.time.DateFormatUtils; | ||
| 14 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 15 | import org.springframework.beans.factory.annotation.Qualifier; | 19 | import org.springframework.beans.factory.annotation.Qualifier; |
| 16 | import org.springframework.dao.DataAccessException; | 20 | import org.springframework.dao.DataAccessException; |
| 17 | import org.springframework.jdbc.core.JdbcTemplate; | 21 | import org.springframework.jdbc.core.JdbcTemplate; |
| 18 | import org.springframework.jdbc.core.ResultSetExtractor; | 22 | import org.springframework.jdbc.core.ResultSetExtractor; |
| 23 | +import org.springframework.jdbc.core.RowMapper; | ||
| 19 | import org.springframework.stereotype.Service; | 24 | import org.springframework.stereotype.Service; |
| 20 | import org.springframework.transaction.annotation.Transactional; | 25 | import org.springframework.transaction.annotation.Transactional; |
| 21 | import org.springframework.util.CollectionUtils; | 26 | import org.springframework.util.CollectionUtils; |
| @@ -277,51 +282,67 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | @@ -277,51 +282,67 @@ public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigIn | ||
| 277 | } | 282 | } |
| 278 | } | 283 | } |
| 279 | 284 | ||
| 285 | + @Autowired | ||
| 286 | + private ModuleService moduleService; | ||
| 280 | @Transactional | 287 | @Transactional |
| 281 | @Override | 288 | @Override |
| 282 | - public List<String> validate_get_destroy_info(List<CompanyAuthority> companyAuthorityList) { | ||
| 283 | - // 获取公司分公司权限代码 | ||
| 284 | - List<String> gs_fgs_dms = new ArrayList<>(); | ||
| 285 | - for (CompanyAuthority companyAuthority : companyAuthorityList) { | ||
| 286 | - gs_fgs_dms.add(companyAuthority.getCompanyCode() + "_" + companyAuthority.getSubCompanyCode()); | ||
| 287 | - } | ||
| 288 | - | ||
| 289 | - // 查询所有人员配置,不用in操作符,n+1查询慢,程序过滤 | ||
| 290 | - Map<String, Object> params = new HashMap<>(); | ||
| 291 | - List<EmployeeConfigInfo> employeeConfigInfoList_all = (List<EmployeeConfigInfo>) this.list(params); | ||
| 292 | - List<EmployeeConfigInfo> employeeConfigInfoList = new ArrayList<>(); | ||
| 293 | - for (EmployeeConfigInfo employeeConfigInfo : employeeConfigInfoList_all) { | ||
| 294 | - if (gs_fgs_dms.contains(employeeConfigInfo.getXl().getCgsbm())) { | ||
| 295 | - employeeConfigInfoList.add(employeeConfigInfo); | 289 | + public List<String> validate_get_destory_info() { |
| 290 | + // 1、查找当前用户是否有运营计划管理,没有的话不分析是否有停用人鱼信息 | ||
| 291 | + List<Module> moduleList = this.moduleService.findByCurrentUser(); | ||
| 292 | + boolean hasPlanModule = false; | ||
| 293 | + for (Module module : moduleList) { | ||
| 294 | + if ("运营计划管理".equals(module.getName())) { | ||
| 295 | + hasPlanModule = true; | ||
| 296 | + break; | ||
| 296 | } | 297 | } |
| 297 | } | 298 | } |
| 299 | + if (!hasPlanModule) { | ||
| 300 | + return null; | ||
| 301 | + } | ||
| 298 | 302 | ||
| 299 | - // 停用信息 | ||
| 300 | - List<String> destroy_infos = new ArrayList<>(); | ||
| 301 | - String info_format = "线路[%s]中人员配置有停用人员,请处理!"; | ||
| 302 | - String info = ""; | ||
| 303 | - Integer xlId = null; | ||
| 304 | - for (EmployeeConfigInfo employeeConfigInfo : employeeConfigInfoList) { | ||
| 305 | - if (employeeConfigInfo.getJsy() != null && | ||
| 306 | - employeeConfigInfo.getJsy().getDestroy() != null && | ||
| 307 | - employeeConfigInfo.getJsy().getDestroy() == 1) { // 驾驶员判定是否停用 | ||
| 308 | - info = String.format(info_format, employeeConfigInfo.getXl().getName()); | ||
| 309 | - if (!destroy_infos.contains(info)) { | ||
| 310 | - destroy_infos.add(info); | ||
| 311 | - } | ||
| 312 | - } | ||
| 313 | - | ||
| 314 | - if (employeeConfigInfo.getSpy() != null && | ||
| 315 | - employeeConfigInfo.getSpy().getDestroy() != null && | ||
| 316 | - employeeConfigInfo.getSpy().getDestroy() == 1) { | ||
| 317 | - info = String.format(info_format, employeeConfigInfo.getXl().getName()); | ||
| 318 | - if (!destroy_infos.contains(info)) { | ||
| 319 | - destroy_infos.add(info); | ||
| 320 | - } | 303 | + // 2、计算从当前时间开始的排班计划中是否有停用人员 |
| 304 | + String sql = | ||
| 305 | + "select distinct " + | ||
| 306 | + "plan.xl_name xlName " + | ||
| 307 | + ", plan.schedule_date scheduleDate " + | ||
| 308 | + "from bsth_c_s_sp_info plan " + | ||
| 309 | + "left join bsth_c_personnel jsy on jsy.id = plan.j " + | ||
| 310 | + "left join bsth_c_personnel spy on spy.id = plan.s " + | ||
| 311 | + "where plan.schedule_date >= ? " + | ||
| 312 | + "and (jsy.destroy = 1 || spy.destroy = 1) " + | ||
| 313 | + "group by plan.xl_name, plan.schedule_date " + | ||
| 314 | + "order by plan.xl_name, plan.schedule_date "; | ||
| 315 | + | ||
| 316 | +// String sql = | ||
| 317 | +// "select distinct " + | ||
| 318 | +// "pinfo.xl_name xlName " + | ||
| 319 | +// ", pinfo.schedule_date scheduleDate " + | ||
| 320 | +// "from " + | ||
| 321 | +// "(" + | ||
| 322 | +// "select plan.xl_name, plan.schedule_date " + | ||
| 323 | +// "from bsth_c_s_sp_info plan " + | ||
| 324 | +// "left join bsth_c_personnel jsy on plan.j = jsy.id " + | ||
| 325 | +// "left join bsth_c_personnel spy on plan.s = spy.id " + | ||
| 326 | +// "where schedule_date >= ? " + | ||
| 327 | +// "and (jsy.destroy = 1 || spy.destroy = 1) " + | ||
| 328 | +// "order by plan.xl_name asc, plan.schedule_date asc " + | ||
| 329 | +// ") pinfo " + | ||
| 330 | +// "group by pinfo.xl_name, pinfo.schedule_date "; | ||
| 331 | + | ||
| 332 | + | ||
| 333 | + Date currentDate = new Date(DateUtils.getTimestamp()); | ||
| 334 | + System.out.println(currentDate); | ||
| 335 | + String info_format = "线路[%s][%s]排班中有人员已经停用,请及时处理!"; | ||
| 336 | + List<String> infoList = this.jdbcTemplate.query(sql, new Object[] {currentDate}, new RowMapper<String>() { | ||
| 337 | + @Override | ||
| 338 | + public String mapRow(ResultSet resultSet, int i) throws SQLException { | ||
| 339 | + String xlName = resultSet.getString("xlName"); | ||
| 340 | + Date scheduleDate = new Date(resultSet.getDate("scheduleDate").getTime()); | ||
| 341 | + return String.format(info_format, xlName, DateFormatUtils.format(scheduleDate, "yyyy年MM月dd日")); | ||
| 321 | } | 342 | } |
| 322 | - } | 343 | + }); |
| 323 | 344 | ||
| 324 | - return destroy_infos; | 345 | + return infoList; |
| 325 | } | 346 | } |
| 326 | 347 | ||
| 327 | @Transactional | 348 | @Transactional |
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
| @@ -1518,18 +1518,18 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1518,18 +1518,18 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1518 | List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | 1518 | List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); |
| 1519 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | 1519 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 1520 | 1520 | ||
| 1521 | - String sfyy = "", company = "", subCompany = ""; | 1521 | + String sfyy = "", company = "", subCompany = "", line = ""; |
| 1522 | if(map.get("sfyy")!=null) | 1522 | if(map.get("sfyy")!=null) |
| 1523 | - sfyy = map.get("sfyy").toString(); | 1523 | + sfyy = map.get("sfyy").toString().trim(); |
| 1524 | if(map.get("company")!=null) | 1524 | if(map.get("company")!=null) |
| 1525 | - company = map.get("company").toString(); | 1525 | + company = map.get("company").toString().trim(); |
| 1526 | if(map.get("subCompany")!=null) | 1526 | if(map.get("subCompany")!=null) |
| 1527 | - subCompany = map.get("subCompany").toString(); | ||
| 1528 | - String line = map.get("line").toString(); | ||
| 1529 | -// String date = map.get("date").toString(); | ||
| 1530 | - String startDate = map.get("startDate").toString(); | ||
| 1531 | - String endDate = map.get("endDate").toString(); | ||
| 1532 | - String type = map.get("type").toString(); | 1527 | + subCompany = map.get("subCompany").toString().trim(); |
| 1528 | + if(map.get("line")!=null) | ||
| 1529 | + line = map.get("line").toString().trim(); | ||
| 1530 | + String startDate = map.get("startDate").toString().trim(); | ||
| 1531 | + String endDate = map.get("endDate").toString().trim(); | ||
| 1532 | + String type = map.get("type").toString().trim(); | ||
| 1533 | 1533 | ||
| 1534 | if(startDate.length() == 0) | 1534 | if(startDate.length() == 0) |
| 1535 | startDate = sdf.format(new Date()); | 1535 | startDate = sdf.format(new Date()); |
| @@ -1547,20 +1547,31 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1547,20 +1547,31 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1547 | +split2[0]+"年"+split2[1]+"月"+split2[2]+"日"; | 1547 | +split2[0]+"年"+split2[1]+"月"+split2[2]+"日"; |
| 1548 | } | 1548 | } |
| 1549 | 1549 | ||
| 1550 | + List<String> objList = new ArrayList<String>(); | ||
| 1551 | + objList.add(startDate); | ||
| 1552 | + objList.add(endDate); | ||
| 1553 | + | ||
| 1550 | try { | 1554 | try { |
| 1551 | - String sql = "select a.schedule_date_str, a.real_exec_date, a.xl_bm, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, a.gs_name, a.fgs_name," | ||
| 1552 | - + " a.fgs_bm, a.cc_service, a.remarks, a.adjust_exps, (select start_opt from bsth_c_line_config where id = " | ||
| 1553 | - + " (select max(id) from bsth_c_line_config where line = (select id from bsth_c_line where line_code = a.xl_bm))) start_opt" | ||
| 1554 | - + " from bsth_c_s_sp_info_real a where schedule_date_str >= '"+startDate+"' and schedule_date_str <= '"+endDate+"'" | 1555 | + String sql = "select a.schedule_date_str, a.real_exec_date, a.xl_bm, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, " |
| 1556 | + + " a.gs_name, a.fgs_name, a.gs_bm, a.fgs_bm, a.cc_service, a.remarks, a.adjust_exps, (select start_opt from bsth_c_line_config where id = " | ||
| 1557 | + + " (select max(id) from bsth_c_line_config where line = (select id from bsth_c_line where line_code = a.xl_bm))) start_opt " | ||
| 1558 | + + " from bsth_c_s_sp_info_real a where schedule_date_str >= ? and schedule_date_str <= ? " | ||
| 1555 | + " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'"; | 1559 | + " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'"; |
| 1556 | - if(line.length() != 0) | ||
| 1557 | - sql += " and xl_bm = '"+line+"'"; | ||
| 1558 | - if(company.length() != 0) | ||
| 1559 | - sql += " and gs_bm = '"+company+"'"; | ||
| 1560 | - if(subCompany.length() != 0) | ||
| 1561 | - sql += " and fgs_bm = '"+subCompany+"'"; | 1560 | + if(line.length() != 0){ |
| 1561 | + sql += " and xl_bm = ? "; | ||
| 1562 | + objList.add(line); | ||
| 1563 | + } | ||
| 1564 | + if(company.length() != 0){ | ||
| 1565 | + sql += " and gs_bm = ? "; | ||
| 1566 | + objList.add(company); | ||
| 1567 | + } | ||
| 1568 | + if(subCompany.length() != 0){ | ||
| 1569 | + sql += " and fgs_bm = ? "; | ||
| 1570 | + objList.add(subCompany); | ||
| 1571 | + } | ||
| 1562 | 1572 | ||
| 1563 | list = jdbcTemplate.query(sql, | 1573 | list = jdbcTemplate.query(sql, |
| 1574 | + objList.toArray(), | ||
| 1564 | new RowMapper<ScheduleRealInfo>(){ | 1575 | new RowMapper<ScheduleRealInfo>(){ |
| 1565 | @Override | 1576 | @Override |
| 1566 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | 1577 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { |
| @@ -1579,6 +1590,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1579,6 +1590,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1579 | schedule.setStatus(rs.getInt("status")); | 1590 | schedule.setStatus(rs.getInt("status")); |
| 1580 | schedule.setGsName(rs.getString("gs_name")); | 1591 | schedule.setGsName(rs.getString("gs_name")); |
| 1581 | schedule.setFgsName(rs.getString("fgs_name")); | 1592 | schedule.setFgsName(rs.getString("fgs_name")); |
| 1593 | + schedule.setGsBm(rs.getString("gs_bm")); | ||
| 1582 | schedule.setFgsBm(rs.getString("fgs_bm")); | 1594 | schedule.setFgsBm(rs.getString("fgs_bm")); |
| 1583 | schedule.setCcService(rs.getBoolean("cc_service")); | 1595 | schedule.setCcService(rs.getBoolean("cc_service")); |
| 1584 | schedule.setRemarks(rs.getString("remarks")!=null?rs.getString("remarks"):""); | 1596 | schedule.setRemarks(rs.getString("remarks")!=null?rs.getString("remarks"):""); |
| @@ -1646,7 +1658,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1646,7 +1658,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1646 | continue; | 1658 | continue; |
| 1647 | } | 1659 | } |
| 1648 | 1660 | ||
| 1649 | - String key = s.getXlName() + "/" + s.getXlBm() + "/" + s.getFgsBm(); | 1661 | + String key = s.getXlName() + "/" + s.getXlBm() + "/" + s.getFgsBm() + "/" + s.getGsBm(); |
| 1650 | String date = s.getScheduleDateStr(); | 1662 | String date = s.getScheduleDateStr(); |
| 1651 | if(!keyMap.containsKey(key)){ | 1663 | if(!keyMap.containsKey(key)){ |
| 1652 | keyMap.put(key, new HashMap<String, List<ScheduleRealInfo>>()); | 1664 | keyMap.put(key, new HashMap<String, List<ScheduleRealInfo>>()); |
| @@ -1664,7 +1676,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1664,7 +1676,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1664 | Map<Long, String> longMap = new HashMap<Long, String>(); | 1676 | Map<Long, String> longMap = new HashMap<Long, String>(); |
| 1665 | for(String key : keyMap.keySet()){ | 1677 | for(String key : keyMap.keySet()){ |
| 1666 | String[] keys = key.split("/"); | 1678 | String[] keys = key.split("/"); |
| 1667 | - Long l = Long.valueOf(keys[2]) * 10000000000l + Long.valueOf(keys[1]); | 1679 | + Long l = Long.valueOf(keys[3] + keys[2]) * 10000000000l + Long.valueOf(keys[1]); |
| 1668 | longMap.put(l, key); | 1680 | longMap.put(l, key); |
| 1669 | longList.add(l); | 1681 | longList.add(l); |
| 1670 | } | 1682 | } |
| @@ -1890,11 +1902,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1890,11 +1902,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1890 | tempMap.put("zdl", (jhbc<1?"0":nf.format((float) sjbc / jhbc * 100)) + "%"); | 1902 | tempMap.put("zdl", (jhbc<1?"0":nf.format((float) sjbc / jhbc * 100)) + "%"); |
| 1891 | for(Map<String, Object> m : mapList){ | 1903 | for(Map<String, Object> m : mapList){ |
| 1892 | m.put("no", ++i); | 1904 | m.put("no", ++i); |
| 1893 | -// m.put("company", companyName); | ||
| 1894 | -// m.put("subCompany", subCompanyName); | ||
| 1895 | } | 1905 | } |
| 1906 | + tempMap.put("company", ""); | ||
| 1907 | + tempMap.put("subCompany", ""); | ||
| 1908 | + tempMap.put("line", ""); | ||
| 1896 | tempMap.put("map", mapList); | 1909 | tempMap.put("map", mapList); |
| 1897 | - if(!type.equals("export")) | 1910 | + if(!type.contains("export")) |
| 1898 | resList.add(tempMap); | 1911 | resList.add(tempMap); |
| 1899 | } | 1912 | } |
| 1900 | 1913 | ||
| @@ -1957,190 +1970,59 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1957,190 +1970,59 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1957 | // TODO: handle exception | 1970 | // TODO: handle exception |
| 1958 | e.printStackTrace(); | 1971 | e.printStackTrace(); |
| 1959 | } | 1972 | } |
| 1960 | - } | ||
| 1961 | - | ||
| 1962 | - return resList; | ||
| 1963 | - } | ||
| 1964 | - /*@Override | ||
| 1965 | - public List<Map<String, Object>> commandState(Map<String, Object> map) { | ||
| 1966 | - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 1967 | - List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); | ||
| 1968 | - Map<String, List<Map<String, Object>>> keyMap = new HashMap<String, List<Map<String, Object>>>(); | ||
| 1969 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 1970 | - | ||
| 1971 | - String company = map.get("company").toString(); | ||
| 1972 | - String subCompany = map.get("subCompany").toString(); | ||
| 1973 | - String line = map.get("line").toString(); | ||
| 1974 | - String date = map.get("date").toString(); | ||
| 1975 | - String code = map.get("code").toString(); | ||
| 1976 | - String type = map.get("type").toString(); | ||
| 1977 | - | ||
| 1978 | - if(date.length() == 0) | ||
| 1979 | - date = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 1980 | - | ||
| 1981 | - try { | ||
| 1982 | - | ||
| 1983 | - String sql = | ||
| 1984 | - "select r.id, r.schedule_date_str, r.xl_name, r.cl_zbh, r.j_gh, r.j_name, r.fcsj, d.timestamp, d.reply46, d.reply47, d.reply46time, d.reply47time, r.gs_name, r.fgs_name " + | ||
| 1985 | - "FROM bsth_c_s_sp_info_real as r left join bsth_v_directive_60 as d on r.id = d.sch and d.is_dispatch = 1 where schedule_date_str = '"+date+"'"; | ||
| 1986 | - if(line.length() != 0){ | ||
| 1987 | - sql += " and xl_bm = '"+line+"'"; | ||
| 1988 | - } | ||
| 1989 | - if(code.length() != 0){ | ||
| 1990 | - sql += " and cl_zbh = '"+code+"'"; | ||
| 1991 | - } | ||
| 1992 | - if(company.length() != 0){ | ||
| 1993 | - sql += " and gs_bm = '"+company+"'"; | ||
| 1994 | - } | ||
| 1995 | - if(subCompany.length() != 0){ | ||
| 1996 | - sql += " and fgs_bm = '"+subCompany+"'"; | ||
| 1997 | - } | ||
| 1998 | - sql += " union " + | ||
| 1999 | - "select r.id, r.schedule_date_str, r.xl_name, r.cl_zbh, r.j_gh, r.j_name, r.fcsj, d.timestamp, d.reply46, d.reply47, d.reply46time, d.reply47time, r.gs_name, r.fgs_name " + | ||
| 2000 | - "FROM bsth_c_s_sp_info_real as r right join bsth_v_directive_60 as d on r.id = d.sch where d.is_dispatch = 1 and schedule_date_str = '"+date+"'"; | ||
| 2001 | - if(line.length() != 0){ | ||
| 2002 | - sql += " and xl_bm = '"+line+"'"; | ||
| 2003 | - } | ||
| 2004 | - if(code.length() != 0){ | ||
| 2005 | - sql += " and cl_zbh = '"+code+"'"; | ||
| 2006 | - } | ||
| 2007 | - if(company.length() != 0){ | ||
| 2008 | - sql += " and gs_bm = '"+company+"'"; | 1973 | + } else if(type.equals("exportAll")){ |
| 1974 | + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); | ||
| 1975 | + Map<String, Map<String, Object>> tempKeyMap = new HashMap<String, Map<String, Object>>(); | ||
| 1976 | + List<Map<String, Object>> removeList = new ArrayList<Map<String, Object>>(); | ||
| 1977 | + for(Map<String, Object> m : resList){ | ||
| 1978 | + if(m.get("gsName") != null && m.get("gsName").toString().trim().length() > 0 | ||
| 1979 | + && m.get("gsName").toString().trim().contains("临港")){ | ||
| 1980 | + removeList.add(m); | ||
| 1981 | + } | ||
| 2009 | } | 1982 | } |
| 2010 | - if(subCompany.length() != 0){ | ||
| 2011 | - sql += " and fgs_bm = '"+subCompany+"'"; | 1983 | + for(Map<String, Object> m : removeList){ |
| 1984 | + resList.remove(m); | ||
| 2012 | } | 1985 | } |
| 2013 | - sql += " order by xl_name, fcsj"; | ||
| 2014 | - | ||
| 2015 | - list = jdbcTemplate.query(sql, | ||
| 2016 | - new RowMapper<Map<String, Object>>(){ | ||
| 2017 | - @Override | ||
| 2018 | - public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 2019 | - Map<String, Object> map = new HashMap<String, Object>(); | ||
| 2020 | - map.put("id", rs.getString("id")); | ||
| 2021 | - map.put("date", rs.getString("schedule_date_str")); | ||
| 2022 | - map.put("line", rs.getString("xl_name")); | ||
| 2023 | - map.put("clZbh", rs.getString("cl_zbh")); | ||
| 2024 | - map.put("jGh", rs.getString("j_gh")); | ||
| 2025 | - map.put("jName", rs.getString("j_name")); | ||
| 2026 | - map.put("fcsj", rs.getString("fcsj")); | ||
| 2027 | - map.put("timestamp", rs.getString("timestamp")); | ||
| 2028 | - map.put("reply46", rs.getString("reply46")); | ||
| 2029 | - map.put("reply47", rs.getString("reply47")); | ||
| 2030 | - map.put("reply46time", rs.getString("reply46time")); | ||
| 2031 | - map.put("reply47time", rs.getString("reply47time")); | ||
| 2032 | - map.put("company", rs.getObject("gs_name")); | ||
| 2033 | - map.put("subCompany", rs.getObject("fgs_name")); | ||
| 2034 | - return map; | 1986 | + for(Map<String, Object> m : resList){ |
| 1987 | + if(m.get("company")!=null && m.get("company").toString().trim().length() > 0){ | ||
| 1988 | + Map<String, Object> temp = new HashMap<String, Object>(); | ||
| 1989 | + String gsName = m.get("company").toString().trim(); | ||
| 1990 | + if(tempKeyMap.containsKey(gsName)){ | ||
| 1991 | + temp = tempKeyMap.get(gsName); | ||
| 1992 | + temp.put("jhbc", Long.valueOf(m.get("jhbc")!=null?m.get("jhbc").toString():"0") | ||
| 1993 | + + Long.valueOf(temp.get("jhbc")!=null?temp.get("jhbc").toString():"0")); | ||
| 1994 | + temp.put("sjbc", Long.valueOf(m.get("sjbc")!=null?m.get("sjbc").toString():"0") | ||
| 1995 | + + Long.valueOf(temp.get("sjbc")!=null?temp.get("sjbc").toString():"0")); | ||
| 1996 | + } else { | ||
| 1997 | + temp.put("date", ""); | ||
| 1998 | + temp.put("company", gsName); | ||
| 1999 | + temp.put("subCompany", "小计"); | ||
| 2000 | + temp.put("line", ""); | ||
| 2001 | + temp.put("jhbc", m.get("jhbc")!=null?m.get("jhbc").toString()+"":"0"); | ||
| 2002 | + temp.put("sjbc", m.get("sjbc")!=null?m.get("sjbc").toString()+"":"0"); | ||
| 2003 | + tempList.add(temp); | ||
| 2004 | + tempKeyMap.put(gsName, temp); | ||
| 2005 | + } | ||
| 2035 | } | 2006 | } |
| 2036 | - }); | ||
| 2037 | - | ||
| 2038 | - } catch (Exception e) { | ||
| 2039 | - // TODO Auto-generated catch block | ||
| 2040 | - e.printStackTrace(); | ||
| 2041 | - } | ||
| 2042 | - | ||
| 2043 | - List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); | ||
| 2044 | - List<String> keyList = new ArrayList<String>(); | ||
| 2045 | - for(Map<String, Object> m : list){ | ||
| 2046 | - String key = m.get("line") + "/" + m.get("clZbh") + "/" + m.get("jGh") + "/" + m.get("jName"); | ||
| 2047 | - if(!keyList.contains(m.get("line").toString())){ | ||
| 2048 | - keyList.add(m.get("line").toString()); | ||
| 2049 | - } | ||
| 2050 | - if(!keyMap.containsKey(key)) | ||
| 2051 | - keyMap.put(key, new ArrayList<Map<String, Object>>()); | ||
| 2052 | - keyMap.get(key).add(m); | ||
| 2053 | - } | ||
| 2054 | - String companyName = "", subCompanyName = ""; | ||
| 2055 | - for(String key : keyMap.keySet()){ | ||
| 2056 | - Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 2057 | - Set<String> tempSet = new HashSet<String>(); | ||
| 2058 | - int sjf = 0; | ||
| 2059 | - int wqr = 0; | ||
| 2060 | - for(Map<String, Object> m : keyMap.get(key)){ | ||
| 2061 | - if(m.containsKey("company") && m.get("company")!=null && m.get("company").toString().length()!=0 && companyName.length()==0) | ||
| 2062 | - companyName = m.get("company").toString(); | ||
| 2063 | - if(m.containsKey("subCompany") && m.get("subCompany")!=null && m.get("subCompany").toString().length()!=0 && subCompanyName.length()==0) | ||
| 2064 | - subCompanyName = m.get("subCompany").toString(); | ||
| 2065 | - tempSet.add(m.get("id").toString()); | ||
| 2066 | - if(m.get("timestamp") != null){ | ||
| 2067 | - sjf++; | ||
| 2068 | - if(m.get("reply47").toString().equals("-1")) | ||
| 2069 | - wqr++; | ||
| 2070 | - m.put("time", sdf.format(new Date(Long.valueOf(m.get("timestamp").toString())))); | ||
| 2071 | - } else | ||
| 2072 | - m.put("time", "/"); | ||
| 2073 | - | ||
| 2074 | - if(m.get("reply46time") != null) | ||
| 2075 | - m.put("time46", sdf.format(new Date(Long.valueOf(m.get("reply46time").toString())))); | ||
| 2076 | - else | ||
| 2077 | - m.put("time46", "/"); | ||
| 2078 | - | ||
| 2079 | - if(m.get("reply47time") != null) | ||
| 2080 | - m.put("time47", sdf.format(new Date(Long.valueOf(m.get("reply47time").toString())))); | ||
| 2081 | - else | ||
| 2082 | - m.put("time47", "/"); | ||
| 2083 | - | ||
| 2084 | } | 2007 | } |
| 2085 | - tempMap.put("company", companyName); | ||
| 2086 | - tempMap.put("subCompany", subCompanyName); | ||
| 2087 | - String[] split = key.split("/"); | ||
| 2088 | - tempMap.put("date", date); | ||
| 2089 | - tempMap.put("line", split[0]); | ||
| 2090 | - tempMap.put("clZbh", split[1]); | ||
| 2091 | - tempMap.put("jsy", split[2] + "/" + split[3]); | ||
| 2092 | - tempMap.put("jhf", tempSet.size()); | ||
| 2093 | - tempMap.put("sjf", sjf); | ||
| 2094 | - tempMap.put("wqr", wqr); | ||
| 2095 | - tempMap.put("workList", keyMap.get(key)); | ||
| 2096 | - tempList.add(tempMap); | ||
| 2097 | - } | ||
| 2098 | - | ||
| 2099 | - for(String key : keyList){ | 2008 | + |
| 2100 | for(Map<String, Object> m : tempList){ | 2009 | for(Map<String, Object> m : tempList){ |
| 2101 | - if(key.equals(m.get("line").toString())){ | ||
| 2102 | - resList.add(m); | 2010 | + if(m.get("jhbc")!=null && Long.valueOf(m.get("jhbc").toString()) > 0l){ |
| 2011 | + m.put("zdl", nf.format((float) Long.valueOf(m.get("sjbc").toString()) / Long.valueOf(m.get("jhbc").toString()) * 100) + "%"); | ||
| 2012 | + }else{ | ||
| 2013 | + m.put("zdl", "0.00%"); | ||
| 2103 | } | 2014 | } |
| 2015 | + resList.add(m); | ||
| 2104 | } | 2016 | } |
| 2105 | - } | ||
| 2106 | - | ||
| 2107 | - if(type.equals("export")){ | ||
| 2108 | - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 2109 | - sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 2017 | + |
| 2110 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 2018 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 2111 | Map<String,Object> m = new HashMap<String, Object>(); | 2019 | Map<String,Object> m = new HashMap<String, Object>(); |
| 2112 | ReportUtils ee = new ReportUtils(); | 2020 | ReportUtils ee = new ReportUtils(); |
| 2113 | try { | 2021 | try { |
| 2114 | listI.add(resList.iterator()); | 2022 | listI.add(resList.iterator()); |
| 2115 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 2023 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 2116 | - ee.excelReplace(listI, new Object[] { m }, path+"mould/commandState.xls", | ||
| 2117 | - path+"export/指令状态分析" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | ||
| 2118 | - } catch (Exception e) { | ||
| 2119 | - // TODO: handle exception | ||
| 2120 | - e.printStackTrace(); | ||
| 2121 | - } | ||
| 2122 | - } | ||
| 2123 | - | ||
| 2124 | - if(type.equals("export1")){ | ||
| 2125 | - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 2126 | - sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 2127 | - List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 2128 | - Map<String,Object> m = new HashMap<String, Object>(); | ||
| 2129 | - ReportUtils ee = new ReportUtils(); | ||
| 2130 | - String jsy = map.get("jsy").toString(); | ||
| 2131 | - try { | ||
| 2132 | - for(Map<String, Object> map1 : resList){ | ||
| 2133 | - if(jsy.equals(map1.get("jsy").toString())){ | ||
| 2134 | - List<Map<String, Object>> temp = (List<Map<String, Object>>)map1.get("workList"); | ||
| 2135 | - listI.add(temp.iterator()); | ||
| 2136 | - m.put("detail", "日期:" + map1.get("date") + " 公司:" + map1.get("company") | ||
| 2137 | - + " 分公司:" + map1.get("subCompany") + " 线路:" + map1.get("line") | ||
| 2138 | - + " 车辆:" + map1.get("clZbh") + " 人员:" + map1.get("jsy")); | ||
| 2139 | - } | ||
| 2140 | - } | ||
| 2141 | - String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | ||
| 2142 | - ee.excelReplace(listI, new Object[] { m }, path+"mould/commandState1.xls", | ||
| 2143 | - path+"export/指令状态明细" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); | 2024 | + ee.excelReplace(listI, new Object[] { tempMap }, path+"mould/firstAndLastBus_sum.xls", |
| 2025 | + path+"export/" + dateTime + "-全部公司-线路首末班准点率.xls"); | ||
| 2144 | } catch (Exception e) { | 2026 | } catch (Exception e) { |
| 2145 | // TODO: handle exception | 2027 | // TODO: handle exception |
| 2146 | e.printStackTrace(); | 2028 | e.printStackTrace(); |
| @@ -2149,7 +2031,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -2149,7 +2031,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 2149 | 2031 | ||
| 2150 | return resList; | 2032 | return resList; |
| 2151 | } | 2033 | } |
| 2152 | -*/ | ||
| 2153 | 2034 | ||
| 2154 | @Override | 2035 | @Override |
| 2155 | public List<Map<String, Object>> commandState(Map<String, Object> map) { | 2036 | public List<Map<String, Object>> commandState(Map<String, Object> map) { |
src/main/java/com/bsth/service/schedule/impl/TTInfoDetailServiceImpl.java
| @@ -3,8 +3,11 @@ package com.bsth.service.schedule.impl; | @@ -3,8 +3,11 @@ package com.bsth.service.schedule.impl; | ||
| 3 | import com.alibaba.fastjson.JSONArray; | 3 | import com.alibaba.fastjson.JSONArray; |
| 4 | import com.alibaba.fastjson.JSONObject; | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | import com.bsth.common.ResponseCode; | 5 | import com.bsth.common.ResponseCode; |
| 6 | -import com.bsth.entity.*; | 6 | +import com.bsth.entity.CarPark; |
| 7 | +import com.bsth.entity.Line; | ||
| 8 | +import com.bsth.entity.LineInformation; | ||
| 7 | import com.bsth.entity.schedule.GuideboardInfo; | 9 | import com.bsth.entity.schedule.GuideboardInfo; |
| 10 | +import com.bsth.entity.schedule.TTInfo; | ||
| 8 | import com.bsth.entity.schedule.TTInfoDetail; | 11 | import com.bsth.entity.schedule.TTInfoDetail; |
| 9 | import com.bsth.repository.CarParkRepository; | 12 | import com.bsth.repository.CarParkRepository; |
| 10 | import com.bsth.repository.LineRepository; | 13 | import com.bsth.repository.LineRepository; |
| @@ -13,28 +16,30 @@ import com.bsth.repository.schedule.GuideboardInfoRepository; | @@ -13,28 +16,30 @@ import com.bsth.repository.schedule.GuideboardInfoRepository; | ||
| 13 | import com.bsth.repository.schedule.TTInfoDetailRepository; | 16 | import com.bsth.repository.schedule.TTInfoDetailRepository; |
| 14 | import com.bsth.repository.schedule.TTInfoRepository; | 17 | import com.bsth.repository.schedule.TTInfoRepository; |
| 15 | import com.bsth.repository.sys.SysUserRepository; | 18 | import com.bsth.repository.sys.SysUserRepository; |
| 19 | +import com.bsth.security.util.SecurityUtils; | ||
| 16 | import com.bsth.service.CarParkService; | 20 | import com.bsth.service.CarParkService; |
| 17 | import com.bsth.service.LineInformationService; | 21 | import com.bsth.service.LineInformationService; |
| 18 | import com.bsth.service.LineService; | 22 | import com.bsth.service.LineService; |
| 19 | import com.bsth.service.StationRouteService; | 23 | import com.bsth.service.StationRouteService; |
| 20 | import com.bsth.service.schedule.GuideboardInfoService; | 24 | import com.bsth.service.schedule.GuideboardInfoService; |
| 21 | import com.bsth.service.schedule.TTInfoDetailService; | 25 | import com.bsth.service.schedule.TTInfoDetailService; |
| 26 | +import com.bsth.service.schedule.datatools.Excel2007PoiOperator; | ||
| 27 | +import com.bsth.service.schedule.datatools.ExcelPoiOperator; | ||
| 22 | import com.bsth.service.schedule.datatools.TTInfoDetailForEdit; | 28 | import com.bsth.service.schedule.datatools.TTInfoDetailForEdit; |
| 23 | import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData; | 29 | import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData; |
| 24 | import com.bsth.service.schedule.exception.ScheduleException; | 30 | import com.bsth.service.schedule.exception.ScheduleException; |
| 25 | import com.bsth.service.schedule.timetable.ExcelData; | 31 | import com.bsth.service.schedule.timetable.ExcelData; |
| 26 | import com.bsth.service.schedule.timetable.ExcelFormatType; | 32 | import com.bsth.service.schedule.timetable.ExcelFormatType; |
| 27 | -import com.bsth.service.schedule.utils.DataToolsFile; | ||
| 28 | -import com.bsth.service.schedule.utils.DataToolsFileType; | ||
| 29 | -import com.bsth.service.schedule.utils.DataToolsService; | ||
| 30 | -import com.bsth.service.schedule.utils.PoiUtils; | 33 | +import com.bsth.service.schedule.utils.*; |
| 31 | import org.apache.commons.lang3.StringUtils; | 34 | import org.apache.commons.lang3.StringUtils; |
| 32 | -import org.apache.poi.ss.usermodel.Cell; | ||
| 33 | -import org.apache.poi.ss.usermodel.Row; | ||
| 34 | -import org.apache.poi.ss.usermodel.Sheet; | ||
| 35 | -import org.apache.poi.ss.usermodel.Workbook; | 35 | +import org.apache.commons.lang3.time.DateFormatUtils; |
| 36 | +import org.apache.poi.ss.usermodel.*; | ||
| 37 | +import org.apache.poi.ss.util.CellRangeAddress; | ||
| 38 | +import org.apache.poi.xssf.usermodel.XSSFCell; | ||
| 39 | +import org.joda.time.DateTime; | ||
| 36 | import org.slf4j.Logger; | 40 | import org.slf4j.Logger; |
| 37 | import org.slf4j.LoggerFactory; | 41 | import org.slf4j.LoggerFactory; |
| 42 | +import org.springframework.beans.BeanUtils; | ||
| 38 | import org.springframework.beans.factory.annotation.Autowired; | 43 | import org.springframework.beans.factory.annotation.Autowired; |
| 39 | import org.springframework.beans.factory.annotation.Qualifier; | 44 | import org.springframework.beans.factory.annotation.Qualifier; |
| 40 | import org.springframework.jdbc.core.JdbcTemplate; | 45 | import org.springframework.jdbc.core.JdbcTemplate; |
| @@ -42,13 +47,10 @@ import org.springframework.stereotype.Service; | @@ -42,13 +47,10 @@ import org.springframework.stereotype.Service; | ||
| 42 | import org.springframework.transaction.annotation.Transactional; | 47 | import org.springframework.transaction.annotation.Transactional; |
| 43 | import org.springframework.util.CollectionUtils; | 48 | import org.springframework.util.CollectionUtils; |
| 44 | 49 | ||
| 50 | +import java.awt.Color; | ||
| 45 | import java.io.File; | 51 | import java.io.File; |
| 46 | -import java.util.ArrayList; | ||
| 47 | -import java.util.HashMap; | 52 | +import java.util.*; |
| 48 | import java.util.List; | 53 | import java.util.List; |
| 49 | -import java.util.Map; | ||
| 50 | -import java.util.regex.Matcher; | ||
| 51 | -import java.util.regex.Pattern; | ||
| 52 | 54 | ||
| 53 | /** | 55 | /** |
| 54 | * Created by xu on 17/1/3. | 56 | * Created by xu on 17/1/3. |
| @@ -149,6 +151,248 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -149,6 +151,248 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 149 | return tTinfoDetailDynamicData.exportDynamicTTinfo(dtInfos, type); | 151 | return tTinfoDetailDynamicData.exportDynamicTTinfo(dtInfos, type); |
| 150 | } | 152 | } |
| 151 | 153 | ||
| 154 | + @Autowired | ||
| 155 | + private DataToolsProperties dataToolsProperties; | ||
| 156 | + | ||
| 157 | + @Transactional | ||
| 158 | + @Override | ||
| 159 | + public DataToolsFile exportPvInfo(Long ttInfoId) throws ScheduleException { | ||
| 160 | + // 1、获取时刻表,时刻表明细数据 | ||
| 161 | + TTInfo ttInfo = this.infoRepository.findOneExtend(ttInfoId); | ||
| 162 | + List<TTInfoDetail> ttInfoDetailList = this.ttInfoDetailRepository.findByTtinfoId(ttInfoId); | ||
| 163 | + LOGGER.info("----------------- 开始导出时刻表[{}]预览视图信息---------------", ttInfo.getName()); | ||
| 164 | + | ||
| 165 | + // 2、构造导出信息 | ||
| 166 | + try { | ||
| 167 | + // 使用excel2007格式(xlsx) | ||
| 168 | + ExcelPoiOperator excelPoiOperator = new Excel2007PoiOperator(); | ||
| 169 | + Workbook wb = excelPoiOperator.createWorkBook(); // 创建workbook | ||
| 170 | + Sheet sheet = excelPoiOperator.createWorkBookSheet(wb, "预览信息"); // 创建sheet | ||
| 171 | + | ||
| 172 | + // 创建表头(从第2行开始,第1行需要合并单元格显示站点名字) | ||
| 173 | + int[] headColNums = new int[] {0, 1, 2, 3, 4, 7, 8, 9, 10, 11}; | ||
| 174 | + String[] headColLabels = new String[] {"序号", "路牌", "发车时间", "到达时间", "备注", "序号", "路牌", "发车时间", "到达时间", "备注"}; | ||
| 175 | + int[] headColWidth = new int[] {10, 10, 20, 20, 35, 10, 10, 20, 20, 35}; | ||
| 176 | + | ||
| 177 | + Row headRow = excelPoiOperator.createSheetRow(sheet, 1); | ||
| 178 | + headRow.setHeight((short) (35 * 20)); // 单位:1/20个点 | ||
| 179 | + for (int i = 0; i < headColNums.length; i ++) { | ||
| 180 | + excelPoiOperator.createCell( | ||
| 181 | + wb, headRow, (short) headColNums[i], | ||
| 182 | + headColLabels[i], XSSFCell.CELL_TYPE_STRING, | ||
| 183 | + HorizontalAlignment.CENTER, VerticalAlignment.CENTER, | ||
| 184 | + BorderStyle.THIN, new java.awt.Color(0x000000), | ||
| 185 | + (short) 14, new java.awt.Color(0xffffff), "宋体", | ||
| 186 | + new Color(0x857F7F), FillPatternType.SOLID_FOREGROUND); | ||
| 187 | + sheet.setColumnWidth(headColNums[i], headColWidth[i] * 256); // 单位:1/256个字符宽度 | ||
| 188 | + } | ||
| 189 | + | ||
| 190 | + // 获取上行线路并按照时间排序 | ||
| 191 | + List<TTInfoDetail> upBcList = sortedByBcsjAsc(ttInfoDetailList, true); | ||
| 192 | + List<TTInfoDetail> downBcList = sortedByBcsjAsc(ttInfoDetailList, false); | ||
| 193 | + int rowDiff = upBcList.size() - downBcList.size(); | ||
| 194 | + int rowSize; | ||
| 195 | + if (rowDiff >= 0) { // 上行班次多 | ||
| 196 | + rowSize = downBcList.size(); | ||
| 197 | + } else { // 下行班次多 | ||
| 198 | + rowSize = upBcList.size(); | ||
| 199 | + } | ||
| 200 | + for (int i = 0; i < rowSize; i++) { | ||
| 201 | + Row bcRow = excelPoiOperator.createSheetRow(sheet, i + 2); | ||
| 202 | + // 上行班次 | ||
| 203 | + excelPoiOperator.createIntegerCell(wb, bcRow, (short) 0, i + 1); | ||
| 204 | + String lpName = upBcList.get(i).getLp().getLpName(); | ||
| 205 | + if (StringUtils.isNumeric(lpName)) { | ||
| 206 | + excelPoiOperator.createIntegerCell(wb, bcRow, (short) 1, Integer.valueOf(lpName)); | ||
| 207 | + } else { | ||
| 208 | + excelPoiOperator.createStringCell(wb, bcRow, (short) 1, lpName); | ||
| 209 | + } | ||
| 210 | + excelPoiOperator.createStringCell(wb, bcRow, (short) 2, upBcList.get(i).getFcsj()); | ||
| 211 | + Date ddsj_up = MyDateUtils.hhssTimePlusMinunits(upBcList.get(i).getFcsj(), upBcList.get(i).getBcsj(), 0); | ||
| 212 | + excelPoiOperator.createStringCell(wb, bcRow, (short) 3, DateFormatUtils.format(ddsj_up, "HH:mm")); | ||
| 213 | + excelPoiOperator.createStringCell(wb, bcRow, (short) 4, StringUtils.trimToEmpty(upBcList.get(i).getRemark())); | ||
| 214 | + | ||
| 215 | + // 下行班次 | ||
| 216 | + excelPoiOperator.createIntegerCell(wb, bcRow, (short) 7, i + 1); | ||
| 217 | + lpName = downBcList.get(i).getLp().getLpName(); | ||
| 218 | + if (StringUtils.isNumeric(lpName)) { | ||
| 219 | + excelPoiOperator.createIntegerCell(wb, bcRow, (short) 8, Integer.valueOf(lpName)); | ||
| 220 | + } else { | ||
| 221 | + excelPoiOperator.createStringCell(wb, bcRow, (short) 8, lpName); | ||
| 222 | + } | ||
| 223 | + excelPoiOperator.createStringCell(wb, bcRow, (short) 9, downBcList.get(i).getFcsj()); | ||
| 224 | + Date ddsj_down = MyDateUtils.hhssTimePlusMinunits(downBcList.get(i).getFcsj(), downBcList.get(i).getBcsj(), 0); | ||
| 225 | + excelPoiOperator.createStringCell(wb, bcRow, (short) 10, DateFormatUtils.format(ddsj_down, "HH:mm")); | ||
| 226 | + excelPoiOperator.createStringCell(wb, bcRow, (short) 11, StringUtils.trimToEmpty(downBcList.get(i).getRemark())); | ||
| 227 | + } | ||
| 228 | + | ||
| 229 | + List<TTInfoDetail> rowDiffBcList; // 剩下的班次 | ||
| 230 | + int rowDiffColIndexStart; | ||
| 231 | + if (rowDiff >= 0) { // 上行班次多 | ||
| 232 | + rowDiffBcList = upBcList; | ||
| 233 | + rowDiffColIndexStart = 0; | ||
| 234 | + } else { // 下行班次多 | ||
| 235 | + rowDiffBcList = downBcList; | ||
| 236 | + rowDiffColIndexStart = 7; | ||
| 237 | + } | ||
| 238 | + for (int i = rowSize; i < rowSize + Math.abs(rowDiff); i++) { | ||
| 239 | + Row bcRow = excelPoiOperator.createSheetRow(sheet, i + 2); | ||
| 240 | + excelPoiOperator.createIntegerCell(wb, bcRow, (short) (rowDiffColIndexStart + 0), i + 1); | ||
| 241 | + String lpName = rowDiffBcList.get(i).getLp().getLpName(); | ||
| 242 | + if (StringUtils.isNumeric(lpName)) { | ||
| 243 | + excelPoiOperator.createIntegerCell(wb, bcRow, (short) (rowDiffColIndexStart + 1), Integer.valueOf(lpName)); | ||
| 244 | + } else { | ||
| 245 | + excelPoiOperator.createStringCell(wb, bcRow, (short) (rowDiffColIndexStart + 1), lpName); | ||
| 246 | + } | ||
| 247 | + excelPoiOperator.createStringCell(wb, bcRow, (short) (rowDiffColIndexStart + 2), rowDiffBcList.get(i).getFcsj()); | ||
| 248 | + Date ddsj = MyDateUtils.hhssTimePlusMinunits(rowDiffBcList.get(i).getFcsj(), rowDiffBcList.get(i).getBcsj(), 0); | ||
| 249 | + excelPoiOperator.createStringCell(wb, bcRow, (short) (rowDiffColIndexStart + 3), DateFormatUtils.format(ddsj, "HH:mm")); | ||
| 250 | + excelPoiOperator.createStringCell(wb, bcRow, (short) (rowDiffColIndexStart + 4), StringUtils.trimToEmpty(rowDiffBcList.get(i).getRemark())); | ||
| 251 | + | ||
| 252 | + } | ||
| 253 | + | ||
| 254 | + // 创建第一行,合并列 | ||
| 255 | + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 4)); | ||
| 256 | + sheet.addMergedRegion(new CellRangeAddress(0, 0, 7, 11)); | ||
| 257 | + Row firstRow = excelPoiOperator.createSheetRow(sheet, 0); | ||
| 258 | + firstRow.setHeight((short) (50 * 20)); // 单位:1/20个点 | ||
| 259 | + if (upBcList.size() > 0 && downBcList.size() > 0) { | ||
| 260 | + String upBcLabel = ""; | ||
| 261 | + for (TTInfoDetail ttInfoDetail : upBcList) { | ||
| 262 | + if ("normal".equals(ttInfoDetail.getBcType())) { | ||
| 263 | + upBcLabel = "上行站点:" + ttInfoDetail.getQdzName() + " >> " + ttInfoDetail.getZdzName(); | ||
| 264 | + break; | ||
| 265 | + } | ||
| 266 | + } | ||
| 267 | + String downBcLabel = ""; | ||
| 268 | + for (TTInfoDetail ttInfoDetail : downBcList) { | ||
| 269 | + if ("normal".equals(ttInfoDetail.getBcType())) { | ||
| 270 | + downBcLabel = "下行站点:" + ttInfoDetail.getQdzName() + " >> " + ttInfoDetail.getZdzName(); | ||
| 271 | + break; | ||
| 272 | + } | ||
| 273 | + } | ||
| 274 | + | ||
| 275 | + excelPoiOperator.createCell( | ||
| 276 | + wb, firstRow, (short) 0, | ||
| 277 | + upBcLabel, XSSFCell.CELL_TYPE_STRING, | ||
| 278 | + HorizontalAlignment.CENTER, VerticalAlignment.CENTER, | ||
| 279 | + BorderStyle.NONE, new java.awt.Color(0x000000), | ||
| 280 | + (short) 20, new java.awt.Color(0xffffff), "宋体", | ||
| 281 | + new Color(0x857F7F), FillPatternType.SOLID_FOREGROUND); | ||
| 282 | + | ||
| 283 | + excelPoiOperator.createCell( | ||
| 284 | + wb, firstRow, (short) 7, | ||
| 285 | + downBcLabel, XSSFCell.CELL_TYPE_STRING, | ||
| 286 | + HorizontalAlignment.CENTER, VerticalAlignment.CENTER, | ||
| 287 | + BorderStyle.NONE, new java.awt.Color(0x000000), | ||
| 288 | + (short) 20, new java.awt.Color(0xffffff), "宋体", | ||
| 289 | + new Color(0x857F7F), FillPatternType.SOLID_FOREGROUND); | ||
| 290 | + } | ||
| 291 | + | ||
| 292 | + // 锁定第1第2行 | ||
| 293 | + sheet.createFreezePane(0, 2); | ||
| 294 | + | ||
| 295 | + // wb内存写入文件 | ||
| 296 | + String filepath = dataToolsProperties.getFileoutputDir() + | ||
| 297 | + File.separator + | ||
| 298 | + ttInfo.getName() + "预览信息-" + | ||
| 299 | + new DateTime().toString("yyyyMMddHHmmss") + ".xlsx"; | ||
| 300 | + File file = new File(filepath); | ||
| 301 | + excelPoiOperator.writeExcel(file, wb); | ||
| 302 | + | ||
| 303 | + DataToolsFile dataToolsFile = new DataToolsFile(); | ||
| 304 | + dataToolsFile.setFileType(DataToolsFileType.XLSX); | ||
| 305 | + dataToolsFile.setFile(file); | ||
| 306 | + | ||
| 307 | + return dataToolsFile; | ||
| 308 | + | ||
| 309 | + } catch (Exception exp) { | ||
| 310 | + LOGGER.error("----------------- 导出时刻表[{}]预览视图信息失败---------------", ttInfo.getName()); | ||
| 311 | + throw new ScheduleException(exp); | ||
| 312 | + } | ||
| 313 | + } | ||
| 314 | + private List<TTInfoDetail> sortedByBcsjAsc(List<TTInfoDetail> bcList, boolean isUp) { | ||
| 315 | + List<TTInfoDetail> sortedList = new ArrayList<>(); | ||
| 316 | + for (TTInfoDetail ttInfoDetail : bcList) { | ||
| 317 | + if (isUp) { | ||
| 318 | + if ("0".equals(ttInfoDetail.getXlDir())) { | ||
| 319 | + sortedList.add(ttInfoDetail); | ||
| 320 | + } | ||
| 321 | + } else { | ||
| 322 | + if ("1".equals(ttInfoDetail.getXlDir())) { | ||
| 323 | + sortedList.add(ttInfoDetail); | ||
| 324 | + } | ||
| 325 | + } | ||
| 326 | + } | ||
| 327 | + Collections.sort(sortedList, new Comparator<TTInfoDetail>() { | ||
| 328 | + @Override | ||
| 329 | + public int compare(TTInfoDetail o1, TTInfoDetail o2) { | ||
| 330 | + Date d1 = MyDateUtils.hhssTimePlusMinunits(o1.getFcsj(), 0, 0); | ||
| 331 | + Date d2 = MyDateUtils.hhssTimePlusMinunits(o2.getFcsj(), 0, 0); | ||
| 332 | + | ||
| 333 | + return d1.compareTo(d2); | ||
| 334 | + } | ||
| 335 | + }); | ||
| 336 | + | ||
| 337 | + return sortedList; | ||
| 338 | + } | ||
| 339 | + | ||
| 340 | + @Transactional | ||
| 341 | + @Override | ||
| 342 | + public void addLp(Long ttInfoId, Long lpId) { | ||
| 343 | + List<TTInfoDetail> bcList = this.ttInfoDetailRepository.findBcdetails(ttInfoId, lpId); | ||
| 344 | + if (!CollectionUtils.isEmpty(bcList)) { | ||
| 345 | + throw new RuntimeException("路牌已经存在!"); | ||
| 346 | + } | ||
| 347 | + List<TTInfoDetail> allBcList = this.ttInfoDetailRepository.findByTtinfoId(ttInfoId); | ||
| 348 | + if (CollectionUtils.isEmpty(allBcList)) { | ||
| 349 | + throw new RuntimeException("时刻表没有班次(添加路牌至少需要一个班次)!"); | ||
| 350 | + } | ||
| 351 | + | ||
| 352 | + Integer maxBcs = this.ttInfoDetailRepository.findMaxBcs(ttInfoId).intValue(); | ||
| 353 | + GuideboardInfo lpInfo = this.guideboardInfoRepository.findById(lpId).get(); | ||
| 354 | + // 将当前时刻表的第一个班次作为新增路牌的第一个班次,然后设置发车时间为00:00 | ||
| 355 | + TTInfoDetail firstBc = allBcList.get(0); | ||
| 356 | + TTInfoDetail newBc = new TTInfoDetail(); | ||
| 357 | + BeanUtils.copyProperties(firstBc, newBc); | ||
| 358 | + newBc.setId(null); | ||
| 359 | + newBc.setLp(lpInfo); | ||
| 360 | + newBc.setFcno(1); | ||
| 361 | + newBc.setBcs(maxBcs + 1); | ||
| 362 | + newBc.setFcsj("00:00"); | ||
| 363 | + newBc.setCreateDate(new Date()); | ||
| 364 | + newBc.setUpdateDate(new Date()); | ||
| 365 | + newBc.setCreateBy(SecurityUtils.getCurrentUser()); | ||
| 366 | + newBc.setUpdateBy(SecurityUtils.getCurrentUser()); | ||
| 367 | + | ||
| 368 | + this.ttInfoDetailRepository.save(newBc); | ||
| 369 | + } | ||
| 370 | + | ||
| 371 | + @Transactional | ||
| 372 | + @Override | ||
| 373 | + public void removeBcByLp(Long ttInfoId, Long lpId) { | ||
| 374 | + this.ttInfoDetailRepository.deleteByTtinfoIdAndLpidWithModify(ttInfoId, lpId); | ||
| 375 | + } | ||
| 376 | + | ||
| 377 | + @Transactional | ||
| 378 | + @Override | ||
| 379 | + public void switchBcByLp(Long ttInfoId, Long lpAId, Long lpBId) { | ||
| 380 | + List<TTInfoDetail> lpABcList = this.ttInfoDetailRepository.findBcdetails(ttInfoId, lpAId); | ||
| 381 | + List<TTInfoDetail> lpBBcList = this.ttInfoDetailRepository.findBcdetails(ttInfoId, lpBId); | ||
| 382 | + | ||
| 383 | + if (!CollectionUtils.isEmpty(lpABcList) && !CollectionUtils.isEmpty(lpBBcList)) { | ||
| 384 | + GuideboardInfo lpA = lpABcList.get(0).getLp(); | ||
| 385 | + GuideboardInfo lpB = lpBBcList.get(0).getLp(); | ||
| 386 | + | ||
| 387 | + for (TTInfoDetail lpABc : lpABcList) { | ||
| 388 | + lpABc.setLp(lpB); | ||
| 389 | + } | ||
| 390 | + for (TTInfoDetail lpBBc : lpBBcList) { | ||
| 391 | + lpBBc.setLp(lpA); | ||
| 392 | + } | ||
| 393 | + } | ||
| 394 | + } | ||
| 395 | + | ||
| 152 | @Override | 396 | @Override |
| 153 | public TTInfoDetailForEdit.EditInfo getEditInfo(Integer xlid, Long ttid, Long maxfcno) throws ScheduleException { | 397 | public TTInfoDetailForEdit.EditInfo getEditInfo(Integer xlid, Long ttid, Long maxfcno) throws ScheduleException { |
| 154 | return ttInfoDetailForEdit.getEditInfo(xlid, ttid, maxfcno); | 398 | return ttInfoDetailForEdit.getEditInfo(xlid, ttid, maxfcno); |
| @@ -225,11 +469,11 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -225,11 +469,11 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 225 | 469 | ||
| 226 | /** | 470 | /** |
| 227 | * @description (TODO) 时刻表明细模型数据保存. | 471 | * @description (TODO) 时刻表明细模型数据保存. |
| 228 | - * | 472 | + * |
| 229 | * @param map | 473 | * @param map |
| 230 | - * | 474 | + * |
| 231 | * @return : 返回保存操作后的状态. | 475 | * @return : 返回保存操作后的状态. |
| 232 | - * | 476 | + * |
| 233 | * @exception 处理所有抛出来的异常. | 477 | * @exception 处理所有抛出来的异常. |
| 234 | * */ | 478 | * */ |
| 235 | @Transactional | 479 | @Transactional |
| @@ -241,7 +485,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -241,7 +485,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 241 | //boolean b = map.get("istidc") ==null ? false : Boolean.parseBoolean(map.get("istidc").toString()); | 485 | //boolean b = map.get("istidc") ==null ? false : Boolean.parseBoolean(map.get("istidc").toString()); |
| 242 | Long ttinfoid = map.get("skb") ==null ? null : Long.parseLong(map.get("skb").toString()); | 486 | Long ttinfoid = map.get("skb") ==null ? null : Long.parseLong(map.get("skb").toString()); |
| 243 | Integer xlid = map.get("xl") ==null ? null : Integer.parseInt(map.get("xl").toString()); | 487 | Integer xlid = map.get("xl") ==null ? null : Integer.parseInt(map.get("xl").toString()); |
| 244 | - if(xlid !=null && ttinfoid !=null) | 488 | + if(xlid !=null && ttinfoid !=null) |
| 245 | ttInfoDetailRepository.deltidc(xlid,ttinfoid); | 489 | ttInfoDetailRepository.deltidc(xlid,ttinfoid); |
| 246 | if(d!=null) | 490 | if(d!=null) |
| 247 | ttInfoDetailRepository.saveAll(jsonArrayToListEntity(d));// 2、保存. | 491 | ttInfoDetailRepository.saveAll(jsonArrayToListEntity(d));// 2、保存. |
| @@ -252,14 +496,14 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -252,14 +496,14 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 252 | rs_m.put("status", ResponseCode.SUCCESS); | 496 | rs_m.put("status", ResponseCode.SUCCESS); |
| 253 | return rs_m; | 497 | return rs_m; |
| 254 | } | 498 | } |
| 255 | - | 499 | + |
| 256 | /** | 500 | /** |
| 257 | * @description : (TODO) json班次数据转list班次. | 501 | * @description : (TODO) json班次数据转list班次. |
| 258 | - * | 502 | + * |
| 259 | * @param jsonStr 班次json字符串] | 503 | * @param jsonStr 班次json字符串] |
| 260 | - * | 504 | + * |
| 261 | * @return 返回一个list分装的班次数据. | 505 | * @return 返回一个list分装的班次数据. |
| 262 | - * | 506 | + * |
| 263 | * @status OK. | 507 | * @status OK. |
| 264 | * */ | 508 | * */ |
| 265 | public List<TTInfoDetail> jsonArrayToListEntity(String jsonStr) throws Exception { | 509 | public List<TTInfoDetail> jsonArrayToListEntity(String jsonStr) throws Exception { |
| @@ -274,14 +518,14 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -274,14 +518,14 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 274 | } | 518 | } |
| 275 | return listTd; | 519 | return listTd; |
| 276 | } | 520 | } |
| 277 | - | 521 | + |
| 278 | /** | 522 | /** |
| 279 | * @description : (TODO) 班次map对象转实体对象. | 523 | * @description : (TODO) 班次map对象转实体对象. |
| 280 | - * | 524 | + * |
| 281 | * @param obj 班次map对象. | 525 | * @param obj 班次map对象. |
| 282 | - * | 526 | + * |
| 283 | * @return 返回一个班次实体对象. | 527 | * @return 返回一个班次实体对象. |
| 284 | - * | 528 | + * |
| 285 | * @exception 异常暂先抛出去. | 529 | * @exception 异常暂先抛出去. |
| 286 | * */ | 530 | * */ |
| 287 | public TTInfoDetail objToEntity(JSONObject obj) throws Exception { | 531 | public TTInfoDetail objToEntity(JSONObject obj) throws Exception { |
| @@ -332,12 +576,12 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -332,12 +576,12 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 332 | // 22、返回实体对象. | 576 | // 22、返回实体对象. |
| 333 | return td; | 577 | return td; |
| 334 | } | 578 | } |
| 335 | - | 579 | + |
| 336 | /** | 580 | /** |
| 337 | * @description : (TODO) int转boolean类型. | 581 | * @description : (TODO) int转boolean类型. |
| 338 | - * | 582 | + * |
| 339 | * @param value--int类型的数值] | 583 | * @param value--int类型的数值] |
| 340 | - * | 584 | + * |
| 341 | * @return : 返回一个布尔类型值. | 585 | * @return : 返回一个布尔类型值. |
| 342 | * */ | 586 | * */ |
| 343 | public Boolean intToBit(int value) { | 587 | public Boolean intToBit(int value) { |
| @@ -347,13 +591,13 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -347,13 +591,13 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 347 | else if(value ==1) | 591 | else if(value ==1) |
| 348 | tag = true; | 592 | tag = true; |
| 349 | return tag; | 593 | return tag; |
| 350 | - } | ||
| 351 | - | 594 | + } |
| 595 | + | ||
| 352 | /** | 596 | /** |
| 353 | * @description (TODO) 获取路牌. | 597 | * @description (TODO) 获取路牌. |
| 354 | - * | 598 | + * |
| 355 | * @param xl --线路,name--路牌名称,code--路牌编码,lpType--路牌类型] | 599 | * @param xl --线路,name--路牌名称,code--路牌编码,lpType--路牌类型] |
| 356 | - * | 600 | + * |
| 357 | * @return 返回路牌. | 601 | * @return 返回路牌. |
| 358 | * */ | 602 | * */ |
| 359 | public GuideboardInfo getLp(Line xl,String name, int code, String lpType) throws Exception { | 603 | public GuideboardInfo getLp(Line xl,String name, int code, String lpType) throws Exception { |
| @@ -380,18 +624,18 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -380,18 +624,18 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 380 | entity.setUpdateBy(null); | 624 | entity.setUpdateBy(null); |
| 381 | // 8、保存路牌. | 625 | // 8、保存路牌. |
| 382 | guideboardInfoRepository.save(entity); | 626 | guideboardInfoRepository.save(entity); |
| 383 | - } | 627 | + } |
| 384 | // 9、返回路牌. | 628 | // 9、返回路牌. |
| 385 | return entity; | 629 | return entity; |
| 386 | } | 630 | } |
| 387 | - | 631 | + |
| 388 | /** | 632 | /** |
| 389 | * @description : (TODO) 线路方向转代码. | 633 | * @description : (TODO) 线路方向转代码. |
| 390 | - * | 634 | + * |
| 391 | * @param str--方向字符串] | 635 | * @param str--方向字符串] |
| 392 | - * | 636 | + * |
| 393 | * @return 返回方向代码. | 637 | * @return 返回方向代码. |
| 394 | - * | 638 | + * |
| 395 | * @exception 异常暂先抛出. | 639 | * @exception 异常暂先抛出. |
| 396 | * */ | 640 | * */ |
| 397 | public String dirToCod(String str) throws Exception { | 641 | public String dirToCod(String str) throws Exception { |
src/main/java/com/bsth/service/schedule/impl/plan/DroolsSchedulePlan.java
| @@ -326,6 +326,8 @@ public class DroolsSchedulePlan { | @@ -326,6 +326,8 @@ public class DroolsSchedulePlan { | ||
| 326 | schedulePlan.setScheduleToTime(this.to); | 326 | schedulePlan.setScheduleToTime(this.to); |
| 327 | schedulePlan.setCreateBy(this.schedulePlan.getCreateBy()); | 327 | schedulePlan.setCreateBy(this.schedulePlan.getCreateBy()); |
| 328 | schedulePlan.setUpdateBy(this.schedulePlan.getUpdateBy()); | 328 | schedulePlan.setUpdateBy(this.schedulePlan.getUpdateBy()); |
| 329 | + schedulePlan.setCreateDate(this.schedulePlan.getCreateDate()); | ||
| 330 | + schedulePlan.setUpdateDate(this.schedulePlan.getUpdateDate()); | ||
| 329 | 331 | ||
| 330 | // 1-1、构造drools规则输入数据,输出数据 | 332 | // 1-1、构造drools规则输入数据,输出数据 |
| 331 | PlanCalcuParam_input planCalcuParam_input = new PlanCalcuParam_input( | 333 | PlanCalcuParam_input planCalcuParam_input = new PlanCalcuParam_input( |
src/main/java/com/bsth/service/schedule/utils/MyDateUtils.java
0 → 100644
| 1 | +package com.bsth.service.schedule.utils; | ||
| 2 | + | ||
| 3 | +import org.apache.commons.lang3.time.DateUtils; | ||
| 4 | +import org.joda.time.DateTime; | ||
| 5 | + | ||
| 6 | +import java.util.Date; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 日期处理工具类。 | ||
| 10 | + */ | ||
| 11 | +public class MyDateUtils { | ||
| 12 | + | ||
| 13 | + /** | ||
| 14 | + * 将HH:mm格式的时间格式加上指定分钟后,生成新的日期返回。 | ||
| 15 | + * @param hhssDate | ||
| 16 | + * @param minutes | ||
| 17 | + * @param day 是否跨天 | ||
| 18 | + */ | ||
| 19 | + public static Date hhssTimePlusMinunits(String hhssDate, Integer minutes, Integer day) { | ||
| 20 | + try { | ||
| 21 | + DateTime newDate = new DateTime(DateUtils.parseDate("1980-01-01 " + hhssDate, "yyyy-MM-dd HH:mm")); | ||
| 22 | + return newDate.plusDays(day).plusMinutes(minutes).toDate(); | ||
| 23 | + } catch (Exception exp) { | ||
| 24 | + throw new RuntimeException(exp); | ||
| 25 | + } | ||
| 26 | + } | ||
| 27 | +} |
src/main/java/com/bsth/service/schedule/utils/MyHttpUtils.java
0 → 100644
| 1 | +package com.bsth.service.schedule.utils; | ||
| 2 | + | ||
| 3 | +import javax.servlet.http.HttpServletResponse; | ||
| 4 | +import java.io.*; | ||
| 5 | +import java.net.URLEncoder; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * 相关Http层的util工具类。 | ||
| 9 | + */ | ||
| 10 | +public class MyHttpUtils { | ||
| 11 | + // 流输出文件 | ||
| 12 | + public static void responseStreamFile(HttpServletResponse response, File file) throws IOException { | ||
| 13 | + // 流输出导出文件 | ||
| 14 | + response.setHeader("content-type", "application/octet-stream"); | ||
| 15 | + String fileName = file.getName(); | ||
| 16 | + if (MyStringUtils.isContainChinese(fileName)) { | ||
| 17 | + response.setHeader("Content-Disposition", "attachment; filename*=" + URLEncoder.encode(fileName, "UTF-8")); | ||
| 18 | + } else { | ||
| 19 | + response.setHeader("Content-Disposition", "attachment; filename=" + fileName); | ||
| 20 | + } | ||
| 21 | + response.setContentType("application/octet-stream"); | ||
| 22 | + | ||
| 23 | + try ( | ||
| 24 | + OutputStream os = response.getOutputStream(); | ||
| 25 | + BufferedOutputStream bos = new BufferedOutputStream(os); | ||
| 26 | + InputStream is = new FileInputStream(file); | ||
| 27 | + BufferedInputStream bis = new BufferedInputStream(is) | ||
| 28 | + ) { | ||
| 29 | + int length; | ||
| 30 | + byte[] temp = new byte[1024 * 10]; | ||
| 31 | + while ((length = bis.read(temp)) != -1) { | ||
| 32 | + bos.write(temp, 0, length); | ||
| 33 | + } | ||
| 34 | + bos.flush(); | ||
| 35 | + } | ||
| 36 | + } | ||
| 37 | +} |
src/main/resources/application-dev.properties
| 1 | -server.port=9088 | ||
| 2 | - | ||
| 3 | -# dubbo服务化使用开关flag | ||
| 4 | -dubbo.use=false | ||
| 5 | - | ||
| 6 | -#JPA | ||
| 7 | -spring.jpa.hibernate.ddl-auto= update | ||
| 8 | -spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyHbmImpl | ||
| 9 | -spring.jpa.hibernate.naming.physical-strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy | ||
| 10 | -spring.jpa.database= MYSQL | ||
| 11 | -spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true | ||
| 12 | -spring.jpa.show-sql= true | ||
| 13 | - | ||
| 14 | -#DATABASE | ||
| 15 | -spring.datasource.driver-class-name= com.mysql.jdbc.Driver | ||
| 16 | -spring.datasource.url= jdbc:mysql://127.0.0.1/control?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 17 | -#spring.datasource.url= jdbc:mysql://192.168.168.222/control?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 18 | -spring.datasource.username= root | ||
| 19 | -spring.datasource.password= | ||
| 20 | -#spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 21 | -#spring.datasource.username= root | ||
| 22 | -#spring.datasource.password= root | ||
| 23 | -spring.datasource.type= com.zaxxer.hikari.HikariDataSource | ||
| 24 | - | ||
| 25 | -#DATASOURCE SETTING | ||
| 26 | -spring.datasource.hikari.minimum-idle= 8 | ||
| 27 | -spring.datasource.hikari.maximum-pool-size= 100 | ||
| 28 | -#spring.datasource.hikari.auto-commit= true | ||
| 29 | -spring.datasource.hikari.idle-timeout= 60000 | ||
| 30 | -#spring.datasource.hikari.pool-name= HikariPool | ||
| 31 | -spring.datasource.hikari.max-lifetime= 1800000 | ||
| 32 | -spring.datasource.hikari.connection-timeout= 3000 | ||
| 33 | -spring.datasource.hikari.connection-test-query= SELECT 1 | ||
| 34 | -spring.datasource.hikari.validation-timeout= 3000 | ||
| 35 | -spring.datasource.hikari.register-mbeans=true | ||
| 36 | - | ||
| 37 | -## gps client data | ||
| 38 | -http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all | ||
| 39 | -## gateway real data | ||
| 40 | -http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/ | ||
| 41 | -## gateway send directive | ||
| 42 | -http.send.directive = http://192.168.168.201:9090/transport_server/message/ | ||
| 43 | -## rfid data | ||
| 44 | -http.rfid.url= http://114.80.178.12:29000/rfid | 1 | +server.port=9088 |
| 2 | + | ||
| 3 | +# dubbo服务化使用开关flag | ||
| 4 | +dubbo.use=false | ||
| 5 | + | ||
| 6 | +#JPA | ||
| 7 | +spring.jpa.hibernate.ddl-auto= none | ||
| 8 | +spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyHbmImpl | ||
| 9 | +spring.jpa.hibernate.naming.physical-strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy | ||
| 10 | +spring.jpa.database= MYSQL | ||
| 11 | +spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true | ||
| 12 | +spring.jpa.show-sql= true | ||
| 13 | + | ||
| 14 | +#DATABASE | ||
| 15 | +spring.datasource.driver-class-name= com.mysql.jdbc.Driver | ||
| 16 | +#spring.datasource.url= jdbc:mysql://127.0.0.1/control?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 17 | +##spring.datasource.url= jdbc:mysql://192.168.168.222/control?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 18 | +#spring.datasource.username= root | ||
| 19 | +#spring.datasource.password= | ||
| 20 | +spring.datasource.url= jdbc:mysql://127.0.0.1/control?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 21 | +spring.datasource.username= root | ||
| 22 | +spring.datasource.password= root | ||
| 23 | +#spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 24 | +#spring.datasource.username= root | ||
| 25 | +#spring.datasource.password= root | ||
| 26 | +spring.datasource.type= com.zaxxer.hikari.HikariDataSource | ||
| 27 | + | ||
| 28 | +#DATASOURCE SETTING | ||
| 29 | +spring.datasource.hikari.minimum-idle= 8 | ||
| 30 | +spring.datasource.hikari.maximum-pool-size= 100 | ||
| 31 | +#spring.datasource.hikari.auto-commit= true | ||
| 32 | +spring.datasource.hikari.idle-timeout= 60000 | ||
| 33 | +#spring.datasource.hikari.pool-name= HikariPool | ||
| 34 | +spring.datasource.hikari.max-lifetime= 1800000 | ||
| 35 | +spring.datasource.hikari.connection-timeout= 3000 | ||
| 36 | +spring.datasource.hikari.connection-test-query= SELECT 1 | ||
| 37 | +spring.datasource.hikari.validation-timeout= 3000 | ||
| 38 | +spring.datasource.hikari.register-mbeans=true | ||
| 39 | + | ||
| 40 | +## gps client data | ||
| 41 | +http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all | ||
| 42 | +## gateway real data | ||
| 43 | +http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/ | ||
| 44 | +## gateway send directive | ||
| 45 | +http.send.directive = http://192.168.168.201:9090/transport_server/message/ | ||
| 46 | +## rfid data | ||
| 47 | +http.rfid.url= http://114.80.178.12:29000/rfid | ||
| 48 | +## first last generate | ||
| 49 | +ms.fl.generate=true | ||
| 45 | \ No newline at end of file | 50 | \ No newline at end of file |
src/main/resources/application-prod.properties
| @@ -47,3 +47,5 @@ http.report.url.05= http://116.228.197.222:8081/ygjwsystem_j2ee/clbx/clbx_dd.do | @@ -47,3 +47,5 @@ http.report.url.05= http://116.228.197.222:8081/ygjwsystem_j2ee/clbx/clbx_dd.do | ||
| 47 | http.report.url.22= http://116.247.73.122:9098/jgjwsystem_j2ee/clbx/clbx_dd.do | 47 | http.report.url.22= http://116.247.73.122:9098/jgjwsystem_j2ee/clbx/clbx_dd.do |
| 48 | http.report.url.26= http://116.236.141.34:8088/nhjwsystem_j2ee/clbx/clbx_dd.do | 48 | http.report.url.26= http://116.236.141.34:8088/nhjwsystem_j2ee/clbx/clbx_dd.do |
| 49 | http.report.url.55= http://180.168.216.248:8088/snjwsystem_j2ee/clbx/clbx_dd.do | 49 | http.report.url.55= http://180.168.216.248:8088/snjwsystem_j2ee/clbx/clbx_dd.do |
| 50 | +## first last generate | ||
| 51 | +ms.fl.generate=true | ||
| 50 | \ No newline at end of file | 52 | \ No newline at end of file |
src/main/resources/application-test.properties
| @@ -38,3 +38,5 @@ http.gps.real.url= http://10.10.200.79:8080/transport_server/rtgps/ | @@ -38,3 +38,5 @@ http.gps.real.url= http://10.10.200.79:8080/transport_server/rtgps/ | ||
| 38 | #http.send.directive = http://10.10.200.79:8080/transport_server/message/ | 38 | #http.send.directive = http://10.10.200.79:8080/transport_server/message/ |
| 39 | ## rfid data | 39 | ## rfid data |
| 40 | http.rfid.url= http://10.10.200.82:9000/rfid | 40 | http.rfid.url= http://10.10.200.82:9000/rfid |
| 41 | +## first last generate | ||
| 42 | +ms.fl.generate=false | ||
| 41 | \ No newline at end of file | 43 | \ No newline at end of file |
src/main/resources/fatso/start.js
| @@ -16,7 +16,7 @@ var platform = process.platform; | @@ -16,7 +16,7 @@ var platform = process.platform; | ||
| 16 | var iswin = platform == 'win32'; | 16 | var iswin = platform == 'win32'; |
| 17 | var sp = platform == 'win32' ? '\\' : '/'; | 17 | var sp = platform == 'win32' ? '\\' : '/'; |
| 18 | //不参与的目录 | 18 | //不参与的目录 |
| 19 | -var excludes = ['scheduleApp', 'trafficManage', 'control', 'permission' + sp + 'authorize_all','permission' + sp + 'user', 'summary', 'history_sch', 'report' + sp + 'oil', 'base' + sp + 'geo_data_edit', 'base' + sp + 'carpark', 'forms', 'mforms', 'report', 'punctual', 'base' + sp + 'timesmodel'] | 19 | +var excludes = ['scheduleApp', 'trafficManage', 'control', 'permission' + sp + 'authorize_all','permission' + sp + 'user', 'summary', 'history_sch', 'report' + sp + 'oil', 'base' + sp + 'geo_data_edit', 'base' + sp + 'carpark', 'forms', 'mforms', 'report', 'punctual', 'base' + sp + 'timesmodel', 'base' + sp + 'stationroute'] |
| 20 | , ep = new EventProxy() | 20 | , ep = new EventProxy() |
| 21 | , pName = 'bsth_control' | 21 | , pName = 'bsth_control' |
| 22 | , path = process.cwd() | 22 | , path = process.cwd() |
src/main/resources/static/pages/electricity/list/list.html
| @@ -280,7 +280,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -280,7 +280,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 280 | $("#checkDl").on('click', function () { | 280 | $("#checkDl").on('click', function () { |
| 281 | if ($("#rq").val() != "") { | 281 | if ($("#rq").val() != "") { |
| 282 | var params=getParamsList(); | 282 | var params=getParamsList(); |
| 283 | - $get('/ylb/checkDate',params,function(status){ | 283 | + var par={}; |
| 284 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 285 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 286 | + $get('/ylb/checkDate',par,function(status){ | ||
| 284 | if(status=='2'){ | 287 | if(status=='2'){ |
| 285 | layer.msg('只能操作三天内数据.'); | 288 | layer.msg('只能操作三天内数据.'); |
| 286 | }else{ | 289 | }else{ |
| @@ -301,7 +304,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -301,7 +304,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 301 | console.log("进场油量等于出场油量"); | 304 | console.log("进场油量等于出场油量"); |
| 302 | if ($("#rq").val() != "") { | 305 | if ($("#rq").val() != "") { |
| 303 | var params=getParamsList(); | 306 | var params=getParamsList(); |
| 304 | - $get('/ylb/checkDate',params,function(status){ | 307 | + var par={}; |
| 308 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 309 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 310 | + $get('/ylb/checkDate',par,function(status){ | ||
| 305 | if(status=='2'){ | 311 | if(status=='2'){ |
| 306 | layer.msg('只能操作三天内数据.'); | 312 | layer.msg('只能操作三天内数据.'); |
| 307 | }else{ | 313 | }else{ |
| @@ -321,7 +327,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -321,7 +327,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 321 | //保存 | 327 | //保存 |
| 322 | $("#saveButton").on('click',function(){ | 328 | $("#saveButton").on('click',function(){ |
| 323 | var params_=getParamsList(); | 329 | var params_=getParamsList(); |
| 324 | - $get('/ylb/checkDate',params_,function(status){ | 330 | + var par={}; |
| 331 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 332 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 333 | + $get('/ylb/checkDate',par,function(status){ | ||
| 325 | if(status=='2'){ | 334 | if(status=='2'){ |
| 326 | layer.msg('只能操作三天内数据.'); | 335 | layer.msg('只能操作三天内数据.'); |
| 327 | }else{ | 336 | }else{ |
| @@ -433,7 +442,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -433,7 +442,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 433 | $("#obtain").on('click', function () { | 442 | $("#obtain").on('click', function () { |
| 434 | if ($("#rq").val() != "") { | 443 | if ($("#rq").val() != "") { |
| 435 | var params=getParamsList(); | 444 | var params=getParamsList(); |
| 436 | - $get('/ylb/checkDate',params,function(status){ | 445 | + var par={}; |
| 446 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 447 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 448 | + $get('/ylb/checkDate',par,function(status){ | ||
| 437 | if(status=='2'){ | 449 | if(status=='2'){ |
| 438 | layer.msg('只能操作三天内数据.'); | 450 | layer.msg('只能操作三天内数据.'); |
| 439 | }else{ | 451 | }else{ |
| @@ -598,7 +610,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -598,7 +610,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 598 | function jsyUpdate(){ | 610 | function jsyUpdate(){ |
| 599 | var params=getParamsList(); | 611 | var params=getParamsList(); |
| 600 | var id = $(this).data('id'); | 612 | var id = $(this).data('id'); |
| 601 | - $get('/ylb/checkDate',params,function(status){ | 613 | + var par={}; |
| 614 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 615 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 616 | + $get('/ylb/checkDate',par,function(status){ | ||
| 602 | if(status=='2'){ | 617 | if(status=='2'){ |
| 603 | layer.msg('只能操作三天内数据.'); | 618 | layer.msg('只能操作三天内数据.'); |
| 604 | }else{ | 619 | }else{ |
| @@ -742,7 +757,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -742,7 +757,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 742 | //删除 | 757 | //删除 |
| 743 | $('#removeButton').on('click', function () { | 758 | $('#removeButton').on('click', function () { |
| 744 | var params_=getParamsList(); | 759 | var params_=getParamsList(); |
| 745 | - $get('/ylb/checkDate',params_,function(status){ | 760 | + var par={}; |
| 761 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 762 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 763 | + $get('/ylb/checkDate',par,function(status){ | ||
| 746 | if(status=='2'){ | 764 | if(status=='2'){ |
| 747 | layer.msg('只能操作三天内数据.'); | 765 | layer.msg('只能操作三天内数据.'); |
| 748 | }else{ | 766 | }else{ |
src/main/resources/static/pages/forms/calc/calcDetailMonthly.html
| 1 | -<style type="text/css"> | ||
| 2 | - .table-bordered { | ||
| 3 | - border: 1px solid; } | ||
| 4 | - .table-bordered > thead > tr > th, | ||
| 5 | - .table-bordered > thead > tr > td, | ||
| 6 | - .table-bordered > tbody > tr > th, | ||
| 7 | - .table-bordered > tbody > tr > td, | ||
| 8 | - .table-bordered > tfoot > tr > th, | ||
| 9 | - .table-bordered > tfoot > tr > td { | ||
| 10 | - border: 1px solid; | ||
| 11 | - text-align: center; } | ||
| 12 | - .table-bordered > thead > tr > th, | ||
| 13 | - .table-bordered > thead > tr > td { | ||
| 14 | - border-bottom-width: 2px; } | ||
| 15 | - | ||
| 16 | - .table > tbody + tbody { | ||
| 17 | - border-top: 1px solid; } | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - #analy_body tr> td >span{ | ||
| 21 | - word-break: keep-all;white-space:nowrap; | ||
| 22 | - } | ||
| 23 | - | ||
| 24 | - #analy_body td{ | ||
| 25 | - min-width: 100px; | ||
| 26 | - max-width: 100px; | ||
| 27 | - width: 100px; | ||
| 28 | - } | ||
| 29 | - | ||
| 30 | - #analy_body{ | ||
| 31 | - margin-top: 20px; | ||
| 32 | - height: 620px; | ||
| 33 | - width: 100% | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | - | ||
| 37 | - .table_head::-webkit-scrollbar { | ||
| 38 | - display:none | ||
| 39 | - } | ||
| 40 | - | ||
| 41 | - .table_head{ | ||
| 42 | - min-width: 906px; | ||
| 43 | - width: 100%; | ||
| 44 | - overflow: hidden; | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - .table_body{ | ||
| 48 | - width:101%; | ||
| 49 | - height:580px; | ||
| 50 | - overflow: auto; | ||
| 51 | - margin-top: -20px; | ||
| 52 | - } | ||
| 53 | -</style> | ||
| 54 | -<div class="page-head"> | ||
| 55 | - <div class="page-title"> | ||
| 56 | - <h1>路单线路明细月报表</h1> | ||
| 57 | - </div> | ||
| 58 | -</div> | ||
| 59 | - | ||
| 60 | -<!--<div class="row">--> | ||
| 61 | -<div class=" row col-md-12 portlet light bordered" style="height:calc(100% - 38px)"> | ||
| 62 | - <div class=""> | ||
| 63 | - <form class="form-inline" > | ||
| 64 | - <!--<div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_daily"> | ||
| 65 | - <span class="item-label" style="width: 80px;">  公司: </span> | ||
| 66 | - <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select> | ||
| 67 | - </div>--> | ||
| 68 | - <div style="display: inline-block; margin-left: 33px;" id="fgsdmDiv_daily"> | ||
| 69 | - <span class="item-label" style="width: 80px;"> 分公司: </span> | ||
| 70 | - <select class="form-control" name="fgsdm" id="fgsdm" style="width: 180px;"></select> | ||
| 71 | - </div> | ||
| 72 | - <!--<div style="display: inline-block;margin-left: 33px;"> | ||
| 73 | - <span class="item-label" style="width: 80px;">  线路: </span> | ||
| 74 | - <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 75 | - </div>--> | ||
| 76 | - <div style="display: inline-block; margin-left: 33px;"> | ||
| 77 | - <span class="item-label" style="width: 80px;">线路性质: </span> | ||
| 78 | - <select class="form-control" name="destroy" id="destroy" style="width: 180px;"> | ||
| 79 | - <option value="0,1">全部线路</option> | ||
| 80 | - <option value="0">营运线路</option> | ||
| 81 | - <option value="1">非营运线路</option> | ||
| 82 | - </select> | ||
| 83 | - </div> | ||
| 84 | - <div style="display: inline-block;margin-left: 33px;" class="date-picker"> | ||
| 85 | - <span class="item-label" style="width: 80px;">  时间: </span> | ||
| 86 | - <input class="form-control" type="text" id="startDate" style="width: 180px;" /> - | ||
| 87 | - <input class="form-control" type="text" id="endDate" style="width: 180px;" /> | ||
| 88 | - <!--<input class="form-control" type="text" id="startDate" style="width: 180px;" value="2020-10-01"/> - --> | ||
| 89 | - <!--<input class="form-control" type="text" id="endDate" style="width: 180px;" value="2020-10-10"/>--> | ||
| 90 | - </div> | ||
| 91 | - <div style="margin-top: 2px"></div> | ||
| 92 | - | ||
| 93 | - <div style="display: inline-block;margin-left: 33px;"> | ||
| 94 | - <span class="item-label" style="width: 80px;">统计对象: </span> | ||
| 95 | - <select class="form-control" name="statisticalObj" id="statisticalObj" style="width: 180px;"> | ||
| 96 | - <option value="cl">车辆</option> | ||
| 97 | - <option value="jsy">驾驶员</option> | ||
| 98 | - <option value="cwy">乘务员</option> | ||
| 99 | - <option value="xl">线路</option> | ||
| 100 | - </select> | ||
| 101 | - </div> | ||
| 102 | - | ||
| 103 | - <div style="display: inline-block; margin-left: 33px;" > | ||
| 104 | - <span class="item-label" style="width: 80px;">统计项目: </span> | ||
| 105 | - <select class="form-control" name="statisticalItem" id="statisticalItem" style="width: 180px;"> | ||
| 106 | - <option value="yh">油耗</option> | ||
| 107 | - <option value="dh">电耗</option> | ||
| 108 | - <option value="gl">公里</option> | ||
| 109 | - <option value="bc">班次</option> | ||
| 110 | - </select> | ||
| 111 | - </div> | ||
| 112 | - <div style="display: inline-block; margin-left: 33px;" > | ||
| 113 | - <span class="item-label" style="width: 80px;">项目明细: </span> | ||
| 114 | - <select class="form-control" name="itemDetails" id="itemDetails" style="width: 180px;"></select> | ||
| 115 | - </div> | ||
| 116 | - <div class="form-group" style="display: inline-block;margin-left: 62px;"> | ||
| 117 | - <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 118 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 119 | - </div> | ||
| 120 | - </form> | ||
| 121 | - </div> | ||
| 122 | - | ||
| 123 | - <div id="analy_body"> | ||
| 124 | - <div class="table_head" id="table_head"> | ||
| 125 | - <table class="table table-bordered table-hover table-checkable " id="forms_head"> | ||
| 126 | - <thead> | ||
| 127 | - </thead> | ||
| 128 | - </table> | ||
| 129 | - </div> | ||
| 130 | - <div class="table_body" id="table_body"> | ||
| 131 | - <table class="table table-bordered table-hover table-checkable" id="forms_body"> | ||
| 132 | - <tbody> | ||
| 133 | - </tbody> | ||
| 134 | - </table> | ||
| 135 | - </div> | ||
| 136 | - </div> | ||
| 137 | -</div> | ||
| 138 | -<script > | ||
| 139 | - $(function(){ | ||
| 140 | - $('#export').attr('disabled', "true"); | ||
| 141 | - // 关闭左侧栏 | ||
| 142 | - if (!$('body').hasClass('page-sidebar-closed')) | ||
| 143 | - $('.menu-toggler.sidebar-toggler').click(); | ||
| 144 | - | ||
| 145 | - var table_body1 = document.getElementById("table_body"); | ||
| 146 | - table_body1.onscroll = function(){ | ||
| 147 | - var table_body1_left = this.scrollLeft; | ||
| 148 | - document.getElementById("table_head").scrollLeft = table_body1_left; | ||
| 149 | - }; | ||
| 150 | - | ||
| 151 | - var d = new Date(); | ||
| 152 | - d.setTime(d.getTime() - 4*1000*60*60*24);//只能查4天以前的数据 | ||
| 153 | - var year = d.getFullYear(); | ||
| 154 | - var month = d.getMonth() + 1; | ||
| 155 | - var day = d.getDate(); | ||
| 156 | - if(month < 10) | ||
| 157 | - month = "0" + month; | ||
| 158 | - if(day < 10) | ||
| 159 | - day = "0" + day; | ||
| 160 | - //时间 | ||
| 161 | - var dateTime=year + "-" + month + "-" + day; | ||
| 162 | - $("#startDate").val(dateTime); | ||
| 163 | - $("#endDate").val(dateTime); | ||
| 164 | - | ||
| 165 | - $("#endDate").datetimepicker({ | ||
| 166 | - format : 'YYYY-MM-DD', | ||
| 167 | - locale : 'zh-cn', | ||
| 168 | - maxDate : dateTime | ||
| 169 | - }); | ||
| 170 | - $("#startDate").datetimepicker({ | ||
| 171 | - format : 'YYYY-MM-DD', | ||
| 172 | - locale : 'zh-cn', | ||
| 173 | - maxDate : dateTime | ||
| 174 | - }); | ||
| 175 | - | ||
| 176 | - var lineAll=""; | ||
| 177 | - var datas = {}; //查询条件 | ||
| 178 | - | ||
| 179 | - /**用户分配的线路*/ | ||
| 180 | - $.get('/realControAuthority/findByCurrentUser', function (userAuthor) { | ||
| 181 | - lineAll = userAuthor.lineCodeStr.substring(0,userAuthor.lineCodeStr.length-1); | ||
| 182 | - }); | ||
| 183 | - | ||
| 184 | - var tempData = {}; | ||
| 185 | - | ||
| 186 | - $.get('/user/companyData', function(obj) { | ||
| 187 | - var option = ''; | ||
| 188 | - var allC = ""; | ||
| 189 | - for (var i = 0; i < obj.length; i++) { | ||
| 190 | - if (obj[i].companyCode == "26") { | ||
| 191 | - var children = obj[i].children; | ||
| 192 | - for (var j = 0; j < children.length; j++) { | ||
| 193 | - allC += children[j].code+","; | ||
| 194 | - option += '<option value="' + children[j].code + '">' + children[j].name + '</option>'; | ||
| 195 | - } | ||
| 196 | - } | ||
| 197 | - } | ||
| 198 | - | ||
| 199 | - var options = '<option value="'+allC.substring(0,allC.length-1)+'">所有分公司</option>'+option; | ||
| 200 | - $('#fgsdm').html(options); | ||
| 201 | - }); | ||
| 202 | - | ||
| 203 | - // 项目明细选项列 | ||
| 204 | - // 触发默认选项 | ||
| 205 | - updateItem(); | ||
| 206 | - $("#statisticalItem").on("change",updateItem); | ||
| 207 | - function updateItem() { | ||
| 208 | - var item = $('#statisticalItem').val(); | ||
| 209 | - var options = ''; | ||
| 210 | - if(item == "yh"){ | ||
| 211 | - options += '<option value="jzlAll">加注量[全部]</option>' + | ||
| 212 | - '<option value="jzl0">加注量[0#]</option>'+ | ||
| 213 | - '<option value="jzl-10">加注量[-10#]</option>'+ | ||
| 214 | - '<option value="yhl">油耗量</option>'+ | ||
| 215 | - '<option value="cccy">出场存油</option>'+ | ||
| 216 | - '<option value="jccy">进场存油</option>'+ | ||
| 217 | - '<option value="bglyh">百公里油耗</option>'; | ||
| 218 | - } else if(item == "gl"){ | ||
| 219 | - options += '<option value="zgl">总公里</option>' + | ||
| 220 | - '<option value="jhgl">计划公里</option>'; | ||
| 221 | - /*'<option value="jclm">进场路码</option>'+ | ||
| 222 | - '<option value="cclm">出场路码</option>'*/ | ||
| 223 | - } else if(item == "bc"){ | ||
| 224 | - options += '<option value="sjbc">实际班次</option>' + | ||
| 225 | - '<option value="jhbc">计划班次</option>'; | ||
| 226 | - } else if(item == "dh"){ | ||
| 227 | - options += '<option value="dh">耗电量</option>'; | ||
| 228 | - options += '<option value="cdl">充电量</option>'; | ||
| 229 | - options += '<option value="cccd">出场存电</option>'; | ||
| 230 | - options += '<option value="jccd">进场存电</option>'; | ||
| 231 | - options += '<option value="bgldh">百公里电耗</option>'; | ||
| 232 | - } | ||
| 233 | - $('#itemDetails').html(options); | ||
| 234 | - } | ||
| 235 | - | ||
| 236 | - //线路名称 | ||
| 237 | - var lineName = ''; | ||
| 238 | - $("#query").on("click",function(){ | ||
| 239 | - var gsdm = "26"; | ||
| 240 | - var fgsdm = $("#fgsdm").val(); | ||
| 241 | - var startDate = $("#startDate").val(); | ||
| 242 | - var endDate = $("#endDate").val(); | ||
| 243 | - var statisticalObj = $("#statisticalObj").val(); | ||
| 244 | - //开始和结束时间 | ||
| 245 | - var startTime = Date.parse(new Date(startDate)); | ||
| 246 | - var endTime = Date.parse(new Date(endDate)); | ||
| 247 | - | ||
| 248 | - datas = {}; // 清空之前数据 | ||
| 249 | - datas.gsdm = gsdm; | ||
| 250 | - datas.fgsdm = fgsdm; | ||
| 251 | - datas.lineCode = lineAll; | ||
| 252 | - datas.timeType = "m"; | ||
| 253 | - datas.startDate = startDate; | ||
| 254 | - datas.endDate = endDate; | ||
| 255 | - datas.destroy = $("#destroy").val(); | ||
| 256 | - datas.statisticalObj = $("#statisticalObj").val(); | ||
| 257 | - datas.itemDetails = $("#itemDetails").val(); | ||
| 258 | - var itemDetails = datas.itemDetails, | ||
| 259 | - type = "加注量[全部]"; | ||
| 260 | - if(itemDetails=="jzl0"){ | ||
| 261 | - type = "加注量[0#]" | ||
| 262 | - } else if(itemDetails=="jzl-10"){ | ||
| 263 | - type = "加注量[-10#]" | ||
| 264 | - } else if(itemDetails=="yhl"){ | ||
| 265 | - type = "油耗量" | ||
| 266 | - } else if(itemDetails=="cccy"){ | ||
| 267 | - type = "出场存油" | ||
| 268 | - } else if(itemDetails=="jccy"){ | ||
| 269 | - type = "进场存油" | ||
| 270 | - } else if(itemDetails=="bglyh"){ | ||
| 271 | - type = "百公里油耗" | ||
| 272 | - } else if(itemDetails=="zgl"){ | ||
| 273 | - type = "总公里" | ||
| 274 | - } else if(itemDetails=="jhgl"){ | ||
| 275 | - type = "计划公里" | ||
| 276 | - } else if(itemDetails=="jclm"){ | ||
| 277 | - type = "进场路码" | ||
| 278 | - } else if(itemDetails=="cclm"){ | ||
| 279 | - type = "出场路码" | ||
| 280 | - } else if(itemDetails=="sjbc"){ | ||
| 281 | - type = "实际班次" | ||
| 282 | - } else if(itemDetails=="jhbc"){ | ||
| 283 | - type = "计划班次" | ||
| 284 | - } else if(itemDetails=="dh"){ | ||
| 285 | - type = "耗电量" | ||
| 286 | - } else if(itemDetails=="cdl"){ | ||
| 287 | - type = "充电量" | ||
| 288 | - } else if(itemDetails=="cccd"){ | ||
| 289 | - type = "出场存电" | ||
| 290 | - } else if(itemDetails=="jccd"){ | ||
| 291 | - type = "进场存电" | ||
| 292 | - } else if(itemDetails=="bgldh"){ | ||
| 293 | - type = "百公里电耗" | ||
| 294 | - } | ||
| 295 | - datas.name = datas.startDate+"-"+datas.endDate+"-路单线路明细月报表("+type+")"; | ||
| 296 | - if(startDate==null || startDate =="" ||endDate==null || endDate ==""){ | ||
| 297 | - layer.msg('请选择时间段!'); | ||
| 298 | - }else if(endTime<startTime){ | ||
| 299 | - layer.msg('结束日期不能小于开始日期!'); | ||
| 300 | - }else { | ||
| 301 | - if (endDate.substring(0, 7) != startDate.substring(0, 7)) { | ||
| 302 | - layer.msg("请查询同月份数据!"); | ||
| 303 | - return; | ||
| 304 | - } else { | ||
| 305 | - var lodingI = layer.load(2); | ||
| 306 | - $get('/calcWaybill/calcDetailMonthly', datas, function (rs) { | ||
| 307 | - if (rs.length <=0) { | ||
| 308 | - layer.close(lodingI); | ||
| 309 | - layer.open({ | ||
| 310 | - title: '提示' | ||
| 311 | - , content: '没有您要查询的数据,请重新选择参数!' | ||
| 312 | - }); | ||
| 313 | - $("#export").attr('disabled',"true"); | ||
| 314 | - return; | ||
| 315 | - }else | ||
| 316 | - $("#export").removeAttr("disabled"); | ||
| 317 | - var htmlHead = "<tr><td colspan='"+rs[0].length+"'>"+datas.name+"</td></tr>", htmlBody = ""; | ||
| 318 | - var rsLength = rs.length; | ||
| 319 | - rs.forEach(function (o, i) { | ||
| 320 | - var html = "<tr>" | ||
| 321 | - o.forEach(function (td, j) { | ||
| 322 | - var colspan; | ||
| 323 | - if (i == rsLength - 1 && j == 0) { | ||
| 324 | - colspan = (statisticalObj == "xl" ? "colspan='3'" : "colspan='5'"); | ||
| 325 | - if(statisticalObj == "cl") | ||
| 326 | - colspan = "colspan='6'"; | ||
| 327 | - } | ||
| 328 | - html += "<td " + colspan + ">" + td + "</td>" | ||
| 329 | - }); | ||
| 330 | - html += "</tr>" | ||
| 331 | - if (i == 0) { | ||
| 332 | - htmlHead += html; | ||
| 333 | - } else | ||
| 334 | - htmlBody += html; | ||
| 335 | - }); | ||
| 336 | - $('#forms_head thead').html(htmlHead); | ||
| 337 | - $('#forms_body tbody').html(htmlBody); | ||
| 338 | - layer.close(lodingI); | ||
| 339 | - }); | ||
| 340 | - } | ||
| 341 | - } | ||
| 342 | - }); | ||
| 343 | - | ||
| 344 | - $("#export").on("click",function(){ | ||
| 345 | - $post("/report/calcDetailMonthlyE",datas,function(result){ | ||
| 346 | - window.open("/downloadFile/download?fileName="+datas.name); | ||
| 347 | - }); | ||
| 348 | - }); | ||
| 349 | - }); | ||
| 350 | -</script> | ||
| 351 | -<!--<script type="application/javascript" src="/pages/forms/calc/calcDetailMonthly.js"></script>--> | 1 | +<style type="text/css"> |
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; | ||
| 11 | + text-align: center; } | ||
| 12 | + .table-bordered > thead > tr > th, | ||
| 13 | + .table-bordered > thead > tr > td { | ||
| 14 | + border-bottom-width: 2px; } | ||
| 15 | + | ||
| 16 | + .table > tbody + tbody { | ||
| 17 | + border-top: 1px solid; } | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + #analy_body tr> td >span{ | ||
| 21 | + word-break: keep-all;white-space:nowrap; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + #analy_body td{ | ||
| 25 | + min-width: 100px; | ||
| 26 | + max-width: 100px; | ||
| 27 | + width: 100px; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + #analy_body{ | ||
| 31 | + margin-top: 20px; | ||
| 32 | + height: 620px; | ||
| 33 | + width: 100% | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + .table_head::-webkit-scrollbar { | ||
| 38 | + display:none | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + .table_head{ | ||
| 42 | + min-width: 906px; | ||
| 43 | + width: 100%; | ||
| 44 | + overflow: hidden; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + .table_body{ | ||
| 48 | + width:101%; | ||
| 49 | + height:580px; | ||
| 50 | + overflow: auto; | ||
| 51 | + margin-top: -20px; | ||
| 52 | + } | ||
| 53 | +</style> | ||
| 54 | +<div class="page-head"> | ||
| 55 | + <div class="page-title"> | ||
| 56 | + <h1>路单线路明细月报表</h1> | ||
| 57 | + </div> | ||
| 58 | +</div> | ||
| 59 | + | ||
| 60 | +<!--<div class="row">--> | ||
| 61 | +<div class=" row col-md-12 portlet light bordered" style="height:calc(100% - 38px)"> | ||
| 62 | + <div class=""> | ||
| 63 | + <form class="form-inline" > | ||
| 64 | + <div style="display: inline-block; margin-left: 13px;" id="gsdmDiv_daily"> | ||
| 65 | + <span class="item-label" style="width: 80px;">  公司: </span> | ||
| 66 | + <select class="form-control" name="company" id="gsdm" style="width: 150px;"></select> | ||
| 67 | + </div> | ||
| 68 | + <div style="display: inline-block; margin-left: 13px;" id="fgsdmDiv_daily"> | ||
| 69 | + <span class="item-label" style="width: 80px;"> 分公司: </span> | ||
| 70 | + <select class="form-control" name="fgsdm" id="fgsdm" style="width: 150px;"></select> | ||
| 71 | + </div> | ||
| 72 | + <!--<div style="display: inline-block;margin-left: 33px;"> | ||
| 73 | + <span class="item-label" style="width: 80px;">  线路: </span> | ||
| 74 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 75 | + </div>--> | ||
| 76 | + <div style="display: inline-block;margin-left: 13px;" class="date-picker"> | ||
| 77 | + <span class="item-label" style="width: 80px;">  时间: </span> | ||
| 78 | + <input class="form-control" type="text" id="startDate" style="width: 150px;" /> - | ||
| 79 | + <input class="form-control" type="text" id="endDate" style="width: 150px;" /> | ||
| 80 | + <!--<input class="form-control" type="text" id="startDate" style="width: 180px;" value="2020-10-01"/> - --> | ||
| 81 | + <!--<input class="form-control" type="text" id="endDate" style="width: 180px;" value="2020-10-10"/>--> | ||
| 82 | + </div> | ||
| 83 | + | ||
| 84 | + <div style="margin-top: 2px"></div> | ||
| 85 | + | ||
| 86 | + <div style="display: inline-block; margin-left: 13px;"> | ||
| 87 | + <span class="item-label" style="width: 80px;">线路性质: </span> | ||
| 88 | + <select class="form-control" name="destroy" id="destroy" style="width: 150px;"> | ||
| 89 | + <option value="0,1">全部线路</option> | ||
| 90 | + <option value="0">营运线路</option> | ||
| 91 | + <option value="1">非营运线路</option> | ||
| 92 | + </select> | ||
| 93 | + </div> | ||
| 94 | + <div style="display: inline-block;margin-left: 13px;"> | ||
| 95 | + <span class="item-label" style="width: 80px;">统计对象: </span> | ||
| 96 | + <select class="form-control" name="statisticalObj" id="statisticalObj" style="width: 150px;"> | ||
| 97 | + <option value="cl">车辆</option> | ||
| 98 | + <option value="jsy">驾驶员</option> | ||
| 99 | + <option value="cwy">乘务员</option> | ||
| 100 | + <option value="xl">线路</option> | ||
| 101 | + </select> | ||
| 102 | + </div> | ||
| 103 | + | ||
| 104 | + <div style="display: inline-block; margin-left: 13px;" > | ||
| 105 | + <span class="item-label" style="width: 80px;">统计项目: </span> | ||
| 106 | + <select class="form-control" name="statisticalItem" id="statisticalItem" style="width: 150px;"> | ||
| 107 | + <option value="yh">油耗</option> | ||
| 108 | + <option value="dh">电耗</option> | ||
| 109 | + <option value="gl">公里</option> | ||
| 110 | + <option value="bc">班次</option> | ||
| 111 | + </select> | ||
| 112 | + </div> | ||
| 113 | + <div style="display: inline-block; margin-left: 13px;" > | ||
| 114 | + <span class="item-label" style="width: 80px;">项目明细: </span> | ||
| 115 | + <select class="form-control" name="itemDetails" id="itemDetails" style="width: 150px;"></select> | ||
| 116 | + </div> | ||
| 117 | + <div class="form-group" style="display: inline-block;margin-left: 22px;"> | ||
| 118 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 119 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 120 | + </div> | ||
| 121 | + </form> | ||
| 122 | + </div> | ||
| 123 | + | ||
| 124 | + <div id="analy_body"> | ||
| 125 | + <div class="table_head" id="table_head"> | ||
| 126 | + <table class="table table-bordered table-hover table-checkable " id="forms_head"> | ||
| 127 | + <thead> | ||
| 128 | + </thead> | ||
| 129 | + </table> | ||
| 130 | + </div> | ||
| 131 | + <div class="table_body" id="table_body"> | ||
| 132 | + <table class="table table-bordered table-hover table-checkable" id="forms_body" style="background-color: white;"> | ||
| 133 | + <tbody> | ||
| 134 | + </tbody> | ||
| 135 | + </table> | ||
| 136 | + </div> | ||
| 137 | + </div> | ||
| 138 | +</div> | ||
| 139 | +<script > | ||
| 140 | + $(function(){ | ||
| 141 | + $('#export').attr('disabled', "true"); | ||
| 142 | + // 关闭左侧栏 | ||
| 143 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 144 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 145 | + | ||
| 146 | + var table_body1 = document.getElementById("table_body"); | ||
| 147 | + table_body1.onscroll = function(){ | ||
| 148 | + var table_body1_left = this.scrollLeft; | ||
| 149 | + document.getElementById("table_head").scrollLeft = table_body1_left; | ||
| 150 | + }; | ||
| 151 | + | ||
| 152 | + var d = new Date(); | ||
| 153 | + d.setTime(d.getTime() - 4*1000*60*60*24);//只能查4天以前的数据 | ||
| 154 | + var year = d.getFullYear(); | ||
| 155 | + var month = d.getMonth() + 1; | ||
| 156 | + var day = d.getDate(); | ||
| 157 | + if(month < 10) | ||
| 158 | + month = "0" + month; | ||
| 159 | + if(day < 10) | ||
| 160 | + day = "0" + day; | ||
| 161 | + //时间 | ||
| 162 | + var dateTime=year + "-" + month + "-" + day; | ||
| 163 | + $("#startDate").val(dateTime); | ||
| 164 | + $("#endDate").val(dateTime); | ||
| 165 | + | ||
| 166 | + $("#endDate").datetimepicker({ | ||
| 167 | + format : 'YYYY-MM-DD', | ||
| 168 | + locale : 'zh-cn', | ||
| 169 | + maxDate : dateTime | ||
| 170 | + }); | ||
| 171 | + $("#startDate").datetimepicker({ | ||
| 172 | + format : 'YYYY-MM-DD', | ||
| 173 | + locale : 'zh-cn', | ||
| 174 | + maxDate : dateTime | ||
| 175 | + }); | ||
| 176 | + | ||
| 177 | + var lineAll=""; | ||
| 178 | + var datas = {}; //查询条件 | ||
| 179 | + | ||
| 180 | + /**用户分配的线路*/ | ||
| 181 | + $.get('/realControAuthority/findByCurrentUser', function (userAuthor) { | ||
| 182 | + lineAll = userAuthor.lineCodeStr.substring(0,userAuthor.lineCodeStr.length-1); | ||
| 183 | + }); | ||
| 184 | + | ||
| 185 | + var tempData = {}; | ||
| 186 | + | ||
| 187 | + $.get('/user/companyData', function(result){ | ||
| 188 | + var obj = result; | ||
| 189 | + var options = ''; | ||
| 190 | + for(var i = 0; i < obj.length; i++){ | ||
| 191 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + if(obj.length ==0){ | ||
| 195 | + $("#gsdmDiv_daily").css('display','none'); | ||
| 196 | + }else if(obj.length ==1){ | ||
| 197 | + $("#gsdmDiv_daily").css('display','none'); | ||
| 198 | + if(obj[0].children.length == 1 || obj[0].children.length == 0){ | ||
| 199 | + fage=false; | ||
| 200 | + $('#gsdmDiv_daily').css('display','none'); | ||
| 201 | + } | ||
| 202 | + } | ||
| 203 | + $('#gsdm').html(options); | ||
| 204 | + updateCompany(); | ||
| 205 | + }); | ||
| 206 | + $("#gsdm").on("change",updateCompany); | ||
| 207 | + | ||
| 208 | + function updateCompany(){ | ||
| 209 | + var company = $('#gsdm').val(); | ||
| 210 | + $.get('/user/companyData', function(obj) { | ||
| 211 | + var option = ''; | ||
| 212 | + var allC = ""; | ||
| 213 | + for (var i = 0; i < obj.length; i++) { | ||
| 214 | + if (obj[i].companyCode == company) { | ||
| 215 | + var children = obj[i].children; | ||
| 216 | + for (var j = 0; j < children.length; j++) { | ||
| 217 | + allC += children[j].code+","; | ||
| 218 | + option += '<option value="' + children[j].code + '">' + children[j].name + '</option>'; | ||
| 219 | + } | ||
| 220 | + } | ||
| 221 | + } | ||
| 222 | + | ||
| 223 | + var options = '<option value="'+allC.substring(0,allC.length-1)+'">所有分公司</option>'+option; | ||
| 224 | + $('#fgsdm').html(options); | ||
| 225 | + }); | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | + // 项目明细选项列 | ||
| 229 | + // 触发默认选项 | ||
| 230 | + updateItem(); | ||
| 231 | + $("#statisticalItem").on("change",updateItem); | ||
| 232 | + function updateItem() { | ||
| 233 | + var item = $('#statisticalItem').val(); | ||
| 234 | + var options = ''; | ||
| 235 | + if(item == "yh"){ | ||
| 236 | + options += '<option value="jzlAll">加注量[全部]</option>' + | ||
| 237 | + '<option value="jzl0">加注量[0#]</option>'+ | ||
| 238 | + '<option value="jzl-10">加注量[-10#]</option>'+ | ||
| 239 | + '<option value="yhl">油耗量</option>'+ | ||
| 240 | + '<option value="cccy">出场存油</option>'+ | ||
| 241 | + '<option value="jccy">进场存油</option>'+ | ||
| 242 | + '<option value="bglyh">百公里油耗</option>'; | ||
| 243 | + } else if(item == "gl"){ | ||
| 244 | + options += '<option value="zgl">总公里</option>' + | ||
| 245 | + '<option value="jhgl">计划公里</option>'; | ||
| 246 | + /*'<option value="jclm">进场路码</option>'+ | ||
| 247 | + '<option value="cclm">出场路码</option>'*/ | ||
| 248 | + } else if(item == "bc"){ | ||
| 249 | + options += '<option value="sjbc">实际班次</option>' + | ||
| 250 | + '<option value="jhbc">计划班次</option>'; | ||
| 251 | + } else if(item == "dh"){ | ||
| 252 | + options += '<option value="dh">耗电量</option>'; | ||
| 253 | + options += '<option value="cdl">充电量</option>'; | ||
| 254 | + options += '<option value="cccd">出场存电</option>'; | ||
| 255 | + options += '<option value="jccd">进场存电</option>'; | ||
| 256 | + options += '<option value="bgldh">百公里电耗</option>'; | ||
| 257 | + } | ||
| 258 | + $('#itemDetails').html(options); | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + //线路名称 | ||
| 262 | + var lineName = ''; | ||
| 263 | + $("#query").on("click",function(){ | ||
| 264 | + var gsdm = $("#gsdm").val(); | ||
| 265 | + var fgsdm = $("#fgsdm").val(); | ||
| 266 | + var startDate = $("#startDate").val(); | ||
| 267 | + var endDate = $("#endDate").val(); | ||
| 268 | + var statisticalObj = $("#statisticalObj").val(); | ||
| 269 | + //开始和结束时间 | ||
| 270 | + var startTime = Date.parse(new Date(startDate)); | ||
| 271 | + var endTime = Date.parse(new Date(endDate)); | ||
| 272 | + | ||
| 273 | + datas = {}; // 清空之前数据 | ||
| 274 | + datas.gsdm = gsdm; | ||
| 275 | + datas.fgsdm = fgsdm; | ||
| 276 | + datas.lineCode = lineAll; | ||
| 277 | + datas.timeType = "m"; | ||
| 278 | + datas.startDate = startDate; | ||
| 279 | + datas.endDate = endDate; | ||
| 280 | + datas.destroy = $("#destroy").val(); | ||
| 281 | + datas.statisticalObj = $("#statisticalObj").val(); | ||
| 282 | + datas.itemDetails = $("#itemDetails").val(); | ||
| 283 | + var itemDetails = datas.itemDetails, | ||
| 284 | + type = "加注量[全部]"; | ||
| 285 | + if(itemDetails=="jzl0"){ | ||
| 286 | + type = "加注量[0#]" | ||
| 287 | + } else if(itemDetails=="jzl-10"){ | ||
| 288 | + type = "加注量[-10#]" | ||
| 289 | + } else if(itemDetails=="yhl"){ | ||
| 290 | + type = "油耗量" | ||
| 291 | + } else if(itemDetails=="cccy"){ | ||
| 292 | + type = "出场存油" | ||
| 293 | + } else if(itemDetails=="jccy"){ | ||
| 294 | + type = "进场存油" | ||
| 295 | + } else if(itemDetails=="bglyh"){ | ||
| 296 | + type = "百公里油耗" | ||
| 297 | + } else if(itemDetails=="zgl"){ | ||
| 298 | + type = "总公里" | ||
| 299 | + } else if(itemDetails=="jhgl"){ | ||
| 300 | + type = "计划公里" | ||
| 301 | + } else if(itemDetails=="jclm"){ | ||
| 302 | + type = "进场路码" | ||
| 303 | + } else if(itemDetails=="cclm"){ | ||
| 304 | + type = "出场路码" | ||
| 305 | + } else if(itemDetails=="sjbc"){ | ||
| 306 | + type = "实际班次" | ||
| 307 | + } else if(itemDetails=="jhbc"){ | ||
| 308 | + type = "计划班次" | ||
| 309 | + } else if(itemDetails=="dh"){ | ||
| 310 | + type = "耗电量" | ||
| 311 | + } else if(itemDetails=="cdl"){ | ||
| 312 | + type = "充电量" | ||
| 313 | + } else if(itemDetails=="cccd"){ | ||
| 314 | + type = "出场存电" | ||
| 315 | + } else if(itemDetails=="jccd"){ | ||
| 316 | + type = "进场存电" | ||
| 317 | + } else if(itemDetails=="bgldh"){ | ||
| 318 | + type = "百公里电耗" | ||
| 319 | + } | ||
| 320 | + datas.name = datas.startDate+"-"+datas.endDate+"-路单线路明细月报表("+type+")"; | ||
| 321 | + if(startDate==null || startDate =="" ||endDate==null || endDate ==""){ | ||
| 322 | + layer.msg('请选择时间段!'); | ||
| 323 | + }else if(endTime<startTime){ | ||
| 324 | + layer.msg('结束日期不能小于开始日期!'); | ||
| 325 | + }else { | ||
| 326 | + if (endDate.substring(0, 7) != startDate.substring(0, 7)) { | ||
| 327 | + layer.msg("请查询同月份数据!"); | ||
| 328 | + return; | ||
| 329 | + } else { | ||
| 330 | + var lodingI = layer.load(2); | ||
| 331 | + $get('/calcWaybill/calcDetailMonthly', datas, function (rs) { | ||
| 332 | + if (rs.length <=0) { | ||
| 333 | + layer.close(lodingI); | ||
| 334 | + layer.open({ | ||
| 335 | + title: '提示' | ||
| 336 | + , content: '没有您要查询的数据,请重新选择参数!' | ||
| 337 | + }); | ||
| 338 | + $("#export").attr('disabled',"true"); | ||
| 339 | + return; | ||
| 340 | + }else | ||
| 341 | + $("#export").removeAttr("disabled"); | ||
| 342 | + var htmlHead = "<tr><td colspan='"+rs[0].length+"'>"+datas.name+"</td></tr>", htmlBody = ""; | ||
| 343 | + var rsLength = rs.length; | ||
| 344 | + rs.forEach(function (o, i) { | ||
| 345 | + var html = "<tr>" | ||
| 346 | + o.forEach(function (td, j) { | ||
| 347 | + var colspan; | ||
| 348 | + if (i == rsLength - 1 && j == 0) { | ||
| 349 | + colspan = (statisticalObj == "xl" ? "colspan='3'" : "colspan='5'"); | ||
| 350 | + if(statisticalObj == "cl") | ||
| 351 | + colspan = "colspan='6'"; | ||
| 352 | + } | ||
| 353 | + html += "<td " + colspan + ">" + td + "</td>" | ||
| 354 | + }); | ||
| 355 | + html += "</tr>" | ||
| 356 | + if (i == 0) { | ||
| 357 | + htmlHead += html; | ||
| 358 | + } else | ||
| 359 | + htmlBody += html; | ||
| 360 | + }); | ||
| 361 | + $('#forms_head thead').html(htmlHead); | ||
| 362 | + $('#forms_body tbody').html(htmlBody); | ||
| 363 | + layer.close(lodingI); | ||
| 364 | + }); | ||
| 365 | + } | ||
| 366 | + } | ||
| 367 | + }); | ||
| 368 | + | ||
| 369 | + $("#export").on("click",function(){ | ||
| 370 | + $post("/report/calcDetailMonthlyE",datas,function(result){ | ||
| 371 | + window.open("/downloadFile/download?fileName="+datas.name); | ||
| 372 | + }); | ||
| 373 | + }); | ||
| 374 | + }); | ||
| 375 | +</script> | ||
| 376 | +<!--<script type="application/javascript" src="/pages/forms/calc/calcDetailMonthly.js"></script>--> |
src/main/resources/static/pages/forms/calc/calcDetailYear.html
| 1 | -<style type="text/css"> | ||
| 2 | - .table-bordered { | ||
| 3 | - border: 1px solid; } | ||
| 4 | - .table-bordered > thead > tr > th, | ||
| 5 | - .table-bordered > thead > tr > td, | ||
| 6 | - .table-bordered > tbody > tr > th, | ||
| 7 | - .table-bordered > tbody > tr > td, | ||
| 8 | - .table-bordered > tfoot > tr > th, | ||
| 9 | - .table-bordered > tfoot > tr > td { | ||
| 10 | - border: 1px solid; | ||
| 11 | - text-align: center; } | ||
| 12 | - .table-bordered > thead > tr > th, | ||
| 13 | - .table-bordered > thead > tr > td { | ||
| 14 | - border-bottom-width: 2px; } | ||
| 15 | - | ||
| 16 | - .table > tbody + tbody { | ||
| 17 | - border-top: 1px solid; } | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - #analy_body tr> td >span{ | ||
| 21 | - word-break: keep-all;white-space:nowrap; | ||
| 22 | - } | ||
| 23 | - | ||
| 24 | - #analy_body td{ | ||
| 25 | - min-width: 100px; | ||
| 26 | - max-width: 100px; | ||
| 27 | - width: 100px; | ||
| 28 | - } | ||
| 29 | - | ||
| 30 | - #analy_body{ | ||
| 31 | - margin-top: 20px; | ||
| 32 | - height: 620px; | ||
| 33 | - width: 100% | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | - | ||
| 37 | - .table_head::-webkit-scrollbar { | ||
| 38 | - display:none | ||
| 39 | - } | ||
| 40 | - | ||
| 41 | - .table_head{ | ||
| 42 | - min-width: 906px; | ||
| 43 | - width: 100%; | ||
| 44 | - overflow: hidden; | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - .table_body{ | ||
| 48 | - width:101%; | ||
| 49 | - height:580px; | ||
| 50 | - overflow: auto; | ||
| 51 | - margin-top: -20px; | ||
| 52 | - } | ||
| 53 | -</style> | ||
| 54 | -<div class="page-head"> | ||
| 55 | - <div class="page-title"> | ||
| 56 | - <h1>路单线路明细年报表</h1> | ||
| 57 | - </div> | ||
| 58 | -</div> | ||
| 59 | - | ||
| 60 | -<!--<div class="row">--> | ||
| 61 | -<div class=" row col-md-12 portlet light bordered" style="height:calc(100% - 38px)"> | ||
| 62 | - <div class=""> | ||
| 63 | - <form class="form-inline" > | ||
| 64 | - <!--<div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_daily"> | ||
| 65 | - <span class="item-label" style="width: 80px;">  公司: </span> | ||
| 66 | - <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select> | ||
| 67 | - </div>--> | ||
| 68 | - <div style="display: inline-block; margin-left: 33px;" id="fgsdmDiv_daily"> | ||
| 69 | - <span class="item-label" style="width: 80px;"> 分公司: </span> | ||
| 70 | - <select class="form-control" name="fgsdm" id="fgsdm" style="width: 180px;"></select> | ||
| 71 | - </div> | ||
| 72 | - <!--<div style="display: inline-block;margin-left: 33px;"> | ||
| 73 | - <span class="item-label" style="width: 80px;">  线路: </span> | ||
| 74 | - <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 75 | - </div>--> | ||
| 76 | - <div style="display: inline-block; margin-left: 33px;"> | ||
| 77 | - <span class="item-label" style="width: 80px;">线路性质: </span> | ||
| 78 | - <select class="form-control" name="destroy" id="destroy" style="width: 180px;"> | ||
| 79 | - <option value="0,1">全部线路</option> | ||
| 80 | - <option value="0">营运线路</option> | ||
| 81 | - <option value="1">非营运线路</option> | ||
| 82 | - </select> | ||
| 83 | - </div> | ||
| 84 | - <div style="display: inline-block;margin-left: 33px;" class="date-picker"> | ||
| 85 | - <span class="item-label" style="width: 80px;">  时间: </span> | ||
| 86 | - <input class="form-control" type="text" id="startDate" style="width: 180px;" /> - | ||
| 87 | - <input class="form-control" type="text" id="endDate" style="width: 180px;" /> | ||
| 88 | - <!--<input class="form-control" type="text" id="startDate" style="width: 180px;" value="2020-10"/> - --> | ||
| 89 | - <!--<input class="form-control" type="text" id="endDate" style="width: 180px;" value="2020-10"/>--> | ||
| 90 | - </div> | ||
| 91 | - | ||
| 92 | - <div style="margin-top: 2px"></div> | ||
| 93 | - | ||
| 94 | - <div style="display: inline-block;margin-left: 33px;"> | ||
| 95 | - <span class="item-label" style="width: 80px;">统计对象: </span> | ||
| 96 | - <select class="form-control" name="statisticalObj" id="statisticalObj" style="width: 180px;"> | ||
| 97 | - <option value="cl">车辆</option> | ||
| 98 | - <option value="jsy">驾驶员</option> | ||
| 99 | - <option value="cwy">乘务员</option> | ||
| 100 | - <option value="xl">线路</option> | ||
| 101 | - </select> | ||
| 102 | - </div> | ||
| 103 | - | ||
| 104 | - <div style="display: inline-block; margin-left: 33px;" > | ||
| 105 | - <span class="item-label" style="width: 80px;">统计项目: </span> | ||
| 106 | - <select class="form-control" name="statisticalItem" id="statisticalItem" style="width: 180px;"> | ||
| 107 | - <option value="yh">油耗</option> | ||
| 108 | - <option value="dh">电耗</option> | ||
| 109 | - <option value="gl">公里</option> | ||
| 110 | - <option value="bc">班次</option> | ||
| 111 | - </select> | ||
| 112 | - </div> | ||
| 113 | - <div style="display: inline-block; margin-left: 33px;" > | ||
| 114 | - <span class="item-label" style="width: 80px;">项目明细: </span> | ||
| 115 | - <select class="form-control" name="itemDetails" id="itemDetails" style="width: 180px;"></select> | ||
| 116 | - </div> | ||
| 117 | - <div class="form-group" style="display: inline-block;margin-left: 62px;"> | ||
| 118 | - <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 119 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 120 | - </div> | ||
| 121 | - </form> | ||
| 122 | - </div> | ||
| 123 | - | ||
| 124 | - <div id="analy_body"> | ||
| 125 | - <div class="table_head" id="table_head"> | ||
| 126 | - <table class="table table-bordered table-hover table-checkable " id="forms_head"> | ||
| 127 | - <thead> | ||
| 128 | - </thead> | ||
| 129 | - </table> | ||
| 130 | - </div> | ||
| 131 | - <div class="table_body" id="table_body"> | ||
| 132 | - <table class="table table-bordered table-hover table-checkable" id="forms_body"> | ||
| 133 | - <tbody> | ||
| 134 | - </tbody> | ||
| 135 | - </table> | ||
| 136 | - </div> | ||
| 137 | - </div> | ||
| 138 | -</div> | ||
| 139 | -<script > | ||
| 140 | - $(function(){ | ||
| 141 | - $('#export').attr('disabled', "true"); | ||
| 142 | - // 关闭左侧栏 | ||
| 143 | - if (!$('body').hasClass('page-sidebar-closed')) | ||
| 144 | - $('.menu-toggler.sidebar-toggler').click(); | ||
| 145 | - | ||
| 146 | - var table_body1 = document.getElementById("table_body"); | ||
| 147 | - table_body1.onscroll = function(){ | ||
| 148 | - var table_body1_left = this.scrollLeft; | ||
| 149 | - document.getElementById("table_head").scrollLeft = table_body1_left; | ||
| 150 | - }; | ||
| 151 | - | ||
| 152 | - var d = new Date(); | ||
| 153 | - var year = d.getFullYear(); | ||
| 154 | - var month = d.getMonth() + 1; | ||
| 155 | - if(month < 10) | ||
| 156 | - month = "0" + month; | ||
| 157 | - //时间 | ||
| 158 | - var dateTime=year + "-" + month; | ||
| 159 | - $("#startDate").val(dateTime); | ||
| 160 | - $("#endDate").val(dateTime); | ||
| 161 | - | ||
| 162 | - $("#endDate").datetimepicker({ | ||
| 163 | - format : 'YYYY-MM', | ||
| 164 | - locale : 'zh-cn', | ||
| 165 | - maxDate : dateTime | ||
| 166 | - }); | ||
| 167 | - $("#startDate").datetimepicker({ | ||
| 168 | - format : 'YYYY-MM', | ||
| 169 | - locale : 'zh-cn', | ||
| 170 | - maxDate : dateTime | ||
| 171 | - }); | ||
| 172 | - | ||
| 173 | - | ||
| 174 | - var lineAll="",lineNoD="",lineD=""; | ||
| 175 | - var datas = {}; //查询条件 | ||
| 176 | - | ||
| 177 | - | ||
| 178 | - /**用户分配的线路*/ | ||
| 179 | - $.get('/realControAuthority/findByCurrentUser', function (userAuthor) { | ||
| 180 | - lineAll = userAuthor.lineCodeStr.substring(0,userAuthor.lineCodeStr.length-1); | ||
| 181 | - /* $.get('/line/all', function (lines) { | ||
| 182 | - $.each(lines,function () { | ||
| 183 | - | ||
| 184 | - }); | ||
| 185 | - | ||
| 186 | - });*/ | ||
| 187 | - }); | ||
| 188 | - | ||
| 189 | - var tempData = {}; | ||
| 190 | - | ||
| 191 | - $.get('/user/companyData', function(obj) { | ||
| 192 | - var option = ''; | ||
| 193 | - var allC = ""; | ||
| 194 | - for (var i = 0; i < obj.length; i++) { | ||
| 195 | - if (obj[i].companyCode == "26") { | ||
| 196 | - var children = obj[i].children; | ||
| 197 | - for (var j = 0; j < children.length; j++) { | ||
| 198 | - allC += children[j].code+","; | ||
| 199 | - option += '<option value="' + children[j].code + '">' + children[j].name + '</option>'; | ||
| 200 | - } | ||
| 201 | - } | ||
| 202 | - } | ||
| 203 | - | ||
| 204 | - var options = '<option value="'+allC.substring(0,allC.length-1)+'">所有分公司</option>'+option; | ||
| 205 | - $('#fgsdm').html(options); | ||
| 206 | - }); | ||
| 207 | - | ||
| 208 | - // 项目明细选项列 | ||
| 209 | - // 触发默认选项 | ||
| 210 | - updateItem(); | ||
| 211 | - $("#statisticalItem").on("change",updateItem); | ||
| 212 | - var item =""; | ||
| 213 | - function updateItem() { | ||
| 214 | - item = $('#statisticalItem').val(); | ||
| 215 | - var options = ''; | ||
| 216 | - if(item == "yh"){ | ||
| 217 | - options += '<option value="jzlAll">加注量[全部]</option>' + | ||
| 218 | - '<option value="jzl0">加注量[0#]</option>'+ | ||
| 219 | - '<option value="jzl-10">加注量[-10#]</option>'+ | ||
| 220 | - '<option value="yhl">油耗量</option>'+ | ||
| 221 | - '<option value="cccy">出场存油</option>'+ | ||
| 222 | - '<option value="jccy">进场存油</option>'+ | ||
| 223 | - '<option value="bglyh">百公里油耗</option>'; | ||
| 224 | - } else if(item == "gl"){ | ||
| 225 | - options += '<option value="zgl">总公里</option>' + | ||
| 226 | - '<option value="jhgl">计划公里</option>'; | ||
| 227 | - /*'<option value="jclm">进场路码</option>'+ | ||
| 228 | - '<option value="cclm">出场路码</option>'*/ | ||
| 229 | - } else if(item == "bc"){ | ||
| 230 | - options += '<option value="sjbc">实际班次</option>' + | ||
| 231 | - '<option value="jhbc">计划班次</option>'; | ||
| 232 | - } else if(item == "dh"){ | ||
| 233 | - options += '<option value="dh">耗电量</option>'; | ||
| 234 | - options += '<option value="cdl">充电量</option>'; | ||
| 235 | - options += '<option value="cccd">出场存电</option>'; | ||
| 236 | - options += '<option value="jccd">进场存电</option>'; | ||
| 237 | - options += '<option value="bgldh">百公里电耗</option>'; | ||
| 238 | - } | ||
| 239 | - $('#itemDetails').html(options); | ||
| 240 | - } | ||
| 241 | - | ||
| 242 | - //线路名称 | ||
| 243 | - var lineName = ''; | ||
| 244 | - $("#query").on("click",function(){ | ||
| 245 | - var gsdm = "26"; | ||
| 246 | - var fgsdm = $("#fgsdm").val(); | ||
| 247 | - var startDate = $("#startDate").val(); | ||
| 248 | - var endDate = $("#endDate").val(); | ||
| 249 | - var statisticalObj = $("#statisticalObj").val(); | ||
| 250 | - //开始和结束时间 | ||
| 251 | - var startTime = Date.parse(new Date(startDate)); | ||
| 252 | - var endTime = Date.parse(new Date(endDate)); | ||
| 253 | - | ||
| 254 | - datas = {}; // 清空之前数据 | ||
| 255 | - datas.timeType = "y"; | ||
| 256 | - datas.gsdm = gsdm; | ||
| 257 | - datas.fgsdm = fgsdm; | ||
| 258 | - datas.lineCode = lineAll; | ||
| 259 | - datas.startDate = startDate; | ||
| 260 | - datas.endDate = endDate; | ||
| 261 | - datas.destroy = $("#destroy").val(); | ||
| 262 | - datas.statisticalObj = $("#statisticalObj").val(); | ||
| 263 | - datas.itemDetails = $("#itemDetails").val(); | ||
| 264 | - datas.item = item; | ||
| 265 | - | ||
| 266 | - var itemDetails = datas.itemDetails, | ||
| 267 | - type = "加注量[全部]"; | ||
| 268 | - if(itemDetails=="jzl0"){ | ||
| 269 | - type = "加注量[0#]" | ||
| 270 | - } else if(itemDetails=="jzl-10"){ | ||
| 271 | - type = "加注量[-10#]" | ||
| 272 | - } else if(itemDetails=="yhl"){ | ||
| 273 | - type = "油耗量" | ||
| 274 | - } else if(itemDetails=="cccy"){ | ||
| 275 | - type = "出场存油" | ||
| 276 | - } else if(itemDetails=="jccy"){ | ||
| 277 | - type = "进场存油" | ||
| 278 | - } else if(itemDetails=="bglyh"){ | ||
| 279 | - type = "百公里油耗" | ||
| 280 | - } else if(itemDetails=="zgl"){ | ||
| 281 | - type = "总公里" | ||
| 282 | - } else if(itemDetails=="jhgl"){ | ||
| 283 | - type = "计划公里" | ||
| 284 | - } else if(itemDetails=="jclm"){ | ||
| 285 | - type = "进场路码" | ||
| 286 | - } else if(itemDetails=="cclm"){ | ||
| 287 | - type = "出场路码" | ||
| 288 | - } else if(itemDetails=="sjbc"){ | ||
| 289 | - type = "实际班次" | ||
| 290 | - } else if(itemDetails=="jhbc"){ | ||
| 291 | - type = "计划班次" | ||
| 292 | - } else if(itemDetails=="dh"){ | ||
| 293 | - type = "耗电量" | ||
| 294 | - } else if(itemDetails=="cdl"){ | ||
| 295 | - type = "充电量" | ||
| 296 | - } else if(itemDetails=="cccd"){ | ||
| 297 | - type = "出场存电" | ||
| 298 | - } else if(itemDetails=="jccd"){ | ||
| 299 | - type = "进场存电" | ||
| 300 | - } else if(itemDetails=="bgldh"){ | ||
| 301 | - type = "百公里电耗" | ||
| 302 | - } | ||
| 303 | - datas.name = datas.startDate+"-"+datas.endDate+"-路单线路明细年报表("+type+")"; | ||
| 304 | - if(startDate==null || startDate =="" ||endDate==null || endDate ==""){ | ||
| 305 | - layer.msg('请选择时间段!'); | ||
| 306 | - }else if(endTime<startTime){ | ||
| 307 | - layer.msg('结束日期不能小于开始日期!'); | ||
| 308 | - }else { | ||
| 309 | - if (endDate.substring(0, 4) != startDate.substring(0, 4)) { | ||
| 310 | - layer.msg("请查询同年份数据!"); | ||
| 311 | - return; | ||
| 312 | - } else { | ||
| 313 | - var lodingI = layer.load(2); | ||
| 314 | - $get('/calcWaybill/calcDetailMonthly', datas, function (rs) { | ||
| 315 | - if (rs.length <=0) { | ||
| 316 | - layer.close(lodingI); | ||
| 317 | - layer.open({ | ||
| 318 | - title: '提示' | ||
| 319 | - , content: '没有您要查询的数据,请重新选择参数!' | ||
| 320 | - }); | ||
| 321 | - $("#export").attr('disabled',"true"); | ||
| 322 | - return; | ||
| 323 | - }else | ||
| 324 | - $("#export").removeAttr("disabled"); | ||
| 325 | - var htmlHead = "<tr><td colspan='"+rs[0].length+"'>"+datas.name+"</td></tr>", htmlBody = ""; | ||
| 326 | - var rsLength = rs.length; | ||
| 327 | - rs.forEach(function (o, i) { | ||
| 328 | - var html = "<tr>" | ||
| 329 | - o.forEach(function (td, j) { | ||
| 330 | - var colspan; | ||
| 331 | - if (i == rsLength - 1 && j == 0) { | ||
| 332 | - colspan = (statisticalObj == "xl" ? "colspan='3'" : "colspan='5'"); | ||
| 333 | - if(statisticalObj == "cl") | ||
| 334 | - colspan = "colspan='6'"; | ||
| 335 | - } | ||
| 336 | - html += "<td " + colspan + ">" + td + "</td>" | ||
| 337 | - }); | ||
| 338 | - html += "</tr>" | ||
| 339 | - if (i == 0) { | ||
| 340 | - htmlHead += html; | ||
| 341 | - } else | ||
| 342 | - htmlBody += html; | ||
| 343 | - }); | ||
| 344 | - $('#forms_head thead').html(htmlHead); | ||
| 345 | - $('#forms_body tbody').html(htmlBody); | ||
| 346 | - layer.close(lodingI); | ||
| 347 | - }); | ||
| 348 | - } | ||
| 349 | - } | ||
| 350 | - }); | ||
| 351 | - | ||
| 352 | - $("#export").on("click",function(){ | ||
| 353 | - $post("/report/calcDetailMonthlyE",datas,function(result){ | ||
| 354 | - window.open("/downloadFile/download?fileName="+datas.name); | ||
| 355 | - }); | ||
| 356 | - }); | ||
| 357 | - }); | ||
| 358 | -</script> | ||
| 359 | -<!--<script type="application/javascript" src="/pages/forms/calc/calcDetailMonthly.js"></script>--> | 1 | +<style type="text/css"> |
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; | ||
| 11 | + text-align: center; } | ||
| 12 | + .table-bordered > thead > tr > th, | ||
| 13 | + .table-bordered > thead > tr > td { | ||
| 14 | + border-bottom-width: 2px; } | ||
| 15 | + | ||
| 16 | + .table > tbody + tbody { | ||
| 17 | + border-top: 1px solid; } | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + #analy_body tr> td >span{ | ||
| 21 | + word-break: keep-all;white-space:nowrap; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + #analy_body td{ | ||
| 25 | + min-width: 100px; | ||
| 26 | + max-width: 100px; | ||
| 27 | + width: 100px; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + #analy_body{ | ||
| 31 | + margin-top: 20px; | ||
| 32 | + height: 620px; | ||
| 33 | + width: 100% | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + .table_head::-webkit-scrollbar { | ||
| 38 | + display:none | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + .table_head{ | ||
| 42 | + min-width: 906px; | ||
| 43 | + width: 100%; | ||
| 44 | + overflow: hidden; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + .table_body{ | ||
| 48 | + width:101%; | ||
| 49 | + height:580px; | ||
| 50 | + overflow: auto; | ||
| 51 | + margin-top: -20px; | ||
| 52 | + } | ||
| 53 | +</style> | ||
| 54 | +<div class="page-head"> | ||
| 55 | + <div class="page-title"> | ||
| 56 | + <h1>路单线路明细年报表</h1> | ||
| 57 | + </div> | ||
| 58 | +</div> | ||
| 59 | + | ||
| 60 | +<!--<div class="row">--> | ||
| 61 | +<div class=" row col-md-12 portlet light bordered" style="height:calc(100% - 38px)"> | ||
| 62 | + <div class=""> | ||
| 63 | + <form class="form-inline" > | ||
| 64 | + <div style="display: inline-block; margin-left: 13px;" id="gsdmDiv_daily"> | ||
| 65 | + <span class="item-label" style="width: 80px;">  公司: </span> | ||
| 66 | + <select class="form-control" name="company" id="gsdm" style="width: 150px;"></select> | ||
| 67 | + </div> | ||
| 68 | + <div style="display: inline-block; margin-left: 13px;" id="fgsdmDiv_daily"> | ||
| 69 | + <span class="item-label" style="width: 80px;"> 分公司: </span> | ||
| 70 | + <select class="form-control" name="fgsdm" id="fgsdm" style="width: 150px;"></select> | ||
| 71 | + </div> | ||
| 72 | + <!--<div style="display: inline-block;margin-left: 33px;"> | ||
| 73 | + <span class="item-label" style="width: 80px;">  线路: </span> | ||
| 74 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 75 | + </div>--> | ||
| 76 | + <div style="display: inline-block;margin-left: 13px;" class="date-picker"> | ||
| 77 | + <span class="item-label" style="width: 80px;">  时间: </span> | ||
| 78 | + <input class="form-control" type="text" id="startDate" style="width: 150px;" /> - | ||
| 79 | + <input class="form-control" type="text" id="endDate" style="width: 150px;" /> | ||
| 80 | + <!--<input class="form-control" type="text" id="startDate" style="width: 180px;" value="2020-10-01"/> - --> | ||
| 81 | + <!--<input class="form-control" type="text" id="endDate" style="width: 180px;" value="2020-10-10"/>--> | ||
| 82 | + </div> | ||
| 83 | + | ||
| 84 | + <div style="margin-top: 2px"></div> | ||
| 85 | + | ||
| 86 | + <div style="display: inline-block; margin-left: 13px;"> | ||
| 87 | + <span class="item-label" style="width: 80px;">线路性质: </span> | ||
| 88 | + <select class="form-control" name="destroy" id="destroy" style="width: 150px;"> | ||
| 89 | + <option value="0,1">全部线路</option> | ||
| 90 | + <option value="0">营运线路</option> | ||
| 91 | + <option value="1">非营运线路</option> | ||
| 92 | + </select> | ||
| 93 | + </div> | ||
| 94 | + <div style="display: inline-block;margin-left: 13px;"> | ||
| 95 | + <span class="item-label" style="width: 80px;">统计对象: </span> | ||
| 96 | + <select class="form-control" name="statisticalObj" id="statisticalObj" style="width: 150px;"> | ||
| 97 | + <option value="cl">车辆</option> | ||
| 98 | + <option value="jsy">驾驶员</option> | ||
| 99 | + <option value="cwy">乘务员</option> | ||
| 100 | + <option value="xl">线路</option> | ||
| 101 | + </select> | ||
| 102 | + </div> | ||
| 103 | + | ||
| 104 | + <div style="display: inline-block; margin-left: 13px;" > | ||
| 105 | + <span class="item-label" style="width: 80px;">统计项目: </span> | ||
| 106 | + <select class="form-control" name="statisticalItem" id="statisticalItem" style="width: 150px;"> | ||
| 107 | + <option value="yh">油耗</option> | ||
| 108 | + <option value="dh">电耗</option> | ||
| 109 | + <option value="gl">公里</option> | ||
| 110 | + <option value="bc">班次</option> | ||
| 111 | + </select> | ||
| 112 | + </div> | ||
| 113 | + <div style="display: inline-block; margin-left: 13px;" > | ||
| 114 | + <span class="item-label" style="width: 80px;">项目明细: </span> | ||
| 115 | + <select class="form-control" name="itemDetails" id="itemDetails" style="width: 150px;"></select> | ||
| 116 | + </div> | ||
| 117 | + <div class="form-group" style="display: inline-block;margin-left: 22px;"> | ||
| 118 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 119 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 120 | + </div> | ||
| 121 | + </form> | ||
| 122 | + </div> | ||
| 123 | + | ||
| 124 | + <div id="analy_body"> | ||
| 125 | + <div class="table_head" id="table_head"> | ||
| 126 | + <table class="table table-bordered table-hover table-checkable " id="forms_head"> | ||
| 127 | + <thead> | ||
| 128 | + </thead> | ||
| 129 | + </table> | ||
| 130 | + </div> | ||
| 131 | + <div class="table_body" id="table_body"> | ||
| 132 | + <table class="table table-bordered table-hover table-checkable" id="forms_body" style="background-color: white;"> | ||
| 133 | + <tbody> | ||
| 134 | + </tbody> | ||
| 135 | + </table> | ||
| 136 | + </div> | ||
| 137 | + </div> | ||
| 138 | +</div> | ||
| 139 | +<script > | ||
| 140 | + $(function(){ | ||
| 141 | + $('#export').attr('disabled', "true"); | ||
| 142 | + // 关闭左侧栏 | ||
| 143 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 144 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 145 | + | ||
| 146 | + var table_body1 = document.getElementById("table_body"); | ||
| 147 | + table_body1.onscroll = function(){ | ||
| 148 | + var table_body1_left = this.scrollLeft; | ||
| 149 | + document.getElementById("table_head").scrollLeft = table_body1_left; | ||
| 150 | + }; | ||
| 151 | + | ||
| 152 | + var d = new Date(); | ||
| 153 | + var year = d.getFullYear(); | ||
| 154 | + var month = d.getMonth() + 1; | ||
| 155 | + if(month < 10) | ||
| 156 | + month = "0" + month; | ||
| 157 | + //时间 | ||
| 158 | + var dateTime=year + "-" + month; | ||
| 159 | + $("#startDate").val(dateTime); | ||
| 160 | + $("#endDate").val(dateTime); | ||
| 161 | + | ||
| 162 | + $("#endDate").datetimepicker({ | ||
| 163 | + format : 'YYYY-MM', | ||
| 164 | + locale : 'zh-cn', | ||
| 165 | + maxDate : dateTime | ||
| 166 | + }); | ||
| 167 | + $("#startDate").datetimepicker({ | ||
| 168 | + format : 'YYYY-MM', | ||
| 169 | + locale : 'zh-cn', | ||
| 170 | + maxDate : dateTime | ||
| 171 | + }); | ||
| 172 | + | ||
| 173 | + | ||
| 174 | + var lineAll="",lineNoD="",lineD=""; | ||
| 175 | + var datas = {}; //查询条件 | ||
| 176 | + | ||
| 177 | + | ||
| 178 | + /**用户分配的线路*/ | ||
| 179 | + $.get('/realControAuthority/findByCurrentUser', function (userAuthor) { | ||
| 180 | + lineAll = userAuthor.lineCodeStr.substring(0,userAuthor.lineCodeStr.length-1); | ||
| 181 | + /* $.get('/line/all', function (lines) { | ||
| 182 | + $.each(lines,function () { | ||
| 183 | + | ||
| 184 | + }); | ||
| 185 | + | ||
| 186 | + });*/ | ||
| 187 | + }); | ||
| 188 | + | ||
| 189 | + var tempData = {}; | ||
| 190 | + | ||
| 191 | + $.get('/user/companyData', function(result){ | ||
| 192 | + var obj = result; | ||
| 193 | + var options = ''; | ||
| 194 | + for(var i = 0; i < obj.length; i++){ | ||
| 195 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + if(obj.length ==0){ | ||
| 199 | + $("#gsdmDiv_daily").css('display','none'); | ||
| 200 | + }else if(obj.length ==1){ | ||
| 201 | + $("#gsdmDiv_daily").css('display','none'); | ||
| 202 | + if(obj[0].children.length == 1 || obj[0].children.length == 0){ | ||
| 203 | + fage=false; | ||
| 204 | + $('#gsdmDiv_daily').css('display','none'); | ||
| 205 | + } | ||
| 206 | + } | ||
| 207 | + $('#gsdm').html(options); | ||
| 208 | + updateCompany(); | ||
| 209 | + }); | ||
| 210 | + $("#gsdm").on("change",updateCompany); | ||
| 211 | + | ||
| 212 | + function updateCompany(){ | ||
| 213 | + var company = $('#gsdm').val(); | ||
| 214 | + $.get('/user/companyData', function(obj) { | ||
| 215 | + var option = ''; | ||
| 216 | + var allC = ""; | ||
| 217 | + for (var i = 0; i < obj.length; i++) { | ||
| 218 | + if (obj[i].companyCode == company) { | ||
| 219 | + var children = obj[i].children; | ||
| 220 | + for (var j = 0; j < children.length; j++) { | ||
| 221 | + allC += children[j].code+","; | ||
| 222 | + option += '<option value="' + children[j].code + '">' + children[j].name + '</option>'; | ||
| 223 | + } | ||
| 224 | + } | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + var options = '<option value="'+allC.substring(0,allC.length-1)+'">所有分公司</option>'+option; | ||
| 228 | + $('#fgsdm').html(options); | ||
| 229 | + }); | ||
| 230 | + } | ||
| 231 | + | ||
| 232 | + // 项目明细选项列 | ||
| 233 | + // 触发默认选项 | ||
| 234 | + updateItem(); | ||
| 235 | + $("#statisticalItem").on("change",updateItem); | ||
| 236 | + var item =""; | ||
| 237 | + function updateItem() { | ||
| 238 | + item = $('#statisticalItem').val(); | ||
| 239 | + var options = ''; | ||
| 240 | + if(item == "yh"){ | ||
| 241 | + options += '<option value="jzlAll">加注量[全部]</option>' + | ||
| 242 | + '<option value="jzl0">加注量[0#]</option>'+ | ||
| 243 | + '<option value="jzl-10">加注量[-10#]</option>'+ | ||
| 244 | + '<option value="yhl">油耗量</option>'+ | ||
| 245 | + '<option value="cccy">出场存油</option>'+ | ||
| 246 | + '<option value="jccy">进场存油</option>'+ | ||
| 247 | + '<option value="bglyh">百公里油耗</option>'; | ||
| 248 | + } else if(item == "gl"){ | ||
| 249 | + options += '<option value="zgl">总公里</option>' + | ||
| 250 | + '<option value="jhgl">计划公里</option>'; | ||
| 251 | + /*'<option value="jclm">进场路码</option>'+ | ||
| 252 | + '<option value="cclm">出场路码</option>'*/ | ||
| 253 | + } else if(item == "bc"){ | ||
| 254 | + options += '<option value="sjbc">实际班次</option>' + | ||
| 255 | + '<option value="jhbc">计划班次</option>'; | ||
| 256 | + } else if(item == "dh"){ | ||
| 257 | + options += '<option value="dh">耗电量</option>'; | ||
| 258 | + options += '<option value="cdl">充电量</option>'; | ||
| 259 | + options += '<option value="cccd">出场存电</option>'; | ||
| 260 | + options += '<option value="jccd">进场存电</option>'; | ||
| 261 | + options += '<option value="bgldh">百公里电耗</option>'; | ||
| 262 | + } | ||
| 263 | + $('#itemDetails').html(options); | ||
| 264 | + } | ||
| 265 | + | ||
| 266 | + //线路名称 | ||
| 267 | + var lineName = ''; | ||
| 268 | + $("#query").on("click",function(){ | ||
| 269 | + var gsdm = $("#gsdm").val(); | ||
| 270 | + var fgsdm = $("#fgsdm").val(); | ||
| 271 | + var startDate = $("#startDate").val(); | ||
| 272 | + var endDate = $("#endDate").val(); | ||
| 273 | + var statisticalObj = $("#statisticalObj").val(); | ||
| 274 | + //开始和结束时间 | ||
| 275 | + var startTime = Date.parse(new Date(startDate)); | ||
| 276 | + var endTime = Date.parse(new Date(endDate)); | ||
| 277 | + | ||
| 278 | + datas = {}; // 清空之前数据 | ||
| 279 | + datas.timeType = "y"; | ||
| 280 | + datas.gsdm = gsdm; | ||
| 281 | + datas.fgsdm = fgsdm; | ||
| 282 | + datas.lineCode = lineAll; | ||
| 283 | + datas.startDate = startDate; | ||
| 284 | + datas.endDate = endDate; | ||
| 285 | + datas.destroy = $("#destroy").val(); | ||
| 286 | + datas.statisticalObj = $("#statisticalObj").val(); | ||
| 287 | + datas.itemDetails = $("#itemDetails").val(); | ||
| 288 | + datas.item = item; | ||
| 289 | + | ||
| 290 | + var itemDetails = datas.itemDetails, | ||
| 291 | + type = "加注量[全部]"; | ||
| 292 | + if(itemDetails=="jzl0"){ | ||
| 293 | + type = "加注量[0#]" | ||
| 294 | + } else if(itemDetails=="jzl-10"){ | ||
| 295 | + type = "加注量[-10#]" | ||
| 296 | + } else if(itemDetails=="yhl"){ | ||
| 297 | + type = "油耗量" | ||
| 298 | + } else if(itemDetails=="cccy"){ | ||
| 299 | + type = "出场存油" | ||
| 300 | + } else if(itemDetails=="jccy"){ | ||
| 301 | + type = "进场存油" | ||
| 302 | + } else if(itemDetails=="bglyh"){ | ||
| 303 | + type = "百公里油耗" | ||
| 304 | + } else if(itemDetails=="zgl"){ | ||
| 305 | + type = "总公里" | ||
| 306 | + } else if(itemDetails=="jhgl"){ | ||
| 307 | + type = "计划公里" | ||
| 308 | + } else if(itemDetails=="jclm"){ | ||
| 309 | + type = "进场路码" | ||
| 310 | + } else if(itemDetails=="cclm"){ | ||
| 311 | + type = "出场路码" | ||
| 312 | + } else if(itemDetails=="sjbc"){ | ||
| 313 | + type = "实际班次" | ||
| 314 | + } else if(itemDetails=="jhbc"){ | ||
| 315 | + type = "计划班次" | ||
| 316 | + } else if(itemDetails=="dh"){ | ||
| 317 | + type = "耗电量" | ||
| 318 | + } else if(itemDetails=="cdl"){ | ||
| 319 | + type = "充电量" | ||
| 320 | + } else if(itemDetails=="cccd"){ | ||
| 321 | + type = "出场存电" | ||
| 322 | + } else if(itemDetails=="jccd"){ | ||
| 323 | + type = "进场存电" | ||
| 324 | + } else if(itemDetails=="bgldh"){ | ||
| 325 | + type = "百公里电耗" | ||
| 326 | + } | ||
| 327 | + datas.name = datas.startDate+"-"+datas.endDate+"-路单线路明细年报表("+type+")"; | ||
| 328 | + if(startDate==null || startDate =="" ||endDate==null || endDate ==""){ | ||
| 329 | + layer.msg('请选择时间段!'); | ||
| 330 | + }else if(endTime<startTime){ | ||
| 331 | + layer.msg('结束日期不能小于开始日期!'); | ||
| 332 | + }else { | ||
| 333 | + if (endDate.substring(0, 4) != startDate.substring(0, 4)) { | ||
| 334 | + layer.msg("请查询同年份数据!"); | ||
| 335 | + return; | ||
| 336 | + } else { | ||
| 337 | + var lodingI = layer.load(2); | ||
| 338 | + $get('/calcWaybill/calcDetailMonthly', datas, function (rs) { | ||
| 339 | + if (rs.length <=0) { | ||
| 340 | + layer.close(lodingI); | ||
| 341 | + layer.open({ | ||
| 342 | + title: '提示' | ||
| 343 | + , content: '没有您要查询的数据,请重新选择参数!' | ||
| 344 | + }); | ||
| 345 | + $("#export").attr('disabled',"true"); | ||
| 346 | + return; | ||
| 347 | + }else | ||
| 348 | + $("#export").removeAttr("disabled"); | ||
| 349 | + var htmlHead = "<tr><td colspan='"+rs[0].length+"'>"+datas.name+"</td></tr>", htmlBody = ""; | ||
| 350 | + var rsLength = rs.length; | ||
| 351 | + rs.forEach(function (o, i) { | ||
| 352 | + var html = "<tr>" | ||
| 353 | + o.forEach(function (td, j) { | ||
| 354 | + var colspan; | ||
| 355 | + if (i == rsLength - 1 && j == 0) { | ||
| 356 | + colspan = (statisticalObj == "xl" ? "colspan='3'" : "colspan='5'"); | ||
| 357 | + if(statisticalObj == "cl") | ||
| 358 | + colspan = "colspan='6'"; | ||
| 359 | + } | ||
| 360 | + html += "<td " + colspan + ">" + td + "</td>" | ||
| 361 | + }); | ||
| 362 | + html += "</tr>" | ||
| 363 | + if (i == 0) { | ||
| 364 | + htmlHead += html; | ||
| 365 | + } else | ||
| 366 | + htmlBody += html; | ||
| 367 | + }); | ||
| 368 | + $('#forms_head thead').html(htmlHead); | ||
| 369 | + $('#forms_body tbody').html(htmlBody); | ||
| 370 | + layer.close(lodingI); | ||
| 371 | + }); | ||
| 372 | + } | ||
| 373 | + } | ||
| 374 | + }); | ||
| 375 | + | ||
| 376 | + $("#export").on("click",function(){ | ||
| 377 | + $post("/report/calcDetailMonthlyE",datas,function(result){ | ||
| 378 | + window.open("/downloadFile/download?fileName="+datas.name); | ||
| 379 | + }); | ||
| 380 | + }); | ||
| 381 | + }); | ||
| 382 | +</script> | ||
| 383 | +<!--<script type="application/javascript" src="/pages/forms/calc/calcDetailMonthly.js"></script>--> |
src/main/resources/static/pages/forms/mould/countMileageSum.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/dispatchDailySum.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/statisticsDaily_4.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/dispatchDailySum.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 | + #forms > thead > tr> td >span{ | ||
| 19 | + width: 5px; | ||
| 20 | + word-wrap: break-word; | ||
| 21 | + letter-spacing: 20px; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + #forms > thead > tr> td >label{ | ||
| 25 | + word-break: keep-all;white-space:nowrap; | ||
| 26 | + } | ||
| 27 | +</style> | ||
| 28 | + | ||
| 29 | +<div class="page-head"> | ||
| 30 | + <div class="page-title"> | ||
| 31 | + <h1>调度日报汇总表</h1> | ||
| 32 | + </div> | ||
| 33 | +</div> | ||
| 34 | + | ||
| 35 | +<!-- <div class="row"> --> | ||
| 36 | + <div class="col-md-12 portlet light porttlet-fit bordered" style="height:calc(100% - 56px)"> | ||
| 37 | +<!-- <div> --> | ||
| 38 | + <div class="portlet-title"> | ||
| 39 | + <form class="form-inline" action=""> | ||
| 40 | + <div style="display: inline-block;"> | ||
| 41 | + <span class="item-label" style="width: 80px;">线路性质: </span> | ||
| 42 | + <select | ||
| 43 | + class="form-control" name="nature" id="nature" | ||
| 44 | + style="width: 180px;"> | ||
| 45 | + <option value="0">全部线路</option> | ||
| 46 | + <option value="1" selected="selected">营运线路</option> | ||
| 47 | + <option value="2">非营运线路</option> | ||
| 48 | + </select> | ||
| 49 | + </div> | ||
| 50 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 51 | + <span class="item-label" style="width: 80px;">开始日期: </span> | ||
| 52 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | ||
| 53 | + </div> | ||
| 54 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 55 | + <span class="item-label" style="width: 80px;">结束日期: </span> | ||
| 56 | + <input class="form-control" type="text" id="date2" style="width: 180px;"/> | ||
| 57 | + </div> | ||
| 58 | + <div class="form-group"> | ||
| 59 | + <input class="btn btn-default" type="button" id="query" value="查询"/> | ||
| 60 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 61 | + </div> | ||
| 62 | + </form> | ||
| 63 | + </div> | ||
| 64 | + <div class="portlet-body" id="tjrbBody" style="overflow:auto;height: calc(100% - 80px)"> | ||
| 65 | + <div class="table-container" style="margin-top: 10px;min-width: 906px"> | ||
| 66 | + <label>日期:<span id="rqxs"></span> 早高峰:6:31~8:30 晚高峰:16:01~18:00</label> | ||
| 67 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 68 | + <thead> | ||
| 69 | + <tr> | ||
| 70 | + <th colspan="45"><label id="tjrq"></label> 调度日报汇总表</th> | ||
| 71 | + </tr> | ||
| 72 | + <tr> | ||
| 73 | + <td rowspan="3"><span >公司</span></td> | ||
| 74 | + <td rowspan="3"><span >分公司</span></td> | ||
| 75 | + <td colspan="21">全日营运里程(公里)</td> | ||
| 76 | + <td colspan="15">全日营运班次</td> | ||
| 77 | + <td colspan="9">大间隔情况</td> | ||
| 78 | + </tr> | ||
| 79 | + <tr> | ||
| 80 | + <td rowspan="2"><label>计划总<br/>公里</label></td> | ||
| 81 | + <td rowspan="2"><label>计划营</label><label>运公里</label></td> | ||
| 82 | + <td rowspan="2"><label>计划空</label><label>驶公里</label></td> | ||
| 83 | + <td rowspan="2"><label>实际</label><label>总公里</label></td> | ||
| 84 | + <td rowspan="2"><label>实际营</label><label>运公里</label></td> | ||
| 85 | + <td rowspan="2"><label>实际空</label><label>驶公里</label></td> | ||
| 86 | + <td rowspan="2"><span>少驶班次</span></td> | ||
| 87 | + <td rowspan="2"><span>少驶公里</span></td> | ||
| 88 | + <td colspan="11">少驶原因(公里)</td> | ||
| 89 | + <td colspan="2">临加公里</td> | ||
| 90 | + <td colspan="3">计划班次</td> | ||
| 91 | + <td colspan="3">实际班次</td> | ||
| 92 | + <td colspan="3">临加班次</td> | ||
| 93 | + <td colspan="3">放站班次</td> | ||
| 94 | + <td colspan="3">调头班次</td> | ||
| 95 | + <td colspan="3">发生次数</td> | ||
| 96 | + <td rowspan="2">最大间隔时间(分)</td> | ||
| 97 | + <td rowspan="2">原因</td> | ||
| 98 | + </tr> | ||
| 99 | + <tr> | ||
| 100 | + <td><span>路阻</span></td> | ||
| 101 | + <td><span>吊慢</span></td> | ||
| 102 | + <td><span>故障</span></td> | ||
| 103 | + <td><span>纠纷</span></td> | ||
| 104 | + <td><span>肇事</span></td> | ||
| 105 | + <td><span>缺人</span></td> | ||
| 106 | + <td><span>缺车</span></td> | ||
| 107 | + <td><span>客稀</span></td> | ||
| 108 | + <td><span>气候</span></td> | ||
| 109 | + <td><span>援外</span></td> | ||
| 110 | + <td><span>其他</span></td> | ||
| 111 | + <td><span>营运</span></td> | ||
| 112 | + <td><span>空驶</span></td> | ||
| 113 | + <td><span>全日</span></td> | ||
| 114 | + <td><span>早高峰</span></td> | ||
| 115 | + <td><span>晚高峰</span></td> | ||
| 116 | + <td><span>全日</span></td> | ||
| 117 | + <td><span>早高峰</span></td> | ||
| 118 | + <td><span>晚高峰</span></td> | ||
| 119 | + <td><span>全日</span></td> | ||
| 120 | + <td><span>早高峰</span></td> | ||
| 121 | + <td><span>晚高峰</span></td> | ||
| 122 | + <td><span>全日</span></td> | ||
| 123 | + <td><span>早高峰</span></td> | ||
| 124 | + <td><span>晚高峰</span></td> | ||
| 125 | + <td><span>全日</span></td> | ||
| 126 | + <td><span>早高峰</span></td> | ||
| 127 | + <td><span>晚高峰</span></td> | ||
| 128 | + <td><span>全日</span></td> | ||
| 129 | + <td><span>早高峰</span></td> | ||
| 130 | + <td><span>晚高峰</span></td> | ||
| 131 | + </tr> | ||
| 132 | + </thead> | ||
| 133 | + <tbody class="dispatch_daily_sum"> | ||
| 134 | + | ||
| 135 | + </tbody> | ||
| 136 | + </table> | ||
| 137 | + </div> | ||
| 138 | + </div> | ||
| 139 | + </div> | ||
| 140 | + | ||
| 141 | +<script> | ||
| 142 | + $(function(){ | ||
| 143 | +// $('#export').attr('disabled', "true"); | ||
| 144 | + | ||
| 145 | + // 关闭左侧栏 | ||
| 146 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 147 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 148 | + var d = new Date(); | ||
| 149 | + var year = d.getFullYear(); | ||
| 150 | + var month = d.getMonth() + 1; | ||
| 151 | + var day = d.getDate(); | ||
| 152 | + if(month < 10) | ||
| 153 | + month = "0" + month; | ||
| 154 | + if(day < 10) | ||
| 155 | + day = "0" + day; | ||
| 156 | + | ||
| 157 | + var dateTime=year + "-" + month + "-" + day; | ||
| 158 | + $("#date").val(dateTime); | ||
| 159 | + $("#date2").val(dateTime); | ||
| 160 | + $("#date").datetimepicker({ | ||
| 161 | + format : 'YYYY-MM-DD', | ||
| 162 | + locale : 'zh-cn', | ||
| 163 | + maxDate : dateTime | ||
| 164 | + }); | ||
| 165 | + $("#date2").datetimepicker({ | ||
| 166 | + format : 'YYYY-MM-DD', | ||
| 167 | + locale : 'zh-cn', | ||
| 168 | + maxDate : dateTime | ||
| 169 | + }); | ||
| 170 | + | ||
| 171 | + var date = ""; | ||
| 172 | + var date2 = ""; | ||
| 173 | + var nature=""; | ||
| 174 | + var time1=""; | ||
| 175 | + var time2=""; | ||
| 176 | + $("#query").on("click",function(){ | ||
| 177 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | ||
| 178 | + layer.msg("请选择日期!"); | ||
| 179 | + return; | ||
| 180 | + } | ||
| 181 | + if($("#date2").val() == null || $("#date2").val().trim().length == 0){ | ||
| 182 | + layer.msg("请选择日期!"); | ||
| 183 | + return; | ||
| 184 | + } | ||
| 185 | + date = $("#date").val(); | ||
| 186 | + date2 = $("#date2").val(); | ||
| 187 | + nature=$("#nature").val(); | ||
| 188 | +// time1 = Date.parse(new Date(date)); | ||
| 189 | +// time2 = Date.parse(new Date(date2)); | ||
| 190 | +// if(date==null || date =="" ||date2==null || date2 ==""){ | ||
| 191 | +// layer.msg('请选择时间段.'); | ||
| 192 | +// }else if(time2<time1){ | ||
| 193 | +// layer.msg('结束日期不能小于开始日期.'); | ||
| 194 | +// }else{ | ||
| 195 | +// if((time2-time1)>2678400000){ | ||
| 196 | +// layer.msg('查询超过一个月请点击【统计查询】.'); | ||
| 197 | +// }else{ | ||
| 198 | + $("#tjrq").html(date); | ||
| 199 | + $("#rqxs").html(date); | ||
| 200 | + var params = {}; | ||
| 201 | + params['date'] = date; | ||
| 202 | + params['date2'] = date2; | ||
| 203 | + params['nature'] = nature; | ||
| 204 | + params['type'] = "query"; | ||
| 205 | + var i = layer.load(2); | ||
| 206 | + $get('/realSchedule/dispatchDailySum',params,function(result){ | ||
| 207 | + // 把数据填充到模版中 | ||
| 208 | + var tbodyHtml = template('dispatch_daily_sum',{list:result}); | ||
| 209 | + // 把渲染好的模版html文本追加到表格中 | ||
| 210 | + $('#forms .dispatch_daily_sum').html(tbodyHtml); | ||
| 211 | + layer.close(i); | ||
| 212 | + | ||
| 213 | + if(result.length == 0){ | ||
| 214 | + $("#export").attr('disabled',"true"); | ||
| 215 | + }else{ | ||
| 216 | + $("#export").removeAttr("disabled"); | ||
| 217 | + } | ||
| 218 | + }); | ||
| 219 | +// } | ||
| 220 | +// } | ||
| 221 | + }); | ||
| 222 | + | ||
| 223 | +// $("#tjrbBody").height($(window).height()-100); | ||
| 224 | + $("#export").on("click",function(){ | ||
| 225 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | ||
| 226 | + layer.msg("请选择时间!"); | ||
| 227 | + return; | ||
| 228 | + } | ||
| 229 | + date = $("#date").val(); | ||
| 230 | + date2 = $("#date2").val(); | ||
| 231 | + nature=$("#nature").val(); | ||
| 232 | + var params = {}; | ||
| 233 | + params['date'] = date; | ||
| 234 | + params['date2'] = date2; | ||
| 235 | + params['nature'] = nature; | ||
| 236 | + params['type'] = "export"; | ||
| 237 | +// if((time2-time1)>2678400000){ | ||
| 238 | +// layer.msg('查询超过一个月请点击【统计查询】.'); | ||
| 239 | +// }else{ | ||
| 240 | + var i = layer.load(2); | ||
| 241 | + $get('/realSchedule/dispatchDailySum',params,function(result){ | ||
| 242 | + var dateTime = ""; | ||
| 243 | + if(date == date2){ | ||
| 244 | + dateTime = moment(date).format("YYYYMMDD"); | ||
| 245 | + } else { | ||
| 246 | + dateTime = moment(date).format("YYYYMMDD") | ||
| 247 | + +"-"+moment(date2).format("YYYYMMDD"); | ||
| 248 | + } | ||
| 249 | + window.open("/downloadFile/download?fileName=" | ||
| 250 | + +dateTime+"-调度日报汇总表"); | ||
| 251 | + layer.close(i); | ||
| 252 | + }); | ||
| 253 | +// } | ||
| 254 | + }); | ||
| 255 | + | ||
| 256 | + | ||
| 257 | + }); | ||
| 258 | +</script> | ||
| 259 | +<script type="text/html" id="dispatch_daily_sum"> | ||
| 260 | + {{each list as obj i}} | ||
| 261 | + <tr style='{{if obj.zt==1}}color: red;{{/if}} | ||
| 262 | + {{if obj.fgsName=='小计' || obj.gsName=='浦交'}}background-color: #b9d6fb;{{/if}}'> | ||
| 263 | + <td>{{obj.gsName}}</td> | ||
| 264 | + <td>{{obj.fgsName}}</td> | ||
| 265 | + <td>{{obj.jhzlc}}</td> | ||
| 266 | + <td>{{obj.jhlc}}</td> | ||
| 267 | + <td>{{obj.jcclc}}</td> | ||
| 268 | + <td>{{obj.sjzgl}}</td> | ||
| 269 | + <td>{{obj.sjgl}}</td> | ||
| 270 | + <td>{{obj.sjksgl}}</td> | ||
| 271 | + <td>{{obj.ssbc}}</td> | ||
| 272 | + <td>{{obj.ssgl}}</td> | ||
| 273 | + <td>{{obj.ssgl_lz}}</td> | ||
| 274 | + <td>{{obj.ssgl_dm}}</td> | ||
| 275 | + <td>{{obj.ssgl_gz}}</td> | ||
| 276 | + <td>{{obj.ssgl_jf}}</td> | ||
| 277 | + <td>{{obj.ssgl_zs}}</td> | ||
| 278 | + <td>{{obj.ssgl_qr}}</td> | ||
| 279 | + <td>{{obj.ssgl_qc}}</td> | ||
| 280 | + <td>{{obj.ssgl_kx}}</td> | ||
| 281 | + <td>{{obj.ssgl_qh}}</td> | ||
| 282 | + <td>{{obj.ssgl_yw}}</td> | ||
| 283 | + <td>{{obj.ssgl_other}}</td> | ||
| 284 | + <td>{{obj.ljgl}}</td> | ||
| 285 | + <td>{{obj.ljks}}</td> | ||
| 286 | + <td>{{obj.jhbc}}</td> | ||
| 287 | + <td>{{obj.jhbc_m}}</td> | ||
| 288 | + <td>{{obj.jhbc_a}}</td> | ||
| 289 | + <td>{{obj.sjbc}}</td> | ||
| 290 | + <td>{{obj.sjbc_m}}</td> | ||
| 291 | + <td>{{obj.sjbc_a}}</td> | ||
| 292 | + <td>{{obj.ljbc}}</td> | ||
| 293 | + <td>{{obj.ljbc_m}}</td> | ||
| 294 | + <td>{{obj.ljbc_a}}</td> | ||
| 295 | + <td>{{obj.fzbc}}</td> | ||
| 296 | + <td>{{obj.fzbc_m}}</td> | ||
| 297 | + <td>{{obj.fzbc_a}}</td> | ||
| 298 | + <td>{{obj.dtbc}}</td> | ||
| 299 | + <td>{{obj.dtbc_m}}</td> | ||
| 300 | + <td>{{obj.dtbc_a}}</td> | ||
| 301 | + <td>{{obj.djg}}</td> | ||
| 302 | + <td>{{obj.djg_m}}</td> | ||
| 303 | + <td>{{obj.djg_a}}</td> | ||
| 304 | + <td>{{obj.djg_time}}</td> | ||
| 305 | + <td> </td> | ||
| 306 | + </tr> | ||
| 307 | + {{/each}} | ||
| 308 | + {{if list.length == 0}} | ||
| 309 | + <tr> | ||
| 310 | + <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 311 | + </tr> | ||
| 312 | + {{/if}} | ||
| 313 | +</script> | ||
| 0 | \ No newline at end of file | 314 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html
| @@ -60,6 +60,7 @@ | @@ -60,6 +60,7 @@ | ||
| 60 | <div class="form-group" style="margin-left: 10px;"> | 60 | <div class="form-group" style="margin-left: 10px;"> |
| 61 | <input class="btn btn-default" type="button" id="query" value="筛选"/> | 61 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 62 | <input class="btn btn-default" type="button" id="export" value="导出"/> | 62 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| 63 | + <input class="btn btn-default" type="button" id="exportAll" value="导出全部公司" style="display: none;"/> | ||
| 63 | </div> | 64 | </div> |
| 64 | </form> | 65 | </form> |
| 65 | </div> | 66 | </div> |
| @@ -418,6 +419,40 @@ | @@ -418,6 +419,40 @@ | ||
| 418 | }); | 419 | }); |
| 419 | 420 | ||
| 420 | 421 | ||
| 422 | + $.get('/user/getCurrentUser', function(result){ | ||
| 423 | + var roleName = ""; | ||
| 424 | + $(result.roles).each(function(i, e){ | ||
| 425 | + roleName += e.roleName + "、"; | ||
| 426 | + }); | ||
| 427 | + if(roleName.indexOf("浦交") > -1 || roleName.indexOf("拓华") > -1){ | ||
| 428 | + $("#exportAll").show(); | ||
| 429 | + } | ||
| 430 | + }); | ||
| 431 | + $("#exportAll").on("click",function(){ | ||
| 432 | + var params = {}; | ||
| 433 | + sfyy = $("#sfyy").val(); | ||
| 434 | + startDate = $("#startDate").val(); | ||
| 435 | + endDate = $("#endDate").val(); | ||
| 436 | + params['sfyy'] = sfyy; | ||
| 437 | + params['startDate'] = startDate; | ||
| 438 | + params['endDate'] = endDate; | ||
| 439 | + params['type'] = "exportAll"; | ||
| 440 | + var i = layer.load(2); | ||
| 441 | + $get('/pcpc/firstAndLastBus_sum', params, function(result){ | ||
| 442 | + var dateTime = ""; | ||
| 443 | + if(startDate == endDate){ | ||
| 444 | + dateTime = moment(startDate).format("YYYYMMDD"); | ||
| 445 | + } else { | ||
| 446 | + dateTime = moment(startDate).format("YYYYMMDD") | ||
| 447 | + +"-"+moment(endDate).format("YYYYMMDD"); | ||
| 448 | + } | ||
| 449 | + window.open("/downloadFile/download?fileName=" | ||
| 450 | + +dateTime+"-全部公司-线路首末班准点率"); | ||
| 451 | + layer.close(i); | ||
| 452 | + }); | ||
| 453 | + }); | ||
| 454 | + | ||
| 455 | + | ||
| 421 | }); | 456 | }); |
| 422 | 457 | ||
| 423 | </script> | 458 | </script> |
src/main/resources/static/pages/forms/statement/statisticsDaily.html
| 1 | -<style type="text/css"> | ||
| 2 | - .table-bordered { | ||
| 3 | - border: 1px solid; } | ||
| 4 | - .table-bordered > thead > tr > th, | ||
| 5 | - .table-bordered > thead > tr > td, | ||
| 6 | - .table-bordered > tbody > tr > th, | ||
| 7 | - .table-bordered > tbody > tr > td, | ||
| 8 | - .table-bordered > tfoot > tr > th, | ||
| 9 | - .table-bordered > tfoot > tr > td { | ||
| 10 | - border: 1px solid; } | ||
| 11 | - .table-bordered > thead > tr > th, | ||
| 12 | - .table-bordered > thead > tr > td { | ||
| 13 | - border-bottom-width: 2px; } | ||
| 14 | - | ||
| 15 | - .table > tbody + tbody { | ||
| 16 | - border-top: 1px solid; } | ||
| 17 | - | ||
| 18 | - #forms > thead > tr> td >span{ | ||
| 19 | - width: 5px; | ||
| 20 | - word-wrap: break-word; | ||
| 21 | - letter-spacing: 20px; | ||
| 22 | - } | ||
| 23 | - | ||
| 24 | - #forms > thead > tr> td >label{ | ||
| 25 | - word-break: keep-all;white-space:nowrap; | ||
| 26 | - } | ||
| 27 | -</style> | ||
| 28 | - | ||
| 29 | -<div class="page-head"> | ||
| 30 | - <div class="page-title"> | ||
| 31 | - <h1>统计日报(按年、月、季度查询请点击<a href="statisticsDailyCalc2.html" target="_blank">【统计查询】</a>)</h1> | ||
| 32 | - </div> | ||
| 33 | -</div> | ||
| 34 | - | ||
| 35 | -<!-- <div class="row"> --> | ||
| 36 | - <div class="col-md-12 portlet light porttlet-fit bordered" style="height:calc(100% - 56px)"> | ||
| 37 | -<!-- <div> --> | ||
| 38 | - <div class="portlet-title"> | ||
| 39 | - <form class="form-inline" action=""> | ||
| 40 | - <div style="display: inline-block;margin-left: 29px; " id="gsdmDiv"> | ||
| 41 | - <span class="item-label" style="width: 80px;">公司: </span> | ||
| 42 | - <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select> | ||
| 43 | - </div> | ||
| 44 | - <div style="display: inline-block; margin-left: 29px;" id="fgsdmDiv"> | ||
| 45 | - <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 46 | - <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select> | ||
| 47 | - </div> | ||
| 48 | - <div style="display: inline-block;margin-left: 42px;"> | ||
| 49 | - <span class="item-label" style="width: 80px;">线路: </span> | ||
| 50 | - <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 51 | - </div> | ||
| 52 | - <div style="margin-top: 3px"></div> | ||
| 53 | - <div style="display: inline-block;"> | ||
| 54 | - <span class="item-label" style="width: 80px;">线路性质: </span> | ||
| 55 | - <select | ||
| 56 | - class="form-control" name="nature" id="nature" | ||
| 57 | - style="width: 180px;"> | ||
| 58 | - <option value="0">全部线路</option> | ||
| 59 | - <option value="1" selected="selected">营运线路</option> | ||
| 60 | - <option value="2">非营运线路</option> | ||
| 61 | - </select> | ||
| 62 | - </div> | ||
| 63 | - <div style="display: inline-block;margin-left: 15px;"> | ||
| 64 | - <span class="item-label" style="width: 80px;">开始时间: </span> | ||
| 65 | - <input class="form-control" type="text" id="date" style="width: 180px;"/> | ||
| 66 | - </div> | ||
| 67 | - <div style="display: inline-block;margin-left: 15px;"> | ||
| 68 | - <span class="item-label" style="width: 80px;">结束时间: </span> | ||
| 69 | - <input class="form-control" type="text" id="date2" style="width: 180px;"/> | ||
| 70 | - </div> | ||
| 71 | - <div class="form-group"> | ||
| 72 | - <input class="btn btn-default" type="button" id="query" value="查询"/> | ||
| 73 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 74 | - </div> | ||
| 75 | - </form> | ||
| 76 | - </div> | ||
| 77 | - <div class="portlet-body" id="tjrbBody" style="overflow:auto;height: calc(100% - 80px)"> | ||
| 78 | - <div class="table-container" style="margin-top: 10px;min-width: 906px"> | ||
| 79 | - <label>早高峰:6:31~8:30 晚高峰:16:01~18:00</label> | ||
| 80 | - <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 81 | - <thead> | ||
| 82 | - <tr> | ||
| 83 | - <th colspan="45"><label id="tjrq"></label> 线路统计日报</th> | ||
| 84 | - </tr> | ||
| 85 | - <tr> | ||
| 86 | - <td rowspan="3"><span >分公司</span></td> | ||
| 87 | - <td rowspan="3"><span >路线名</span></td> | ||
| 88 | - <td colspan="21">全日营运里程(公里)(注:实际营运里程、实际空驶里程、实际总里程均已包含临加里程)</td> | ||
| 89 | - <td colspan="15">全日营运班次</td> | ||
| 90 | - <td colspan="9">大间隔情况</td> | ||
| 91 | - </tr> | ||
| 92 | - <tr> | ||
| 93 | - <td rowspan="2"><label>计划总</label> | ||
| 94 | - <label>公里 </label></td> | ||
| 95 | - <td rowspan="2"><label>计划营</label><label>运公里</label></td> | ||
| 96 | - <td rowspan="2"><label>计划空</label><label>驶公里</label></td> | ||
| 97 | - <td rowspan="2"><label>实际</label><label>总公里</label></td> | ||
| 98 | - <td rowspan="2"><label>实际营</label><label>运公里</label></td> | ||
| 99 | - <td rowspan="2"><label>实际空</label><label>驶公里</label></td> | ||
| 100 | - <td rowspan="2"><span>少驶公里</span></td> | ||
| 101 | - <td rowspan="2"><span>少驶班次</span></td> | ||
| 102 | - <td colspan="11">少驶原因(公里)</td> | ||
| 103 | - <td colspan="2">临加公里</td> | ||
| 104 | - <td colspan="3">计划班次</td> | ||
| 105 | - <td colspan="3">实际班次</td> | ||
| 106 | - <td colspan="3">临加班次</td> | ||
| 107 | - <td colspan="3">放站班次</td> | ||
| 108 | - <td colspan="3">调头班次</td> | ||
| 109 | - <td colspan="3">发生次数</td> | ||
| 110 | - <td rowspan="2">最大间隔时间(分)</td> | ||
| 111 | - <td rowspan="2">原因</td> | ||
| 112 | - </tr> | ||
| 113 | - <tr> | ||
| 114 | - <td><span >路阻</span></td> | ||
| 115 | - <td><span>吊慢</span></td> | ||
| 116 | - <td><span >故障</span></td> | ||
| 117 | - <td><span >纠纷</span></td> | ||
| 118 | - <td><span >肇事</span></td> | ||
| 119 | - <td><span>缺人</span></td> | ||
| 120 | - <td><span>缺车</span></td> | ||
| 121 | - <td><span >客稀</span></td> | ||
| 122 | - <td><span>气候</span></td> | ||
| 123 | - <td><span>援外</span></td> | ||
| 124 | - <td><span>其他</span></td> | ||
| 125 | - <td><span>营运</span></td> | ||
| 126 | - <td><span>空驶</span></td> | ||
| 127 | - <td><span>全日</span></td> | ||
| 128 | - <td><span>早高峰</span></td> | ||
| 129 | - <td><span>晚高峰</span></td> | ||
| 130 | - <td><span>全日</span></td> | ||
| 131 | - <td><span>早高峰</span></td> | ||
| 132 | - <td><span>晚高峰</span></td> | ||
| 133 | - <td><span>全日</span></td> | ||
| 134 | - <td><span>早高峰</span></td> | ||
| 135 | - <td><span>晚高峰</span></td> | ||
| 136 | - <td><span>全日</span></td> | ||
| 137 | - <td><span>早高峰</span></td> | ||
| 138 | - <td><span>晚高峰</span></td> | ||
| 139 | - <td><span>全日</span></td> | ||
| 140 | - <td><span>早高峰</span></td> | ||
| 141 | - <td><span>晚高峰</span></td> | ||
| 142 | - <td><span>全日</span></td> | ||
| 143 | - <td><span>早高峰</span></td> | ||
| 144 | - <td><span>晚高峰</span></td> | ||
| 145 | - </tr> | ||
| 146 | - </thead> | ||
| 147 | - <tbody class="statisticsDaily"> | ||
| 148 | - | ||
| 149 | - </tbody> | ||
| 150 | - </table> | ||
| 151 | - </div> | ||
| 152 | - </div> | ||
| 153 | - </div> | ||
| 154 | - | ||
| 155 | -<script> | ||
| 156 | - $(function(){ | ||
| 157 | - $('#export').attr('disabled', "true"); | ||
| 158 | - | ||
| 159 | - // 关闭左侧栏 | ||
| 160 | - if (!$('body').hasClass('page-sidebar-closed')) | ||
| 161 | - $('.menu-toggler.sidebar-toggler').click(); | ||
| 162 | - var d = new Date(); | ||
| 163 | - var year = d.getFullYear(); | ||
| 164 | - var month = d.getMonth() + 1; | ||
| 165 | - var day = d.getDate(); | ||
| 166 | - if(month < 10) | ||
| 167 | - month = "0" + month; | ||
| 168 | - if(day < 10) | ||
| 169 | - day = "0" + day; | ||
| 170 | - | ||
| 171 | - var dateTime=year + "-" + month + "-" + day; | ||
| 172 | - $("#date").val(dateTime); | ||
| 173 | - $("#date2").val(dateTime); | ||
| 174 | - $("#date").datetimepicker({ | ||
| 175 | - format : 'YYYY-MM-DD', | ||
| 176 | - locale : 'zh-cn', | ||
| 177 | - maxDate : dateTime | ||
| 178 | - }); | ||
| 179 | - | ||
| 180 | - $("#date2").datetimepicker({ | ||
| 181 | - format : 'YYYY-MM-DD', | ||
| 182 | - locale : 'zh-cn', | ||
| 183 | - maxDate : dateTime | ||
| 184 | - }); | ||
| 185 | - | ||
| 186 | - | ||
| 187 | - var fage=true; | ||
| 188 | - var obj = []; | ||
| 189 | - var xlList; | ||
| 190 | - $.get('/report/lineList',function(result){ | ||
| 191 | - xlList=result; | ||
| 192 | - $.get('/user/companyData', function(result){ | ||
| 193 | - obj = result; | ||
| 194 | - var options = ''; | ||
| 195 | - for(var i = 0; i < obj.length; i++){ | ||
| 196 | - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 197 | - } | ||
| 198 | - | ||
| 199 | - if(obj.length ==0){ | ||
| 200 | - $("#gsdmDiv").css('display','none'); | ||
| 201 | - }else if(obj.length ==1){ | ||
| 202 | - $("#gsdmDiv").css('display','none'); | ||
| 203 | - if(obj[0].children.length == 1 || obj[0].children.length ==0){ | ||
| 204 | - fage=false; | ||
| 205 | - $('#fgsdmDiv').css('display','none'); | ||
| 206 | - } | ||
| 207 | - } | ||
| 208 | - $('#gsdm').html(options); | ||
| 209 | - updateCompany(); | ||
| 210 | - }); | ||
| 211 | - }) | ||
| 212 | - $("#gsdm").on("change",updateCompany); | ||
| 213 | - function updateCompany(){ | ||
| 214 | - var company = $('#gsdm').val(); | ||
| 215 | - var options = ''; | ||
| 216 | - if(fage){ | ||
| 217 | - options = '<option value="">请选择</option>'; | ||
| 218 | - } | ||
| 219 | - for(var i = 0; i < obj.length; i++){ | ||
| 220 | - if(obj[i].companyCode == company){ | ||
| 221 | - var children = obj[i].children; | ||
| 222 | - for(var j = 0; j < children.length; j++){ | ||
| 223 | - options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 224 | - } | ||
| 225 | - } | ||
| 226 | - } | ||
| 227 | - $('#fgsdm').html(options); | ||
| 228 | -// initXl(); | ||
| 229 | - } | ||
| 230 | - | ||
| 231 | - var tempData = {}; | ||
| 232 | - $.get('/report/lineList',function(xlList){ | ||
| 233 | - var data = []; | ||
| 234 | - data.push({id: " ", text: "全部线路"}); | ||
| 235 | - $.get('/user/companyData', function(result){ | ||
| 236 | - for(var i = 0; i < result.length; i++){ | ||
| 237 | - var companyCode = result[i].companyCode; | ||
| 238 | - var children = result[i].children; | ||
| 239 | - for(var j = 0; j < children.length; j++){ | ||
| 240 | - var code = children[j].code; | ||
| 241 | - for(var k=0;k < xlList.length;k++ ){ | ||
| 242 | - if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | ||
| 243 | - data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | ||
| 244 | - tempData[xlList[k]["xlbm"]] = companyCode+":"+code; | ||
| 245 | - } | ||
| 246 | - } | ||
| 247 | - } | ||
| 248 | - } | ||
| 249 | - initPinYinSelect2('#line',data,''); | ||
| 250 | - | ||
| 251 | - }); | ||
| 252 | - }); | ||
| 253 | - | ||
| 254 | - $("#line").on("change", function(){ | ||
| 255 | - if($("#line").val() == " "){ | ||
| 256 | - $("#gsdm").attr("disabled", false); | ||
| 257 | - $("#fgsdm").attr("disabled", false); | ||
| 258 | - } else { | ||
| 259 | - var temp = (tempData[$("#line").val()] ? tempData[$("#line").val()] : " : ").split(":"); | ||
| 260 | - $("#gsdm").val(temp[0]); | ||
| 261 | - updateCompany(); | ||
| 262 | - $("#nature").val(0); | ||
| 263 | - $("#fgsdm").val(temp[1]); | ||
| 264 | - $("#gsdm").attr("disabled", true); | ||
| 265 | - $("#fgsdm").attr("disabled", true); | ||
| 266 | - } | ||
| 267 | - }); | ||
| 268 | - | ||
| 269 | - | ||
| 270 | - var line =""; | ||
| 271 | - var xlName =""; | ||
| 272 | - var date = ""; | ||
| 273 | - var date2 =""; | ||
| 274 | - var gsdm=""; | ||
| 275 | - var fgsdm=""; | ||
| 276 | - var nature=""; | ||
| 277 | - var time1=""; | ||
| 278 | - var time2=""; | ||
| 279 | - $("#query").on("click",function(){ | ||
| 280 | - if($("#date").val() == null || $("#date").val().trim().length == 0){ | ||
| 281 | - layer.msg("请选择时间范围!"); | ||
| 282 | - return; | ||
| 283 | - } | ||
| 284 | - if($("#date2").val() == null || $("#date2").val().trim().length == 0){ | ||
| 285 | - layer.msg("请选择时间范围!"); | ||
| 286 | - return; | ||
| 287 | - } | ||
| 288 | -// $("#tjrbBody").height($(window).height()-100); | ||
| 289 | - line = $("#line").val(); | ||
| 290 | - date = $("#date").val(); | ||
| 291 | - date2 =$("#date2").val(); | ||
| 292 | - gsdm =$("#gsdm").val(); | ||
| 293 | - fgsdm=$("#fgsdm").val(); | ||
| 294 | - nature=$("#nature").val(); | ||
| 295 | - xlName = $("#select2-line-container").html(); | ||
| 296 | - if(xlName == "全部线路") | ||
| 297 | - xlName = $('#fgsdm option:selected').text(); | ||
| 298 | - if(xlName == "请选择") | ||
| 299 | - xlName = $('#gsdm option:selected').text(); | ||
| 300 | - if(line=="请选择"){ | ||
| 301 | - line=""; | ||
| 302 | - } | ||
| 303 | - time1 = Date.parse(new Date(date)); | ||
| 304 | - time2 = Date.parse(new Date(date2)); | ||
| 305 | - if(date==null || date =="" ||date2==null || date2 ==""){ | ||
| 306 | - layer.msg('请选择时间段.'); | ||
| 307 | - }else if(time2<time1){ | ||
| 308 | - layer.msg('结束日期不能小于开始日期.'); | ||
| 309 | - }else{ | ||
| 310 | - if((time2-time1)>2678400000){ | ||
| 311 | - layer.msg('查询超过一个月请点击【统计查询】.'); | ||
| 312 | - }else{ | ||
| 313 | - $("#tjrq").html(date+"至"+date2); | ||
| 314 | - var params = {}; | ||
| 315 | - params['gsdm'] = gsdm; | ||
| 316 | - params['fgsdm'] =fgsdm ; | ||
| 317 | - params['line'] = line; | ||
| 318 | - params['date'] = date; | ||
| 319 | - params['date2'] = date2; | ||
| 320 | - params['xlName'] = xlName; | ||
| 321 | - params['nature'] = nature; | ||
| 322 | - params['type'] = "query"; | ||
| 323 | - var i = layer.load(2); | ||
| 324 | - $get('/realSchedule/statisticsDailyTj',params,function(result){ | ||
| 325 | - // 把数据填充到模版中 | ||
| 326 | - var tbodyHtml = template('statisticsDaily',{list:result}); | ||
| 327 | - // 把渲染好的模版html文本追加到表格中 | ||
| 328 | - $('#forms .statisticsDaily').html(tbodyHtml); | ||
| 329 | - layer.close(i); | ||
| 330 | - | ||
| 331 | - if(result.length == 0) | ||
| 332 | - $("#export").attr('disabled',"true"); | ||
| 333 | - else | ||
| 334 | - $("#export").removeAttr("disabled"); | ||
| 335 | - }); | ||
| 336 | - } | ||
| 337 | - | ||
| 338 | - } | ||
| 339 | - | ||
| 340 | - }); | ||
| 341 | -// $("#tjrbBody").height($(window).height()-100); | ||
| 342 | - $("#export").on("click",function(){ | ||
| 343 | - var params = {}; | ||
| 344 | - params['gsdm'] = gsdm; | ||
| 345 | - params['fgsdm'] =fgsdm; | ||
| 346 | - params['line'] = line; | ||
| 347 | - date = $("#date").val(); | ||
| 348 | - date2 =$("#date2").val(); | ||
| 349 | - params['date'] = date; | ||
| 350 | - params['date2'] = date2; | ||
| 351 | - params['xlName'] = xlName; | ||
| 352 | - params['nature'] = nature; | ||
| 353 | - params['type'] = "export"; | ||
| 354 | - if((time2-time1)>2678400000){ | ||
| 355 | - layer.msg('查询超过一个月请点击【统计查询】.'); | ||
| 356 | - }else{ | ||
| 357 | - var i = layer.load(2); | ||
| 358 | - $get('/realSchedule/statisticsDailyTj',params,function(result){ | ||
| 359 | - var dateTime = ""; | ||
| 360 | - if(date == date2){ | ||
| 361 | - dateTime = moment(date).format("YYYYMMDD"); | ||
| 362 | - } else { | ||
| 363 | - dateTime = moment(date).format("YYYYMMDD") | ||
| 364 | - +"-"+moment(date2).format("YYYYMMDD"); | ||
| 365 | - } | ||
| 366 | - window.open("/downloadFile/download?fileName=" | ||
| 367 | - +dateTime+"-"+xlName+"-统计日报"); | ||
| 368 | - layer.close(i); | ||
| 369 | - }); | ||
| 370 | - } | ||
| 371 | - }); | ||
| 372 | - | ||
| 373 | - }); | ||
| 374 | -</script> | ||
| 375 | -<script type="text/html" id="statisticsDaily"> | ||
| 376 | - {{each list as obj i}} | ||
| 377 | - <tr {{if obj.zt==1}}style='color: red'{{/if}}> | ||
| 378 | - <td>{{obj.fgsName}}</td> | ||
| 379 | - <td>{{obj.xlName}}</td> | ||
| 380 | - <td>{{obj.jhzlc}}</td> | ||
| 381 | - <td>{{obj.jhlc}}</td> | ||
| 382 | - <td>{{obj.jcclc}}</td> | ||
| 383 | - <td>{{obj.sjzgl}}</td> | ||
| 384 | - <td>{{obj.sjgl}}</td> | ||
| 385 | - <td>{{obj.sjksgl}}</td> | ||
| 386 | - <td>{{obj.ssgl}}</td> | ||
| 387 | - <td>{{obj.ssbc}}</td> | ||
| 388 | - <td>{{obj.ssgl_lz}}</td> | ||
| 389 | - <td>{{obj.ssgl_dm}}</td> | ||
| 390 | - <td>{{obj.ssgl_gz}}</td> | ||
| 391 | - <td>{{obj.ssgl_jf}}</td> | ||
| 392 | - <td>{{obj.ssgl_zs}}</td> | ||
| 393 | - <td>{{obj.ssgl_qr}}</td> | ||
| 394 | - <td>{{obj.ssgl_qc}}</td> | ||
| 395 | - <td>{{obj.ssgl_kx}}</td> | ||
| 396 | - <td>{{obj.ssgl_qh}}</td> | ||
| 397 | - <td>{{obj.ssgl_yw}}</td> | ||
| 398 | - <td>{{obj.ssgl_other}}</td> | ||
| 399 | - <td>{{obj.ljgl}}</td> | ||
| 400 | - <td>{{obj.ljks}}</td> | ||
| 401 | - <td>{{obj.jhbc}}</td> | ||
| 402 | - <td>{{obj.jhbc_m}}</td> | ||
| 403 | - <td>{{obj.jhbc_a}}</td> | ||
| 404 | - <td>{{obj.sjbc}}</td> | ||
| 405 | - <td>{{obj.sjbc_m}}</td> | ||
| 406 | - <td>{{obj.sjbc_a}}</td> | ||
| 407 | - <td>{{obj.ljbc}}</td> | ||
| 408 | - <td>{{obj.ljbc_m}}</td> | ||
| 409 | - <td>{{obj.ljbc_a}}</td> | ||
| 410 | - <td>{{obj.fzbc}}</td> | ||
| 411 | - <td>{{obj.fzbc_m}}</td> | ||
| 412 | - <td>{{obj.fzbc_a}}</td> | ||
| 413 | - <td>{{obj.dtbc}}</td> | ||
| 414 | - <td>{{obj.dtbc_m}}</td> | ||
| 415 | - <td>{{obj.dtbc_a}}</td> | ||
| 416 | - <td>{{obj.djg}}</td> | ||
| 417 | - <td>{{obj.djg_m}}</td> | ||
| 418 | - <td>{{obj.djg_a}}</td> | ||
| 419 | - <td>{{obj.djg_time}}</td> | ||
| 420 | - <td> </td> | ||
| 421 | - </tr> | ||
| 422 | - {{/each}} | ||
| 423 | - {{if list.length == 0}} | ||
| 424 | - <tr> | ||
| 425 | - <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 426 | - </tr> | ||
| 427 | - {{/if}} | 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 | + #forms > thead > tr> td >span{ | ||
| 19 | + width: 5px; | ||
| 20 | + word-wrap: break-word; | ||
| 21 | + letter-spacing: 20px; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + #forms > thead > tr> td >label{ | ||
| 25 | + word-break: keep-all;white-space:nowrap; | ||
| 26 | + } | ||
| 27 | +</style> | ||
| 28 | + | ||
| 29 | +<div class="page-head"> | ||
| 30 | + <div class="page-title"> | ||
| 31 | + <h1>统计日报(按年、月、季度查询请点击<a href="statisticsDailyCalc2.html" target="_blank">【统计查询】</a>)</h1> | ||
| 32 | + </div> | ||
| 33 | +</div> | ||
| 34 | + | ||
| 35 | +<!-- <div class="row"> --> | ||
| 36 | + <div class="col-md-12 portlet light porttlet-fit bordered" style="height:calc(100% - 56px)"> | ||
| 37 | +<!-- <div> --> | ||
| 38 | + <div class="portlet-title"> | ||
| 39 | + <form class="form-inline" action=""> | ||
| 40 | + <div style="display: inline-block;margin-left: 29px; " id="gsdmDiv"> | ||
| 41 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 42 | + <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select> | ||
| 43 | + </div> | ||
| 44 | + <div style="display: inline-block; margin-left: 29px;" id="fgsdmDiv"> | ||
| 45 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 46 | + <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select> | ||
| 47 | + </div> | ||
| 48 | + <div style="display: inline-block;margin-left: 42px;"> | ||
| 49 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 50 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 51 | + </div> | ||
| 52 | + <div style="margin-top: 3px"></div> | ||
| 53 | + <div style="display: inline-block;"> | ||
| 54 | + <span class="item-label" style="width: 80px;">线路性质: </span> | ||
| 55 | + <select | ||
| 56 | + class="form-control" name="nature" id="nature" | ||
| 57 | + style="width: 180px;"> | ||
| 58 | + <option value="0">全部线路</option> | ||
| 59 | + <option value="1" selected="selected">营运线路</option> | ||
| 60 | + <option value="2">非营运线路</option> | ||
| 61 | + </select> | ||
| 62 | + </div> | ||
| 63 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 64 | + <span class="item-label" style="width: 80px;">开始时间: </span> | ||
| 65 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | ||
| 66 | + </div> | ||
| 67 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 68 | + <span class="item-label" style="width: 80px;">结束时间: </span> | ||
| 69 | + <input class="form-control" type="text" id="date2" style="width: 180px;"/> | ||
| 70 | + </div> | ||
| 71 | + <div class="form-group"> | ||
| 72 | + <input class="btn btn-default" type="button" id="query" value="查询"/> | ||
| 73 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 74 | + <input class="btn btn-default" type="button" id="exportAll" value="导出全部公司" style="display: none;"/> | ||
| 75 | + </div> | ||
| 76 | + </form> | ||
| 77 | + </div> | ||
| 78 | + <div class="portlet-body" id="tjrbBody" style="overflow:auto;height: calc(100% - 80px)"> | ||
| 79 | + <div class="table-container" style="margin-top: 10px;min-width: 906px"> | ||
| 80 | + <label>早高峰:6:31~8:30 晚高峰:16:01~18:00</label> | ||
| 81 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 82 | + <thead> | ||
| 83 | + <tr> | ||
| 84 | + <th colspan="45"><label id="tjrq"></label> 线路统计日报</th> | ||
| 85 | + </tr> | ||
| 86 | + <tr> | ||
| 87 | + <td rowspan="3"><span >分公司</span></td> | ||
| 88 | + <td rowspan="3"><span >路线名</span></td> | ||
| 89 | + <td colspan="21">全日营运里程(公里)(注:实际营运里程、实际空驶里程、实际总里程均已包含临加里程)</td> | ||
| 90 | + <td colspan="15">全日营运班次</td> | ||
| 91 | + <td colspan="9">大间隔情况</td> | ||
| 92 | + </tr> | ||
| 93 | + <tr> | ||
| 94 | + <td rowspan="2"><label>计划总</label> | ||
| 95 | + <label>公里 </label></td> | ||
| 96 | + <td rowspan="2"><label>计划营</label><label>运公里</label></td> | ||
| 97 | + <td rowspan="2"><label>计划空</label><label>驶公里</label></td> | ||
| 98 | + <td rowspan="2"><label>实际</label><label>总公里</label></td> | ||
| 99 | + <td rowspan="2"><label>实际营</label><label>运公里</label></td> | ||
| 100 | + <td rowspan="2"><label>实际空</label><label>驶公里</label></td> | ||
| 101 | + <td rowspan="2"><span>少驶公里</span></td> | ||
| 102 | + <td rowspan="2"><span>少驶班次</span></td> | ||
| 103 | + <td colspan="11">少驶原因(公里)</td> | ||
| 104 | + <td colspan="2">临加公里</td> | ||
| 105 | + <td colspan="3">计划班次</td> | ||
| 106 | + <td colspan="3">实际班次</td> | ||
| 107 | + <td colspan="3">临加班次</td> | ||
| 108 | + <td colspan="3">放站班次</td> | ||
| 109 | + <td colspan="3">调头班次</td> | ||
| 110 | + <td colspan="3">发生次数</td> | ||
| 111 | + <td rowspan="2">最大间隔时间(分)</td> | ||
| 112 | + <td rowspan="2">原因</td> | ||
| 113 | + </tr> | ||
| 114 | + <tr> | ||
| 115 | + <td><span >路阻</span></td> | ||
| 116 | + <td><span>吊慢</span></td> | ||
| 117 | + <td><span >故障</span></td> | ||
| 118 | + <td><span >纠纷</span></td> | ||
| 119 | + <td><span >肇事</span></td> | ||
| 120 | + <td><span>缺人</span></td> | ||
| 121 | + <td><span>缺车</span></td> | ||
| 122 | + <td><span >客稀</span></td> | ||
| 123 | + <td><span>气候</span></td> | ||
| 124 | + <td><span>援外</span></td> | ||
| 125 | + <td><span>其他</span></td> | ||
| 126 | + <td><span>营运</span></td> | ||
| 127 | + <td><span>空驶</span></td> | ||
| 128 | + <td><span>全日</span></td> | ||
| 129 | + <td><span>早高峰</span></td> | ||
| 130 | + <td><span>晚高峰</span></td> | ||
| 131 | + <td><span>全日</span></td> | ||
| 132 | + <td><span>早高峰</span></td> | ||
| 133 | + <td><span>晚高峰</span></td> | ||
| 134 | + <td><span>全日</span></td> | ||
| 135 | + <td><span>早高峰</span></td> | ||
| 136 | + <td><span>晚高峰</span></td> | ||
| 137 | + <td><span>全日</span></td> | ||
| 138 | + <td><span>早高峰</span></td> | ||
| 139 | + <td><span>晚高峰</span></td> | ||
| 140 | + <td><span>全日</span></td> | ||
| 141 | + <td><span>早高峰</span></td> | ||
| 142 | + <td><span>晚高峰</span></td> | ||
| 143 | + <td><span>全日</span></td> | ||
| 144 | + <td><span>早高峰</span></td> | ||
| 145 | + <td><span>晚高峰</span></td> | ||
| 146 | + </tr> | ||
| 147 | + </thead> | ||
| 148 | + <tbody class="statisticsDaily"> | ||
| 149 | + | ||
| 150 | + </tbody> | ||
| 151 | + </table> | ||
| 152 | + </div> | ||
| 153 | + </div> | ||
| 154 | + </div> | ||
| 155 | + | ||
| 156 | +<script> | ||
| 157 | + $(function(){ | ||
| 158 | + $('#export').attr('disabled', "true"); | ||
| 159 | + | ||
| 160 | + // 关闭左侧栏 | ||
| 161 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 162 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 163 | + var d = new Date(); | ||
| 164 | + var year = d.getFullYear(); | ||
| 165 | + var month = d.getMonth() + 1; | ||
| 166 | + var day = d.getDate(); | ||
| 167 | + if(month < 10) | ||
| 168 | + month = "0" + month; | ||
| 169 | + if(day < 10) | ||
| 170 | + day = "0" + day; | ||
| 171 | + | ||
| 172 | + var dateTime=year + "-" + month + "-" + day; | ||
| 173 | + $("#date").val(dateTime); | ||
| 174 | + $("#date2").val(dateTime); | ||
| 175 | + $("#date").datetimepicker({ | ||
| 176 | + format : 'YYYY-MM-DD', | ||
| 177 | + locale : 'zh-cn', | ||
| 178 | + maxDate : dateTime | ||
| 179 | + }); | ||
| 180 | + | ||
| 181 | + $("#date2").datetimepicker({ | ||
| 182 | + format : 'YYYY-MM-DD', | ||
| 183 | + locale : 'zh-cn', | ||
| 184 | + maxDate : dateTime | ||
| 185 | + }); | ||
| 186 | + | ||
| 187 | + | ||
| 188 | + var fage=true; | ||
| 189 | + var obj = []; | ||
| 190 | + var xlList; | ||
| 191 | + $.get('/report/lineList',function(result){ | ||
| 192 | + xlList=result; | ||
| 193 | + $.get('/user/companyData', function(result){ | ||
| 194 | + obj = result; | ||
| 195 | + var options = ''; | ||
| 196 | + for(var i = 0; i < obj.length; i++){ | ||
| 197 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 198 | + } | ||
| 199 | + | ||
| 200 | + if(obj.length ==0){ | ||
| 201 | + $("#gsdmDiv").css('display','none'); | ||
| 202 | + }else if(obj.length ==1){ | ||
| 203 | + $("#gsdmDiv").css('display','none'); | ||
| 204 | + if(obj[0].children.length == 1 || obj[0].children.length ==0){ | ||
| 205 | + fage=false; | ||
| 206 | + $('#fgsdmDiv').css('display','none'); | ||
| 207 | + } | ||
| 208 | + } | ||
| 209 | + $('#gsdm').html(options); | ||
| 210 | + updateCompany(); | ||
| 211 | + }); | ||
| 212 | + }) | ||
| 213 | + $("#gsdm").on("change",updateCompany); | ||
| 214 | + function updateCompany(){ | ||
| 215 | + var company = $('#gsdm').val(); | ||
| 216 | + var options = ''; | ||
| 217 | + if(fage){ | ||
| 218 | + options = '<option value="">请选择</option>'; | ||
| 219 | + } | ||
| 220 | + for(var i = 0; i < obj.length; i++){ | ||
| 221 | + if(obj[i].companyCode == company){ | ||
| 222 | + var children = obj[i].children; | ||
| 223 | + for(var j = 0; j < children.length; j++){ | ||
| 224 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 225 | + } | ||
| 226 | + } | ||
| 227 | + } | ||
| 228 | + $('#fgsdm').html(options); | ||
| 229 | +// initXl(); | ||
| 230 | + } | ||
| 231 | + | ||
| 232 | + var tempData = {}; | ||
| 233 | + $.get('/report/lineList',function(xlList){ | ||
| 234 | + var data = []; | ||
| 235 | + data.push({id: " ", text: "全部线路"}); | ||
| 236 | + $.get('/user/companyData', function(result){ | ||
| 237 | + for(var i = 0; i < result.length; i++){ | ||
| 238 | + var companyCode = result[i].companyCode; | ||
| 239 | + var children = result[i].children; | ||
| 240 | + for(var j = 0; j < children.length; j++){ | ||
| 241 | + var code = children[j].code; | ||
| 242 | + for(var k=0;k < xlList.length;k++ ){ | ||
| 243 | + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | ||
| 244 | + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | ||
| 245 | + tempData[xlList[k]["xlbm"]] = companyCode+":"+code; | ||
| 246 | + } | ||
| 247 | + } | ||
| 248 | + } | ||
| 249 | + } | ||
| 250 | + initPinYinSelect2('#line',data,''); | ||
| 251 | + | ||
| 252 | + }); | ||
| 253 | + }); | ||
| 254 | + | ||
| 255 | + $("#line").on("change", function(){ | ||
| 256 | + if($("#line").val() == " "){ | ||
| 257 | + $("#gsdm").attr("disabled", false); | ||
| 258 | + $("#fgsdm").attr("disabled", false); | ||
| 259 | + } else { | ||
| 260 | + var temp = (tempData[$("#line").val()] ? tempData[$("#line").val()] : " : ").split(":"); | ||
| 261 | + $("#gsdm").val(temp[0]); | ||
| 262 | + updateCompany(); | ||
| 263 | + $("#nature").val(0); | ||
| 264 | + $("#fgsdm").val(temp[1]); | ||
| 265 | + $("#gsdm").attr("disabled", true); | ||
| 266 | + $("#fgsdm").attr("disabled", true); | ||
| 267 | + } | ||
| 268 | + }); | ||
| 269 | + | ||
| 270 | + | ||
| 271 | + var line =""; | ||
| 272 | + var xlName =""; | ||
| 273 | + var date = ""; | ||
| 274 | + var date2 =""; | ||
| 275 | + var gsdm=""; | ||
| 276 | + var fgsdm=""; | ||
| 277 | + var nature=""; | ||
| 278 | + var time1=""; | ||
| 279 | + var time2=""; | ||
| 280 | + $("#query").on("click",function(){ | ||
| 281 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | ||
| 282 | + layer.msg("请选择时间范围!"); | ||
| 283 | + return; | ||
| 284 | + } | ||
| 285 | + if($("#date2").val() == null || $("#date2").val().trim().length == 0){ | ||
| 286 | + layer.msg("请选择时间范围!"); | ||
| 287 | + return; | ||
| 288 | + } | ||
| 289 | +// $("#tjrbBody").height($(window).height()-100); | ||
| 290 | + line = $("#line").val(); | ||
| 291 | + date = $("#date").val(); | ||
| 292 | + date2 =$("#date2").val(); | ||
| 293 | + gsdm =$("#gsdm").val(); | ||
| 294 | + fgsdm=$("#fgsdm").val(); | ||
| 295 | + nature=$("#nature").val(); | ||
| 296 | + xlName = $("#select2-line-container").html(); | ||
| 297 | + if(xlName == "全部线路") | ||
| 298 | + xlName = $('#fgsdm option:selected').text(); | ||
| 299 | + if(xlName == "请选择") | ||
| 300 | + xlName = $('#gsdm option:selected').text(); | ||
| 301 | + if(line=="请选择"){ | ||
| 302 | + line=""; | ||
| 303 | + } | ||
| 304 | + time1 = Date.parse(new Date(date)); | ||
| 305 | + time2 = Date.parse(new Date(date2)); | ||
| 306 | + if(date==null || date =="" ||date2==null || date2 ==""){ | ||
| 307 | + layer.msg('请选择时间段.'); | ||
| 308 | + }else if(time2<time1){ | ||
| 309 | + layer.msg('结束日期不能小于开始日期.'); | ||
| 310 | + }else{ | ||
| 311 | + if((time2-time1)>2678400000){ | ||
| 312 | + layer.msg('查询超过一个月请点击【统计查询】.'); | ||
| 313 | + }else{ | ||
| 314 | + $("#tjrq").html(date+"至"+date2); | ||
| 315 | + var params = {}; | ||
| 316 | + params['gsdm'] = gsdm; | ||
| 317 | + params['fgsdm'] =fgsdm ; | ||
| 318 | + params['line'] = line; | ||
| 319 | + params['date'] = date; | ||
| 320 | + params['date2'] = date2; | ||
| 321 | + params['xlName'] = xlName; | ||
| 322 | + params['nature'] = nature; | ||
| 323 | + params['type'] = "query"; | ||
| 324 | + var i = layer.load(2); | ||
| 325 | + $get('/realSchedule/statisticsDailyTj',params,function(result){ | ||
| 326 | + // 把数据填充到模版中 | ||
| 327 | + var tbodyHtml = template('statisticsDaily',{list:result}); | ||
| 328 | + // 把渲染好的模版html文本追加到表格中 | ||
| 329 | + $('#forms .statisticsDaily').html(tbodyHtml); | ||
| 330 | + layer.close(i); | ||
| 331 | + | ||
| 332 | + if(result.length == 0){ | ||
| 333 | + $("#export").attr('disabled',"true"); | ||
| 334 | + }else{ | ||
| 335 | + $("#export").removeAttr("disabled"); | ||
| 336 | + } | ||
| 337 | + }); | ||
| 338 | + } | ||
| 339 | + | ||
| 340 | + } | ||
| 341 | + | ||
| 342 | + }); | ||
| 343 | +// $("#tjrbBody").height($(window).height()-100); | ||
| 344 | + $("#export").on("click",function(){ | ||
| 345 | + var params = {}; | ||
| 346 | + params['gsdm'] = gsdm; | ||
| 347 | + params['fgsdm'] =fgsdm; | ||
| 348 | + params['line'] = line; | ||
| 349 | + date = $("#date").val(); | ||
| 350 | + date2 =$("#date2").val(); | ||
| 351 | + params['date'] = date; | ||
| 352 | + params['date2'] = date2; | ||
| 353 | + params['xlName'] = xlName; | ||
| 354 | + params['nature'] = nature; | ||
| 355 | + params['type'] = "export"; | ||
| 356 | + if((time2-time1)>2678400000){ | ||
| 357 | + layer.msg('查询超过一个月请点击【统计查询】.'); | ||
| 358 | + }else{ | ||
| 359 | + var i = layer.load(2); | ||
| 360 | + $get('/realSchedule/statisticsDailyTj',params,function(result){ | ||
| 361 | + var dateTime = ""; | ||
| 362 | + if(date == date2){ | ||
| 363 | + dateTime = moment(date).format("YYYYMMDD"); | ||
| 364 | + } else { | ||
| 365 | + dateTime = moment(date).format("YYYYMMDD") | ||
| 366 | + +"-"+moment(date2).format("YYYYMMDD"); | ||
| 367 | + } | ||
| 368 | + window.open("/downloadFile/download?fileName=" | ||
| 369 | + +dateTime+"-"+xlName+"-统计日报"); | ||
| 370 | + layer.close(i); | ||
| 371 | + }); | ||
| 372 | + } | ||
| 373 | + }); | ||
| 374 | + | ||
| 375 | + | ||
| 376 | + $.get('/user/getCurrentUser', function(result){ | ||
| 377 | + var roleName = ""; | ||
| 378 | + $(result.roles).each(function(i, e){ | ||
| 379 | + roleName += e.roleName + "、"; | ||
| 380 | + }); | ||
| 381 | + if(roleName.indexOf("浦交") > -1 || roleName.indexOf("拓华") > -1){ | ||
| 382 | + $("#exportAll").show(); | ||
| 383 | + } | ||
| 384 | + }); | ||
| 385 | + $("#exportAll").on("click",function(){ | ||
| 386 | + var params = {}; | ||
| 387 | + date = $("#date").val(); | ||
| 388 | + date2 = $("#date2").val(); | ||
| 389 | + nature = $("#nature").val(); | ||
| 390 | + params['date'] = date; | ||
| 391 | + params['date2'] = date2; | ||
| 392 | + params['nature'] = nature; | ||
| 393 | + params['type'] = "exportAll"; | ||
| 394 | + if((time2-time1)>2678400000){ | ||
| 395 | + layer.msg('查询超过一个月请点击【统计查询】.'); | ||
| 396 | + }else{ | ||
| 397 | + var i = layer.load(2); | ||
| 398 | + $get('/realSchedule/statisticsDailyTj',params,function(result){ | ||
| 399 | + var dateTime = ""; | ||
| 400 | + if(date == date2){ | ||
| 401 | + dateTime = moment(date).format("YYYYMMDD"); | ||
| 402 | + } else { | ||
| 403 | + dateTime = moment(date).format("YYYYMMDD") | ||
| 404 | + +"-"+moment(date2).format("YYYYMMDD"); | ||
| 405 | + } | ||
| 406 | + window.open("/downloadFile/download?fileName=" | ||
| 407 | + +dateTime+"-全部公司-统计日报"); | ||
| 408 | + layer.close(i); | ||
| 409 | + }); | ||
| 410 | + } | ||
| 411 | + }); | ||
| 412 | + | ||
| 413 | + }); | ||
| 414 | +</script> | ||
| 415 | +<script type="text/html" id="statisticsDaily"> | ||
| 416 | + {{each list as obj i}} | ||
| 417 | + <tr {{if obj.zt==1}}style='color: red'{{/if}}> | ||
| 418 | + <td>{{obj.fgsName}}</td> | ||
| 419 | + <td>{{obj.xlName}}</td> | ||
| 420 | + <td>{{obj.jhzlc}}</td> | ||
| 421 | + <td>{{obj.jhlc}}</td> | ||
| 422 | + <td>{{obj.jcclc}}</td> | ||
| 423 | + <td>{{obj.sjzgl}}</td> | ||
| 424 | + <td>{{obj.sjgl}}</td> | ||
| 425 | + <td>{{obj.sjksgl}}</td> | ||
| 426 | + <td>{{obj.ssgl}}</td> | ||
| 427 | + <td>{{obj.ssbc}}</td> | ||
| 428 | + <td>{{obj.ssgl_lz}}</td> | ||
| 429 | + <td>{{obj.ssgl_dm}}</td> | ||
| 430 | + <td>{{obj.ssgl_gz}}</td> | ||
| 431 | + <td>{{obj.ssgl_jf}}</td> | ||
| 432 | + <td>{{obj.ssgl_zs}}</td> | ||
| 433 | + <td>{{obj.ssgl_qr}}</td> | ||
| 434 | + <td>{{obj.ssgl_qc}}</td> | ||
| 435 | + <td>{{obj.ssgl_kx}}</td> | ||
| 436 | + <td>{{obj.ssgl_qh}}</td> | ||
| 437 | + <td>{{obj.ssgl_yw}}</td> | ||
| 438 | + <td>{{obj.ssgl_other}}</td> | ||
| 439 | + <td>{{obj.ljgl}}</td> | ||
| 440 | + <td>{{obj.ljks}}</td> | ||
| 441 | + <td>{{obj.jhbc}}</td> | ||
| 442 | + <td>{{obj.jhbc_m}}</td> | ||
| 443 | + <td>{{obj.jhbc_a}}</td> | ||
| 444 | + <td>{{obj.sjbc}}</td> | ||
| 445 | + <td>{{obj.sjbc_m}}</td> | ||
| 446 | + <td>{{obj.sjbc_a}}</td> | ||
| 447 | + <td>{{obj.ljbc}}</td> | ||
| 448 | + <td>{{obj.ljbc_m}}</td> | ||
| 449 | + <td>{{obj.ljbc_a}}</td> | ||
| 450 | + <td>{{obj.fzbc}}</td> | ||
| 451 | + <td>{{obj.fzbc_m}}</td> | ||
| 452 | + <td>{{obj.fzbc_a}}</td> | ||
| 453 | + <td>{{obj.dtbc}}</td> | ||
| 454 | + <td>{{obj.dtbc_m}}</td> | ||
| 455 | + <td>{{obj.dtbc_a}}</td> | ||
| 456 | + <td>{{obj.djg}}</td> | ||
| 457 | + <td>{{obj.djg_m}}</td> | ||
| 458 | + <td>{{obj.djg_a}}</td> | ||
| 459 | + <td>{{obj.djg_time}}</td> | ||
| 460 | + <td> </td> | ||
| 461 | + </tr> | ||
| 462 | + {{/each}} | ||
| 463 | + {{if list.length == 0}} | ||
| 464 | + <tr> | ||
| 465 | + <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 466 | + </tr> | ||
| 467 | + {{/if}} | ||
| 428 | </script> | 468 | </script> |
| 429 | \ No newline at end of file | 469 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/statisticsDailyCalc2.html
| @@ -71,6 +71,7 @@ | @@ -71,6 +71,7 @@ | ||
| 71 | <div class="form-group"> | 71 | <div class="form-group"> |
| 72 | <input class="btn btn-default" type="button" id="query" value="查询"/> | 72 | <input class="btn btn-default" type="button" id="query" value="查询"/> |
| 73 | <input class="btn btn-default" type="button" id="export" value="导出"/> | 73 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| 74 | + <input class="btn btn-default" type="button" id="exportAll" value="导出全部公司" style="display: none;"/> | ||
| 74 | </div> | 75 | </div> |
| 75 | </form> | 76 | </form> |
| 76 | </div> | 77 | </div> |
| @@ -353,6 +354,41 @@ | @@ -353,6 +354,41 @@ | ||
| 353 | layer.close(i); | 354 | layer.close(i); |
| 354 | }); | 355 | }); |
| 355 | }); | 356 | }); |
| 357 | + | ||
| 358 | + | ||
| 359 | + $.get('/user/getCurrentUser', function(result){ | ||
| 360 | + var roleName = ""; | ||
| 361 | + $(result.roles).each(function(i, e){ | ||
| 362 | + roleName += e.roleName + "、"; | ||
| 363 | + }); | ||
| 364 | + if(roleName.indexOf("浦交") > -1 || roleName.indexOf("拓华") > -1){ | ||
| 365 | + $("#exportAll").show(); | ||
| 366 | + } | ||
| 367 | + }); | ||
| 368 | + $("#exportAll").on("click",function(){ | ||
| 369 | + var params = {}; | ||
| 370 | + date = $("#date").val(); | ||
| 371 | + date2 = $("#date2").val(); | ||
| 372 | + nature = $("#nature").val(); | ||
| 373 | + params['date'] = date; | ||
| 374 | + params['date2'] = date2; | ||
| 375 | + params['nature'] = nature; | ||
| 376 | + params['type'] = "exportAll"; | ||
| 377 | + var i = layer.load(2); | ||
| 378 | +// $get('/realSchedule/statisticsDailyTj',params,function(result){ | ||
| 379 | + $get('/calcWaybill/calcStatisticsDaily',params,function(result){ | ||
| 380 | + var dateTime = ""; | ||
| 381 | + if(date == date2){ | ||
| 382 | + dateTime = moment(date).format("YYYYMMDD"); | ||
| 383 | + } else { | ||
| 384 | + dateTime = moment(date).format("YYYYMMDD") | ||
| 385 | + +"-"+moment(date2).format("YYYYMMDD"); | ||
| 386 | + } | ||
| 387 | + window.open("/downloadFile/download?fileName=" | ||
| 388 | + +dateTime+"-全部公司-统计日报"); | ||
| 389 | + layer.close(i); | ||
| 390 | + }); | ||
| 391 | + }); | ||
| 356 | 392 | ||
| 357 | }); | 393 | }); |
| 358 | </script> | 394 | </script> |
src/main/resources/static/pages/home.html
| @@ -83,15 +83,24 @@ | @@ -83,15 +83,24 @@ | ||
| 83 | success: function(rs) { | 83 | success: function(rs) { |
| 84 | if (rs && rs.status === "SUCCESS") { | 84 | if (rs && rs.status === "SUCCESS") { |
| 85 | if (rs.data && rs.data.length && rs.data.length > 0) { | 85 | if (rs.data && rs.data.length && rs.data.length > 0) { |
| 86 | - var text = ""; | 86 | + var htmlText = ""; |
| 87 | + var wrapData = []; | ||
| 87 | if (rs.data.length > 8) { | 88 | if (rs.data.length > 8) { |
| 88 | - text = "部分停用信息如下:</br>" + rs.data.slice(0, 8).join("</br>"); | 89 | + htmlText = "<span style='font-weight: bold; font-style: italic; '>部分停用信息如下:</span></br>"; |
| 90 | + wrapData = rs.data.slice(0, 8); | ||
| 89 | } else { | 91 | } else { |
| 90 | - text = "所有停用信息如下:</br>" + rs.data.join("</br>"); | 92 | + htmlText = "<span style='font-weight: bold; font-style: italic; '>所有停用信息如下:</span></br>"; |
| 93 | + wrapData = rs.data; | ||
| 91 | } | 94 | } |
| 95 | + $.each(wrapData, function(index, value) { | ||
| 96 | + wrapData[index] = "<span style='font-size: 14px;'>" + value + "</span>"; | ||
| 97 | + }); | ||
| 98 | + | ||
| 99 | + htmlText += wrapData.join("</br>"); | ||
| 100 | + | ||
| 92 | swal({ | 101 | swal({ |
| 93 | - title: "人员配置停用信息", | ||
| 94 | - text: text, | 102 | + title: "排班人员停用信息", |
| 103 | + text: htmlText, | ||
| 95 | html: true, | 104 | html: true, |
| 96 | type: "warning", | 105 | type: "warning", |
| 97 | showCancelButton: true, | 106 | showCancelButton: true, |
src/main/resources/static/pages/mforms/turnoutrates/calcTurnoutrate.html
| @@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
| 50 | <select class="form-control" name="line" id="line" style="width: 140px;"></select> | 50 | <select class="form-control" name="line" id="line" style="width: 140px;"></select> |
| 51 | </div> | 51 | </div> |
| 52 | <div style="margin-top: 10px"></div> | 52 | <div style="margin-top: 10px"></div> |
| 53 | - <div style="display: inline-block;"> | 53 | + <div style="display: inline-block;margin-left: 3px;"> |
| 54 | <span class="item-label" style="width: 80px;">线路性质: </span> <select | 54 | <span class="item-label" style="width: 80px;">线路性质: </span> <select |
| 55 | class="form-control" name="nature" id="nature" | 55 | class="form-control" name="nature" id="nature" |
| 56 | style="width: 140px;"> | 56 | style="width: 140px;"> |
| @@ -59,17 +59,18 @@ | @@ -59,17 +59,18 @@ | ||
| 59 | <option value="2">非营运线路</option> | 59 | <option value="2">非营运线路</option> |
| 60 | </select> | 60 | </select> |
| 61 | </div> | 61 | </div> |
| 62 | - <div style="display: inline-block;margin-left: 15px;"> | 62 | + <div style="display: inline-block;margin-left: 11px;"> |
| 63 | <span class="item-label" style="width: 80px;">开始时间: </span> | 63 | <span class="item-label" style="width: 80px;">开始时间: </span> |
| 64 | <input class="form-control" type="text" id="startDate" style="width: 140px;"/> | 64 | <input class="form-control" type="text" id="startDate" style="width: 140px;"/> |
| 65 | </div> | 65 | </div> |
| 66 | - <div style="display: inline-block;margin-left: 15px;"> | 66 | + <div style="display: inline-block;margin-left: 16px;"> |
| 67 | <span class="item-label" style="width: 80px;">结束时间: </span> | 67 | <span class="item-label" style="width: 80px;">结束时间: </span> |
| 68 | <input class="form-control" type="text" id="endDate" style="width: 140px;"/> | 68 | <input class="form-control" type="text" id="endDate" style="width: 140px;"/> |
| 69 | </div> | 69 | </div> |
| 70 | <div class="form-group"> | 70 | <div class="form-group"> |
| 71 | <input class="btn btn-default" type="button" id="query" value="筛选"/> | 71 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 72 | <input class="btn btn-default" type="button" id="export" value="导出"/> | 72 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| 73 | + <input class="btn btn-default" type="button" id="exportAll" value="导出全部公司" style="display: none;"/> | ||
| 73 | </div> | 74 | </div> |
| 74 | </form> | 75 | </form> |
| 75 | </div> | 76 | </div> |
| @@ -294,6 +295,39 @@ | @@ -294,6 +295,39 @@ | ||
| 294 | layer.close(i); | 295 | layer.close(i); |
| 295 | }); | 296 | }); |
| 296 | }); | 297 | }); |
| 298 | + | ||
| 299 | + | ||
| 300 | + $.get('/user/getCurrentUser', function(result){ | ||
| 301 | + var roleName = ""; | ||
| 302 | + $(result.roles).each(function(i, e){ | ||
| 303 | + roleName += e.roleName + "、"; | ||
| 304 | + }); | ||
| 305 | + if(roleName.indexOf("浦交") > -1 || roleName.indexOf("拓华") > -1){ | ||
| 306 | + $("#exportAll").show(); | ||
| 307 | + } | ||
| 308 | + }); | ||
| 309 | + $("#exportAll").on("click",function(){ | ||
| 310 | + var params = {}; | ||
| 311 | + startDate=$("#startDate").val(); | ||
| 312 | + endDate=$("#endDate").val(); | ||
| 313 | + params['startDate'] = startDate; | ||
| 314 | + params['endDate'] = endDate; | ||
| 315 | + params['nature'] = $("#nature").val(); | ||
| 316 | + params['type'] = "exportAll"; | ||
| 317 | + var i = layer.load(2); | ||
| 318 | + $get('/calcSheet/calcTurnoutrate',params,function(result){ | ||
| 319 | + var dateTime = ""; | ||
| 320 | + if(startDate == endDate){ | ||
| 321 | + dateTime = startDate; | ||
| 322 | + } else { | ||
| 323 | + dateTime = startDate+"-"+endDate; | ||
| 324 | + } | ||
| 325 | + window.open("/downloadFile/download?fileName=" | ||
| 326 | + +dateTime+"-全部公司-营运线路出车率统计表"); | ||
| 327 | + layer.close(i); | ||
| 328 | + }); | ||
| 329 | + }); | ||
| 330 | + | ||
| 297 | }); | 331 | }); |
| 298 | </script> | 332 | </script> |
| 299 | <script type="text/html" id="calcTurnoutrate"> | 333 | <script type="text/html" id="calcTurnoutrate"> |
src/main/resources/static/pages/oil/list_ph.html
| @@ -358,7 +358,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -358,7 +358,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 358 | //console.log("核对加注量"); | 358 | //console.log("核对加注量"); |
| 359 | if ($("#rq").val() != "") { | 359 | if ($("#rq").val() != "") { |
| 360 | var params=getParamsList(); | 360 | var params=getParamsList(); |
| 361 | - $get('/ylb/checkDate',params,function(status){ | 361 | + var par={}; |
| 362 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 363 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 364 | + $get('/ylb/checkDate',par,function(status){ | ||
| 362 | if(status=='2'){ | 365 | if(status=='2'){ |
| 363 | layer.msg('只能操作三天内数据.'); | 366 | layer.msg('只能操作三天内数据.'); |
| 364 | }else{ | 367 | }else{ |
| @@ -380,7 +383,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -380,7 +383,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 380 | // console.log("进场油量等于出场油量"); | 383 | // console.log("进场油量等于出场油量"); |
| 381 | if ($("#rq").val() != "") { | 384 | if ($("#rq").val() != "") { |
| 382 | var params=getParamsList(); | 385 | var params=getParamsList(); |
| 383 | - $get('/ylb/checkDate',params,function(status){ | 386 | + var par={}; |
| 387 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 388 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 389 | + $get('/ylb/checkDate',par,function(status){ | ||
| 384 | if(status=='2'){ | 390 | if(status=='2'){ |
| 385 | layer.msg('只能操作三天内数据.'); | 391 | layer.msg('只能操作三天内数据.'); |
| 386 | }else{ | 392 | }else{ |
| @@ -400,7 +406,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -400,7 +406,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 400 | $(".saveButton").on('click',function(){ | 406 | $(".saveButton").on('click',function(){ |
| 401 | 407 | ||
| 402 | var params_=getParamsList(); | 408 | var params_=getParamsList(); |
| 403 | - $get('/ylb/checkDate',params_,function(status){ | 409 | + var par={}; |
| 410 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 411 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 412 | + $get('/ylb/checkDate',par,function(status){ | ||
| 404 | if(status=='2'){ | 413 | if(status=='2'){ |
| 405 | layer.msg('只能操作三天内数据.'); | 414 | layer.msg('只能操作三天内数据.'); |
| 406 | }else{ | 415 | }else{ |
| @@ -464,7 +473,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -464,7 +473,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 464 | $(".sortButton").on('click', function () { | 473 | $(".sortButton").on('click', function () { |
| 465 | if ($("#rq").val() != "") { | 474 | if ($("#rq").val() != "") { |
| 466 | var params_=getParamsList(); | 475 | var params_=getParamsList(); |
| 467 | - $get('/ylb/checkDate',params_,function(status){ | 476 | + var par={}; |
| 477 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 478 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 479 | + $get('/ylb/checkDate',par,function(status){ | ||
| 468 | if(status=='2'){ | 480 | if(status=='2'){ |
| 469 | layer.msg('只能操作三天内数据.'); | 481 | layer.msg('只能操作三天内数据.'); |
| 470 | }else{ | 482 | }else{ |
| @@ -632,7 +644,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -632,7 +644,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 632 | //console.log("获取加存"); | 644 | //console.log("获取加存"); |
| 633 | if ($("#rq").val() != "") { | 645 | if ($("#rq").val() != "") { |
| 634 | var params=getParamsList(); | 646 | var params=getParamsList(); |
| 635 | - $get('/ylb/checkDate',params,function(status){ | 647 | + var par={}; |
| 648 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 649 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 650 | + $get('/ylb/checkDate',par,function(status){ | ||
| 636 | if(status=='2'){ | 651 | if(status=='2'){ |
| 637 | layer.msg('只能操作三天内数据.'); | 652 | layer.msg('只能操作三天内数据.'); |
| 638 | }else{ | 653 | }else{ |
| @@ -788,7 +803,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -788,7 +803,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 788 | 803 | ||
| 789 | function jsyUpdate(){ | 804 | function jsyUpdate(){ |
| 790 | var params=getParamsList(); | 805 | var params=getParamsList(); |
| 791 | - $get('/ylb/checkDate',params,function(status){ | 806 | + var par={}; |
| 807 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 808 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 809 | + $get('/ylb/checkDate',par,function(status){ | ||
| 792 | var id = $(this).data('id'); | 810 | var id = $(this).data('id'); |
| 793 | if(status=='2'){ | 811 | if(status=='2'){ |
| 794 | layer.msg('只能操作三天内数据.'); | 812 | layer.msg('只能操作三天内数据.'); |
| @@ -926,7 +944,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -926,7 +944,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 926 | //删除 | 944 | //删除 |
| 927 | $('.removeButton').on('click', function () { | 945 | $('.removeButton').on('click', function () { |
| 928 | var params_=getParamsList(); | 946 | var params_=getParamsList(); |
| 929 | - $get('/ylb/checkDate',params_,function(status){ | 947 | + var par={}; |
| 948 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 949 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 950 | + $get('/ylb/checkDate',par,function(status){ | ||
| 930 | if(status=='2'){ | 951 | if(status=='2'){ |
| 931 | layer.msg('只能操作三天内数据.'); | 952 | layer.msg('只能操作三天内数据.'); |
| 932 | }else{ | 953 | }else{ |
src/main/resources/static/pages/report/countMileage/countLine/countMileageSum.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 | + #forms > thead > tr> td >span{ | ||
| 19 | + width: 5px; | ||
| 20 | + word-wrap: break-word; | ||
| 21 | + letter-spacing: 20px; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + #forms > thead > tr> td >label{ | ||
| 25 | + word-break: keep-all;white-space:nowrap; | ||
| 26 | + } | ||
| 27 | +</style> | ||
| 28 | + | ||
| 29 | +<div class="page-head"> | ||
| 30 | + <div class="page-title"> | ||
| 31 | + <h1>审计公里汇总表</h1> | ||
| 32 | + </div> | ||
| 33 | +</div> | ||
| 34 | + | ||
| 35 | +<div class="row"> | ||
| 36 | + <div class="col-md-12"> | ||
| 37 | + <div class="portlet light porttlet-fit bordered"> | ||
| 38 | + <div class="portlet-title"> | ||
| 39 | + <form class="form-inline" action=""> | ||
| 40 | + <div style="display: inline-block;"> | ||
| 41 | + <span class="item-label" style="width: 80px;">线路性质: </span> | ||
| 42 | + <select | ||
| 43 | + class="form-control" name="nature" id="nature" | ||
| 44 | + style="width: 180px;"> | ||
| 45 | + <option value="0">全部线路</option> | ||
| 46 | + <option value="1" selected="selected">营运线路</option> | ||
| 47 | + <option value="2">非营运线路</option> | ||
| 48 | + </select> | ||
| 49 | + </div> | ||
| 50 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 51 | + <span class="item-label" style="width: 80px;">开始日期: </span> | ||
| 52 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | ||
| 53 | + </div> | ||
| 54 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 55 | + <span class="item-label" style="width: 80px;">结束日期: </span> | ||
| 56 | + <input class="form-control" type="text" id="date2" style="width: 180px;"/> | ||
| 57 | + </div> | ||
| 58 | + <div class="form-group"> | ||
| 59 | + <input class="btn btn-default" type="button" id="query" value="查询"/> | ||
| 60 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 61 | + </div> | ||
| 62 | + </form> | ||
| 63 | + </div> | ||
| 64 | + <div class="portlet-body"> | ||
| 65 | + <div class="table-container" id="countLine" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 66 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 67 | + <thead> | ||
| 68 | + <tr> | ||
| 69 | + <th colspan="30"><label id="datetodate"></label> 审计公里汇总表</th> | ||
| 70 | + </tr> | ||
| 71 | + <tr> | ||
| 72 | + <td rowspan="2"><span>公司</span></td> | ||
| 73 | + <td rowspan="2"><span>分公司</span></td> | ||
| 74 | + <td rowspan="2"><label>计划</label><label>总公里</label></td> | ||
| 75 | + <td rowspan="2"><label>计划营</label><label>运公里</label></td> | ||
| 76 | + <td rowspan="2"><label>计划空</label><label>驶公里</label></td> | ||
| 77 | + <td rowspan="2"><label>实际</label><label>总公里</label></td> | ||
| 78 | + <td colspan="2"><label>实际营</label><label>运公里</label></td> | ||
| 79 | + <td colspan="6"><label>实际空</label><label>驶公里</label></td> | ||
| 80 | + <td rowspan="2"><label>少驶营</label><label>运里程</label></td> | ||
| 81 | + <td colspan="11">少驶原因(公里)</td> | ||
| 82 | + <td colspan="3">临加公里</td> | ||
| 83 | + </tr> | ||
| 84 | + <tr> | ||
| 85 | + <td><label>计划内</label><label>营运</label><label>里程</label></td> | ||
| 86 | + <td><label>临时性</label><label>多样化</label><label>调度营</label><label>运里程</label></td> | ||
| 87 | + <td><label>计划内</label><label>进出场</label><label>空驶</label></td> | ||
| 88 | + <td><label>计划外</label><label>进出场</label><label>空驶</label></td> | ||
| 89 | + <td><label>故障</label><label>进出场</label><label>空驶</label></td> | ||
| 90 | + <td><label>肇事</label><label>进出场</label><label>空驶</label></td> | ||
| 91 | + <td><label>纠纷</label><label>进出场</label><label>空驶</label></td> | ||
| 92 | + <td><label>空放 </label><label>空驶</label></td> | ||
| 93 | + <td><span>路阻</span></td> | ||
| 94 | + <td><span>吊慢</span></td> | ||
| 95 | + <td><span>故障</span></td> | ||
| 96 | + <td><span>纠纷</span></td> | ||
| 97 | + <td><span>肇事</span></td> | ||
| 98 | + <td><span>缺人</span></td> | ||
| 99 | + <td><span>缺车</span></td> | ||
| 100 | + <td><span>客稀</span></td> | ||
| 101 | + <td><span>气候</span></td> | ||
| 102 | + <td><span>援外</span></td> | ||
| 103 | + <td><span>其他</span></td> | ||
| 104 | + <td><label>临加营</label><label>运公里</label></td> | ||
| 105 | + <td><label>临加进出</label><label>场空驶</label></td> | ||
| 106 | + <td><label>临加</label><label>空放</label><label>空驶</label></td> | ||
| 107 | + </tr> | ||
| 108 | + | ||
| 109 | + </thead> | ||
| 110 | + <tbody class="count_mileage_sum"> | ||
| 111 | + | ||
| 112 | + </tbody> | ||
| 113 | + </table> | ||
| 114 | + </div> | ||
| 115 | + </div> | ||
| 116 | + </div> | ||
| 117 | + </div> | ||
| 118 | +</div> | ||
| 119 | + | ||
| 120 | +<script> | ||
| 121 | + $(function(){ | ||
| 122 | +// $('#export').attr('disabled', "true"); | ||
| 123 | + | ||
| 124 | + // 关闭左侧栏 | ||
| 125 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 126 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 127 | + | ||
| 128 | + $("#date").datetimepicker({ | ||
| 129 | + format : 'YYYY-MM-DD', | ||
| 130 | + locale : 'zh-cn' | ||
| 131 | + }); | ||
| 132 | + $("#date2").datetimepicker({ | ||
| 133 | + format : 'YYYY-MM-DD', | ||
| 134 | + locale : 'zh-cn' | ||
| 135 | + }); | ||
| 136 | + | ||
| 137 | + var d = new Date(); | ||
| 138 | + var year = d.getFullYear(); | ||
| 139 | + var month = d.getMonth() + 1; | ||
| 140 | + var day = d.getDate(); | ||
| 141 | + if(month < 10) | ||
| 142 | + month = "0" + month; | ||
| 143 | + if(day < 10) | ||
| 144 | + day = "0" + day; | ||
| 145 | + $("#date").val(year + "-" + month + "-" + day); | ||
| 146 | + $("#date2").val(year + "-" + month + "-" + day); | ||
| 147 | + | ||
| 148 | + var date = ""; | ||
| 149 | + var date2 = ""; | ||
| 150 | + var nature = ""; | ||
| 151 | + $("#query").on("click",function(){ | ||
| 152 | + $("#countLine").height($(window).height()-280); | ||
| 153 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | ||
| 154 | + layer.msg("请选择日期!"); | ||
| 155 | + return; | ||
| 156 | + } | ||
| 157 | + if($("#date2").val() == null || $("#date2").val().trim().length == 0){ | ||
| 158 | + layer.msg("请选择日期!"); | ||
| 159 | + return; | ||
| 160 | + } | ||
| 161 | + date = $("#date").val(); | ||
| 162 | + date2 = $("#date2").val(); | ||
| 163 | +// if(date==null || date =="" ||date2==null || date2 ==""){ | ||
| 164 | +// layer.msg('请选择时间段.'); | ||
| 165 | +// }else{ | ||
| 166 | + nature = $("#nature").val(); | ||
| 167 | + var params = {}; | ||
| 168 | + params['date'] = date; | ||
| 169 | + params['date2'] = date2; | ||
| 170 | + params['nature'] = nature; | ||
| 171 | + params['type'] = "query"; | ||
| 172 | + var i = layer.load(2); | ||
| 173 | + $get('/report/countMileageSum',params,function(result){ | ||
| 174 | + layer.close(i); | ||
| 175 | + $("#datetodate").html(date); | ||
| 176 | + // 把数据填充到模版中 | ||
| 177 | + var tbodyHtml = template('count_mileage_sum',{list:result}); | ||
| 178 | + // 把渲染好的模版html文本追加到表格中 | ||
| 179 | + $('#forms .count_mileage_sum').html(tbodyHtml); | ||
| 180 | + | ||
| 181 | + if(result.length == 0) | ||
| 182 | + $("#export").attr('disabled',"true"); | ||
| 183 | + else | ||
| 184 | + $("#export").removeAttr("disabled"); | ||
| 185 | + }); | ||
| 186 | +// } | ||
| 187 | + | ||
| 188 | + }); | ||
| 189 | + | ||
| 190 | + $("#countLine").height($(window).height()-280); | ||
| 191 | + $("#export").on("click",function(){ | ||
| 192 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | ||
| 193 | + layer.msg("请选择日期!"); | ||
| 194 | + return; | ||
| 195 | + }if($("#date2").val() == null || $("#date2").val().trim().length == 0){ | ||
| 196 | + layer.msg("请选择日期!"); | ||
| 197 | + return; | ||
| 198 | + } | ||
| 199 | + date = $("#date").val(); | ||
| 200 | + date2 = $("#date2").val(); | ||
| 201 | + nature = $("#nature").val(); | ||
| 202 | + var params = {}; | ||
| 203 | + params['date'] = date; | ||
| 204 | + params['date2'] = date2; | ||
| 205 | + params['nature'] = nature; | ||
| 206 | + params['type'] = "export"; | ||
| 207 | + params['by']='sj'; | ||
| 208 | + var i = layer.load(2); | ||
| 209 | + $get('/report/countMileageSum',params,function(result){ | ||
| 210 | + var dateTime = ""; | ||
| 211 | + if(date == date2){ | ||
| 212 | + dateTime = moment(date).format("YYYYMMDD"); | ||
| 213 | + } else { | ||
| 214 | + dateTime = moment(date).format("YYYYMMDD") | ||
| 215 | + +"-"+moment(date2).format("YYYYMMDD"); | ||
| 216 | + } | ||
| 217 | + window.open("/downloadFile/download?fileName=" | ||
| 218 | + +dateTime+"-审计公里汇总表"); | ||
| 219 | + layer.close(i); | ||
| 220 | + }); | ||
| 221 | + }); | ||
| 222 | + }); | ||
| 223 | +</script> | ||
| 224 | +<script type="text/html" id="count_mileage_sum"> | ||
| 225 | + {{each list as obj i}} | ||
| 226 | + <tr style='{{if obj.fgsName=='小计' || obj.gsName=='浦交'}}background-color: #b9d6fb;{{/if}}'> | ||
| 227 | + <td>{{obj.gsName}}</td> | ||
| 228 | + <td>{{obj.fgsName}}</td> | ||
| 229 | + <td>{{obj.jhzlc}}</td> | ||
| 230 | + <td>{{obj.jhlc}}</td> | ||
| 231 | + <td>{{obj.jcclc}}</td> | ||
| 232 | + <td>{{obj.sjzgl}}</td> | ||
| 233 | + <td>{{obj.jhnlc}}</td> | ||
| 234 | + <td>{{obj.jhwlc}}</td> | ||
| 235 | + <td>{{obj.jhnjcclc}}</td> | ||
| 236 | + <td>{{obj.jhwjcclc_z}}</td> | ||
| 237 | + <td>{{obj.zrwjcclc}}</td> | ||
| 238 | + <td>{{obj.zrwjcclc1}}</td> | ||
| 239 | + <td>{{obj.zrwjcclc2}}</td> | ||
| 240 | + <td>{{obj.kfks}}</td> | ||
| 241 | + <td>{{obj.lbss}}</td> | ||
| 242 | + <td>{{obj.ssgl_lz}}</td> | ||
| 243 | + <td>{{obj.ssgl_dm}}</td> | ||
| 244 | + <td>{{obj.ssgl_gz}}</td> | ||
| 245 | + <td>{{obj.ssgl_jf}}</td> | ||
| 246 | + <td>{{obj.ssgl_zs}}</td> | ||
| 247 | + <td>{{obj.ssgl_qr}}</td> | ||
| 248 | + <td>{{obj.ssgl_qc}}</td> | ||
| 249 | + <td>{{obj.ssgl_kx}}</td> | ||
| 250 | + <td>{{obj.ssgl_qh}}</td> | ||
| 251 | + <td>{{obj.ssgl_yw}}</td> | ||
| 252 | + <td>{{obj.ssgl_other}}</td> | ||
| 253 | + <td>{{obj.ljyy}}</td> | ||
| 254 | + <td>{{obj.ljjcc}}</td> | ||
| 255 | + <td>{{obj.ljkfks}}</td> | ||
| 256 | + </tr> | ||
| 257 | + {{/each}} | ||
| 258 | + {{if list.length == 0}} | ||
| 259 | + <tr> | ||
| 260 | + <td colspan="30"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 261 | + </tr> | ||
| 262 | + {{/if}} | ||
| 263 | +</script> | ||
| 0 | \ No newline at end of file | 264 | \ No newline at end of file |
src/main/resources/static/pages/report/sheet/calcSheetList.html
| @@ -373,8 +373,10 @@ | @@ -373,8 +373,10 @@ | ||
| 373 | <td>{{obj.sjszddzds}}</td> | 373 | <td>{{obj.sjszddzds}}</td> |
| 374 | <td>{{obj.szddzdl}}</td> | 374 | <td>{{obj.szddzdl}}</td> |
| 375 | <td> | 375 | <td> |
| 376 | - <button type="button" class="btn btn-sm blue btn-calcSheetList" | ||
| 377 | - data-id="{{obj.xl}}">查看</button> | 376 | + {{if obj.xl && obj.xl > 0}} |
| 377 | + <button type="button" class="btn btn-sm blue btn-calcSheetList" | ||
| 378 | + data-id="{{obj.xl}}">查看</button> | ||
| 379 | + {{/if}} | ||
| 378 | </td> | 380 | </td> |
| 379 | </tr> | 381 | </tr> |
| 380 | {{/each}} | 382 | {{/each}} |
| @@ -411,7 +413,7 @@ | @@ -411,7 +413,7 @@ | ||
| 411 | {{/each}} | 413 | {{/each}} |
| 412 | {{if list.length == 0}} | 414 | {{if list.length == 0}} |
| 413 | <tr> | 415 | <tr> |
| 414 | - <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> | 416 | + <td colspan="9"><h6 class="muted">没有找到相关数据</h6></td> |
| 415 | </tr> | 417 | </tr> |
| 416 | {{/if}} | 418 | {{/if}} |
| 417 | </script> | 419 | </script> |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| @@ -967,6 +967,87 @@ angular.module('ScheduleApp').factory( | @@ -967,6 +967,87 @@ angular.module('ScheduleApp').factory( | ||
| 967 | } | 967 | } |
| 968 | } | 968 | } |
| 969 | ), | 969 | ), |
| 970 | + | ||
| 971 | + pvInfoExport: $resource( | ||
| 972 | + '/tidc/exportPvInfo/:id', | ||
| 973 | + {id: '@id'}, | ||
| 974 | + { | ||
| 975 | + do: { | ||
| 976 | + method: 'GET', | ||
| 977 | + responseType: "arraybuffer", | ||
| 978 | + transformResponse: function(data, headers, status){ | ||
| 979 | + if (status != 200) { | ||
| 980 | + return data; | ||
| 981 | + } | ||
| 982 | + | ||
| 983 | + // console.log(headers("Content-Disposition")); | ||
| 984 | + // 获取文件名,后台根据是否还有中文名字,返回filename=ascii编码的文件名 或 filename*=unicode编码的文件名 | ||
| 985 | + var fileName = headers("Content-Disposition").split(";")[1].split("filename=")[1]; | ||
| 986 | + var fileNameUnicode = headers("Content-Disposition").split("filename*=")[1]; | ||
| 987 | + if (fileNameUnicode) {//当存在 filename* 时,取filename* 并进行解码(为了解决中文乱码问题) | ||
| 988 | + fileName = decodeURIComponent(fileNameUnicode); | ||
| 989 | + } | ||
| 990 | + | ||
| 991 | + return {fileData : data, fileName: fileName}; | ||
| 992 | + } | ||
| 993 | + } | ||
| 994 | + } | ||
| 995 | + ), | ||
| 996 | + | ||
| 997 | + addLp: $resource( | ||
| 998 | + '/tidc/addLp/:ttInfoId/:lpId', | ||
| 999 | + {}, | ||
| 1000 | + { | ||
| 1001 | + do: { | ||
| 1002 | + method: 'GET', | ||
| 1003 | + transformResponse: function(rs) { | ||
| 1004 | + var dst = angular.fromJson(rs); | ||
| 1005 | + if (dst.status == 'SUCCESS') { | ||
| 1006 | + return {msg: dst.data}; | ||
| 1007 | + } else { | ||
| 1008 | + return {error: dst.msg}; // 业务错误留给控制器处理 | ||
| 1009 | + } | ||
| 1010 | + } | ||
| 1011 | + } | ||
| 1012 | + } | ||
| 1013 | + ), | ||
| 1014 | + | ||
| 1015 | + removeLp: $resource( | ||
| 1016 | + '/tidc/removeLp/:ttInfoId/:lpId', | ||
| 1017 | + {}, | ||
| 1018 | + { | ||
| 1019 | + do: { | ||
| 1020 | + method: 'GET', | ||
| 1021 | + transformResponse: function(rs) { | ||
| 1022 | + var dst = angular.fromJson(rs); | ||
| 1023 | + if (dst.status == 'SUCCESS') { | ||
| 1024 | + return {msg: dst.data}; | ||
| 1025 | + } else { | ||
| 1026 | + return {error: dst.msg}; // 业务错误留给控制器处理 | ||
| 1027 | + } | ||
| 1028 | + } | ||
| 1029 | + } | ||
| 1030 | + } | ||
| 1031 | + ), | ||
| 1032 | + | ||
| 1033 | + switchLp: $resource( | ||
| 1034 | + '/tidc/switchLp/:ttInfoId/:lpAId/:lpBId', | ||
| 1035 | + {}, | ||
| 1036 | + { | ||
| 1037 | + do: { | ||
| 1038 | + method: 'GET', | ||
| 1039 | + transformResponse: function(rs) { | ||
| 1040 | + var dst = angular.fromJson(rs); | ||
| 1041 | + if (dst.status == 'SUCCESS') { | ||
| 1042 | + return {msg: dst.data}; | ||
| 1043 | + } else { | ||
| 1044 | + return {error: dst.msg}; // 业务错误留给控制器处理 | ||
| 1045 | + } | ||
| 1046 | + } | ||
| 1047 | + } | ||
| 1048 | + } | ||
| 1049 | + ), | ||
| 1050 | + | ||
| 970 | edit: $resource( | 1051 | edit: $resource( |
| 971 | '/tidc/edit/:xlid/:ttid', | 1052 | '/tidc/edit/:xlid/:ttid', |
| 972 | {}, | 1053 | {}, |
| @@ -1017,7 +1098,8 @@ angular.module('ScheduleApp').factory( | @@ -1017,7 +1098,8 @@ angular.module('ScheduleApp').factory( | ||
| 1017 | } | 1098 | } |
| 1018 | 1099 | ||
| 1019 | ] | 1100 | ] |
| 1020 | -); | 1101 | +); |
| 1102 | + | ||
| 1021 | // 时刻表日志管理service | 1103 | // 时刻表日志管理service |
| 1022 | angular.module('ScheduleApp').factory( | 1104 | angular.module('ScheduleApp').factory( |
| 1023 | 'TimetableLogManageService_g', | 1105 | 'TimetableLogManageService_g', |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
| @@ -1357,13 +1357,70 @@ ScheduleApp.config([ | @@ -1357,13 +1357,70 @@ ScheduleApp.config([ | ||
| 1357 | }] | 1357 | }] |
| 1358 | } | 1358 | } |
| 1359 | }) | 1359 | }) |
| 1360 | - | 1360 | + .state("ttInfoDetailManage_detail_edit_addLp", { // 时刻表 添加路牌 |
| 1361 | + url: '/ttInfoDetailManage_detail_edit_addLp/:xlid/:ttid/:xlname/:ttname/:lineversion', | ||
| 1362 | + views: { | ||
| 1363 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-addLp.html'} | ||
| 1364 | + }, | ||
| 1365 | + resolve: { | ||
| 1366 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | ||
| 1367 | + return $ocLazyLoad.load({ | ||
| 1368 | + name: 'ttInfoDetailManage_detail_edit_addLp', | ||
| 1369 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | ||
| 1370 | + files: [ | ||
| 1371 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | ||
| 1372 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | ||
| 1373 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | ||
| 1374 | + ] | ||
| 1375 | + }); | ||
| 1376 | + }] | ||
| 1377 | + } | ||
| 1378 | + }) | ||
| 1379 | + .state("ttInfoDetailManage_detail_edit_removeLp", { // 时刻表 删除路牌 | ||
| 1380 | + url: '/ttInfoDetailManage_detail_edit_removeLp/:xlid/:ttid/:xlname/:ttname/:lineversion', | ||
| 1381 | + views: { | ||
| 1382 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-removeLp.html'} | ||
| 1383 | + }, | ||
| 1384 | + resolve: { | ||
| 1385 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | ||
| 1386 | + return $ocLazyLoad.load({ | ||
| 1387 | + name: 'ttInfoDetailManage_detail_edit_removeLp', | ||
| 1388 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | ||
| 1389 | + files: [ | ||
| 1390 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | ||
| 1391 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | ||
| 1392 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | ||
| 1393 | + ] | ||
| 1394 | + }); | ||
| 1395 | + }] | ||
| 1396 | + } | ||
| 1397 | + }) | ||
| 1398 | + .state("ttInfoDetailManage_detail_edit_switchLp", { // 时刻表 调换路牌 | ||
| 1399 | + url: '/ttInfoDetailManage_detail_edit_switchLp/:xlid/:ttid/:xlname/:ttname/:lineversion', | ||
| 1400 | + views: { | ||
| 1401 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-switchLp.html'} | ||
| 1402 | + }, | ||
| 1403 | + resolve: { | ||
| 1404 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | ||
| 1405 | + return $ocLazyLoad.load({ | ||
| 1406 | + name: 'ttInfoDetailManage_detail_edit_switchLp', | ||
| 1407 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | ||
| 1408 | + files: [ | ||
| 1409 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | ||
| 1410 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | ||
| 1411 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | ||
| 1412 | + ] | ||
| 1413 | + }); | ||
| 1414 | + }] | ||
| 1415 | + } | ||
| 1416 | + }) | ||
| 1361 | 1417 | ||
| 1362 | 1418 | ||
| 1363 | ; | 1419 | ; |
| 1364 | 1420 | ||
| 1365 | } | 1421 | } |
| 1366 | -]); | 1422 | +]); |
| 1423 | + | ||
| 1367 | // ui route 配置 | 1424 | // ui route 配置 |
| 1368 | 1425 | ||
| 1369 | /** 时刻表管理配置route */ | 1426 | /** 时刻表管理配置route */ |
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/list.html
| @@ -11,7 +11,8 @@ | @@ -11,7 +11,8 @@ | ||
| 11 | <th style="width: 15%;">驾驶员</th> | 11 | <th style="width: 15%;">驾驶员</th> |
| 12 | <th >售票员工号</th> | 12 | <th >售票员工号</th> |
| 13 | <th >售票员</th> | 13 | <th >售票员</th> |
| 14 | - <th style="width: 80px;">状态</th> | 14 | + <th style="width: 80px;">状态1</th> |
| 15 | + <th style="width: 80px;">状态2</th> | ||
| 15 | <th style="width: 21%">操作</th> | 16 | <th style="width: 21%">操作</th> |
| 16 | </tr> | 17 | </tr> |
| 17 | <tr role="row" class="filter"> | 18 | <tr role="row" class="filter"> |
| @@ -51,6 +52,11 @@ | @@ -51,6 +52,11 @@ | ||
| 51 | </label> | 52 | </label> |
| 52 | </td> | 53 | </td> |
| 53 | <td> | 54 | <td> |
| 55 | + <label class="checkbox-inline"> | ||
| 56 | + <input type="checkbox" ng-model="ctrl.personIsDestroyCheck"/>已停用 | ||
| 57 | + </label> | ||
| 58 | + </td> | ||
| 59 | + <td> | ||
| 54 | <div class="btn-group"> | 60 | <div class="btn-group"> |
| 55 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;" | 61 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right: 0;" |
| 56 | ng-click="ctrl.doPage()"> | 62 | ng-click="ctrl.doPage()"> |
| @@ -111,6 +117,10 @@ | @@ -111,6 +117,10 @@ | ||
| 111 | <span class="glyphicon glyphicon-remove" ng-if="info.isCancel == '1'"></span> | 117 | <span class="glyphicon glyphicon-remove" ng-if="info.isCancel == '1'"></span> |
| 112 | </td> | 118 | </td> |
| 113 | <td> | 119 | <td> |
| 120 | + <span class="glyphicon glyphicon-ok" ng-if="info.ryDestroyStatus == 0"></span> | ||
| 121 | + <span class="glyphicon glyphicon-remove" ng-if="info.ryDestroyStatus > 0"></span> | ||
| 122 | + </td> | ||
| 123 | + <td> | ||
| 114 | <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> | 124 | <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> |
| 115 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> | 125 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> |
| 116 | <a ui-sref="employeeConfig_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a> | 126 | <a ui-sref="employeeConfig_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a> |
| @@ -147,4 +157,4 @@ | @@ -147,4 +157,4 @@ | ||
| 147 | </div> | 157 | </div> |
| 148 | </div> | 158 | </div> |
| 149 | 159 | ||
| 150 | -</div> | ||
| 151 | \ No newline at end of file | 160 | \ No newline at end of file |
| 161 | +</div> |
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/module.js
| @@ -236,7 +236,17 @@ angular.module('ScheduleApp').controller( | @@ -236,7 +236,17 @@ angular.module('ScheduleApp').controller( | ||
| 236 | self.searchCondition = function() { | 236 | self.searchCondition = function() { |
| 237 | return service.getSearchCondition(); | 237 | return service.getSearchCondition(); |
| 238 | }; | 238 | }; |
| 239 | + self.personIsDestroyCheck = false; // 人员停用选择框 | ||
| 239 | self.doPage = function() { | 240 | self.doPage = function() { |
| 241 | + // 人员停用判定(目前只判定驾驶员) | ||
| 242 | + delete self.searchCondition()['ryDestroyStatus_gt']; | ||
| 243 | + delete self.searchCondition()['ryDestroyStatus_eq']; | ||
| 244 | + if (self.personIsDestroyCheck) { | ||
| 245 | + self.searchCondition()['ryDestroyStatus_gt'] = 0; // 选中时,true替换成1 | ||
| 246 | + } else { | ||
| 247 | + self.searchCondition()['ryDestroyStatus_eq'] = 0; | ||
| 248 | + } | ||
| 249 | + | ||
| 240 | var page = EmpConfig.list(self.searchCondition(), function() { | 250 | var page = EmpConfig.list(self.searchCondition(), function() { |
| 241 | service.getPage(page); | 251 | service.getPage(page); |
| 242 | }); | 252 | }); |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/edit.html
| @@ -152,6 +152,39 @@ | @@ -152,6 +152,39 @@ | ||
| 152 | </div> | 152 | </div> |
| 153 | 153 | ||
| 154 | <div class="form-group has-success has-feedback"> | 154 | <div class="form-group has-success has-feedback"> |
| 155 | + <label class="col-md-2 control-label">计划里程*:</label> | ||
| 156 | + <div class="col-md-3"> | ||
| 157 | + <input type="text" class="form-control" name="jhlc" | ||
| 158 | + ng-model="ctrl.schedulePlanInfoForSave.jhlc" required ng-pattern="ctrl.float_regex" | ||
| 159 | + /> | ||
| 160 | + </div> | ||
| 161 | + <!-- 隐藏块,显示验证信息 --> | ||
| 162 | + <div class="alert alert-danger well-sm" ng-show="myForm.jhlc.$error.required"> | ||
| 163 | + 计划里程必须填写 | ||
| 164 | + </div> | ||
| 165 | + <div class="alert alert-danger well-sm" ng-show="myForm.jhlc.$error.pattern"> | ||
| 166 | + 输入数字 | ||
| 167 | + </div> | ||
| 168 | + | ||
| 169 | + </div> | ||
| 170 | + <div class="form-group has-success has-feedback"> | ||
| 171 | + <label class="col-md-2 control-label">班次历时*:</label> | ||
| 172 | + <div class="col-md-3"> | ||
| 173 | + <input type="text" class="form-control" name="bcsj" | ||
| 174 | + ng-model="ctrl.schedulePlanInfoForSave.bcsj" required ng-pattern="ctrl.number_regex" | ||
| 175 | + /> | ||
| 176 | + </div> | ||
| 177 | + <!-- 隐藏块,显示验证信息 --> | ||
| 178 | + <div class="alert alert-danger well-sm" ng-show="myForm.bcsj.$error.required"> | ||
| 179 | + 班次时间必须填写 | ||
| 180 | + </div> | ||
| 181 | + <div class="alert alert-danger well-sm" ng-show="myForm.bcsj.$error.pattern"> | ||
| 182 | + 输入整数 | ||
| 183 | + </div> | ||
| 184 | + | ||
| 185 | + </div> | ||
| 186 | + | ||
| 187 | + <div class="form-group has-success has-feedback"> | ||
| 155 | <label class="col-md-2 control-label">车辆*:</label> | 188 | <label class="col-md-2 control-label">车辆*:</label> |
| 156 | <div class="col-md-4"> | 189 | <div class="col-md-4"> |
| 157 | <sa-Select5 name="cl" | 190 | <sa-Select5 name="cl" |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/module.js
| @@ -230,6 +230,11 @@ angular.module("ScheduleApp").controller( | @@ -230,6 +230,11 @@ angular.module("ScheduleApp").controller( | ||
| 230 | $state.go("schedulePlanInfoManage", $stateParams); | 230 | $state.go("schedulePlanInfoManage", $stateParams); |
| 231 | }; | 231 | }; |
| 232 | 232 | ||
| 233 | + // 整数 | ||
| 234 | + self.number_regex = /^-?\d+$/; | ||
| 235 | + // 小数 | ||
| 236 | + self.float_regex = /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/; | ||
| 237 | + | ||
| 233 | // 线路版本描述 | 238 | // 线路版本描述 |
| 234 | self.title_tip = "版本加载中..."; | 239 | self.title_tip = "版本加载中..."; |
| 235 | 240 |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-addLp.html
0 → 100644
| 1 | +<div ng-controller="TimeTableDetailManageFormCtrl_addLp as ctrl"> | ||
| 2 | + <div class="page-head"> | ||
| 3 | + <div class="page-title"> | ||
| 4 | + <h1>时刻表管理</h1> | ||
| 5 | + </div> | ||
| 6 | + </div> | ||
| 7 | + | ||
| 8 | + <ul class="page-breadcrumb breadcrumb"> | ||
| 9 | + <li> | ||
| 10 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 11 | + <i class="fa fa-circle"></i> | ||
| 12 | + </li> | ||
| 13 | + <li> | ||
| 14 | + <span class="active">运营计划管理</span> | ||
| 15 | + <i class="fa fa-circle"></i> | ||
| 16 | + </li> | ||
| 17 | + <li> | ||
| 18 | + <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 19 | + <i class="fa fa-circle"></i> | ||
| 20 | + </li> | ||
| 21 | + <li> | ||
| 22 | + <a ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid: ctrl.ttid, xlname: ctrl.xlname, ttname: ctrl.ttname, lineversion: ctrl.lineversion})"><span ng-bind="ctrl.title1"></span></a> | ||
| 23 | + <i class="fa fa-circle"></i> | ||
| 24 | + </li> | ||
| 25 | + <li> | ||
| 26 | + <span class="active">添加路牌</span> | ||
| 27 | + </li> | ||
| 28 | + </ul> | ||
| 29 | + | ||
| 30 | + <div class="portlet light bordered"> | ||
| 31 | + <div class="portlet-title"> | ||
| 32 | + <div class="caption"> | ||
| 33 | + <div> | ||
| 34 | + <i class="icon-equalizer font-red-sunglo"></i> | ||
| 35 | + <span class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title1"></span> | ||
| 36 | + </div> | ||
| 37 | + <div style="padding-top: 10px;"> | ||
| 38 | + <i class="icon-equalizer font-red-sunglo"></i> | ||
| 39 | + <span class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title_tip"></span> | ||
| 40 | + </div> | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 43 | + | ||
| 44 | + <div class="portlet-body form"> | ||
| 45 | + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 46 | + <div class="form-body"> | ||
| 47 | + | ||
| 48 | + <div class="form-group"> | ||
| 49 | + <label class="col-md-2 control-label">路牌:</label> | ||
| 50 | + <div class="col-md-3"> | ||
| 51 | + <sa-Select5 name="lp" | ||
| 52 | + model="ctrl.formInfo" | ||
| 53 | + cmaps="{'lpId' : 'id'}" | ||
| 54 | + dcname="lpId" | ||
| 55 | + icname="id" | ||
| 56 | + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.xlid, 'type': 'all'}, atype:'lpInfo2' } | json }}" | ||
| 57 | + iterobjname="item" | ||
| 58 | + iterobjexp="item.lpName" | ||
| 59 | + searchph="输入路牌名字" | ||
| 60 | + searchexp="this.lpName" | ||
| 61 | + required | ||
| 62 | + > | ||
| 63 | + </sa-Select5> | ||
| 64 | + </div> | ||
| 65 | + <!-- 隐藏块,显示验证信息 --> | ||
| 66 | + <div class="alert alert-danger well-sm" ng-show="myForm.lp.$error.required"> | ||
| 67 | + 请选择路牌 | ||
| 68 | + </div> | ||
| 69 | + </div> | ||
| 70 | + | ||
| 71 | + </div> | ||
| 72 | + | ||
| 73 | + <div class="form-actions"> | ||
| 74 | + <div class="row"> | ||
| 75 | + <div class="col-md-offset-3 col-md-4"> | ||
| 76 | + <button type="submit" class="btn green" | ||
| 77 | + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 78 | + <a type="button" class="btn default" | ||
| 79 | + ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname, lineversion : ctrl.lineversion})" ><i class="fa fa-times"></i> 取消</a> | ||
| 80 | + </div> | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + </form> | ||
| 84 | + | ||
| 85 | + </div> | ||
| 86 | + | ||
| 87 | + </div> | ||
| 88 | + | ||
| 89 | +</div> |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html
| 1 | <div ng-controller="TimeTableDetailManageFormCtrl_old2 as ctrl"> | 1 | <div ng-controller="TimeTableDetailManageFormCtrl_old2 as ctrl"> |
| 2 | <div class="page-head"> | 2 | <div class="page-head"> |
| 3 | <div class="page-title"> | 3 | <div class="page-title"> |
| 4 | - <h1>修改班次信息</h1> | 4 | + <h1>时刻表管理</h1> |
| 5 | </div> | 5 | </div> |
| 6 | </div> | 6 | </div> |
| 7 | 7 | ||
| @@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
| 23 | <i class="fa fa-circle"></i> | 23 | <i class="fa fa-circle"></i> |
| 24 | </li> | 24 | </li> |
| 25 | <li> | 25 | <li> |
| 26 | - <span class="active">修改班次信息</span> | 26 | + <span class="active">批量修改</span> |
| 27 | </li> | 27 | </li> |
| 28 | </ul> | 28 | </ul> |
| 29 | 29 |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-mulselect.html
| 1 | <div ng-controller="TimeTableDetailManageFormCtrl_mulselect as ctrl"> | 1 | <div ng-controller="TimeTableDetailManageFormCtrl_mulselect as ctrl"> |
| 2 | <div class="page-head"> | 2 | <div class="page-head"> |
| 3 | <div class="page-title"> | 3 | <div class="page-title"> |
| 4 | - <h1>修改班次信息</h1> | 4 | + <h1>时刻表管理</h1> |
| 5 | </div> | 5 | </div> |
| 6 | </div> | 6 | </div> |
| 7 | 7 | ||
| @@ -19,19 +19,25 @@ | @@ -19,19 +19,25 @@ | ||
| 19 | <i class="fa fa-circle"></i> | 19 | <i class="fa fa-circle"></i> |
| 20 | </li> | 20 | </li> |
| 21 | <li> | 21 | <li> |
| 22 | - <a ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})"><span ng-bind="ctrl.title1"></span></a> | 22 | + <a ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname, lineversion: ctrl.lineversion})"><span ng-bind="ctrl.title1"></span></a> |
| 23 | <i class="fa fa-circle"></i> | 23 | <i class="fa fa-circle"></i> |
| 24 | </li> | 24 | </li> |
| 25 | <li> | 25 | <li> |
| 26 | - <span class="active">修改班次信息</span> | 26 | + <span class="active">批量选择</span> |
| 27 | </li> | 27 | </li> |
| 28 | </ul> | 28 | </ul> |
| 29 | 29 | ||
| 30 | <div class="portlet light bordered"> | 30 | <div class="portlet light bordered"> |
| 31 | <div class="portlet-title"> | 31 | <div class="portlet-title"> |
| 32 | <div class="caption"> | 32 | <div class="caption"> |
| 33 | - <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 34 | - class="caption-subject font-red-sunglo bold uppercase" >批量选择</span> | 33 | + <div> |
| 34 | + <i class="icon-equalizer font-red-sunglo"></i> | ||
| 35 | + <span class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title1"></span> | ||
| 36 | + </div> | ||
| 37 | + <div style="padding-top: 10px;"> | ||
| 38 | + <i class="icon-equalizer font-red-sunglo"></i> | ||
| 39 | + <span class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title_tip"></span> | ||
| 40 | + </div> | ||
| 35 | </div> | 41 | </div> |
| 36 | </div> | 42 | </div> |
| 37 | 43 |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-removeLp.html
0 → 100644
| 1 | +<div ng-controller="TimeTableDetailManageFormCtrl_removeLp as ctrl"> | ||
| 2 | + <div class="page-head"> | ||
| 3 | + <div class="page-title"> | ||
| 4 | + <h1>时刻表管理</h1> | ||
| 5 | + </div> | ||
| 6 | + </div> | ||
| 7 | + | ||
| 8 | + <ul class="page-breadcrumb breadcrumb"> | ||
| 9 | + <li> | ||
| 10 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 11 | + <i class="fa fa-circle"></i> | ||
| 12 | + </li> | ||
| 13 | + <li> | ||
| 14 | + <span class="active">运营计划管理</span> | ||
| 15 | + <i class="fa fa-circle"></i> | ||
| 16 | + </li> | ||
| 17 | + <li> | ||
| 18 | + <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 19 | + <i class="fa fa-circle"></i> | ||
| 20 | + </li> | ||
| 21 | + <li> | ||
| 22 | + <a ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid: ctrl.ttid, xlname: ctrl.xlname, ttname: ctrl.ttname, lineversion: ctrl.lineversion})"><span ng-bind="ctrl.title1"></span></a> | ||
| 23 | + <i class="fa fa-circle"></i> | ||
| 24 | + </li> | ||
| 25 | + <li> | ||
| 26 | + <span class="active">删除路牌</span> | ||
| 27 | + </li> | ||
| 28 | + </ul> | ||
| 29 | + | ||
| 30 | + <div class="portlet light bordered"> | ||
| 31 | + <div class="portlet-title"> | ||
| 32 | + <div class="caption"> | ||
| 33 | + <div> | ||
| 34 | + <i class="icon-equalizer font-red-sunglo"></i> | ||
| 35 | + <span class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title1"></span> | ||
| 36 | + </div> | ||
| 37 | + <div style="padding-top: 10px;"> | ||
| 38 | + <i class="icon-equalizer font-red-sunglo"></i> | ||
| 39 | + <span class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title_tip"></span> | ||
| 40 | + </div> | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 43 | + | ||
| 44 | + <div class="portlet-body form"> | ||
| 45 | + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 46 | + <div class="form-body"> | ||
| 47 | + | ||
| 48 | + <div class="form-group"> | ||
| 49 | + <label class="col-md-2 control-label">路牌:</label> | ||
| 50 | + <div class="col-md-3"> | ||
| 51 | + <sa-Select5 name="lp" | ||
| 52 | + model="ctrl.formInfo" | ||
| 53 | + cmaps="{'lpId' : 'id'}" | ||
| 54 | + dcname="lpId" | ||
| 55 | + icname="id" | ||
| 56 | + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.xlid, 'type': 'all'}, atype:'lpInfo2' } | json }}" | ||
| 57 | + iterobjname="item" | ||
| 58 | + iterobjexp="item.lpName" | ||
| 59 | + searchph="输入路牌名字" | ||
| 60 | + searchexp="this.lpName" | ||
| 61 | + required | ||
| 62 | + > | ||
| 63 | + </sa-Select5> | ||
| 64 | + </div> | ||
| 65 | + <!-- 隐藏块,显示验证信息 --> | ||
| 66 | + <div class="alert alert-danger well-sm" ng-show="myForm.lp.$error.required"> | ||
| 67 | + 请选择路牌 | ||
| 68 | + </div> | ||
| 69 | + </div> | ||
| 70 | + | ||
| 71 | + </div> | ||
| 72 | + | ||
| 73 | + <div class="form-actions"> | ||
| 74 | + <div class="row"> | ||
| 75 | + <div class="col-md-offset-3 col-md-4"> | ||
| 76 | + <button type="submit" class="btn green" | ||
| 77 | + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 78 | + <a type="button" class="btn default" | ||
| 79 | + ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname, lineversion : ctrl.lineversion})" ><i class="fa fa-times"></i> 取消</a> | ||
| 80 | + </div> | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + </form> | ||
| 84 | + | ||
| 85 | + </div> | ||
| 86 | + | ||
| 87 | + </div> | ||
| 88 | + | ||
| 89 | +</div> |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-switchLp.html
0 → 100644
| 1 | +<div ng-controller="TimeTableDetailManageFormCtrl_switchLp as ctrl"> | ||
| 2 | + <div class="page-head"> | ||
| 3 | + <div class="page-title"> | ||
| 4 | + <h1>时刻表管理</h1> | ||
| 5 | + </div> | ||
| 6 | + </div> | ||
| 7 | + | ||
| 8 | + <ul class="page-breadcrumb breadcrumb"> | ||
| 9 | + <li> | ||
| 10 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 11 | + <i class="fa fa-circle"></i> | ||
| 12 | + </li> | ||
| 13 | + <li> | ||
| 14 | + <span class="active">运营计划管理</span> | ||
| 15 | + <i class="fa fa-circle"></i> | ||
| 16 | + </li> | ||
| 17 | + <li> | ||
| 18 | + <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 19 | + <i class="fa fa-circle"></i> | ||
| 20 | + </li> | ||
| 21 | + <li> | ||
| 22 | + <a ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid: ctrl.ttid, xlname: ctrl.xlname, ttname: ctrl.ttname, lineversion: ctrl.lineversion})"><span ng-bind="ctrl.title1"></span></a> | ||
| 23 | + <i class="fa fa-circle"></i> | ||
| 24 | + </li> | ||
| 25 | + <li> | ||
| 26 | + <span class="active">调换路牌</span> | ||
| 27 | + </li> | ||
| 28 | + </ul> | ||
| 29 | + | ||
| 30 | + <div class="portlet light bordered"> | ||
| 31 | + <div class="portlet-title"> | ||
| 32 | + <div class="caption"> | ||
| 33 | + <div> | ||
| 34 | + <i class="icon-equalizer font-red-sunglo"></i> | ||
| 35 | + <span class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title1"></span> | ||
| 36 | + </div> | ||
| 37 | + <div style="padding-top: 10px;"> | ||
| 38 | + <i class="icon-equalizer font-red-sunglo"></i> | ||
| 39 | + <span class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title_tip"></span> | ||
| 40 | + </div> | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 43 | + | ||
| 44 | + <div class="portlet-body form"> | ||
| 45 | + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 46 | + <div class="form-body"> | ||
| 47 | + | ||
| 48 | + <div class="form-group"> | ||
| 49 | + <label class="col-md-2 control-label">路牌A:</label> | ||
| 50 | + <div class="col-md-3"> | ||
| 51 | + <sa-Select5 name="lpA" | ||
| 52 | + model="ctrl.formInfo" | ||
| 53 | + cmaps="{'lpAId' : 'id'}" | ||
| 54 | + dcname="lpAId" | ||
| 55 | + icname="id" | ||
| 56 | + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.xlid, 'type': 'all'}, atype:'lpInfo2' } | json }}" | ||
| 57 | + iterobjname="item" | ||
| 58 | + iterobjexp="item.lpName" | ||
| 59 | + searchph="输入路牌名字" | ||
| 60 | + searchexp="this.lpName" | ||
| 61 | + required | ||
| 62 | + > | ||
| 63 | + </sa-Select5> | ||
| 64 | + </div> | ||
| 65 | + <!-- 隐藏块,显示验证信息 --> | ||
| 66 | + <div class="alert alert-danger well-sm" ng-show="myForm.lpA.$error.required"> | ||
| 67 | + 请选择路牌A | ||
| 68 | + </div> | ||
| 69 | + </div> | ||
| 70 | + | ||
| 71 | + <div class="form-group"> | ||
| 72 | + <label class="col-md-2 control-label">路牌B:</label> | ||
| 73 | + <div class="col-md-3"> | ||
| 74 | + <sa-Select5 name="lpB" | ||
| 75 | + model="ctrl.formInfo" | ||
| 76 | + cmaps="{'lpBId' : 'id'}" | ||
| 77 | + dcname="lpBId" | ||
| 78 | + icname="id" | ||
| 79 | + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.xlid, 'type': 'all'}, atype:'lpInfo2' } | json }}" | ||
| 80 | + iterobjname="item" | ||
| 81 | + iterobjexp="item.lpName" | ||
| 82 | + searchph="输入路牌名字" | ||
| 83 | + searchexp="this.lpName" | ||
| 84 | + required | ||
| 85 | + > | ||
| 86 | + </sa-Select5> | ||
| 87 | + </div> | ||
| 88 | + <!-- 隐藏块,显示验证信息 --> | ||
| 89 | + <div class="alert alert-danger well-sm" ng-show="myForm.lpB.$error.required"> | ||
| 90 | + 请选择路牌B | ||
| 91 | + </div> | ||
| 92 | + </div> | ||
| 93 | + | ||
| 94 | + </div> | ||
| 95 | + | ||
| 96 | + <div class="form-actions"> | ||
| 97 | + <div class="row"> | ||
| 98 | + <div class="col-md-offset-3 col-md-4"> | ||
| 99 | + <button type="submit" class="btn green" | ||
| 100 | + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 101 | + <a type="button" class="btn default" | ||
| 102 | + ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname, lineversion : ctrl.lineversion})" ><i class="fa fa-times"></i> 取消</a> | ||
| 103 | + </div> | ||
| 104 | + </div> | ||
| 105 | + </div> | ||
| 106 | + </form> | ||
| 107 | + | ||
| 108 | + </div> | ||
| 109 | + | ||
| 110 | + </div> | ||
| 111 | + | ||
| 112 | +</div> |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit3.html
| @@ -121,11 +121,35 @@ | @@ -121,11 +121,35 @@ | ||
| 121 | 取消选择 | 121 | 取消选择 |
| 122 | </a> | 122 | </a> |
| 123 | <a href="javascript:" style="padding-right: 5px;" | 123 | <a href="javascript:" style="padding-right: 5px;" |
| 124 | + ng-click="ctrl.toAddLp()" | ||
| 125 | + ng-show="ctrl.currentView.btn7"> | ||
| 126 | + <i class="fa fa-th-list" aria-hidden="true"></i> | ||
| 127 | + 增加路牌 | ||
| 128 | + </a> | ||
| 129 | + <a href="javascript:" style="padding-right: 5px;" | ||
| 130 | + ng-click="ctrl.toRemoveLp()" | ||
| 131 | + ng-show="ctrl.currentView.btn8"> | ||
| 132 | + <i class="fa fa-th-list" aria-hidden="true"></i> | ||
| 133 | + 删除路牌 | ||
| 134 | + </a> | ||
| 135 | + <a href="javascript:" style="padding-right: 5px;" | ||
| 136 | + ng-click="ctrl.toSwitchLp()" | ||
| 137 | + ng-show="ctrl.currentView.btn9"> | ||
| 138 | + <i class="fa fa-th-list" aria-hidden="true"></i> | ||
| 139 | + 调换路牌 | ||
| 140 | + </a> | ||
| 141 | + <a href="javascript:" style="padding-right: 5px;" | ||
| 124 | ng-click="ctrl.refresh()" | 142 | ng-click="ctrl.refresh()" |
| 125 | ng-show="ctrl.currentView.btn5"> | 143 | ng-show="ctrl.currentView.btn5"> |
| 126 | <i class="fa fa-refresh"></i> | 144 | <i class="fa fa-refresh"></i> |
| 127 | 刷新数据 | 145 | 刷新数据 |
| 128 | </a> | 146 | </a> |
| 147 | + <a href="javascript:" style="padding-right: 5px;" | ||
| 148 | + ng-click="ctrl.exportPvInfo()" | ||
| 149 | + ng-show="ctrl.currentView.btn6"> | ||
| 150 | + <i class="fa fa-file-excel-o" aria-hidden="true"></i> | ||
| 151 | + 导出 | ||
| 152 | + </a> | ||
| 129 | </div> | 153 | </div> |
| 130 | 154 | ||
| 131 | 155 |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/route.js
| @@ -157,10 +157,66 @@ ScheduleApp.config([ | @@ -157,10 +157,66 @@ ScheduleApp.config([ | ||
| 157 | }] | 157 | }] |
| 158 | } | 158 | } |
| 159 | }) | 159 | }) |
| 160 | - | 160 | + .state("ttInfoDetailManage_detail_edit_addLp", { // 时刻表 添加路牌 |
| 161 | + url: '/ttInfoDetailManage_detail_edit_addLp/:xlid/:ttid/:xlname/:ttname/:lineversion', | ||
| 162 | + views: { | ||
| 163 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-addLp.html'} | ||
| 164 | + }, | ||
| 165 | + resolve: { | ||
| 166 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | ||
| 167 | + return $ocLazyLoad.load({ | ||
| 168 | + name: 'ttInfoDetailManage_detail_edit_addLp', | ||
| 169 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | ||
| 170 | + files: [ | ||
| 171 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | ||
| 172 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | ||
| 173 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | ||
| 174 | + ] | ||
| 175 | + }); | ||
| 176 | + }] | ||
| 177 | + } | ||
| 178 | + }) | ||
| 179 | + .state("ttInfoDetailManage_detail_edit_removeLp", { // 时刻表 删除路牌 | ||
| 180 | + url: '/ttInfoDetailManage_detail_edit_removeLp/:xlid/:ttid/:xlname/:ttname/:lineversion', | ||
| 181 | + views: { | ||
| 182 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-removeLp.html'} | ||
| 183 | + }, | ||
| 184 | + resolve: { | ||
| 185 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | ||
| 186 | + return $ocLazyLoad.load({ | ||
| 187 | + name: 'ttInfoDetailManage_detail_edit_removeLp', | ||
| 188 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | ||
| 189 | + files: [ | ||
| 190 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | ||
| 191 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | ||
| 192 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | ||
| 193 | + ] | ||
| 194 | + }); | ||
| 195 | + }] | ||
| 196 | + } | ||
| 197 | + }) | ||
| 198 | + .state("ttInfoDetailManage_detail_edit_switchLp", { // 时刻表 调换路牌 | ||
| 199 | + url: '/ttInfoDetailManage_detail_edit_switchLp/:xlid/:ttid/:xlname/:ttname/:lineversion', | ||
| 200 | + views: { | ||
| 201 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-switchLp.html'} | ||
| 202 | + }, | ||
| 203 | + resolve: { | ||
| 204 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | ||
| 205 | + return $ocLazyLoad.load({ | ||
| 206 | + name: 'ttInfoDetailManage_detail_edit_switchLp', | ||
| 207 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | ||
| 208 | + files: [ | ||
| 209 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | ||
| 210 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | ||
| 211 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | ||
| 212 | + ] | ||
| 213 | + }); | ||
| 214 | + }] | ||
| 215 | + } | ||
| 216 | + }) | ||
| 161 | 217 | ||
| 162 | 218 | ||
| 163 | ; | 219 | ; |
| 164 | 220 | ||
| 165 | } | 221 | } |
| 166 | -]); | ||
| 167 | \ No newline at end of file | 222 | \ No newline at end of file |
| 223 | +]); |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
| @@ -60,6 +60,20 @@ angular.module('ScheduleApp').factory( | @@ -60,6 +60,20 @@ angular.module('ScheduleApp').factory( | ||
| 60 | ); | 60 | ); |
| 61 | }, | 61 | }, |
| 62 | 62 | ||
| 63 | + pvInfoExportPromise: function(ttInfoId) { | ||
| 64 | + return service.pvInfoExport.do({id: ttInfoId}).$promise; | ||
| 65 | + }, | ||
| 66 | + | ||
| 67 | + addLpPromise: function(ttInfoId, lpId) { | ||
| 68 | + return service.addLp.do({ttInfoId: ttInfoId, lpId: lpId}).$promise; | ||
| 69 | + }, | ||
| 70 | + removeLpPromise: function(ttInfoId, lpId) { | ||
| 71 | + return service.removeLp.do({ttInfoId: ttInfoId, lpId: lpId}).$promise; | ||
| 72 | + }, | ||
| 73 | + switchLpPromise: function(ttInfoId, lpAId, lpBId) { | ||
| 74 | + return service.switchLp.do({ttInfoId: ttInfoId, lpAId: lpAId, lpBId: lpBId}).$promise; | ||
| 75 | + }, | ||
| 76 | + | ||
| 63 | /** | 77 | /** |
| 64 | * 获取编辑用的时刻表明细数据。 | 78 | * 获取编辑用的时刻表明细数据。 |
| 65 | * @param xlid 线路id | 79 | * @param xlid 线路id |
| @@ -357,7 +371,8 @@ angular.module('ScheduleApp').controller( | @@ -357,7 +371,8 @@ angular.module('ScheduleApp').controller( | ||
| 357 | '$state', | 371 | '$state', |
| 358 | '$scope', | 372 | '$scope', |
| 359 | '$window', | 373 | '$window', |
| 360 | - function(service, $stateParams, $uibModal, $state, $scope, $window) { | 374 | + 'FileDownload_g', |
| 375 | + function(service, $stateParams, $uibModal, $state, $scope, $window, fileDownload) { | ||
| 361 | var self = this; | 376 | var self = this; |
| 362 | self.xlid = $stateParams.xlid; // 获取传过来的线路id | 377 | self.xlid = $stateParams.xlid; // 获取传过来的线路id |
| 363 | self.ttid = $stateParams.ttid; // 获取传过来的时刻表id | 378 | self.ttid = $stateParams.ttid; // 获取传过来的时刻表id |
| @@ -439,12 +454,16 @@ angular.module('ScheduleApp').controller( | @@ -439,12 +454,16 @@ angular.module('ScheduleApp').controller( | ||
| 439 | btn2 : true, | 454 | btn2 : true, |
| 440 | btn3 : true, | 455 | btn3 : true, |
| 441 | btn4 : true, | 456 | btn4 : true, |
| 442 | - btn5 : true | 457 | + btn5 : true, |
| 458 | + btn7 : true, | ||
| 459 | + btn8 : true, | ||
| 460 | + btn9 : true | ||
| 443 | }, | 461 | }, |
| 444 | "preView" : { | 462 | "preView" : { |
| 445 | viewId : 2, | 463 | viewId : 2, |
| 446 | switchBtnMsg : "切换编辑视图", | 464 | switchBtnMsg : "切换编辑视图", |
| 447 | - btn5 : true | 465 | + btn5 : true, |
| 466 | + btn6 : true | ||
| 448 | } | 467 | } |
| 449 | }; | 468 | }; |
| 450 | self.currentView = self.viewInfos["editView"]; // 默认编辑视图 | 469 | self.currentView = self.viewInfos["editView"]; // 默认编辑视图 |
| @@ -639,6 +658,50 @@ angular.module('ScheduleApp').controller( | @@ -639,6 +658,50 @@ angular.module('ScheduleApp').controller( | ||
| 639 | } | 658 | } |
| 640 | }; | 659 | }; |
| 641 | 660 | ||
| 661 | + // 导出pv预览视图数据 | ||
| 662 | + self.exportPvInfo = function() { | ||
| 663 | + var promise = service.pvInfoExportPromise(self.ttid); | ||
| 664 | + promise.then( | ||
| 665 | + function(result) { | ||
| 666 | + fileDownload.downloadFile(result.fileData, "application/octet-stream", result.fileName); | ||
| 667 | + }, | ||
| 668 | + function(result) { | ||
| 669 | + console.log("导出预览视图信息失败:" + result); | ||
| 670 | + } | ||
| 671 | + ); | ||
| 672 | + }; | ||
| 673 | + | ||
| 674 | + // 增加路牌(跳转页面) | ||
| 675 | + self.toAddLp = function() { | ||
| 676 | + $state.go("ttInfoDetailManage_detail_edit_addLp", { | ||
| 677 | + xlid: self.xlid, | ||
| 678 | + ttid: self.ttid, | ||
| 679 | + xlname: self.xlname, | ||
| 680 | + ttname: self.ttname, | ||
| 681 | + lineversion: self.lineversion | ||
| 682 | + }); | ||
| 683 | + }; | ||
| 684 | + // 删除路牌(跳转页面) | ||
| 685 | + self.toRemoveLp = function() { | ||
| 686 | + $state.go("ttInfoDetailManage_detail_edit_removeLp", { | ||
| 687 | + xlid: self.xlid, | ||
| 688 | + ttid: self.ttid, | ||
| 689 | + xlname: self.xlname, | ||
| 690 | + ttname: self.ttname, | ||
| 691 | + lineversion: self.lineversion | ||
| 692 | + }); | ||
| 693 | + }; | ||
| 694 | + // 调换路牌(跳转页面) | ||
| 695 | + self.toSwitchLp = function() { | ||
| 696 | + $state.go("ttInfoDetailManage_detail_edit_switchLp", { | ||
| 697 | + xlid: self.xlid, | ||
| 698 | + ttid: self.ttid, | ||
| 699 | + xlname: self.xlname, | ||
| 700 | + ttname: self.ttname, | ||
| 701 | + lineversion: self.lineversion | ||
| 702 | + }); | ||
| 703 | + }; | ||
| 704 | + | ||
| 642 | } | 705 | } |
| 643 | 706 | ||
| 644 | ] | 707 | ] |
| @@ -994,7 +1057,13 @@ angular.module('ScheduleApp').controller( | @@ -994,7 +1057,13 @@ angular.module('ScheduleApp').controller( | ||
| 994 | self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 | 1057 | self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 |
| 995 | self.lineversion = $stateParams.lineversion; // 线路版本 | 1058 | self.lineversion = $stateParams.lineversion; // 线路版本 |
| 996 | 1059 | ||
| 997 | - self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; | 1060 | + self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息 批量条件选择班次"; |
| 1061 | + self.title_tip = "版本加载中..."; | ||
| 1062 | + service.versiondesc(self.xlid, self.lineversion).then( | ||
| 1063 | + function(result) { | ||
| 1064 | + self.title_tip = "线路版本(" + result.desc + ")"; | ||
| 1065 | + } | ||
| 1066 | + ); | ||
| 998 | 1067 | ||
| 999 | self.xldir = 2; // 线路上下行 | 1068 | self.xldir = 2; // 线路上下行 |
| 1000 | self.starttime = undefined; // 开始时间 | 1069 | self.starttime = undefined; // 开始时间 |
| @@ -1051,3 +1120,156 @@ angular.module('ScheduleApp').controller( | @@ -1051,3 +1120,156 @@ angular.module('ScheduleApp').controller( | ||
| 1051 | ] | 1120 | ] |
| 1052 | ); | 1121 | ); |
| 1053 | 1122 | ||
| 1123 | +// edit-addLp.html 添加路牌页面 | ||
| 1124 | +angular.module('ScheduleApp').controller( | ||
| 1125 | + 'TimeTableDetailManageFormCtrl_addLp', | ||
| 1126 | + [ | ||
| 1127 | + 'TimeTableDetailManageService_old', | ||
| 1128 | + '$stateParams', | ||
| 1129 | + '$state', | ||
| 1130 | + function(service, $stateParams, $state) { | ||
| 1131 | + var self = this; | ||
| 1132 | + | ||
| 1133 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | ||
| 1134 | + self.xlid = $stateParams.xlid; // 获取传过来的线路id | ||
| 1135 | + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id | ||
| 1136 | + self.xlname = $stateParams.xlname; // 获取传过来的线路名字 | ||
| 1137 | + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 | ||
| 1138 | + self.lineversion = $stateParams.lineversion; // 线路版本 | ||
| 1139 | + | ||
| 1140 | + self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息 添加路牌"; | ||
| 1141 | + self.title_tip = "版本加载中..."; | ||
| 1142 | + service.versiondesc(self.xlid, self.lineversion).then( | ||
| 1143 | + function(result) { | ||
| 1144 | + self.title_tip = "线路版本(" + result.desc + ")"; | ||
| 1145 | + } | ||
| 1146 | + ); | ||
| 1147 | + | ||
| 1148 | + // form数据 | ||
| 1149 | + self.formInfo = {}; | ||
| 1150 | + // from提交 | ||
| 1151 | + self.submit = function() { | ||
| 1152 | + service.addLpPromise(self.ttid, self.formInfo.lpId).then( | ||
| 1153 | + function(rst) { | ||
| 1154 | + if (rst.error) { | ||
| 1155 | + alert(rst.error); | ||
| 1156 | + } else { | ||
| 1157 | + service.refreshEditInfo(self.xlid, self.ttid); | ||
| 1158 | + $state.go("ttInfoDetailManage_edit3", { | ||
| 1159 | + xlid: self.xlid, | ||
| 1160 | + ttid: self.ttid, | ||
| 1161 | + xlname: self.xlname, | ||
| 1162 | + ttname: self.ttname, | ||
| 1163 | + lineversion: self.lineversion | ||
| 1164 | + }); | ||
| 1165 | + } | ||
| 1166 | + } | ||
| 1167 | + ); | ||
| 1168 | + }; | ||
| 1169 | + | ||
| 1170 | + } | ||
| 1171 | + ] | ||
| 1172 | +); | ||
| 1173 | + | ||
| 1174 | +// edit-removeLp.html 删除路牌页面 | ||
| 1175 | +angular.module('ScheduleApp').controller( | ||
| 1176 | + 'TimeTableDetailManageFormCtrl_removeLp', | ||
| 1177 | + [ | ||
| 1178 | + 'TimeTableDetailManageService_old', | ||
| 1179 | + '$stateParams', | ||
| 1180 | + '$state', | ||
| 1181 | + function(service, $stateParams, $state) { | ||
| 1182 | + var self = this; | ||
| 1183 | + | ||
| 1184 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | ||
| 1185 | + self.xlid = $stateParams.xlid; // 获取传过来的线路id | ||
| 1186 | + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id | ||
| 1187 | + self.xlname = $stateParams.xlname; // 获取传过来的线路名字 | ||
| 1188 | + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 | ||
| 1189 | + self.lineversion = $stateParams.lineversion; // 线路版本 | ||
| 1190 | + | ||
| 1191 | + self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息 删除路牌"; | ||
| 1192 | + self.title_tip = "版本加载中..."; | ||
| 1193 | + service.versiondesc(self.xlid, self.lineversion).then( | ||
| 1194 | + function(result) { | ||
| 1195 | + self.title_tip = "线路版本(" + result.desc + ")"; | ||
| 1196 | + } | ||
| 1197 | + ); | ||
| 1198 | + | ||
| 1199 | + // form数据 | ||
| 1200 | + self.formInfo = {}; | ||
| 1201 | + // from提交 | ||
| 1202 | + self.submit = function() { | ||
| 1203 | + service.removeLpPromise(self.ttid, self.formInfo.lpId).then( | ||
| 1204 | + function(rst) { | ||
| 1205 | + if (rst.error) { | ||
| 1206 | + alert(rst.error); | ||
| 1207 | + } else { | ||
| 1208 | + service.refreshEditInfo(self.xlid, self.ttid); | ||
| 1209 | + $state.go("ttInfoDetailManage_edit3", { | ||
| 1210 | + xlid: self.xlid, | ||
| 1211 | + ttid: self.ttid, | ||
| 1212 | + xlname: self.xlname, | ||
| 1213 | + ttname: self.ttname, | ||
| 1214 | + lineversion: self.lineversion | ||
| 1215 | + }); | ||
| 1216 | + } | ||
| 1217 | + } | ||
| 1218 | + ); | ||
| 1219 | + }; | ||
| 1220 | + | ||
| 1221 | + } | ||
| 1222 | + ] | ||
| 1223 | +); | ||
| 1224 | + | ||
| 1225 | +// edit-switchLp.html 调换路牌页面 | ||
| 1226 | +angular.module('ScheduleApp').controller( | ||
| 1227 | + 'TimeTableDetailManageFormCtrl_switchLp', | ||
| 1228 | + [ | ||
| 1229 | + 'TimeTableDetailManageService_old', | ||
| 1230 | + '$stateParams', | ||
| 1231 | + '$state', | ||
| 1232 | + function(service, $stateParams, $state) { | ||
| 1233 | + var self = this; | ||
| 1234 | + | ||
| 1235 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | ||
| 1236 | + self.xlid = $stateParams.xlid; // 获取传过来的线路id | ||
| 1237 | + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id | ||
| 1238 | + self.xlname = $stateParams.xlname; // 获取传过来的线路名字 | ||
| 1239 | + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 | ||
| 1240 | + self.lineversion = $stateParams.lineversion; // 线路版本 | ||
| 1241 | + | ||
| 1242 | + self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息 路牌A和路牌B的班次互换"; | ||
| 1243 | + self.title_tip = "版本加载中..."; | ||
| 1244 | + service.versiondesc(self.xlid, self.lineversion).then( | ||
| 1245 | + function(result) { | ||
| 1246 | + self.title_tip = "线路版本(" + result.desc + ")"; | ||
| 1247 | + } | ||
| 1248 | + ); | ||
| 1249 | + | ||
| 1250 | + // form数据 | ||
| 1251 | + self.formInfo = {}; | ||
| 1252 | + // from提交 | ||
| 1253 | + self.submit = function() { | ||
| 1254 | + service.switchLpPromise(self.ttid, self.formInfo.lpAId, self.formInfo.lpBId).then( | ||
| 1255 | + function(rst) { | ||
| 1256 | + if (rst.error) { | ||
| 1257 | + alert(rst.error); | ||
| 1258 | + } else { | ||
| 1259 | + service.refreshEditInfo(self.xlid, self.ttid); | ||
| 1260 | + $state.go("ttInfoDetailManage_edit3", { | ||
| 1261 | + xlid: self.xlid, | ||
| 1262 | + ttid: self.ttid, | ||
| 1263 | + xlname: self.xlname, | ||
| 1264 | + ttname: self.ttname, | ||
| 1265 | + lineversion: self.lineversion | ||
| 1266 | + }); | ||
| 1267 | + } | ||
| 1268 | + } | ||
| 1269 | + ); | ||
| 1270 | + | ||
| 1271 | + }; | ||
| 1272 | + | ||
| 1273 | + } | ||
| 1274 | + ] | ||
| 1275 | +); |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/service.js
| @@ -207,6 +207,87 @@ angular.module('ScheduleApp').factory( | @@ -207,6 +207,87 @@ angular.module('ScheduleApp').factory( | ||
| 207 | } | 207 | } |
| 208 | } | 208 | } |
| 209 | ), | 209 | ), |
| 210 | + | ||
| 211 | + pvInfoExport: $resource( | ||
| 212 | + '/tidc/exportPvInfo/:id', | ||
| 213 | + {id: '@id'}, | ||
| 214 | + { | ||
| 215 | + do: { | ||
| 216 | + method: 'GET', | ||
| 217 | + responseType: "arraybuffer", | ||
| 218 | + transformResponse: function(data, headers, status){ | ||
| 219 | + if (status != 200) { | ||
| 220 | + return data; | ||
| 221 | + } | ||
| 222 | + | ||
| 223 | + // console.log(headers("Content-Disposition")); | ||
| 224 | + // 获取文件名,后台根据是否还有中文名字,返回filename=ascii编码的文件名 或 filename*=unicode编码的文件名 | ||
| 225 | + var fileName = headers("Content-Disposition").split(";")[1].split("filename=")[1]; | ||
| 226 | + var fileNameUnicode = headers("Content-Disposition").split("filename*=")[1]; | ||
| 227 | + if (fileNameUnicode) {//当存在 filename* 时,取filename* 并进行解码(为了解决中文乱码问题) | ||
| 228 | + fileName = decodeURIComponent(fileNameUnicode); | ||
| 229 | + } | ||
| 230 | + | ||
| 231 | + return {fileData : data, fileName: fileName}; | ||
| 232 | + } | ||
| 233 | + } | ||
| 234 | + } | ||
| 235 | + ), | ||
| 236 | + | ||
| 237 | + addLp: $resource( | ||
| 238 | + '/tidc/addLp/:ttInfoId/:lpId', | ||
| 239 | + {}, | ||
| 240 | + { | ||
| 241 | + do: { | ||
| 242 | + method: 'GET', | ||
| 243 | + transformResponse: function(rs) { | ||
| 244 | + var dst = angular.fromJson(rs); | ||
| 245 | + if (dst.status == 'SUCCESS') { | ||
| 246 | + return {msg: dst.data}; | ||
| 247 | + } else { | ||
| 248 | + return {error: dst.msg}; // 业务错误留给控制器处理 | ||
| 249 | + } | ||
| 250 | + } | ||
| 251 | + } | ||
| 252 | + } | ||
| 253 | + ), | ||
| 254 | + | ||
| 255 | + removeLp: $resource( | ||
| 256 | + '/tidc/removeLp/:ttInfoId/:lpId', | ||
| 257 | + {}, | ||
| 258 | + { | ||
| 259 | + do: { | ||
| 260 | + method: 'GET', | ||
| 261 | + transformResponse: function(rs) { | ||
| 262 | + var dst = angular.fromJson(rs); | ||
| 263 | + if (dst.status == 'SUCCESS') { | ||
| 264 | + return {msg: dst.data}; | ||
| 265 | + } else { | ||
| 266 | + return {error: dst.msg}; // 业务错误留给控制器处理 | ||
| 267 | + } | ||
| 268 | + } | ||
| 269 | + } | ||
| 270 | + } | ||
| 271 | + ), | ||
| 272 | + | ||
| 273 | + switchLp: $resource( | ||
| 274 | + '/tidc/switchLp/:ttInfoId/:lpAId/:lpBId', | ||
| 275 | + {}, | ||
| 276 | + { | ||
| 277 | + do: { | ||
| 278 | + method: 'GET', | ||
| 279 | + transformResponse: function(rs) { | ||
| 280 | + var dst = angular.fromJson(rs); | ||
| 281 | + if (dst.status == 'SUCCESS') { | ||
| 282 | + return {msg: dst.data}; | ||
| 283 | + } else { | ||
| 284 | + return {error: dst.msg}; // 业务错误留给控制器处理 | ||
| 285 | + } | ||
| 286 | + } | ||
| 287 | + } | ||
| 288 | + } | ||
| 289 | + ), | ||
| 290 | + | ||
| 210 | edit: $resource( | 291 | edit: $resource( |
| 211 | '/tidc/edit/:xlid/:ttid', | 292 | '/tidc/edit/:xlid/:ttid', |
| 212 | {}, | 293 | {}, |
| @@ -257,4 +338,4 @@ angular.module('ScheduleApp').factory( | @@ -257,4 +338,4 @@ angular.module('ScheduleApp').factory( | ||
| 257 | } | 338 | } |
| 258 | 339 | ||
| 259 | ] | 340 | ] |
| 260 | -); | ||
| 261 | \ No newline at end of file | 341 | \ No newline at end of file |
| 342 | +); |
src/main/resources/static/real_control_v2/fragments/line_schedule/car_info_all.html
| @@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
| 15 | <th style="width: 13%;">当前执行任务</th> | 15 | <th style="width: 13%;">当前执行任务</th> |
| 16 | <th style="width: 7%;">状态</th> | 16 | <th style="width: 7%;">状态</th> |
| 17 | <th style="width: 19%">最后gps时间</th> | 17 | <th style="width: 19%">最后gps时间</th> |
| 18 | - <th>请求出场</th> | 18 | + <th style="width: 11%">请求出场</th> |
| 19 | </tr> | 19 | </tr> |
| 20 | </thead> | 20 | </thead> |
| 21 | <tbody> | 21 | <tbody> |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/jhlb.html
| @@ -106,7 +106,7 @@ | @@ -106,7 +106,7 @@ | ||
| 106 | 106 | ||
| 107 | <script> | 107 | <script> |
| 108 | (function() { | 108 | (function() { |
| 109 | - var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '路救', '其他']; | 109 | + var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '路救故障', '其他']; |
| 110 | var modal = '#schedule-jhlb-modal', | 110 | var modal = '#schedule-jhlb-modal', |
| 111 | sch; | 111 | sch; |
| 112 | $(modal).on('init', function(e, data) { | 112 | $(modal).on('init', function(e, data) { |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/temp_sch_v2/add_normal.html
0 → 100644
| 1 | +<!-- 临加班次form --> | ||
| 2 | +<script id="add_normal_sch-form-temp" type="text/html"> | ||
| 3 | + <form class="uk-form uk-form-horizontal add-sch-form"> | ||
| 4 | + <div class="uk-grid"> | ||
| 5 | + <div class="uk-width-1-2"> | ||
| 6 | + <div class="uk-form-row"> | ||
| 7 | + <label class="uk-form-label">班次类型</label> | ||
| 8 | + <div class="uk-form-controls"> | ||
| 9 | + <select class="form-control nt-dictionary" name="bcType" data-code="{{bcType}}" | ||
| 10 | + data-group=ScheduleType></select> | ||
| 11 | + </div> | ||
| 12 | + </div> | ||
| 13 | + </div> | ||
| 14 | + <div class="uk-width-1-2"> | ||
| 15 | + <div class="uk-form-row"> | ||
| 16 | + <label class="uk-form-label">上下行</label> | ||
| 17 | + <div class="uk-form-controls"> | ||
| 18 | + <select name="xlDir"> | ||
| 19 | + <option value="0">上行</option> | ||
| 20 | + <option value="1">下行</option> | ||
| 21 | + </select> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + </div> | ||
| 26 | + <div class="uk-grid"> | ||
| 27 | + <div class="uk-width-1-2"> | ||
| 28 | + <div class="uk-form-row"> | ||
| 29 | + <label class="uk-form-label">起点站</label> | ||
| 30 | + <div class="uk-form-controls"> | ||
| 31 | + <select name="qdzCode"> | ||
| 32 | + </select> | ||
| 33 | + </div> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + <div class="uk-width-1-2"> | ||
| 37 | + <div class="uk-form-row"> | ||
| 38 | + <label class="uk-form-label">终点站</label> | ||
| 39 | + <div class="uk-form-controls"> | ||
| 40 | + <select name="zdzCode"> | ||
| 41 | + </select> | ||
| 42 | + </div> | ||
| 43 | + </div> | ||
| 44 | + </div> | ||
| 45 | + </div> | ||
| 46 | + <div class="uk-grid"> | ||
| 47 | + <div class="uk-width-1-2"> | ||
| 48 | + <div class="uk-form-row"> | ||
| 49 | + <label class="uk-form-label">开始时间</label> | ||
| 50 | + <div class="uk-form-controls"> | ||
| 51 | + <input type="time" value="{{zdsjActual==null?zdsj:zdsjActual}}" name="fcsj" required> | ||
| 52 | + </div> | ||
| 53 | + </div> | ||
| 54 | + </div> | ||
| 55 | + <div class="uk-width-1-2"> | ||
| 56 | + <div class="uk-form-row"> | ||
| 57 | + <label class="uk-form-label">结束时间</label> | ||
| 58 | + <div class="uk-form-controls"> | ||
| 59 | + <input type="time" name="zdsj" required> | ||
| 60 | + </div> | ||
| 61 | + </div> | ||
| 62 | + </div> | ||
| 63 | + </div> | ||
| 64 | + <div class="uk-grid"> | ||
| 65 | + <div class="uk-width-1-2"> | ||
| 66 | + <div class="uk-form-row"> | ||
| 67 | + <label class="uk-form-label">车辆</label> | ||
| 68 | + <div class="uk-form-controls"> | ||
| 69 | + <div class="uk-autocomplete uk-form car-autocom"> | ||
| 70 | + <input type="text" value="{{clZbh}}" name="clZbh" required> | ||
| 71 | + </div> | ||
| 72 | + </div> | ||
| 73 | + </div> | ||
| 74 | + </div> | ||
| 75 | + <div class="uk-width-1-2"> | ||
| 76 | + <div class="uk-form-row"> | ||
| 77 | + <label class="uk-form-label">里程</label> | ||
| 78 | + <div class="uk-form-controls"> | ||
| 79 | + <input type="text" name="jhlc" value="{{jhlc}}" max=222 data-fv-lessthan-inclusive="false" | ||
| 80 | + required> | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + </div> | ||
| 84 | + </div> | ||
| 85 | + <div class="uk-grid"> | ||
| 86 | + <div class="uk-width-1-2"> | ||
| 87 | + <div class="uk-form-row"> | ||
| 88 | + <label class="uk-form-label">驾驶员</label> | ||
| 89 | + <div class="uk-form-controls"> | ||
| 90 | + <div class="uk-autocomplete uk-form jsy-autocom"> | ||
| 91 | + <input type="text" value="{{jGh}}/{{jName}}" name="jsy" required> | ||
| 92 | + </div> | ||
| 93 | + </div> | ||
| 94 | + </div> | ||
| 95 | + </div> | ||
| 96 | + <div class="uk-width-1-2"> | ||
| 97 | + <div class="uk-form-row"> | ||
| 98 | + <label class="uk-form-label">售票员</label> | ||
| 99 | + <div class="uk-form-controls"> | ||
| 100 | + <div class="uk-autocomplete uk-form spy-autocom"> | ||
| 101 | + <input type="text" name="spy" value="{{sGh}}/{{sName}}"> | ||
| 102 | + </div> | ||
| 103 | + </div> | ||
| 104 | + </div> | ||
| 105 | + </div> | ||
| 106 | + </div> | ||
| 107 | + <div class="uk-grid"> | ||
| 108 | + <div class="uk-width-1-2"> | ||
| 109 | + <div class="uk-form-row"> | ||
| 110 | + <label class="uk-form-label">路牌</label> | ||
| 111 | + <div class="uk-form-controls"> | ||
| 112 | + <input type="text" value="{{lpName}}" name="lpName" required> | ||
| 113 | + </div> | ||
| 114 | + </div> | ||
| 115 | + </div> | ||
| 116 | + </div> | ||
| 117 | + <div class="uk-grid"> | ||
| 118 | + <div class="uk-width-1-1"> | ||
| 119 | + <div class="uk-form-row"> | ||
| 120 | + <label class="uk-form-label">备注</label> | ||
| 121 | + <div class="uk-form-controls"> | ||
| 122 | + <div class="uk-autocomplete uk-form remarks-autocom"> | ||
| 123 | + <input type="text" name="remarks"> | ||
| 124 | + </div> | ||
| 125 | + </div> | ||
| 126 | + </div> | ||
| 127 | + </div> | ||
| 128 | + </div> | ||
| 129 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | ||
| 130 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 131 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存 | ||
| 132 | + </button> | ||
| 133 | + </div> | ||
| 134 | + </form> | ||
| 135 | +</script> | ||
| 136 | +<script> | ||
| 137 | + (function () { | ||
| 138 | + var wrap = '#schedule-addsch-modal .normalCont', sch, nf, submitFun; | ||
| 139 | + | ||
| 140 | + $(wrap).on('init', function (e, data) { | ||
| 141 | + e.stopPropagation(); | ||
| 142 | + sch = data.sch; | ||
| 143 | + submitFun = data.submitFun; | ||
| 144 | + | ||
| 145 | + nf = addForm(); | ||
| 146 | + //提交 | ||
| 147 | + nf.on('success.form.fv', function (e) { | ||
| 148 | + e.preventDefault(); | ||
| 149 | + | ||
| 150 | + disabled_submit_btn(nf); | ||
| 151 | + var data = nf.serializeJSON(); | ||
| 152 | + submitFun(data, function (rs) { | ||
| 153 | + //前端数据更新 | ||
| 154 | + gb_schedule_table.insertSchedule(rs.t, rs.ts); | ||
| 155 | + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: rs.t}); | ||
| 156 | + try { | ||
| 157 | + if(rs.t.bcType=='in' || rs.t.bcType=='out') | ||
| 158 | + gb_data_basic.reload_stat_park_data(); | ||
| 159 | + }catch (e){ | ||
| 160 | + console.log(e);} | ||
| 161 | + UIkit.modal('#schedule-addsch-modal').hide(); | ||
| 162 | + //更新路牌公里统计面板 | ||
| 163 | + gb_schedule_table.showLpMileageTipBySch(rs.t); | ||
| 164 | + }, function () { | ||
| 165 | + enable_submit_btn(nf); | ||
| 166 | + }); | ||
| 167 | + }); | ||
| 168 | + }); | ||
| 169 | + | ||
| 170 | + function addForm() { | ||
| 171 | + var htmlStr = template('add_normal_sch-form-temp', sch); | ||
| 172 | + var f = $(htmlStr); | ||
| 173 | + $(wrap).append(f); | ||
| 174 | + //字典转换 | ||
| 175 | + dictionaryUtils.transformDom($('.nt-dictionary', f)); | ||
| 176 | + //validation | ||
| 177 | + f.formValidation({framework: 'uikit', locale: 'zh_CN'}); | ||
| 178 | + //autocomp | ||
| 179 | + f.trigger('init-autoCom'); | ||
| 180 | + | ||
| 181 | + $f('bcType', f).trigger('change'); | ||
| 182 | + return f; | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | + function $f(name, f) { | ||
| 186 | + return $('[name=' + name + ']', f); | ||
| 187 | + } | ||
| 188 | + })(); | ||
| 189 | +</script> | ||
| 0 | \ No newline at end of file | 190 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/temp_sch_v2/add_park_to_park.html
0 → 100644
| 1 | +<!-- 临加场到场班次form --> | ||
| 2 | +<script id="add_park_to_park_sch-form-temp" type="text/html"> | ||
| 3 | + <form class="uk-form uk-form-horizontal"> | ||
| 4 | + <div class="uk-grid"> | ||
| 5 | + <div class="uk-width-1-2"> | ||
| 6 | + <div class="uk-form-row"> | ||
| 7 | + <label class="uk-form-label">班次类型</label> | ||
| 8 | + <div class="uk-form-controls"> | ||
| 9 | + <select class="form-control" name="bcType"> | ||
| 10 | + <option value="in">进场</option> | ||
| 11 | + </select> | ||
| 12 | + </div> | ||
| 13 | + </div> | ||
| 14 | + </div> | ||
| 15 | + <div class="uk-width-1-2"> | ||
| 16 | + <div class="uk-form-row"> | ||
| 17 | + <label class="uk-form-label">上下行</label> | ||
| 18 | + <div class="uk-form-controls"> | ||
| 19 | + <select name="xlDir"> | ||
| 20 | + <option value="0">上行</option> | ||
| 21 | + <option value="1">下行</option> | ||
| 22 | + </select> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + </div> | ||
| 26 | + </div> | ||
| 27 | + <div class="uk-grid"> | ||
| 28 | + <div class="uk-width-1-2"> | ||
| 29 | + <div class="uk-form-row"> | ||
| 30 | + <label class="uk-form-label">起点站</label> | ||
| 31 | + <div class="uk-form-controls"> | ||
| 32 | + <select name="qdzCode"> | ||
| 33 | + </select> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + </div> | ||
| 37 | + <div class="uk-width-1-2"> | ||
| 38 | + <div class="uk-form-row"> | ||
| 39 | + <label class="uk-form-label">终点站</label> | ||
| 40 | + <div class="uk-form-controls"> | ||
| 41 | + <select name="zdzCode"> | ||
| 42 | + </select> | ||
| 43 | + </div> | ||
| 44 | + </div> | ||
| 45 | + </div> | ||
| 46 | + </div> | ||
| 47 | + <div class="uk-grid"> | ||
| 48 | + <div class="uk-width-1-2"> | ||
| 49 | + <div class="uk-form-row"> | ||
| 50 | + <label class="uk-form-label">开始时间</label> | ||
| 51 | + <div class="uk-form-controls"> | ||
| 52 | + <input type="time" value="{{zdsjActual==null?zdsj:zdsjActual}}" name="fcsj" required> | ||
| 53 | + </div> | ||
| 54 | + </div> | ||
| 55 | + </div> | ||
| 56 | + <div class="uk-width-1-2"> | ||
| 57 | + <div class="uk-form-row"> | ||
| 58 | + <label class="uk-form-label">结束时间</label> | ||
| 59 | + <div class="uk-form-controls"> | ||
| 60 | + <input type="time" name="zdsj" required> | ||
| 61 | + </div> | ||
| 62 | + </div> | ||
| 63 | + </div> | ||
| 64 | + </div> | ||
| 65 | + <div class="uk-grid"> | ||
| 66 | + <div class="uk-width-1-2"> | ||
| 67 | + <div class="uk-form-row"> | ||
| 68 | + <label class="uk-form-label">车辆</label> | ||
| 69 | + <div class="uk-form-controls"> | ||
| 70 | + <div class="uk-autocomplete uk-form car-autocom"> | ||
| 71 | + <input type="text" value="{{clZbh}}" name="clZbh" required> | ||
| 72 | + </div> | ||
| 73 | + </div> | ||
| 74 | + </div> | ||
| 75 | + </div> | ||
| 76 | + <div class="uk-width-1-2"> | ||
| 77 | + <div class="uk-form-row"> | ||
| 78 | + <label class="uk-form-label">里程</label> | ||
| 79 | + <div class="uk-form-controls"> | ||
| 80 | + <input type="text" name="jhlc" value="{{jhlc}}" max=222 data-fv-lessthan-inclusive="false" | ||
| 81 | + required> | ||
| 82 | + </div> | ||
| 83 | + </div> | ||
| 84 | + </div> | ||
| 85 | + </div> | ||
| 86 | + <div class="uk-grid"> | ||
| 87 | + <div class="uk-width-1-2"> | ||
| 88 | + <div class="uk-form-row"> | ||
| 89 | + <label class="uk-form-label">驾驶员</label> | ||
| 90 | + <div class="uk-form-controls"> | ||
| 91 | + <div class="uk-autocomplete uk-form jsy-autocom"> | ||
| 92 | + <input type="text" value="{{jGh}}/{{jName}}" name="jsy" required> | ||
| 93 | + </div> | ||
| 94 | + </div> | ||
| 95 | + </div> | ||
| 96 | + </div> | ||
| 97 | + <div class="uk-width-1-2"> | ||
| 98 | + <div class="uk-form-row"> | ||
| 99 | + <label class="uk-form-label">售票员</label> | ||
| 100 | + <div class="uk-form-controls"> | ||
| 101 | + <div class="uk-autocomplete uk-form spy-autocom"> | ||
| 102 | + <input type="text" name="spy" value="{{sGh}}/{{sName}}"> | ||
| 103 | + </div> | ||
| 104 | + </div> | ||
| 105 | + </div> | ||
| 106 | + </div> | ||
| 107 | + </div> | ||
| 108 | + <div class="uk-grid"> | ||
| 109 | + <div class="uk-width-1-2"> | ||
| 110 | + <div class="uk-form-row"> | ||
| 111 | + <label class="uk-form-label">路牌</label> | ||
| 112 | + <div class="uk-form-controls"> | ||
| 113 | + <input type="text" value="{{lpName}}" name="lpName" required> | ||
| 114 | + </div> | ||
| 115 | + </div> | ||
| 116 | + </div> | ||
| 117 | + </div> | ||
| 118 | + <div class="uk-grid"> | ||
| 119 | + <div class="uk-width-1-1"> | ||
| 120 | + <div class="uk-form-row"> | ||
| 121 | + <label class="uk-form-label">备注</label> | ||
| 122 | + <div class="uk-form-controls"> | ||
| 123 | + <div class="uk-autocomplete uk-form remarks-autocom"> | ||
| 124 | + <input type="text" name="remarks"> | ||
| 125 | + </div> | ||
| 126 | + </div> | ||
| 127 | + </div> | ||
| 128 | + </div> | ||
| 129 | + </div> | ||
| 130 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | ||
| 131 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 132 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存 | ||
| 133 | + </button> | ||
| 134 | + </div> | ||
| 135 | + </form> | ||
| 136 | +</script> | ||
| 137 | + | ||
| 138 | +<script> | ||
| 139 | + (function () { | ||
| 140 | + var wrap = '#schedule-addsch-modal .parkToParkCont', sch, nf, submitFun,parks,carsArray; | ||
| 141 | + | ||
| 142 | + $(wrap).on('init', function (e, data) { | ||
| 143 | + e.stopPropagation(); | ||
| 144 | + sch = data.sch; | ||
| 145 | + submitFun = data.submitFun; | ||
| 146 | + parks = data.parks; | ||
| 147 | + carsArray = data.carsArray; | ||
| 148 | + | ||
| 149 | + nf = addForm(); | ||
| 150 | + //提交 | ||
| 151 | + nf.on('success.form.fv', function (e) { | ||
| 152 | + e.preventDefault(); | ||
| 153 | + | ||
| 154 | + disabled_submit_btn(nf); | ||
| 155 | + var data = nf.serializeJSON(); | ||
| 156 | + submitFun(data, function (rs) { | ||
| 157 | + //前端数据更新 | ||
| 158 | + gb_schedule_table.insertSchedule(rs.t, rs.ts); | ||
| 159 | + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: rs.t}); | ||
| 160 | + try { | ||
| 161 | + if(rs.t.bcType=='in' || rs.t.bcType=='out') | ||
| 162 | + gb_data_basic.reload_stat_park_data(); | ||
| 163 | + }catch (e){ | ||
| 164 | + console.log(e);} | ||
| 165 | + UIkit.modal('#schedule-addsch-modal').hide(); | ||
| 166 | + //更新路牌公里统计面板 | ||
| 167 | + gb_schedule_table.showLpMileageTipBySch(rs.t); | ||
| 168 | + }, function () { | ||
| 169 | + enable_submit_btn(nf); | ||
| 170 | + }); | ||
| 171 | + }); | ||
| 172 | + $f('zdzCode',nf).trigger('change'); | ||
| 173 | + }); | ||
| 174 | + | ||
| 175 | + function addForm() { | ||
| 176 | + var htmlStr = template('add_park_to_park_sch-form-temp', sch); | ||
| 177 | + var f = $(htmlStr); | ||
| 178 | + $(wrap).append(f); | ||
| 179 | + //字典转换 | ||
| 180 | + dictionaryUtils.transformDom($('.nt-dictionary', f)); | ||
| 181 | + //validation | ||
| 182 | + f.formValidation({framework: 'uikit', locale: 'zh_CN'}); | ||
| 183 | + //autocomp | ||
| 184 | + initAutoComp(f); | ||
| 185 | + | ||
| 186 | + //起终点都是停车场 | ||
| 187 | + var park_opts; | ||
| 188 | + for(var i=0,p;p=parks[i++];) | ||
| 189 | + park_opts += '<option value="' + p.code + '">' + p.name + '</option>'; | ||
| 190 | + $f('qdzCode', f).html(park_opts); | ||
| 191 | + $f('zdzCode', f).html(park_opts); | ||
| 192 | + | ||
| 193 | + if(sch.bcType=='in'){ | ||
| 194 | + $f('qdzCode', f).val(sch.zdzCode); | ||
| 195 | + //选中的也是场到场班次 | ||
| 196 | + if(gb_data_basic.getCarparkByCode(sch.qdzCode) != null){ | ||
| 197 | + //默认做返程 | ||
| 198 | + $f('zdzCode', f).val(sch.qdzCode); | ||
| 199 | + $f('remarks', f).val(sch.remarks); | ||
| 200 | + $f('jhlc', f).val(sch.jhlc); | ||
| 201 | + //时间 | ||
| 202 | + var zdsj = moment(sch.zdsj, 'HH:mm').add('minutes', sch.bcsj).format('HH:mm'); | ||
| 203 | + $f('zdsj', f).val(zdsj); | ||
| 204 | + } | ||
| 205 | + } | ||
| 206 | + return f; | ||
| 207 | + } | ||
| 208 | + | ||
| 209 | + function $f(name, f) { | ||
| 210 | + return $('[name=' + name + ']', f); | ||
| 211 | + } | ||
| 212 | + | ||
| 213 | + function initAutoComp(f) { | ||
| 214 | + //车辆 | ||
| 215 | + if(carsArray) | ||
| 216 | + gb_common.carAutocomplete($('.car-autocom', f), carsArray); | ||
| 217 | + //驾驶员 | ||
| 218 | + gb_common.personAutocomplete($('.jsy-autocom', f)); | ||
| 219 | + //售票员 | ||
| 220 | + gb_common.personAutocomplete($('.spy-autocom', f)); | ||
| 221 | + //备注补全 | ||
| 222 | + gb_common.remarksAutocomplete($('.remarks-autocom', f)); | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + })(); | ||
| 226 | +</script> | ||
| 0 | \ No newline at end of file | 227 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/temp_sch_v2/add_two_way.html
0 → 100644
| 1 | +<!-- 线路上往返临加班次 --> | ||
| 2 | +<script id="add_toAndFro_sch-form-temp" type="text/html"> | ||
| 3 | + <form class="uk-form uk-form-horizontal add-sch-form one_form"> | ||
| 4 | + <div class="uk-grid"> | ||
| 5 | + <div class="uk-width-1-2"> | ||
| 6 | + <div class="uk-form-row"> | ||
| 7 | + <label class="uk-form-label">班次类型</label> | ||
| 8 | + <div class="uk-form-controls"> | ||
| 9 | + <select class="form-control nt-dictionary" name="bcType" data-code="{{bcType}}" | ||
| 10 | + data-group=ScheduleType></select> | ||
| 11 | + </div> | ||
| 12 | + </div> | ||
| 13 | + </div> | ||
| 14 | + <div class="uk-width-1-2"> | ||
| 15 | + <div class="uk-form-row"> | ||
| 16 | + <label class="uk-form-label">上下行</label> | ||
| 17 | + <div class="uk-form-controls"> | ||
| 18 | + <select name="xlDir"> | ||
| 19 | + <option value="0">上行</option> | ||
| 20 | + <option value="1">下行</option> | ||
| 21 | + </select> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + </div> | ||
| 26 | + <div class="uk-grid"> | ||
| 27 | + <div class="uk-width-1-2"> | ||
| 28 | + <div class="uk-form-row"> | ||
| 29 | + <label class="uk-form-label">起点站</label> | ||
| 30 | + <div class="uk-form-controls"> | ||
| 31 | + <select name="qdzCode" > | ||
| 32 | + </select> | ||
| 33 | + </div> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + <div class="uk-width-1-2"> | ||
| 37 | + <div class="uk-form-row"> | ||
| 38 | + <label class="uk-form-label">终点站</label> | ||
| 39 | + <div class="uk-form-controls"> | ||
| 40 | + <select name="zdzCode" > | ||
| 41 | + </select> | ||
| 42 | + </div> | ||
| 43 | + </div> | ||
| 44 | + </div> | ||
| 45 | + </div> | ||
| 46 | + <div class="uk-grid"> | ||
| 47 | + <div class="uk-width-1-2"> | ||
| 48 | + <div class="uk-form-row"> | ||
| 49 | + <label class="uk-form-label">开始时间</label> | ||
| 50 | + <div class="uk-form-controls"> | ||
| 51 | + <input type="time" value="{{zdsj}}" name="fcsj" required> | ||
| 52 | + </div> | ||
| 53 | + </div> | ||
| 54 | + </div> | ||
| 55 | + <div class="uk-width-1-2"> | ||
| 56 | + <div class="uk-form-row"> | ||
| 57 | + <label class="uk-form-label">结束时间</label> | ||
| 58 | + <div class="uk-form-controls"> | ||
| 59 | + <input type="time" name="zdsj" required> | ||
| 60 | + </div> | ||
| 61 | + </div> | ||
| 62 | + </div> | ||
| 63 | + </div> | ||
| 64 | + <div class="uk-grid"> | ||
| 65 | + <div class="uk-width-1-2"> | ||
| 66 | + <div class="uk-form-row"> | ||
| 67 | + <label class="uk-form-label">车辆</label> | ||
| 68 | + <div class="uk-form-controls"> | ||
| 69 | + <div class="uk-autocomplete uk-form car-autocom"> | ||
| 70 | + <input type="text" value="{{clZbh}}" name="clZbh" required> | ||
| 71 | + </div> | ||
| 72 | + </div> | ||
| 73 | + </div> | ||
| 74 | + </div> | ||
| 75 | + <div class="uk-width-1-2"> | ||
| 76 | + <div class="uk-form-row"> | ||
| 77 | + <label class="uk-form-label">里程</label> | ||
| 78 | + <div class="uk-form-controls"> | ||
| 79 | + <input type="text" name="jhlc" value="{{jhlc}}" max=222 data-fv-lessthan-inclusive="false" | ||
| 80 | + required> | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + </div> | ||
| 84 | + </div> | ||
| 85 | + <div class="uk-grid"> | ||
| 86 | + <div class="uk-width-1-2"> | ||
| 87 | + <div class="uk-form-row"> | ||
| 88 | + <label class="uk-form-label">驾驶员</label> | ||
| 89 | + <div class="uk-form-controls"> | ||
| 90 | + <div class="uk-autocomplete uk-form jsy-autocom"> | ||
| 91 | + <input type="text" value="{{jGh}}/{{jName}}" name="jsy" required> | ||
| 92 | + </div> | ||
| 93 | + </div> | ||
| 94 | + </div> | ||
| 95 | + </div> | ||
| 96 | + <div class="uk-width-1-2"> | ||
| 97 | + <div class="uk-form-row"> | ||
| 98 | + <label class="uk-form-label">售票员</label> | ||
| 99 | + <div class="uk-form-controls"> | ||
| 100 | + <div class="uk-autocomplete uk-form spy-autocom"> | ||
| 101 | + <input type="text" name="spy" value="{{sGh}}/{{sName}}"> | ||
| 102 | + </div> | ||
| 103 | + </div> | ||
| 104 | + </div> | ||
| 105 | + </div> | ||
| 106 | + </div> | ||
| 107 | + <div class="uk-grid"> | ||
| 108 | + <div class="uk-width-1-2"> | ||
| 109 | + <div class="uk-form-row"> | ||
| 110 | + <label class="uk-form-label">路牌</label> | ||
| 111 | + <div class="uk-form-controls"> | ||
| 112 | + <input type="text" value="{{lpName}}" name="lpName" required> | ||
| 113 | + </div> | ||
| 114 | + </div> | ||
| 115 | + </div> | ||
| 116 | + </div> | ||
| 117 | + <div class="uk-grid"> | ||
| 118 | + <div class="uk-width-1-1"> | ||
| 119 | + <div class="uk-form-row"> | ||
| 120 | + <label class="uk-form-label">备注</label> | ||
| 121 | + <div class="uk-form-controls"> | ||
| 122 | + <div class="uk-autocomplete uk-form remarks-autocom"> | ||
| 123 | + <input type="text" name="remarks"> | ||
| 124 | + </div> | ||
| 125 | + </div> | ||
| 126 | + </div> | ||
| 127 | + </div> | ||
| 128 | + </div> | ||
| 129 | + </form> | ||
| 130 | + <hr style="margin-top: 35px;"> | ||
| 131 | + <form class="uk-form uk-form-horizontal add-sch-form two_form"> | ||
| 132 | + <div class="uk-grid"> | ||
| 133 | + <div class="uk-width-1-2"> | ||
| 134 | + <div class="uk-form-row"> | ||
| 135 | + <label class="uk-form-label">班次类型</label> | ||
| 136 | + <div class="uk-form-controls"> | ||
| 137 | + <select class="form-control nt-dictionary" name="bcType" data-code="{{bcType}}" | ||
| 138 | + data-group=ScheduleType></select> | ||
| 139 | + </div> | ||
| 140 | + </div> | ||
| 141 | + </div> | ||
| 142 | + <div class="uk-width-1-2"> | ||
| 143 | + <div class="uk-form-row"> | ||
| 144 | + <label class="uk-form-label">上下行</label> | ||
| 145 | + <div class="uk-form-controls"> | ||
| 146 | + <select name="xlDir"> | ||
| 147 | + <option value="0">上行</option> | ||
| 148 | + <option value="1">下行</option> | ||
| 149 | + </select> | ||
| 150 | + </div> | ||
| 151 | + </div> | ||
| 152 | + </div> | ||
| 153 | + </div> | ||
| 154 | + <div class="uk-grid"> | ||
| 155 | + <div class="uk-width-1-2"> | ||
| 156 | + <div class="uk-form-row"> | ||
| 157 | + <label class="uk-form-label">起点站</label> | ||
| 158 | + <div class="uk-form-controls"> | ||
| 159 | + <select name="qdzCode" > | ||
| 160 | + </select> | ||
| 161 | + </div> | ||
| 162 | + </div> | ||
| 163 | + </div> | ||
| 164 | + <div class="uk-width-1-2"> | ||
| 165 | + <div class="uk-form-row"> | ||
| 166 | + <label class="uk-form-label">终点站</label> | ||
| 167 | + <div class="uk-form-controls"> | ||
| 168 | + <select name="zdzCode" > | ||
| 169 | + </select> | ||
| 170 | + </div> | ||
| 171 | + </div> | ||
| 172 | + </div> | ||
| 173 | + </div> | ||
| 174 | + <div class="uk-grid"> | ||
| 175 | + <div class="uk-width-1-2"> | ||
| 176 | + <div class="uk-form-row"> | ||
| 177 | + <label class="uk-form-label">开始时间</label> | ||
| 178 | + <div class="uk-form-controls"> | ||
| 179 | + <input type="time" value="{{zdsj}}" name="fcsj" required> | ||
| 180 | + </div> | ||
| 181 | + </div> | ||
| 182 | + </div> | ||
| 183 | + <div class="uk-width-1-2"> | ||
| 184 | + <div class="uk-form-row"> | ||
| 185 | + <label class="uk-form-label">结束时间</label> | ||
| 186 | + <div class="uk-form-controls"> | ||
| 187 | + <input type="time" name="zdsj" required> | ||
| 188 | + </div> | ||
| 189 | + </div> | ||
| 190 | + </div> | ||
| 191 | + </div> | ||
| 192 | + <div class="uk-grid"> | ||
| 193 | + <div class="uk-width-1-2"> | ||
| 194 | + <div class="uk-form-row"> | ||
| 195 | + <label class="uk-form-label">车辆</label> | ||
| 196 | + <div class="uk-form-controls"> | ||
| 197 | + <div class="uk-autocomplete uk-form car-autocom"> | ||
| 198 | + <input type="text" value="{{clZbh}}" name="clZbh" required> | ||
| 199 | + </div> | ||
| 200 | + </div> | ||
| 201 | + </div> | ||
| 202 | + </div> | ||
| 203 | + <div class="uk-width-1-2"> | ||
| 204 | + <div class="uk-form-row"> | ||
| 205 | + <label class="uk-form-label">里程</label> | ||
| 206 | + <div class="uk-form-controls"> | ||
| 207 | + <input type="text" name="jhlc" value="{{jhlc}}" max=222 data-fv-lessthan-inclusive="false" | ||
| 208 | + required> | ||
| 209 | + </div> | ||
| 210 | + </div> | ||
| 211 | + </div> | ||
| 212 | + </div> | ||
| 213 | + <div class="uk-grid"> | ||
| 214 | + <div class="uk-width-1-2"> | ||
| 215 | + <div class="uk-form-row"> | ||
| 216 | + <label class="uk-form-label">驾驶员</label> | ||
| 217 | + <div class="uk-form-controls"> | ||
| 218 | + <div class="uk-autocomplete uk-form jsy-autocom"> | ||
| 219 | + <input type="text" value="{{jGh}}/{{jName}}" name="jsy" required> | ||
| 220 | + </div> | ||
| 221 | + </div> | ||
| 222 | + </div> | ||
| 223 | + </div> | ||
| 224 | + <div class="uk-width-1-2"> | ||
| 225 | + <div class="uk-form-row"> | ||
| 226 | + <label class="uk-form-label">售票员</label> | ||
| 227 | + <div class="uk-form-controls"> | ||
| 228 | + <div class="uk-autocomplete uk-form spy-autocom"> | ||
| 229 | + <input type="text" name="spy" value="{{sGh}}/{{sName}}"> | ||
| 230 | + </div> | ||
| 231 | + </div> | ||
| 232 | + </div> | ||
| 233 | + </div> | ||
| 234 | + </div> | ||
| 235 | + <div class="uk-grid"> | ||
| 236 | + <div class="uk-width-1-2"> | ||
| 237 | + <div class="uk-form-row"> | ||
| 238 | + <label class="uk-form-label">路牌</label> | ||
| 239 | + <div class="uk-form-controls"> | ||
| 240 | + <input type="text" value="{{lpName}}" name="lpName" required> | ||
| 241 | + </div> | ||
| 242 | + </div> | ||
| 243 | + </div> | ||
| 244 | + </div> | ||
| 245 | + <div class="uk-grid"> | ||
| 246 | + <div class="uk-width-1-1"> | ||
| 247 | + <div class="uk-form-row"> | ||
| 248 | + <label class="uk-form-label">备注</label> | ||
| 249 | + <div class="uk-form-controls"> | ||
| 250 | + <div class="uk-autocomplete uk-form remarks-autocom"> | ||
| 251 | + <input type="text" name="remarks"> | ||
| 252 | + </div> | ||
| 253 | + </div> | ||
| 254 | + </div> | ||
| 255 | + </div> | ||
| 256 | + </div> | ||
| 257 | + </form> | ||
| 258 | + | ||
| 259 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | ||
| 260 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 261 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | ||
| 262 | + </div> | ||
| 263 | +</script> | ||
| 264 | + | ||
| 265 | +<script> | ||
| 266 | + (function () { | ||
| 267 | + var wrap = '#schedule-addsch-modal .toAndFroCont', sch, f1, f2, submitFun, stationRoutes; | ||
| 268 | + | ||
| 269 | + $(wrap).on('init', function (e, data) { | ||
| 270 | + e.stopPropagation(); | ||
| 271 | + sch = data.sch; | ||
| 272 | + submitFun = data.submitFun; | ||
| 273 | + stationRoutes = data.stationRoutes; | ||
| 274 | + | ||
| 275 | + var htmlStr = template('add_toAndFro_sch-form-temp', sch); | ||
| 276 | + $(wrap).append(htmlStr); | ||
| 277 | + //字典转换 | ||
| 278 | + dictionaryUtils.transformDom($('.nt-dictionary', wrap)); | ||
| 279 | + //validation | ||
| 280 | + $('.add-sch-form', wrap).formValidation({framework: 'uikit', locale: 'zh_CN'}).trigger('init-autoCom'); | ||
| 281 | + $('.add-sch-form [name=bcType]', wrap).trigger('change'); | ||
| 282 | + | ||
| 283 | + f1 = $('.add-sch-form.one_form', wrap); | ||
| 284 | + f2 = $('.add-sch-form.two_form', wrap); | ||
| 285 | + | ||
| 286 | + //默认1备注同步到2 | ||
| 287 | + $f('remarks', f1).on('input', function () { | ||
| 288 | + $f('remarks', f2).val($(this).val()); | ||
| 289 | + }); | ||
| 290 | + //默认1备注同步到2 | ||
| 291 | + $('.remarks-autocom', f1).on('selectitem.uk.autocomplete', function (e, data, acobject) { | ||
| 292 | + $f('remarks', f2).val(data.value); | ||
| 293 | + }); | ||
| 294 | + | ||
| 295 | + //人车级联 | ||
| 296 | + $f('clZbh',f1).on('input change', function () { | ||
| 297 | + $f('clZbh', f2).val($(this).val()); | ||
| 298 | + }); | ||
| 299 | + $f('jsy',f1).on('input change', function () { | ||
| 300 | + $f('jsy', f2).val($(this).val()); | ||
| 301 | + }); | ||
| 302 | + $f('spy',f1).on('input change', function () { | ||
| 303 | + $f('spy', f2).val($(this).val()); | ||
| 304 | + }); | ||
| 305 | + $f('lpName',f1).on('input change', function () { | ||
| 306 | + $f('lpName', f2).val($(this).val()); | ||
| 307 | + }); | ||
| 308 | + //表单同步 | ||
| 309 | + $(f1).on('ct_callback', synchroFormData).trigger('ct_callback'); | ||
| 310 | + //修改1结束时间 | ||
| 311 | + $f('zdsj',f1).on('input', synchroFormData); | ||
| 312 | + | ||
| 313 | + //表单校验提交相关 | ||
| 314 | + var dataArray; | ||
| 315 | + var fs = $('.add-sch-form', wrap); | ||
| 316 | + fs.on('success.form.fv', function (e) { | ||
| 317 | + e.preventDefault(); | ||
| 318 | + dataArray.push($(this).serializeJSON()); | ||
| 319 | + $(this).data('valid', true); | ||
| 320 | + if (allValidSuccess()) { | ||
| 321 | + //开始post | ||
| 322 | + var i = 0; | ||
| 323 | + var inArr = []; | ||
| 324 | + var upArr = []; | ||
| 325 | + (function () { | ||
| 326 | + var f = arguments.callee; | ||
| 327 | + if (i >= dataArray.length) { | ||
| 328 | + //前端数据更新 | ||
| 329 | + var last = inArr.pop(); | ||
| 330 | + gb_schedule_table.insertSchedule(last, upArr); | ||
| 331 | + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: last}); | ||
| 332 | + | ||
| 333 | + try { | ||
| 334 | + if(last.bcType=='in' || last.bcType=='out') | ||
| 335 | + gb_data_basic.reload_stat_park_data(); | ||
| 336 | + }catch (e){ | ||
| 337 | + console.log(e);} | ||
| 338 | + UIkit.modal('#schedule-addsch-modal').hide(); | ||
| 339 | + //更新路牌公里统计面板 | ||
| 340 | + gb_schedule_table.showLpMileageTipBySch(last); | ||
| 341 | + return; | ||
| 342 | + } | ||
| 343 | + submitFun(dataArray[i], function (rs) { | ||
| 344 | + inArr.push(rs.t); | ||
| 345 | + upArr = upArr.concat(rs.ts); | ||
| 346 | + upArr.push(rs.t); | ||
| 347 | + i++; | ||
| 348 | + f(); | ||
| 349 | + }, function () { | ||
| 350 | + $('[type=submit]', wrap).removeClass('disabled').removeAttr('disabled'); | ||
| 351 | + }); | ||
| 352 | + })(); | ||
| 353 | + } | ||
| 354 | + }); | ||
| 355 | + //提交 | ||
| 356 | + $('[type=submit]', wrap).on('click', function () { | ||
| 357 | + $(this).addClass('disabled').attr('disabled', 'disabled'); | ||
| 358 | + dataArray = []; | ||
| 359 | + fs.data('valid', false); | ||
| 360 | + fs.formValidation('validate'); | ||
| 361 | + }); | ||
| 362 | + }); | ||
| 363 | + | ||
| 364 | + function $f(name, f) { | ||
| 365 | + return $('[name=' + name + ']', f); | ||
| 366 | + } | ||
| 367 | + | ||
| 368 | + function allValidSuccess() { | ||
| 369 | + var flag = true; | ||
| 370 | + $('form.add-sch-form:visible', wrap).each(function (i, f) { | ||
| 371 | + if (!$(f).data('valid')) { | ||
| 372 | + flag = false; | ||
| 373 | + return false; | ||
| 374 | + } | ||
| 375 | + }); | ||
| 376 | + return flag; | ||
| 377 | + } | ||
| 378 | + | ||
| 379 | + /** | ||
| 380 | + * 同步2个表单的数据 | ||
| 381 | + */ | ||
| 382 | + var bcTypes = {'normal': 'normal', 'region': 'region', 'out': 'in', 'in': 'out'}; | ||
| 383 | + var synchroFormData = function () { | ||
| 384 | + //同步班次类型 | ||
| 385 | + var type = $f('bcType', f1).val(); | ||
| 386 | + if (bcTypes[type]) | ||
| 387 | + $f('bcType', f2).val(bcTypes[type]).trigger('change'); | ||
| 388 | + var updown = $f('xlDir', f1).val(); | ||
| 389 | + | ||
| 390 | + //1 结束时间 = 2 开始时间 | ||
| 391 | + $f('fcsj', f2).val($f('zdsj', f1).val()); | ||
| 392 | + if (type != 'out' && type != 'in') { | ||
| 393 | + //走向 | ||
| 394 | + $f('xlDir', f2).val(updown == 0 ? 1 : 0).trigger('change'); | ||
| 395 | + | ||
| 396 | + //第一个表单终点 = 第二个起点 | ||
| 397 | + var oneZdName = $('[name=zdzCode] option:selected', f1).text(); | ||
| 398 | + $f('qdzCode', f2).val(searchParallelStation(oneZdName, updown == 0 ? 1 : 0)); | ||
| 399 | + //第一个表单起点 = 第二个终点 | ||
| 400 | + var oneQdName = $('[name=qdzCode] option:selected', f1).text(); | ||
| 401 | + $f('zdzCode', f2).val(searchParallelStation(oneQdName, updown == 0 ? 1 : 0)).trigger('change'); | ||
| 402 | + } | ||
| 403 | + else { | ||
| 404 | + //进出场走向相同 | ||
| 405 | + $f('xlDir', f2).val(updown).trigger('change'); | ||
| 406 | + //第一个表单终点 = 第二个起点 | ||
| 407 | + $f('qdzCode', f2).val($f('zdzCode', f1).val()); | ||
| 408 | + //第一个表单起点 = 第二个终点 | ||
| 409 | + $f('zdzCode', f2).val($f('qdzCode', f1).val()).trigger('change'); | ||
| 410 | + } | ||
| 411 | + | ||
| 412 | + }; | ||
| 413 | + | ||
| 414 | + | ||
| 415 | + //返回另一个走向对应的站点 | ||
| 416 | + function searchParallelStation(stationName, updown) { | ||
| 417 | + var routes = stationRoutes[updown] | ||
| 418 | + , len = routes.length; | ||
| 419 | + | ||
| 420 | + for (var i = 0; i < len; i++) { | ||
| 421 | + if (routes[i].stationName == stationName) | ||
| 422 | + return routes[i].stationCode; | ||
| 423 | + } | ||
| 424 | + } | ||
| 425 | + })(); | ||
| 426 | +</script> | ||
| 0 | \ No newline at end of file | 427 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/temp_sch_v2/main.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal ct_move_modal" id="schedule-addsch-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 800px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>新增临加班次</h2></div> | ||
| 6 | + | ||
| 7 | + <div class="uk-grid"> | ||
| 8 | + <div class="uk-width-1-4"> | ||
| 9 | + <ul data-uk-switcher="{connect:'#tempScheduleContent'}" class="uk-nav uk-nav-side left_tabs_lg"> | ||
| 10 | + <li data-handle="normal"><a>1、临加班次</a></li> | ||
| 11 | + <li data-handle="toAndFro"><a>2、往返</a></li> | ||
| 12 | + <li data-handle="parkToPark"><a>3、场到场</a></li> | ||
| 13 | + </ul> | ||
| 14 | + </div> | ||
| 15 | + <div class="uk-width-3-4"> | ||
| 16 | + <ul id="tempScheduleContent" class="uk-switcher"> | ||
| 17 | + <li class="normalCont"></li> | ||
| 18 | + <li class="toAndFroCont"></li> | ||
| 19 | + <li class="parkToParkCont"></li> | ||
| 20 | + </ul> | ||
| 21 | + </div> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + | ||
| 25 | + <script> | ||
| 26 | + (function () { | ||
| 27 | + var modal = '#schedule-addsch-modal', | ||
| 28 | + sch, stationRoutes, parks, information, carsArray, st_park_data; | ||
| 29 | + | ||
| 30 | + $(modal).on('init', function (e, data) { | ||
| 31 | + e.stopPropagation(); | ||
| 32 | + sch = data.sch; | ||
| 33 | + //站到场数据 | ||
| 34 | + st_park_data = gb_data_basic.get_stat_park_data()[sch.xlBm]; | ||
| 35 | + //站点路由 | ||
| 36 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) { | ||
| 37 | + return a.stationRouteCode - b.stationRouteCode; | ||
| 38 | + }), 'directions'); | ||
| 39 | + //停车场 | ||
| 40 | + parks = gb_data_basic.simpleParksArray(); | ||
| 41 | + //线路标准 | ||
| 42 | + information = gb_data_basic.getLineInformation(sch.xlBm); | ||
| 43 | + //停车场排序,常用的放前面 | ||
| 44 | + parks = sort_parks(parks, information, st_park_data); | ||
| 45 | + //车辆信息 | ||
| 46 | + carsArray = gb_data_basic.carsArray(); | ||
| 47 | + | ||
| 48 | + var st_doms = gb_schedule_context_menu.get_add_sch_doms_v2(); | ||
| 49 | + //normal | ||
| 50 | + $('.normalCont', modal).html(st_doms.normal_dom) | ||
| 51 | + .trigger('init', {sch: sch, submitFun: submit_temp_schedule_form}); | ||
| 52 | + | ||
| 53 | + //to and fro | ||
| 54 | + $('.toAndFroCont', modal).html(st_doms.two_way_dom) | ||
| 55 | + .trigger('init', {sch: sch, submitFun: submit_temp_schedule_form, stationRoutes: stationRoutes}); | ||
| 56 | + | ||
| 57 | + //park to park | ||
| 58 | + $('.parkToParkCont', modal).html(st_doms.park_to_park_dom) | ||
| 59 | + .trigger('init', {sch: sch, submitFun: submit_temp_schedule_form, parks: parks, carsArray: carsArray}); | ||
| 60 | + }); | ||
| 61 | + | ||
| 62 | + //init-autoCom | ||
| 63 | + $(modal).on('init-autoCom', '.add-sch-form', function () { | ||
| 64 | + //车辆 | ||
| 65 | + if(carsArray) | ||
| 66 | + gb_common.carAutocomplete($('.car-autocom', this), carsArray); | ||
| 67 | + //驾驶员 | ||
| 68 | + gb_common.personAutocomplete($('.jsy-autocom', this)); | ||
| 69 | + //售票员 | ||
| 70 | + gb_common.personAutocomplete($('.spy-autocom', this)); | ||
| 71 | + //备注补全 | ||
| 72 | + gb_common.remarksAutocomplete($('.remarks-autocom', this)); | ||
| 73 | + }); | ||
| 74 | + | ||
| 75 | + //班次类型 和 上下行 切换事件 | ||
| 76 | + $(modal).on('change', '.add-sch-form [name=bcType],.add-sch-form [name=xlDir]', reCalcInputs_type); | ||
| 77 | + //起终点站改变事件 | ||
| 78 | + $(modal).on('change', '[name=qdzCode],[name=zdzCode]', reCalcInputs_station); | ||
| 79 | + //开始时间和公里改变 | ||
| 80 | + $(modal).on('input', '.add-sch-form [name=fcsj],.add-sch-form [name=jhlc]', reCalcEndTime); | ||
| 81 | + | ||
| 82 | + | ||
| 83 | + function reCalcInputs_type() { | ||
| 84 | + var f = $(this).parents('.add-sch-form'); | ||
| 85 | + var bcType_e = $('[name=bcType]', f) | ||
| 86 | + , xlDir_e = $('[name=xlDir]', f); | ||
| 87 | + | ||
| 88 | + var routes = stationRoutes[xlDir_e.val()] | ||
| 89 | + , lastCode = routes[routes.length - 1].stationCode | ||
| 90 | + , opts = '', park_opts = ''; | ||
| 91 | + //station options | ||
| 92 | + $.each(routes, function () { | ||
| 93 | + opts += '<option value="' + this.stationCode + '">' + this.stationName + '</option>' | ||
| 94 | + }); | ||
| 95 | + //park options | ||
| 96 | + for(var i=0,p;p=parks[i++];) | ||
| 97 | + park_opts += '<option value="' + p.code + '">' + p.name + '</option>'; | ||
| 98 | + | ||
| 99 | + var qdz = $('[name=qdzCode]', f), zdz = $('[name=zdzCode]', f); | ||
| 100 | + //var time, mileage; | ||
| 101 | + switch (bcType_e.val()) { | ||
| 102 | + case 'out': | ||
| 103 | + qdz.html(park_opts).val(information.carPark); | ||
| 104 | + zdz.html(opts); | ||
| 105 | + break; | ||
| 106 | + case 'in': | ||
| 107 | + qdz.html(opts); | ||
| 108 | + zdz.html(park_opts).val(information.carPark); | ||
| 109 | + break; | ||
| 110 | + default: | ||
| 111 | + qdz.html(opts); | ||
| 112 | + zdz.html(opts).val(lastCode); | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + zdz.trigger('change'); | ||
| 116 | + f.trigger('ct_callback'); | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + function reCalcInputs_station() { | ||
| 120 | + var f = $(this).parents('form'), | ||
| 121 | + bcType = $('[name=bcType]', f).val(), | ||
| 122 | + qdzCode = $('[name=qdzCode]', f).val(), | ||
| 123 | + zdzCode =$('[name=zdzCode]', f).val(), | ||
| 124 | + startDate = $('[name=fcsj]', f).val(), | ||
| 125 | + upDown = $('[name=xlDir]', f).val(), mileage, time; | ||
| 126 | + | ||
| 127 | + //从站到场里获取数据 | ||
| 128 | + var stp = search_st_park(f); | ||
| 129 | + if(stp){ | ||
| 130 | + mileage=bcType=='in'?stp['mileage1']:stp['mileage2']; | ||
| 131 | + time=bcType=='in'?stp['time1']:stp['time2']; | ||
| 132 | + } | ||
| 133 | + else{ | ||
| 134 | + switch (upDown + '_' + bcType) { | ||
| 135 | + case '0_out'://上行出场 | ||
| 136 | + mileage = information.upOutMileage; | ||
| 137 | + time = information.upOutTimer; | ||
| 138 | + break; | ||
| 139 | + case '1_out'://下行出场 | ||
| 140 | + mileage = information.downOutMileage; | ||
| 141 | + time = information.downOutTimer; | ||
| 142 | + break; | ||
| 143 | + case '0_in'://上行进场 | ||
| 144 | + mileage = information.upInMileage; | ||
| 145 | + time = information.upInTimer; | ||
| 146 | + break; | ||
| 147 | + case '1_in'://下行进场 | ||
| 148 | + mileage = information.downInMileage; | ||
| 149 | + time = information.downInTimer; | ||
| 150 | + break; | ||
| 151 | + default: | ||
| 152 | + | ||
| 153 | + var qc_time=upDown==0?information.upTravelTime:information.downTravelTime, | ||
| 154 | + qc_mileage=upDown==0?information.upMileage:information.downMileage, _type; | ||
| 155 | + if(is_normal_sch(f)){ | ||
| 156 | + _type='normal'; | ||
| 157 | + mileage=qc_mileage; | ||
| 158 | + } | ||
| 159 | + else{ | ||
| 160 | + _type='region'; | ||
| 161 | + mileage = calcMileage(stationRoutes[upDown], qdzCode, zdzCode); | ||
| 162 | + } | ||
| 163 | + | ||
| 164 | + time = gb_common.mul(gb_common.accDiv(qc_time, qc_mileage), mileage); | ||
| 165 | + if(bcType!='ldks' && bcType!='major' && bcType!='venting') | ||
| 166 | + $('[name=bcType]', f).val(_type); | ||
| 167 | + } | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + $('[name=jhlc]', f).val(mileage); | ||
| 171 | + var et = moment(startDate, 'HH:mm').add(time, 'minutes'); | ||
| 172 | + $f('zdsj', f).val(et.format('HH:mm')); | ||
| 173 | + f.trigger('ct_callback'); | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + | ||
| 177 | + function reCalcEndTime() { | ||
| 178 | + var f = $(this).parents('.add-sch-form') | ||
| 179 | + , startDate = $f('fcsj', f).val()//开始时间 | ||
| 180 | + , mileage = $f('jhlc', f).val()//公里 | ||
| 181 | + , type2 = $f('bcType', f).val(),//班次类型 | ||
| 182 | + upDown = $('[name=xlDir]', f).val(); | ||
| 183 | + if (!startDate || !mileage) | ||
| 184 | + return; | ||
| 185 | + | ||
| 186 | + var time; | ||
| 187 | + //从站到场里获取数据 | ||
| 188 | + var stp = search_st_park(f); | ||
| 189 | + if(stp){ | ||
| 190 | + time=type2=='in'?stp['time1']:stp['time2']; | ||
| 191 | + } | ||
| 192 | + else{ | ||
| 193 | + if (type2 == 'in') | ||
| 194 | + time = upDown == 0 ? information.upInTimer : information.downInTimer; | ||
| 195 | + else if (type2 == 'out') | ||
| 196 | + time = upDown == 0 ? information.upOutTimer : information.downOutTimer; | ||
| 197 | + else{ | ||
| 198 | + var qc_time=upDown==0?information.upTravelTime:information.downTravelTime, | ||
| 199 | + qc_mileage=upDown==0?information.upMileage:information.downMileage; | ||
| 200 | + | ||
| 201 | + time = gb_common.mul(gb_common.accDiv(qc_time, qc_mileage), mileage); | ||
| 202 | + } | ||
| 203 | + } | ||
| 204 | + | ||
| 205 | + var et = moment(startDate, 'HH:mm').add(time, 'minutes'); | ||
| 206 | + $f('zdsj', f).val(et.format('HH:mm')); | ||
| 207 | + f.trigger('ct_callback'); | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + function is_normal_sch(f) { | ||
| 211 | + var qdzCode = $('[name=qdzCode]', f).val(), | ||
| 212 | + zdzCode =$('[name=zdzCode]', f).val(), | ||
| 213 | + upDown = $('[name=xlDir]', f).val(), | ||
| 214 | + rts = stationRoutes[upDown]; | ||
| 215 | + | ||
| 216 | + if(rts[0].stationCode == qdzCode | ||
| 217 | + && rts[rts.length - 1].stationCode == zdzCode) | ||
| 218 | + return true; | ||
| 219 | + else | ||
| 220 | + return false; | ||
| 221 | + } | ||
| 222 | + | ||
| 223 | + function isInOut(bcType) { | ||
| 224 | + return bcType=='in' || bcType=='out'; | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + /** | ||
| 228 | + * 计算线路上站点间公里 | ||
| 229 | + */ | ||
| 230 | + function calcMileage(rts, s, e) { | ||
| 231 | + var mileage = 0, flag, code; | ||
| 232 | + $.each(rts, function () { | ||
| 233 | + code = this['stationCode']; | ||
| 234 | + if (flag) | ||
| 235 | + mileage = gb_common.accAdd(mileage, this.distances); | ||
| 236 | + if (code == s) | ||
| 237 | + flag = true; | ||
| 238 | + if (code == e) | ||
| 239 | + return false; | ||
| 240 | + }); | ||
| 241 | + return mileage; | ||
| 242 | + } | ||
| 243 | + | ||
| 244 | + function search_st_park(f) { | ||
| 245 | + if(!st_park_data) | ||
| 246 | + return; | ||
| 247 | + var stp; | ||
| 248 | + var qdSelect=$f('qdzCode', f)[0],zdSelect=$f('zdzCode', f)[0]; | ||
| 249 | + | ||
| 250 | + if(qdSelect.options.selectedIndex < 0) | ||
| 251 | + return; | ||
| 252 | + var qdzName=qdSelect.options[qdSelect.options.selectedIndex].text, | ||
| 253 | + zdzName=zdSelect.options[zdSelect.options.selectedIndex].text, | ||
| 254 | + type2 = $f('bcType', f).val(); | ||
| 255 | + | ||
| 256 | + if(!isInOut(type2)) | ||
| 257 | + return; | ||
| 258 | + | ||
| 259 | + $.each(st_park_data, function () { | ||
| 260 | + if((type2=='in' && this.stationName==qdzName && this.parkName==zdzName) | ||
| 261 | + || (type2=='out' && this.stationName==zdzName && this.parkName==qdzName)){ | ||
| 262 | + stp = this; | ||
| 263 | + return false; | ||
| 264 | + } | ||
| 265 | + }); | ||
| 266 | + | ||
| 267 | + return stp; | ||
| 268 | + } | ||
| 269 | + | ||
| 270 | + /** | ||
| 271 | + * 停车场排序 | ||
| 272 | + * @param parks 停车场 code 2 name | ||
| 273 | + * @param information 线路标准 | ||
| 274 | + * @param st_park_data 站到场 | ||
| 275 | + */ | ||
| 276 | + function sort_parks(parks, information, st_park_data) { | ||
| 277 | + var array = [], names=[]; | ||
| 278 | + for(var code in parks){ | ||
| 279 | + array.push({code: code, name: parks[code]}); | ||
| 280 | + } | ||
| 281 | + | ||
| 282 | + if(st_park_data && st_park_data.length > 0){ | ||
| 283 | + $.each(st_park_data, function () { | ||
| 284 | + names.push(this.parkName); | ||
| 285 | + }); | ||
| 286 | + } | ||
| 287 | + | ||
| 288 | + //debugger | ||
| 289 | + array.sort(function (a, b) { | ||
| 290 | + if(a.code==information.carPark) | ||
| 291 | + return -1; | ||
| 292 | + if(b.code==information.carPark) | ||
| 293 | + return 1; | ||
| 294 | + | ||
| 295 | + var ai = names.indexOf(a.name), | ||
| 296 | + bi = names.indexOf(b.name); | ||
| 297 | + | ||
| 298 | + if(ai!=-1 && bi==-1) | ||
| 299 | + return -1; | ||
| 300 | + else if(ai==-1 && bi!=-1) | ||
| 301 | + return 1; | ||
| 302 | + else | ||
| 303 | + return $.trim(a.name).localeCompare($.trim(b.name), 'zh-CN'); | ||
| 304 | + }); | ||
| 305 | + return array; | ||
| 306 | + } | ||
| 307 | + | ||
| 308 | + function $f(name, f) { | ||
| 309 | + return $('[name=' + name + ']', f); | ||
| 310 | + } | ||
| 311 | + | ||
| 312 | + /** | ||
| 313 | + * 提交表单 | ||
| 314 | + */ | ||
| 315 | + function submit_temp_schedule_form(data, cb, err) { | ||
| 316 | + data.xlBm = sch.xlBm; | ||
| 317 | + data.xlName = sch.xlName; | ||
| 318 | + //拆分驾驶员工号和姓名 | ||
| 319 | + data.jGh = data.jsy.split('/')[0]; | ||
| 320 | + data.jName = data.jsy.split('/')[1]; | ||
| 321 | + delete data.jsy; | ||
| 322 | + //拆分售票员工号和姓名 | ||
| 323 | + if (data.spy != '') { | ||
| 324 | + data.sGh = data.spy.split('/')[0]; | ||
| 325 | + data.sName = data.spy.split('/')[1]; | ||
| 326 | + delete data.spy; | ||
| 327 | + } | ||
| 328 | + | ||
| 329 | + //公司信息 | ||
| 330 | + var line = gb_data_basic.findLineByCodes([data.xlBm]); | ||
| 331 | + if(line && line.length > 0){ | ||
| 332 | + line = line[0]; | ||
| 333 | + data.xlName = line.name; | ||
| 334 | + data.gsBm = line.company; | ||
| 335 | + data.fgsBm = line.brancheCompany; | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + gb_common.$post('/realSchedule', data, function (rs) { | ||
| 339 | + notify_succ('新增临加班次成功'); | ||
| 340 | + cb && cb(rs); | ||
| 341 | + }, err); | ||
| 342 | + } | ||
| 343 | + })(); | ||
| 344 | + </script> | ||
| 345 | +</div> | ||
| 0 | \ No newline at end of file | 346 | \ No newline at end of file |
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
| @@ -23,7 +23,7 @@ var gb_schedule_context_menu = (function () { | @@ -23,7 +23,7 @@ var gb_schedule_context_menu = (function () { | ||
| 23 | st_doms.range_2_normal_dom=dom; | 23 | st_doms.range_2_normal_dom=dom; |
| 24 | }); | 24 | }); |
| 25 | //提前缓存临加的片段页面 | 25 | //提前缓存临加的片段页面 |
| 26 | - var add_sch_doms={}; | 26 | + var add_sch_doms={}, add_sch_doms_v2 = {}; |
| 27 | $.get(folder + '/temp_sch/add_normal.html', function (dom) { | 27 | $.get(folder + '/temp_sch/add_normal.html', function (dom) { |
| 28 | add_sch_doms.normal_dom=dom; | 28 | add_sch_doms.normal_dom=dom; |
| 29 | }); | 29 | }); |
| @@ -33,6 +33,15 @@ var gb_schedule_context_menu = (function () { | @@ -33,6 +33,15 @@ var gb_schedule_context_menu = (function () { | ||
| 33 | $.get(folder + '/temp_sch/add_park_to_park.html', function (dom) { | 33 | $.get(folder + '/temp_sch/add_park_to_park.html', function (dom) { |
| 34 | add_sch_doms.park_to_park_dom=dom; | 34 | add_sch_doms.park_to_park_dom=dom; |
| 35 | }); | 35 | }); |
| 36 | + $.get(folder + '/temp_sch_v2/add_normal.html', function (dom) { | ||
| 37 | + add_sch_doms_v2.normal_dom=dom; | ||
| 38 | + }); | ||
| 39 | + $.get(folder + '/temp_sch_v2/add_two_way.html', function (dom) { | ||
| 40 | + add_sch_doms_v2.two_way_dom=dom; | ||
| 41 | + }); | ||
| 42 | + $.get(folder + '/temp_sch_v2/add_park_to_park.html', function (dom) { | ||
| 43 | + add_sch_doms_v2.park_to_park_dom=dom; | ||
| 44 | + }); | ||
| 36 | 45 | ||
| 37 | 46 | ||
| 38 | var callbackHandler = { | 47 | var callbackHandler = { |
| @@ -42,6 +51,9 @@ var gb_schedule_context_menu = (function () { | @@ -42,6 +51,9 @@ var gb_schedule_context_menu = (function () { | ||
| 42 | get_add_sch_doms: function () { | 51 | get_add_sch_doms: function () { |
| 43 | return add_sch_doms; | 52 | return add_sch_doms; |
| 44 | }, | 53 | }, |
| 54 | + get_add_sch_doms_v2: function () { | ||
| 55 | + return add_sch_doms_v2; | ||
| 56 | + }, | ||
| 45 | dftz: function (sch) { | 57 | dftz: function (sch) { |
| 46 | if(sch.status > 0){ | 58 | if(sch.status > 0){ |
| 47 | notify_err((sch.status==1?'已发出':'已执行') + '的班次不能修改待发'); | 59 | notify_err((sch.status==1?'已发出':'已执行') + '的班次不能修改待发'); |
| @@ -277,6 +289,11 @@ var gb_schedule_context_menu = (function () { | @@ -277,6 +289,11 @@ var gb_schedule_context_menu = (function () { | ||
| 277 | sch: sch | 289 | sch: sch |
| 278 | }, modal_opts); | 290 | }, modal_opts); |
| 279 | }, | 291 | }, |
| 292 | + add_temp_sch_v2: function (sch) { | ||
| 293 | + open_modal(folder + '/temp_sch_v2/main.html', { | ||
| 294 | + sch: sch | ||
| 295 | + }, modal_opts); | ||
| 296 | + }, | ||
| 280 | add_sub_task: function (sch) { | 297 | add_sub_task: function (sch) { |
| 281 | if ($('#add-sub-task-main-modal').length>0) { | 298 | if ($('#add-sub-task-main-modal').length>0) { |
| 282 | layer.msg('已存在正在添加的子任务.'); | 299 | layer.msg('已存在正在添加的子任务.'); |
| @@ -359,6 +376,20 @@ var gb_schedule_context_menu = (function () { | @@ -359,6 +376,20 @@ var gb_schedule_context_menu = (function () { | ||
| 359 | } | 376 | } |
| 360 | }); | 377 | }); |
| 361 | 378 | ||
| 379 | + $.contextMenu({ | ||
| 380 | + selector: '.line_schedule .schedule-wrap .card-panel', | ||
| 381 | + className: 'schedule-ct-menu', | ||
| 382 | + callback: function (key, options) { | ||
| 383 | + var $tbody = options.$trigger.parent(), lineCode = $tbody.parents('li.line_schedule').data('id'); | ||
| 384 | + | ||
| 385 | + callbackHandler[key] && callbackHandler[key]({ xlBm : lineCode }); | ||
| 386 | + }, | ||
| 387 | + items: { | ||
| 388 | + 'add_temp_sch_v2': { | ||
| 389 | + name: '新增临加班次' | ||
| 390 | + } | ||
| 391 | + } | ||
| 392 | + }); | ||
| 362 | 393 | ||
| 363 | $.contextMenu({ | 394 | $.contextMenu({ |
| 364 | selector: '.line_schedule .ct_table_body dl.drag-active', | 395 | selector: '.line_schedule .ct_table_body dl.drag-active', |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| @@ -109,7 +109,7 @@ var gb_schedule_table = (function () { | @@ -109,7 +109,7 @@ var gb_schedule_table = (function () { | ||
| 109 | }); | 109 | }); |
| 110 | 110 | ||
| 111 | }; | 111 | }; |
| 112 | - | 112 | + |
| 113 | var renderCarRemark = function () { | 113 | var renderCarRemark = function () { |
| 114 | try{ | 114 | try{ |
| 115 | var $activeTab = $('.north-tabs>ul>li.tab-line.uk-active');//.data('code'); | 115 | var $activeTab = $('.north-tabs>ul>li.tab-line.uk-active');//.data('code'); |
| @@ -190,7 +190,7 @@ var gb_schedule_table = (function () { | @@ -190,7 +190,7 @@ var gb_schedule_table = (function () { | ||
| 190 | sch.status=4; | 190 | sch.status=4; |
| 191 | } | 191 | } |
| 192 | } | 192 | } |
| 193 | - | 193 | + |
| 194 | 194 | ||
| 195 | 195 | ||
| 196 | function arrayIsNull(array) { | 196 | function arrayIsNull(array) { |
| @@ -205,6 +205,9 @@ var gb_schedule_table = (function () { | @@ -205,6 +205,9 @@ var gb_schedule_table = (function () { | ||
| 205 | var insertSchedule = function (sch, upArr) { | 205 | var insertSchedule = function (sch, upArr) { |
| 206 | var xls = {}; | 206 | var xls = {}; |
| 207 | xls[sch.xlBm] = 1; | 207 | xls[sch.xlBm] = 1; |
| 208 | + if (!line2Schedule[sch.xlBm]) { | ||
| 209 | + line2Schedule[sch.xlBm] = {}; | ||
| 210 | + } | ||
| 208 | line2Schedule[sch.xlBm][sch.id] = sch; | 211 | line2Schedule[sch.xlBm][sch.id] = sch; |
| 209 | //update | 212 | //update |
| 210 | if (isArray(upArr)) { | 213 | if (isArray(upArr)) { |