Commit 960655bf72e3b657cf7b41a710b03d75dd83d469
1 parent
f25f4d48
统计人员车辆里程班次
Showing
6 changed files
with
2602 additions
and
1485 deletions
src/main/java/com/bsth/entity/ScheduleRealInfo.java
| 1 | -package com.bsth.entity; | ||
| 2 | - | ||
| 3 | -import org.apache.commons.lang3.StringUtils; | ||
| 4 | -import org.joda.time.format.DateTimeFormat; | ||
| 5 | -import org.joda.time.format.DateTimeFormatter; | ||
| 6 | - | ||
| 7 | -import javax.persistence.*; | ||
| 8 | -import java.io.Serializable; | ||
| 9 | -import java.util.Date; | ||
| 10 | -import java.util.HashSet; | ||
| 11 | -import java.util.Set; | ||
| 12 | - | ||
| 13 | -/** | ||
| 14 | - * 实际排班计划明细。 | ||
| 15 | - */ | ||
| 16 | -@Entity | ||
| 17 | -@Table(name = "bsth_c_s_sp_info_real") | ||
| 18 | -@NamedEntityGraphs({ | ||
| 19 | - @NamedEntityGraph(name = "scheduleRealInfo_cTasks", attributeNodes = { | ||
| 20 | - @NamedAttributeNode("cTasks") | ||
| 21 | - }) | ||
| 22 | -}) | ||
| 23 | -public class ScheduleRealInfo implements Serializable{ | ||
| 24 | - | ||
| 25 | - | ||
| 26 | - | ||
| 27 | - /** 主键Id */ | ||
| 28 | - @Id | ||
| 29 | - private Long id; | ||
| 30 | - | ||
| 31 | - /** 计划ID */ | ||
| 32 | - private Long spId; | ||
| 33 | - | ||
| 34 | - /** 排班计划日期 */ | ||
| 35 | - private Date scheduleDate; | ||
| 36 | - private String scheduleDateStr; | ||
| 37 | - | ||
| 38 | - /** 真实执行时间 yyyy-MM-dd */ | ||
| 39 | - private String realExecDate; | ||
| 40 | - | ||
| 41 | - /** 线路名称 */ | ||
| 42 | - private String xlName; | ||
| 43 | - /** 线路编码 */ | ||
| 44 | - private String xlBm; | ||
| 45 | - | ||
| 46 | - /** 路牌名称 */ | ||
| 47 | - private String lpName; | ||
| 48 | - | ||
| 49 | - /** 车辆自编号 */ | ||
| 50 | - private String clZbh; | ||
| 51 | - | ||
| 52 | - /** 驾驶员工号 */ | ||
| 53 | - private String jGh; | ||
| 54 | - /** 驾驶员名字 */ | ||
| 55 | - private String jName; | ||
| 56 | - /** 售票员工号 */ | ||
| 57 | - private String sGh; | ||
| 58 | - /** 售票员名字 */ | ||
| 59 | - private String sName; | ||
| 60 | - | ||
| 61 | - /** 线路方向 */ | ||
| 62 | - private String xlDir; | ||
| 63 | - /** 起点站code*/ | ||
| 64 | - private String qdzCode; | ||
| 65 | - /** 起点站名字 */ | ||
| 66 | - private String qdzName; | ||
| 67 | - | ||
| 68 | - /** 终点站code*/ | ||
| 69 | - private String zdzCode; | ||
| 70 | - /** 终点站名字 */ | ||
| 71 | - private String zdzName; | ||
| 72 | - | ||
| 73 | - /** 计划发车时间(格式 HH:mm) */ | ||
| 74 | - private String fcsj; | ||
| 75 | - /** 计划发车时间戳*/ | ||
| 76 | - @Transient | ||
| 77 | - private Long fcsjT; | ||
| 78 | - | ||
| 79 | - /** 计划终点时间(格式 HH:mm) */ | ||
| 80 | - private String zdsj; | ||
| 81 | - /** 计划终点时间戳*/ | ||
| 82 | - @Transient | ||
| 83 | - private Long zdsjT; | ||
| 84 | - | ||
| 85 | - /** 计划里程 */ | ||
| 86 | - private Double jhlc; | ||
| 87 | - | ||
| 88 | - /** 原始计划里程 (原计调的数据) */ | ||
| 89 | - private Double jhlcOrig; | ||
| 90 | - | ||
| 91 | - /** 班次历时 */ | ||
| 92 | - private Integer bcsj; | ||
| 93 | - | ||
| 94 | - /** | ||
| 95 | - * 班次类型 TODO:正常班次、出场、进场、加油、区间班次、放空班次、放大站班次、两点间空驶 | ||
| 96 | - */ | ||
| 97 | - private String bcType; | ||
| 98 | - | ||
| 99 | - /** 实际发车时间*/ | ||
| 100 | - private String fcsjActual; | ||
| 101 | - /** 实际发车时间戳*/ | ||
| 102 | - @Transient | ||
| 103 | - private Long fcsjActualTime; | ||
| 104 | - /**实际终点时间 */ | ||
| 105 | - private String zdsjActual; | ||
| 106 | - /** 实际终点时间戳*/ | ||
| 107 | - @Transient | ||
| 108 | - private Long zdsjActualTime; | ||
| 109 | - | ||
| 110 | - /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */ | ||
| 111 | - private int status; | ||
| 112 | - | ||
| 113 | - private String adjustExps; | ||
| 114 | - | ||
| 115 | - /** 是否是临加班次 */ | ||
| 116 | - private boolean sflj; | ||
| 117 | - | ||
| 118 | - /** 备注*/ | ||
| 119 | - private String remarks; | ||
| 120 | - | ||
| 121 | - /**待发时间(格式 HH:mm) */ | ||
| 122 | - private String dfsj; | ||
| 123 | - | ||
| 124 | - /**待发时间戳 */ | ||
| 125 | - @Transient | ||
| 126 | - private Long dfsjT; | ||
| 127 | - | ||
| 128 | - /** 指令下发状态 60: 已发送, 100: 设备确认收到, 200:驾驶员确认 0:失败 */ | ||
| 129 | - private Integer directiveState = -1; | ||
| 130 | - | ||
| 131 | - /** 子任务 */ | ||
| 132 | - @OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule") | ||
| 133 | - private Set<ChildTaskPlan> cTasks = new HashSet<>(); | ||
| 134 | - | ||
| 135 | - /** 关联的公司名称 */ | ||
| 136 | - private String gsName; | ||
| 137 | - /** 关联的公司编码 */ | ||
| 138 | - private String gsBm; | ||
| 139 | - /** 关联的分公司名称 */ | ||
| 140 | - private String fgsName; | ||
| 141 | - /** 关联的分公司编码 */ | ||
| 142 | - private String fgsBm; | ||
| 143 | - | ||
| 144 | - /** 工时(分钟),包含停站时间 */ | ||
| 145 | - @Transient | ||
| 146 | - private Integer hours; | ||
| 147 | - | ||
| 148 | - @Override | ||
| 149 | - public int hashCode() { | ||
| 150 | - return (this.id + this.scheduleDateStr + this.xlBm + this.fcsj).hashCode(); | ||
| 151 | - } | ||
| 152 | - | ||
| 153 | - @Override | ||
| 154 | - public boolean equals(Object obj) { | ||
| 155 | - return this.id.equals(((ScheduleRealInfo)obj).getId()); | ||
| 156 | - } | ||
| 157 | - | ||
| 158 | - public Long getId() { | ||
| 159 | - return id; | ||
| 160 | - } | ||
| 161 | - | ||
| 162 | - public void setId(Long id) { | ||
| 163 | - this.id = id; | ||
| 164 | - } | ||
| 165 | - | ||
| 166 | - public Long getSpId() { | ||
| 167 | - return spId; | ||
| 168 | - } | ||
| 169 | - | ||
| 170 | - public void setSpId(Long spId) { | ||
| 171 | - this.spId = spId; | ||
| 172 | - } | ||
| 173 | - | ||
| 174 | - public Date getScheduleDate() { | ||
| 175 | - return scheduleDate; | ||
| 176 | - } | ||
| 177 | - | ||
| 178 | - public void setScheduleDate(Date scheduleDate) { | ||
| 179 | - this.scheduleDate = scheduleDate; | ||
| 180 | - } | ||
| 181 | - | ||
| 182 | - public String getScheduleDateStr() { | ||
| 183 | - return scheduleDateStr; | ||
| 184 | - } | ||
| 185 | - | ||
| 186 | - public void setScheduleDateStr(String scheduleDateStr) { | ||
| 187 | - this.scheduleDateStr = scheduleDateStr; | ||
| 188 | - } | ||
| 189 | - | ||
| 190 | - public String getRealExecDate() { | ||
| 191 | - return realExecDate; | ||
| 192 | - } | ||
| 193 | - | ||
| 194 | - public void setRealExecDate(String realExecDate) { | ||
| 195 | - this.realExecDate = realExecDate; | ||
| 196 | - } | ||
| 197 | - | ||
| 198 | - public String getXlName() { | ||
| 199 | - return xlName; | ||
| 200 | - } | ||
| 201 | - | ||
| 202 | - public void setXlName(String xlName) { | ||
| 203 | - this.xlName = xlName; | ||
| 204 | - } | ||
| 205 | - | ||
| 206 | - public String getXlBm() { | ||
| 207 | - return xlBm; | ||
| 208 | - } | ||
| 209 | - | ||
| 210 | - public void setXlBm(String xlBm) { | ||
| 211 | - this.xlBm = xlBm; | ||
| 212 | - } | ||
| 213 | - | ||
| 214 | - public String getLpName() { | ||
| 215 | - return lpName; | ||
| 216 | - } | ||
| 217 | - | ||
| 218 | - public void setLpName(String lpName) { | ||
| 219 | - this.lpName = lpName; | ||
| 220 | - } | ||
| 221 | - | ||
| 222 | - public String getClZbh() { | ||
| 223 | - return clZbh; | ||
| 224 | - } | ||
| 225 | - | ||
| 226 | - public void setClZbh(String clZbh) { | ||
| 227 | - this.clZbh = clZbh; | ||
| 228 | - } | ||
| 229 | - | ||
| 230 | - public String getjGh() { | ||
| 231 | - return jGh; | ||
| 232 | - } | ||
| 233 | - | ||
| 234 | - public void setjGh(String jGh) { | ||
| 235 | - this.jGh = jGh; | ||
| 236 | - } | ||
| 237 | - | ||
| 238 | - public String getjName() { | ||
| 239 | - return jName; | ||
| 240 | - } | ||
| 241 | - | ||
| 242 | - public void setjName(String jName) { | ||
| 243 | - this.jName = jName; | ||
| 244 | - } | ||
| 245 | - | ||
| 246 | - public String getsGh() { | ||
| 247 | - return sGh; | ||
| 248 | - } | ||
| 249 | - | ||
| 250 | - public void setsGh(String sGh) { | ||
| 251 | - this.sGh = sGh; | ||
| 252 | - } | ||
| 253 | - | ||
| 254 | - public String getsName() { | ||
| 255 | - return sName; | ||
| 256 | - } | ||
| 257 | - | ||
| 258 | - public void setsName(String sName) { | ||
| 259 | - this.sName = sName; | ||
| 260 | - } | ||
| 261 | - | ||
| 262 | - public String getXlDir() { | ||
| 263 | - return xlDir; | ||
| 264 | - } | ||
| 265 | - | ||
| 266 | - public void setXlDir(String xlDir) { | ||
| 267 | - this.xlDir = xlDir; | ||
| 268 | - } | ||
| 269 | - | ||
| 270 | - public String getQdzCode() { | ||
| 271 | - return qdzCode; | ||
| 272 | - } | ||
| 273 | - | ||
| 274 | - public void setQdzCode(String qdzCode) { | ||
| 275 | - this.qdzCode = qdzCode; | ||
| 276 | - } | ||
| 277 | - | ||
| 278 | - public String getQdzName() { | ||
| 279 | - return qdzName; | ||
| 280 | - } | ||
| 281 | - | ||
| 282 | - public void setQdzName(String qdzName) { | ||
| 283 | - this.qdzName = qdzName; | ||
| 284 | - } | ||
| 285 | - | ||
| 286 | - public String getZdzCode() { | ||
| 287 | - return zdzCode; | ||
| 288 | - } | ||
| 289 | - | ||
| 290 | - public void setZdzCode(String zdzCode) { | ||
| 291 | - this.zdzCode = zdzCode; | ||
| 292 | - } | ||
| 293 | - | ||
| 294 | - public String getZdzName() { | ||
| 295 | - return zdzName; | ||
| 296 | - } | ||
| 297 | - | ||
| 298 | - public void setZdzName(String zdzName) { | ||
| 299 | - this.zdzName = zdzName; | ||
| 300 | - } | ||
| 301 | - | ||
| 302 | - public String getFcsj() { | ||
| 303 | - return fcsj; | ||
| 304 | - } | ||
| 305 | - | ||
| 306 | - public void setFcsj(String fcsj) { | ||
| 307 | - this.fcsj = fcsj; | ||
| 308 | - } | ||
| 309 | - | ||
| 310 | - public Long getFcsjT() { | ||
| 311 | - return fcsjT; | ||
| 312 | - } | ||
| 313 | - | ||
| 314 | - public void setFcsjT(Long fcsjT) { | ||
| 315 | - this.fcsjT = fcsjT; | ||
| 316 | - } | ||
| 317 | - | ||
| 318 | - public String getZdsj() { | ||
| 319 | - return zdsj; | ||
| 320 | - } | ||
| 321 | - | ||
| 322 | - public void setZdsj(String zdsj) { | ||
| 323 | - this.zdsj = zdsj; | ||
| 324 | - } | ||
| 325 | - | ||
| 326 | - public Long getZdsjT() { | ||
| 327 | - return zdsjT; | ||
| 328 | - } | ||
| 329 | - | ||
| 330 | - public void setZdsjT(Long zdsjT) { | ||
| 331 | - this.zdsjT = zdsjT; | ||
| 332 | - } | ||
| 333 | - | ||
| 334 | - public Double getJhlc() { | ||
| 335 | - return jhlc; | ||
| 336 | - } | ||
| 337 | - | ||
| 338 | - public void setJhlc(Double jhlc) { | ||
| 339 | - this.jhlc = jhlc; | ||
| 340 | - } | ||
| 341 | - | ||
| 342 | - public Integer getBcsj() { | ||
| 343 | - return bcsj; | ||
| 344 | - } | ||
| 345 | - | ||
| 346 | - public void setBcsj(Integer bcsj) { | ||
| 347 | - this.bcsj = bcsj; | ||
| 348 | - } | ||
| 349 | - | ||
| 350 | - public String getBcType() { | ||
| 351 | - return bcType; | ||
| 352 | - } | ||
| 353 | - | ||
| 354 | - public void setBcType(String bcType) { | ||
| 355 | - this.bcType = bcType; | ||
| 356 | - } | ||
| 357 | - | ||
| 358 | - public String getFcsjActual() { | ||
| 359 | - return fcsjActual; | ||
| 360 | - } | ||
| 361 | - | ||
| 362 | - public void setFcsjActual(String fcsjActual) { | ||
| 363 | - this.fcsjActual = fcsjActual; | ||
| 364 | - } | ||
| 365 | - | ||
| 366 | - public Long getFcsjActualTime() { | ||
| 367 | - return fcsjActualTime; | ||
| 368 | - } | ||
| 369 | - | ||
| 370 | - public void setFcsjActualTime(Long fcsjActualTime) { | ||
| 371 | - this.fcsjActualTime = fcsjActualTime; | ||
| 372 | - } | ||
| 373 | - | ||
| 374 | - public String getZdsjActual() { | ||
| 375 | - return zdsjActual; | ||
| 376 | - } | ||
| 377 | - | ||
| 378 | - public void setZdsjActual(String zdsjActual) { | ||
| 379 | - this.zdsjActual = zdsjActual; | ||
| 380 | - } | ||
| 381 | - | ||
| 382 | - public Long getZdsjActualTime() { | ||
| 383 | - return zdsjActualTime; | ||
| 384 | - } | ||
| 385 | - | ||
| 386 | - public void setZdsjActualTime(Long zdsjActualTime) { | ||
| 387 | - this.zdsjActualTime = zdsjActualTime; | ||
| 388 | - } | ||
| 389 | - | ||
| 390 | - public int getStatus() { | ||
| 391 | - return status; | ||
| 392 | - } | ||
| 393 | - | ||
| 394 | - public void setStatus(int status) { | ||
| 395 | - this.status = status; | ||
| 396 | - } | ||
| 397 | - | ||
| 398 | - public String getAdjustExps() { | ||
| 399 | - return adjustExps; | ||
| 400 | - } | ||
| 401 | - | ||
| 402 | - public void setAdjustExps(String adjustExps) { | ||
| 403 | - this.adjustExps = adjustExps; | ||
| 404 | - } | ||
| 405 | - | ||
| 406 | - public boolean isSflj() { | ||
| 407 | - return sflj; | ||
| 408 | - } | ||
| 409 | - | ||
| 410 | - public void setSflj(boolean sflj) { | ||
| 411 | - this.sflj = sflj; | ||
| 412 | - } | ||
| 413 | - | ||
| 414 | - public String getRemarks() { | ||
| 415 | - return remarks; | ||
| 416 | - } | ||
| 417 | - | ||
| 418 | - public void setRemarks(String remarks) { | ||
| 419 | - this.remarks = remarks; | ||
| 420 | - } | ||
| 421 | - | ||
| 422 | - public String getDfsj() { | ||
| 423 | - return dfsj; | ||
| 424 | - } | ||
| 425 | - | ||
| 426 | - public void setDfsj(String dfsj) { | ||
| 427 | - this.dfsj = dfsj; | ||
| 428 | - } | ||
| 429 | - | ||
| 430 | - public Long getDfsjT() { | ||
| 431 | - return dfsjT; | ||
| 432 | - } | ||
| 433 | - | ||
| 434 | - public void setDfsjT(Long dfsjT) { | ||
| 435 | - this.dfsjT = dfsjT; | ||
| 436 | - } | ||
| 437 | - | ||
| 438 | - public Integer getDirectiveState() { | ||
| 439 | - return directiveState; | ||
| 440 | - } | ||
| 441 | - | ||
| 442 | - public void setDirectiveState(Integer directiveState) { | ||
| 443 | - this.directiveState = directiveState; | ||
| 444 | - } | ||
| 445 | - | ||
| 446 | - public Set<ChildTaskPlan> getcTasks() { | ||
| 447 | - return cTasks; | ||
| 448 | - } | ||
| 449 | - | ||
| 450 | - public void setcTasks(Set<ChildTaskPlan> cTasks) { | ||
| 451 | - this.cTasks = cTasks; | ||
| 452 | - } | ||
| 453 | - | ||
| 454 | - public String getGsName() { | ||
| 455 | - return gsName; | ||
| 456 | - } | ||
| 457 | - | ||
| 458 | - public void setGsName(String gsName) { | ||
| 459 | - this.gsName = gsName; | ||
| 460 | - } | ||
| 461 | - | ||
| 462 | - public String getGsBm() { | ||
| 463 | - return gsBm; | ||
| 464 | - } | ||
| 465 | - | ||
| 466 | - public void setGsBm(String gsBm) { | ||
| 467 | - this.gsBm = gsBm; | ||
| 468 | - } | ||
| 469 | - | ||
| 470 | - public String getFgsName() { | ||
| 471 | - return fgsName; | ||
| 472 | - } | ||
| 473 | - | ||
| 474 | - public void setFgsName(String fgsName) { | ||
| 475 | - this.fgsName = fgsName; | ||
| 476 | - } | ||
| 477 | - | ||
| 478 | - public String getFgsBm() { | ||
| 479 | - return fgsBm; | ||
| 480 | - } | ||
| 481 | - | ||
| 482 | - public void setFgsBm(String fgsBm) { | ||
| 483 | - this.fgsBm = fgsBm; | ||
| 484 | - } | ||
| 485 | - | ||
| 486 | - public Double getJhlcOrig() { | ||
| 487 | - return jhlcOrig; | ||
| 488 | - } | ||
| 489 | - | ||
| 490 | - public void setJhlcOrig(Double jhlcOrig) { | ||
| 491 | - this.jhlcOrig = jhlcOrig; | ||
| 492 | - } | ||
| 493 | - | ||
| 494 | - | ||
| 495 | - @Transient | ||
| 496 | - private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm"); | ||
| 497 | - @Transient | ||
| 498 | - private static DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm"); | ||
| 499 | - | ||
| 500 | - /** | ||
| 501 | - * | ||
| 502 | - * @Title: setFcsjAll | ||
| 503 | - * @Description: TODO(设置计划发车时间) | ||
| 504 | - * @throws | ||
| 505 | - */ | ||
| 506 | - public void setFcsjAll(Long fcsjT){ | ||
| 507 | - this.fcsjT = fcsjT; | ||
| 508 | - this.fcsj = fmtHHmm.print(fcsjT); | ||
| 509 | - } | ||
| 510 | - | ||
| 511 | - public void setDfsjAll(Long dfsjT) { | ||
| 512 | - this.dfsjT = dfsjT; | ||
| 513 | - this.dfsj = fmtHHmm.print(this.dfsjT); | ||
| 514 | - } | ||
| 515 | - | ||
| 516 | - /** | ||
| 517 | - * | ||
| 518 | - * @Title: setFcsjActualAll | ||
| 519 | - * @Description: TODO(设置实际发车时间 时间戳) | ||
| 520 | - * @throws | ||
| 521 | - */ | ||
| 522 | - public void setFcsjActualAll(Long t){ | ||
| 523 | - this.fcsjActualTime = t; | ||
| 524 | - this.fcsjActual = fmtHHmm.print(t); | ||
| 525 | - } | ||
| 526 | - | ||
| 527 | - /** | ||
| 528 | - * | ||
| 529 | - * @Title: setFcsjActualAll | ||
| 530 | - * @Description: TODO(设置实际终点时间) | ||
| 531 | - * @throws | ||
| 532 | - */ | ||
| 533 | - public void setZdsjActualAll(Long t){ | ||
| 534 | - this.zdsjActualTime = t; | ||
| 535 | - this.zdsjActual = fmtHHmm.print(t); | ||
| 536 | - } | ||
| 537 | - | ||
| 538 | - public void setDfsjAll(String dfsj) { | ||
| 539 | - this.dfsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + dfsj); | ||
| 540 | - this.dfsj = dfsj; | ||
| 541 | - } | ||
| 542 | - | ||
| 543 | - /** | ||
| 544 | - * | ||
| 545 | - * @Title: setFcsjActualAll | ||
| 546 | - * @Description: TODO(设置实际发车时间 字符串) | ||
| 547 | - * @throws | ||
| 548 | - */ | ||
| 549 | - public void setFcsjActualAll(String fcsjActual){ | ||
| 550 | - this.fcsjActualTime = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + fcsjActual); | ||
| 551 | - this.fcsjActual = fcsjActual; | ||
| 552 | - } | ||
| 553 | - | ||
| 554 | - /** | ||
| 555 | - * | ||
| 556 | - * @Title: setFcsjActualAll | ||
| 557 | - * @Description: TODO(设置实际终点时间) | ||
| 558 | - * @throws | ||
| 559 | - */ | ||
| 560 | - public void setZdsjActualAll(String zdsjActual){ | ||
| 561 | - this.zdsjActualTime = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + zdsjActual); | ||
| 562 | - this.zdsjActual = zdsjActual; | ||
| 563 | - } | ||
| 564 | - | ||
| 565 | - public void calcHoursJh() { | ||
| 566 | - if(this.status == -1) | ||
| 567 | - this.setHours(0); | ||
| 568 | - else | ||
| 569 | - this.setHours(this.getBcsj()); | ||
| 570 | - } | ||
| 571 | - | ||
| 572 | - public void calcHoursSJ() { | ||
| 573 | - try { | ||
| 574 | - if(StringUtils.isEmpty(this.fcsjActual)) | ||
| 575 | - this.setFcsjActualAll(this.dfsjT); | ||
| 576 | - if(StringUtils.isEmpty(this.zdsjActual)) | ||
| 577 | - this.setZdsjActualAll(this.zdsjT); | ||
| 578 | - | ||
| 579 | - /*if(this.status == -1) | ||
| 580 | - this.hours = 0; | ||
| 581 | - else*/ | ||
| 582 | - this.hours = Integer.parseInt(String.valueOf((this.zdsjActualTime - this.fcsjActualTime) / 1000 / 60)); | ||
| 583 | - }catch (Exception e){ | ||
| 584 | - System.out.println("aa"); | ||
| 585 | - } | ||
| 586 | - } | ||
| 587 | - | ||
| 588 | - public Integer getHours() { | ||
| 589 | - return hours; | ||
| 590 | - } | ||
| 591 | - | ||
| 592 | - public void setHours(Integer hours) { | ||
| 593 | - this.hours = hours; | ||
| 594 | - } | ||
| 595 | -} | 1 | +package com.bsth.entity; |
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonIgnore; | ||
| 4 | +import org.apache.commons.lang3.StringUtils; | ||
| 5 | +import org.joda.time.format.DateTimeFormat; | ||
| 6 | +import org.joda.time.format.DateTimeFormatter; | ||
| 7 | + | ||
| 8 | +import javax.persistence.*; | ||
| 9 | +import java.util.Date; | ||
| 10 | +import java.util.HashSet; | ||
| 11 | +import java.util.Set; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 实际排班计划明细。 | ||
| 15 | + */ | ||
| 16 | +@Entity | ||
| 17 | +@Table(name = "bsth_c_s_sp_info_real") | ||
| 18 | +@NamedEntityGraphs({ | ||
| 19 | + @NamedEntityGraph(name = "scheduleRealInfo_cTasks", attributeNodes = { | ||
| 20 | + @NamedAttributeNode("cTasks") | ||
| 21 | + }) | ||
| 22 | +}) | ||
| 23 | +public class ScheduleRealInfo { | ||
| 24 | + /** 主键Id */ | ||
| 25 | + @Id | ||
| 26 | + @GeneratedValue | ||
| 27 | + private Long id; | ||
| 28 | + | ||
| 29 | + /** 计划ID */ | ||
| 30 | + private Long spId; | ||
| 31 | + | ||
| 32 | + /** 排班计划日期 --no webSocket */ | ||
| 33 | + private Date scheduleDate; | ||
| 34 | + /** 排班日期字符串 YYYY-MM-DD */ | ||
| 35 | + private String scheduleDateStr; | ||
| 36 | + | ||
| 37 | + /** 真实执行时间 yyyy-MM-dd */ | ||
| 38 | + private String realExecDate; | ||
| 39 | + | ||
| 40 | + /** 线路名称 */ | ||
| 41 | + private String xlName; | ||
| 42 | + /** 线路编码 */ | ||
| 43 | + private String xlBm; | ||
| 44 | + | ||
| 45 | + /** 路牌名称 */ | ||
| 46 | + private String lpName; | ||
| 47 | + | ||
| 48 | + /** 车辆自编号 */ | ||
| 49 | + private String clZbh; | ||
| 50 | + | ||
| 51 | + /** 驾驶员工号 */ | ||
| 52 | + private String jGh; | ||
| 53 | + /** 驾驶员名字 */ | ||
| 54 | + private String jName; | ||
| 55 | + /** 售票员工号 */ | ||
| 56 | + private String sGh; | ||
| 57 | + /** 售票员名字 */ | ||
| 58 | + private String sName; | ||
| 59 | + | ||
| 60 | + /** 线路方向 */ | ||
| 61 | + private String xlDir; | ||
| 62 | + /** 起点站code*/ | ||
| 63 | + private String qdzCode; | ||
| 64 | + /** 起点站名字 */ | ||
| 65 | + private String qdzName; | ||
| 66 | + | ||
| 67 | + /** 终点站code*/ | ||
| 68 | + private String zdzCode; | ||
| 69 | + /** 终点站名字 */ | ||
| 70 | + private String zdzName; | ||
| 71 | + | ||
| 72 | + /** 计划发车时间(格式 HH:mm) */ | ||
| 73 | + private String fcsj; | ||
| 74 | + /** 计划发车时间戳*/ | ||
| 75 | + @Transient | ||
| 76 | + private Long fcsjT; | ||
| 77 | + | ||
| 78 | + /** 计划终点时间(格式 HH:mm) */ | ||
| 79 | + private String zdsj; | ||
| 80 | + /** 计划终点时间戳*/ | ||
| 81 | + @Transient | ||
| 82 | + private Long zdsjT; | ||
| 83 | + | ||
| 84 | + /** 发车顺序号 --no webSocket*/ | ||
| 85 | + private Integer fcno; | ||
| 86 | + /** 对应班次数 --no webSocket*/ | ||
| 87 | + private Integer bcs; | ||
| 88 | + /** 计划里程 */ | ||
| 89 | + private Double jhlc; | ||
| 90 | + | ||
| 91 | + /** 原始计划里程 (原计调的数据) */ | ||
| 92 | + private Double jhlcOrig; | ||
| 93 | + | ||
| 94 | + /** 实际里程 --no webSocket*/ | ||
| 95 | + @Transient | ||
| 96 | + @JsonIgnore | ||
| 97 | + private Double realMileage; | ||
| 98 | + | ||
| 99 | + /** 实际里程 --no webSocket */ | ||
| 100 | + @Transient | ||
| 101 | + private String sjlc; | ||
| 102 | + /** 班次历时 */ | ||
| 103 | + private Integer bcsj; | ||
| 104 | + | ||
| 105 | + /** | ||
| 106 | + * 班次类型 TODO:正常班次、出场、进场、加油、区间班次、放空班次、放大站班次、两点间空驶 | ||
| 107 | + */ | ||
| 108 | + private String bcType; | ||
| 109 | + | ||
| 110 | + //放站班次 站点名称 | ||
| 111 | + private String majorStationName; | ||
| 112 | + | ||
| 113 | + /** 创建日期 */ | ||
| 114 | + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | ||
| 115 | + private Date createDate; | ||
| 116 | + /** 修改日期 */ | ||
| 117 | + @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | ||
| 118 | + private Date updateDate; | ||
| 119 | + | ||
| 120 | + /** 实际发车时间*/ | ||
| 121 | + private String fcsjActual; | ||
| 122 | + /** 实际发车时间戳*/ | ||
| 123 | + @Transient | ||
| 124 | + private Long fcsjActualTime; | ||
| 125 | + /**实际终点时间 */ | ||
| 126 | + private String zdsjActual; | ||
| 127 | + /** 实际终点时间戳*/ | ||
| 128 | + @Transient | ||
| 129 | + private Long zdsjActualTime; | ||
| 130 | + | ||
| 131 | + /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */ | ||
| 132 | + private int status; | ||
| 133 | + | ||
| 134 | + private String adjustExps; | ||
| 135 | + | ||
| 136 | + /** 是否是临加班次 */ | ||
| 137 | + private boolean sflj; | ||
| 138 | + | ||
| 139 | + /** 是否误点 (应发未发)*/ | ||
| 140 | + @Transient | ||
| 141 | + private boolean late; | ||
| 142 | + | ||
| 143 | + /** 是否误点 (应发未到) */ | ||
| 144 | + @Transient | ||
| 145 | + private boolean late2; | ||
| 146 | + /** 误点停靠时间 */ | ||
| 147 | + @Transient | ||
| 148 | + private float lateMinute; | ||
| 149 | + | ||
| 150 | + /** 备注*/ | ||
| 151 | + private String remarks; | ||
| 152 | + | ||
| 153 | + /** 原计划排班备注 --no webSocket */ | ||
| 154 | + @Transient | ||
| 155 | + private String remark; | ||
| 156 | + | ||
| 157 | + /**待发时间(格式 HH:mm) */ | ||
| 158 | + private String dfsj; | ||
| 159 | + | ||
| 160 | + /**待发时间戳 */ | ||
| 161 | + @Transient | ||
| 162 | + private Long dfsjT; | ||
| 163 | + | ||
| 164 | + /** 指令下发状态 60: 已发送, 100: 设备确认收到, 200:驾驶员确认 0:失败 */ | ||
| 165 | + private Integer directiveState = -1; | ||
| 166 | + | ||
| 167 | + /** 起点站计划到达时间 */ | ||
| 168 | + @Transient | ||
| 169 | + private String qdzArrDatejh; | ||
| 170 | + | ||
| 171 | + /** 起点站实际到达时间 */ | ||
| 172 | + @Transient | ||
| 173 | + private String qdzArrDatesj; | ||
| 174 | + | ||
| 175 | + /** 子任务 */ | ||
| 176 | + @OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule") | ||
| 177 | + private Set<ChildTaskPlan> cTasks = new HashSet<>(); | ||
| 178 | + | ||
| 179 | + /** 关联的公司名称 */ | ||
| 180 | + private String gsName; | ||
| 181 | + /** 关联的公司编码 */ | ||
| 182 | + private String gsBm; | ||
| 183 | + /** 关联的分公司名称 */ | ||
| 184 | + private String fgsName; | ||
| 185 | + /** 关联的分公司编码 */ | ||
| 186 | + private String fgsBm; | ||
| 187 | + /** 出场顺序号 */ | ||
| 188 | + private Integer ccno; | ||
| 189 | + | ||
| 190 | + //待发调试(是否自动调整) | ||
| 191 | + private boolean dfAuto; | ||
| 192 | + //是否有GPS信号 | ||
| 193 | + private boolean online; | ||
| 194 | + | ||
| 195 | + /** 是否有补发GPS信号 */ | ||
| 196 | + private boolean reissue; | ||
| 197 | + | ||
| 198 | + /** 发车屏 发车顺序号,不持久化,会动态变化 --no webSocket*/ | ||
| 199 | + @Transient | ||
| 200 | + private int fcpSn; | ||
| 201 | + | ||
| 202 | + /** 标记班次已被删除 */ | ||
| 203 | + @Transient | ||
| 204 | + @JsonIgnore | ||
| 205 | + private boolean deleted; | ||
| 206 | + | ||
| 207 | + @Transient | ||
| 208 | + @JsonIgnore | ||
| 209 | + private int saveFailCount=0; | ||
| 210 | + | ||
| 211 | + /** 是否需要补充GPS信号 (网关提交至运管处动态数据用) 1: 能发车, 2:能到达 3: 补发过*/ | ||
| 212 | + private int siginCompate; | ||
| 213 | + | ||
| 214 | + /** | ||
| 215 | + * 漂移状态 | ||
| 216 | + * 1: 发车漂移 | ||
| 217 | + * 2:到站漂移 | ||
| 218 | + * 3:中途漂移 | ||
| 219 | + */ | ||
| 220 | + private Integer driftStatus = 0; | ||
| 221 | + | ||
| 222 | + /** | ||
| 223 | + * 换车营运标记 true 表示该主任务由 【中途换车子任务】 级联生成 | ||
| 224 | + */ | ||
| 225 | + private boolean ccService; | ||
| 226 | + | ||
| 227 | + public boolean isDfAuto() { | ||
| 228 | + return dfAuto; | ||
| 229 | + } | ||
| 230 | + | ||
| 231 | + public void setDfAuto(boolean dfAuto) { | ||
| 232 | + this.dfAuto = dfAuto; | ||
| 233 | + } | ||
| 234 | + | ||
| 235 | + public boolean isOnline() { | ||
| 236 | + return online; | ||
| 237 | + } | ||
| 238 | + | ||
| 239 | + public void setOnline(boolean online) { | ||
| 240 | + this.online = online; | ||
| 241 | + } | ||
| 242 | + | ||
| 243 | + public String getQdzArrDatejh() { | ||
| 244 | + return qdzArrDatejh; | ||
| 245 | + } | ||
| 246 | + | ||
| 247 | + public void setQdzArrDatejh(String qdzArrDatejh) { | ||
| 248 | + this.qdzArrDatejh = qdzArrDatejh; | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + public String getQdzArrDatesj() { | ||
| 252 | + return qdzArrDatesj; | ||
| 253 | + } | ||
| 254 | + | ||
| 255 | + public void setQdzArrDatesj(String qdzArrDatesj) { | ||
| 256 | + this.qdzArrDatesj = qdzArrDatesj; | ||
| 257 | + } | ||
| 258 | + | ||
| 259 | + public void setcTasks(Set<ChildTaskPlan> cTasks) { | ||
| 260 | + this.cTasks = cTasks; | ||
| 261 | + } | ||
| 262 | + | ||
| 263 | + public String getGsName() { | ||
| 264 | + return gsName; | ||
| 265 | + } | ||
| 266 | + | ||
| 267 | + public void setGsName(String gsName) { | ||
| 268 | + this.gsName = gsName; | ||
| 269 | + } | ||
| 270 | + | ||
| 271 | + public String getGsBm() { | ||
| 272 | + return gsBm; | ||
| 273 | + } | ||
| 274 | + | ||
| 275 | + public void setGsBm(String gsBm) { | ||
| 276 | + this.gsBm = gsBm; | ||
| 277 | + } | ||
| 278 | + | ||
| 279 | + public String getFgsName() { | ||
| 280 | + return fgsName; | ||
| 281 | + } | ||
| 282 | + | ||
| 283 | + public void setFgsName(String fgsName) { | ||
| 284 | + this.fgsName = fgsName; | ||
| 285 | + } | ||
| 286 | + | ||
| 287 | + public String getFgsBm() { | ||
| 288 | + return fgsBm; | ||
| 289 | + } | ||
| 290 | + | ||
| 291 | + public void setFgsBm(String fgsBm) { | ||
| 292 | + this.fgsBm = fgsBm; | ||
| 293 | + } | ||
| 294 | + | ||
| 295 | + public Integer getCcno() { | ||
| 296 | + return ccno; | ||
| 297 | + } | ||
| 298 | + | ||
| 299 | + public void setCcno(Integer ccno) { | ||
| 300 | + this.ccno = ccno; | ||
| 301 | + } | ||
| 302 | + | ||
| 303 | + | ||
| 304 | + /** ---------------- | ||
| 305 | + @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) | ||
| 306 | + private RealTimeModel sjfcModel; | ||
| 307 | + @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) | ||
| 308 | + private RealTimeModel sjddModel; | ||
| 309 | + */ | ||
| 310 | + public void addRemarks(String remark){ | ||
| 311 | + if(StringUtils.isBlank(remark)) | ||
| 312 | + return; | ||
| 313 | + String old = this.getRemarks(); | ||
| 314 | + if(StringUtils.isBlank(old)) | ||
| 315 | + old = ""; | ||
| 316 | + | ||
| 317 | + old += remark + ";"; | ||
| 318 | + this.setRemarks(old); | ||
| 319 | + | ||
| 320 | + } | ||
| 321 | + | ||
| 322 | + public Long getId() { | ||
| 323 | + return id; | ||
| 324 | + } | ||
| 325 | + | ||
| 326 | + public void setId(Long id) { | ||
| 327 | + this.id = id; | ||
| 328 | + } | ||
| 329 | + | ||
| 330 | + public Date getScheduleDate() { | ||
| 331 | + return scheduleDate; | ||
| 332 | + } | ||
| 333 | + | ||
| 334 | + public void setScheduleDate(Date scheduleDate) { | ||
| 335 | + this.scheduleDate = scheduleDate; | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + public String getXlName() { | ||
| 339 | + return xlName; | ||
| 340 | + } | ||
| 341 | + | ||
| 342 | + public void setXlName(String xlName) { | ||
| 343 | + this.xlName = xlName; | ||
| 344 | + } | ||
| 345 | + | ||
| 346 | + public String getXlBm() { | ||
| 347 | + return xlBm; | ||
| 348 | + } | ||
| 349 | + | ||
| 350 | + public void setXlBm(String xlBm) { | ||
| 351 | + this.xlBm = xlBm; | ||
| 352 | + } | ||
| 353 | + | ||
| 354 | + public String getLpName() { | ||
| 355 | + return lpName; | ||
| 356 | + } | ||
| 357 | + | ||
| 358 | + public void setLpName(String lpName) { | ||
| 359 | + this.lpName = lpName; | ||
| 360 | + } | ||
| 361 | + | ||
| 362 | + public String getClZbh() { | ||
| 363 | + return clZbh; | ||
| 364 | + } | ||
| 365 | + | ||
| 366 | + public void setClZbh(String clZbh) { | ||
| 367 | + this.clZbh = clZbh; | ||
| 368 | + } | ||
| 369 | + | ||
| 370 | + public String getjGh() { | ||
| 371 | + return jGh; | ||
| 372 | + } | ||
| 373 | + | ||
| 374 | + public void setjGh(String jGh) { | ||
| 375 | + this.jGh = jGh; | ||
| 376 | + } | ||
| 377 | + | ||
| 378 | + public String getjName() { | ||
| 379 | + return jName; | ||
| 380 | + } | ||
| 381 | + | ||
| 382 | + public void setjName(String jName) { | ||
| 383 | + this.jName = jName; | ||
| 384 | + } | ||
| 385 | + | ||
| 386 | + public String getsGh() { | ||
| 387 | + if(sGh == null) | ||
| 388 | + return ""; | ||
| 389 | + return sGh; | ||
| 390 | + } | ||
| 391 | + | ||
| 392 | + public void setsGh(String sGh) { | ||
| 393 | + this.sGh = sGh; | ||
| 394 | + } | ||
| 395 | + | ||
| 396 | + public String getsName() { | ||
| 397 | + if(sGh == null) | ||
| 398 | + return ""; | ||
| 399 | + return sName; | ||
| 400 | + } | ||
| 401 | + | ||
| 402 | + public void setsName(String sName) { | ||
| 403 | + this.sName = sName; | ||
| 404 | + } | ||
| 405 | + | ||
| 406 | + public String getXlDir() { | ||
| 407 | + return xlDir; | ||
| 408 | + } | ||
| 409 | + | ||
| 410 | + public void setXlDir(String xlDir) { | ||
| 411 | + this.xlDir = xlDir; | ||
| 412 | + } | ||
| 413 | + | ||
| 414 | + public String getQdzCode() { | ||
| 415 | + return qdzCode; | ||
| 416 | + } | ||
| 417 | + | ||
| 418 | + public void setQdzCode(String qdzCode) { | ||
| 419 | + this.qdzCode = qdzCode; | ||
| 420 | + } | ||
| 421 | + | ||
| 422 | + public String getQdzName() { | ||
| 423 | + return qdzName; | ||
| 424 | + } | ||
| 425 | + | ||
| 426 | + public void setQdzName(String qdzName) { | ||
| 427 | + this.qdzName = qdzName; | ||
| 428 | + } | ||
| 429 | + | ||
| 430 | + public String getZdzCode() { | ||
| 431 | + return zdzCode; | ||
| 432 | + } | ||
| 433 | + | ||
| 434 | + public void setZdzCode(String zdzCode) { | ||
| 435 | + this.zdzCode = zdzCode; | ||
| 436 | + } | ||
| 437 | + | ||
| 438 | + public String getZdzName() { | ||
| 439 | + return zdzName; | ||
| 440 | + } | ||
| 441 | + | ||
| 442 | + public void setZdzName(String zdzName) { | ||
| 443 | + this.zdzName = zdzName; | ||
| 444 | + } | ||
| 445 | + | ||
| 446 | + public String getFcsj() { | ||
| 447 | + return fcsj; | ||
| 448 | + } | ||
| 449 | + | ||
| 450 | + public void setFcsj(String fcsj) { | ||
| 451 | + this.fcsj = fcsj; | ||
| 452 | + } | ||
| 453 | + | ||
| 454 | + public Long getFcsjT() { | ||
| 455 | + return fcsjT; | ||
| 456 | + } | ||
| 457 | + | ||
| 458 | + public void setFcsjT(Long fcsjT) { | ||
| 459 | + this.fcsjT = fcsjT; | ||
| 460 | + } | ||
| 461 | + | ||
| 462 | + public String getZdsj() { | ||
| 463 | + return zdsj; | ||
| 464 | + } | ||
| 465 | + | ||
| 466 | + public void setZdsj(String zdsj) { | ||
| 467 | + this.zdsj = zdsj; | ||
| 468 | + } | ||
| 469 | + | ||
| 470 | + public Long getZdsjT() { | ||
| 471 | + return zdsjT; | ||
| 472 | + } | ||
| 473 | + | ||
| 474 | + public void setZdsjT(Long zdsjT) { | ||
| 475 | + this.zdsjT = zdsjT; | ||
| 476 | + } | ||
| 477 | + | ||
| 478 | + public Integer getFcno() { | ||
| 479 | + return fcno; | ||
| 480 | + } | ||
| 481 | + | ||
| 482 | + public void setFcno(Integer fcno) { | ||
| 483 | + this.fcno = fcno; | ||
| 484 | + } | ||
| 485 | + | ||
| 486 | + public Integer getBcs() { | ||
| 487 | + return bcs; | ||
| 488 | + } | ||
| 489 | + | ||
| 490 | + public void setBcs(Integer bcs) { | ||
| 491 | + this.bcs = bcs; | ||
| 492 | + } | ||
| 493 | + | ||
| 494 | + public Double getJhlc() { | ||
| 495 | + return jhlc; | ||
| 496 | + } | ||
| 497 | + | ||
| 498 | + public void setJhlc(Double jhlc) { | ||
| 499 | + this.jhlc = jhlc; | ||
| 500 | + //临加班次 计划公里 和 实际计划公里一样 | ||
| 501 | + if(this.isSflj()) | ||
| 502 | + this.setJhlcOrig(this.getJhlc()); | ||
| 503 | + } | ||
| 504 | + | ||
| 505 | + public String getSjlc() { | ||
| 506 | + return sjlc; | ||
| 507 | + } | ||
| 508 | + | ||
| 509 | + public void setSjlc(String sjlc) { | ||
| 510 | + this.sjlc = sjlc; | ||
| 511 | + } | ||
| 512 | + | ||
| 513 | + public Integer getBcsj() { | ||
| 514 | + return bcsj; | ||
| 515 | + } | ||
| 516 | + | ||
| 517 | + public void setBcsj(Integer bcsj) { | ||
| 518 | + this.bcsj = bcsj; | ||
| 519 | + } | ||
| 520 | + | ||
| 521 | + public String getBcType() { | ||
| 522 | + return bcType; | ||
| 523 | + } | ||
| 524 | + | ||
| 525 | + public void setBcType(String bcType) { | ||
| 526 | + this.bcType = bcType; | ||
| 527 | + } | ||
| 528 | + | ||
| 529 | + | ||
| 530 | + | ||
| 531 | + public Date getCreateDate() { | ||
| 532 | + return createDate; | ||
| 533 | + } | ||
| 534 | + | ||
| 535 | + public void setCreateDate(Date createDate) { | ||
| 536 | + this.createDate = createDate; | ||
| 537 | + } | ||
| 538 | + | ||
| 539 | + public Date getUpdateDate() { | ||
| 540 | + return updateDate; | ||
| 541 | + } | ||
| 542 | + | ||
| 543 | + public void setUpdateDate(Date updateDate) { | ||
| 544 | + this.updateDate = updateDate; | ||
| 545 | + } | ||
| 546 | + | ||
| 547 | + public String getFcsjActual() { | ||
| 548 | + return fcsjActual; | ||
| 549 | + } | ||
| 550 | + | ||
| 551 | + public void setFcsjActual(String fcsjActual) { | ||
| 552 | + this.fcsjActual = fcsjActual; | ||
| 553 | + } | ||
| 554 | + | ||
| 555 | + public Long getFcsjActualTime() { | ||
| 556 | + return fcsjActualTime; | ||
| 557 | + } | ||
| 558 | + | ||
| 559 | + public void setFcsjActualTime(Long fcsjActualTime) { | ||
| 560 | + this.fcsjActualTime = fcsjActualTime; | ||
| 561 | + } | ||
| 562 | + | ||
| 563 | + public String getZdsjActual() { | ||
| 564 | + return zdsjActual; | ||
| 565 | + } | ||
| 566 | + | ||
| 567 | + public void setZdsjActual(String zdsjActual) { | ||
| 568 | + this.zdsjActual = zdsjActual; | ||
| 569 | + } | ||
| 570 | + | ||
| 571 | + public Long getZdsjActualTime() { | ||
| 572 | + return zdsjActualTime; | ||
| 573 | + } | ||
| 574 | + | ||
| 575 | + public void setZdsjActualTime(Long zdsjActualTime) { | ||
| 576 | + this.zdsjActualTime = zdsjActualTime; | ||
| 577 | + } | ||
| 578 | + | ||
| 579 | + public int getStatus() { | ||
| 580 | + return status; | ||
| 581 | + } | ||
| 582 | + | ||
| 583 | + public void setStatus(int status) { | ||
| 584 | + this.status = status; | ||
| 585 | + } | ||
| 586 | + | ||
| 587 | + public String getRemarks() { | ||
| 588 | + return remarks; | ||
| 589 | + } | ||
| 590 | + | ||
| 591 | + public void setRemarks(String remarks) { | ||
| 592 | + this.remarks = remarks; | ||
| 593 | + } | ||
| 594 | + | ||
| 595 | + public String getDfsj() { | ||
| 596 | + return dfsj; | ||
| 597 | + } | ||
| 598 | + | ||
| 599 | + public void setDfsj(String dfsj) { | ||
| 600 | + this.dfsj = dfsj; | ||
| 601 | + } | ||
| 602 | + | ||
| 603 | + public Long getDfsjT() { | ||
| 604 | + return dfsjT; | ||
| 605 | + } | ||
| 606 | + | ||
| 607 | + public void setDfsjT(Long dfsjT) { | ||
| 608 | + this.dfsjT = dfsjT; | ||
| 609 | + } | ||
| 610 | + | ||
| 611 | + | ||
| 612 | + @Transient | ||
| 613 | + private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm"); | ||
| 614 | + @Transient | ||
| 615 | + private static DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm"); | ||
| 616 | + | ||
| 617 | + public void setDfsjAll(Long dfsjT) { | ||
| 618 | + this.dfsjT = dfsjT; | ||
| 619 | + this.dfsj = fmtHHmm.print(this.dfsjT); | ||
| 620 | + } | ||
| 621 | + | ||
| 622 | + public void setDfsjAll(String dfsj) { | ||
| 623 | + this.dfsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + dfsj); | ||
| 624 | + this.dfsj = dfsj; | ||
| 625 | + } | ||
| 626 | + | ||
| 627 | + public void calcEndTime(){ | ||
| 628 | + //计划终点时间 | ||
| 629 | + if(this.getBcsj() != null){ | ||
| 630 | + //this.setZdsjT(this.getDfsjT() + (this.getBcsj() * 60 * 1000)); | ||
| 631 | + this.setZdsjT(this.getFcsjT() + (this.getBcsj() * 60 * 1000));//计划终点时间不变 | ||
| 632 | + this.setZdsj(fmtHHmm.print(this.zdsjT)); | ||
| 633 | + } | ||
| 634 | + } | ||
| 635 | + | ||
| 636 | + public Integer getDirectiveState() { | ||
| 637 | + return directiveState; | ||
| 638 | + } | ||
| 639 | + | ||
| 640 | + public void setDirectiveState(Integer directiveState) { | ||
| 641 | + this.directiveState = directiveState; | ||
| 642 | + } | ||
| 643 | + | ||
| 644 | + @Override | ||
| 645 | + public boolean equals(Object obj) { | ||
| 646 | + try{ | ||
| 647 | + return this.id.equals(((ScheduleRealInfo)obj).getId()); | ||
| 648 | + }catch(Exception e){ | ||
| 649 | + return false; | ||
| 650 | + } | ||
| 651 | + } | ||
| 652 | + | ||
| 653 | + @Override | ||
| 654 | + public int hashCode() { | ||
| 655 | + return ("schedule_" + this.id).hashCode(); | ||
| 656 | + } | ||
| 657 | + | ||
| 658 | + public boolean isSflj() { | ||
| 659 | + return sflj; | ||
| 660 | + } | ||
| 661 | + | ||
| 662 | + public void setSflj(boolean sflj) { | ||
| 663 | + this.sflj = sflj; | ||
| 664 | + } | ||
| 665 | + | ||
| 666 | + /** | ||
| 667 | + * | ||
| 668 | + * @Title: setFcsjAll | ||
| 669 | + * @Description: TODO(设置计划发车时间) | ||
| 670 | + * @throws | ||
| 671 | + */ | ||
| 672 | + public void setFcsjAll(String fcsj){ | ||
| 673 | + this.fcsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + fcsj); | ||
| 674 | + this.fcsj = fcsj; | ||
| 675 | + } | ||
| 676 | + | ||
| 677 | + /** | ||
| 678 | + * | ||
| 679 | + * @Title: setFcsjAll | ||
| 680 | + * @Description: TODO(设置计划发车时间) | ||
| 681 | + * @throws | ||
| 682 | + */ | ||
| 683 | + public void setFcsjAll(Long fcsjT){ | ||
| 684 | + this.fcsjT = fcsjT; | ||
| 685 | + this.fcsj = fmtHHmm.print(fcsjT); | ||
| 686 | + } | ||
| 687 | + | ||
| 688 | + /** | ||
| 689 | + * | ||
| 690 | + * @Title: setFcsjActualAll | ||
| 691 | + * @Description: TODO(设置实际发车时间 字符串) | ||
| 692 | + * @throws | ||
| 693 | + */ | ||
| 694 | + public void setFcsjActualAll(String fcsjActual){ | ||
| 695 | + this.fcsjActualTime = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + fcsjActual); | ||
| 696 | + this.fcsjActual = fcsjActual; | ||
| 697 | + calcStatus(); | ||
| 698 | + } | ||
| 699 | + | ||
| 700 | + /** | ||
| 701 | + * | ||
| 702 | + * @Title: setFcsjActualAll | ||
| 703 | + * @Description: TODO(设置实际发车时间 时间戳) | ||
| 704 | + * @throws | ||
| 705 | + */ | ||
| 706 | + public void setFcsjActualAll(Long t){ | ||
| 707 | + | ||
| 708 | + this.fcsjActualTime = t; | ||
| 709 | + if(null == t) | ||
| 710 | + this.fcsjActual = null; | ||
| 711 | + else | ||
| 712 | + this.fcsjActual = fmtHHmm.print(t); | ||
| 713 | + | ||
| 714 | + //更新班次状态 | ||
| 715 | + calcStatus(); | ||
| 716 | + } | ||
| 717 | + | ||
| 718 | + /** | ||
| 719 | + * | ||
| 720 | + * @Title: setFcsjActualAll | ||
| 721 | + * @Description: TODO(设置实际终点时间) | ||
| 722 | + * @throws | ||
| 723 | + */ | ||
| 724 | + public void setZdsjActualAll(Long t){ | ||
| 725 | + this.zdsjActualTime = t; | ||
| 726 | + | ||
| 727 | + if(null == t) | ||
| 728 | + this.zdsjActual = null; | ||
| 729 | + else | ||
| 730 | + this.zdsjActual = fmtHHmm.print(t); | ||
| 731 | + | ||
| 732 | + //更新班次状态 | ||
| 733 | + calcStatus(); | ||
| 734 | + } | ||
| 735 | + | ||
| 736 | + /** | ||
| 737 | + * | ||
| 738 | + * @Title: setFcsjActualAll | ||
| 739 | + * @Description: TODO(设置实际终点时间) | ||
| 740 | + * @throws | ||
| 741 | + */ | ||
| 742 | + public void setZdsjActualAll(String zdsjActual){ | ||
| 743 | + this.zdsjActualTime = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + zdsjActual); | ||
| 744 | + this.zdsjActual = zdsjActual; | ||
| 745 | + | ||
| 746 | + calcStatus(); | ||
| 747 | + } | ||
| 748 | + | ||
| 749 | + public Long getSpId() { | ||
| 750 | + return spId; | ||
| 751 | + } | ||
| 752 | + | ||
| 753 | + public void setSpId(Long spId) { | ||
| 754 | + this.spId = spId; | ||
| 755 | + } | ||
| 756 | + | ||
| 757 | + public String getRealExecDate() { | ||
| 758 | + return realExecDate; | ||
| 759 | + } | ||
| 760 | + | ||
| 761 | + public void setRealExecDate(String realExecDate) { | ||
| 762 | + this.realExecDate = realExecDate; | ||
| 763 | + } | ||
| 764 | + | ||
| 765 | + public void calcStatus() { | ||
| 766 | + if(this.status == -1) | ||
| 767 | + return; | ||
| 768 | + | ||
| 769 | + this.status = 0; | ||
| 770 | + if(StringUtils.isNotBlank(this.fcsjActual)){ | ||
| 771 | + this.status = 1; | ||
| 772 | + | ||
| 773 | + //进出场班次并且没有计划里程的 | ||
| 774 | + if((this.bcType.equals("out") || this.bcType.equals("in")) | ||
| 775 | + && this.jhlc == null){ | ||
| 776 | + this.status = 2; | ||
| 777 | + } | ||
| 778 | + } | ||
| 779 | + if(StringUtils.isNotBlank(this.zdsjActual)) | ||
| 780 | + this.status = 2; | ||
| 781 | + } | ||
| 782 | + | ||
| 783 | + public void destroy(){ | ||
| 784 | + this.jhlc = 0.0; | ||
| 785 | + if(this.isSflj()) | ||
| 786 | + this.jhlcOrig = 0.0; | ||
| 787 | + this.status = -1; | ||
| 788 | + this.clearFcsjActual(); | ||
| 789 | + } | ||
| 790 | + | ||
| 791 | + public boolean isDestroy(){ | ||
| 792 | + return this.status == -1; | ||
| 793 | + } | ||
| 794 | + | ||
| 795 | +/* public boolean isNotDestroy(){ | ||
| 796 | + return this.status != -1; | ||
| 797 | + }*/ | ||
| 798 | + | ||
| 799 | + public Set<ChildTaskPlan> getcTasks() { | ||
| 800 | + return cTasks; | ||
| 801 | + } | ||
| 802 | + | ||
| 803 | +/* public void setcTasks(Set<ChildTaskPlan> cTasks) { | ||
| 804 | + this.cTasks = cTasks; | ||
| 805 | + }*/ | ||
| 806 | + | ||
| 807 | + public String getScheduleDateStr() { | ||
| 808 | + return scheduleDateStr; | ||
| 809 | + } | ||
| 810 | + | ||
| 811 | + public void setScheduleDateStr(String scheduleDateStr) { | ||
| 812 | + this.scheduleDateStr = scheduleDateStr; | ||
| 813 | + } | ||
| 814 | + | ||
| 815 | + public void clearFcsjActual(){ | ||
| 816 | + this.setFcsjActual(null); | ||
| 817 | + this.setFcsjActualTime(null); | ||
| 818 | + this.calcStatus(); | ||
| 819 | + } | ||
| 820 | + | ||
| 821 | + //清除实际终点时间 | ||
| 822 | + public void clearZdsjActual(){ | ||
| 823 | + this.setZdsjActual(null); | ||
| 824 | + this.setZdsjActualTime(null); | ||
| 825 | + | ||
| 826 | + calcStatus(); | ||
| 827 | + } | ||
| 828 | + | ||
| 829 | + public boolean isLate() { | ||
| 830 | + return late; | ||
| 831 | + } | ||
| 832 | + | ||
| 833 | + public void setLate(boolean late) { | ||
| 834 | + this.late = late; | ||
| 835 | + } | ||
| 836 | + | ||
| 837 | + public String getAdjustExps() { | ||
| 838 | + return adjustExps; | ||
| 839 | + } | ||
| 840 | + | ||
| 841 | + public void setAdjustExps(String adjustExps) { | ||
| 842 | + this.adjustExps = adjustExps; | ||
| 843 | + } | ||
| 844 | + | ||
| 845 | + public boolean isReissue() { | ||
| 846 | + return reissue; | ||
| 847 | + } | ||
| 848 | + | ||
| 849 | + public void setReissue(boolean reissue) { | ||
| 850 | + this.reissue = reissue; | ||
| 851 | + } | ||
| 852 | + | ||
| 853 | + public Double getRealMileage() { | ||
| 854 | + return realMileage; | ||
| 855 | + } | ||
| 856 | + | ||
| 857 | + public void setRealMileage(Double realMileage) { | ||
| 858 | + this.realMileage = realMileage; | ||
| 859 | + } | ||
| 860 | + | ||
| 861 | + public Double getJhlcOrig() { | ||
| 862 | + return jhlcOrig; | ||
| 863 | + } | ||
| 864 | + | ||
| 865 | + public void setJhlcOrig(Double jhlcOrig) { | ||
| 866 | + this.jhlcOrig = jhlcOrig; | ||
| 867 | + } | ||
| 868 | + | ||
| 869 | + public void reCalcLate() { | ||
| 870 | + if(this.getStatus() == 0 | ||
| 871 | + && this.getFcsjActual() == null | ||
| 872 | + && this.dfsjT < System.currentTimeMillis()){ | ||
| 873 | + this.setLate(true); | ||
| 874 | + } | ||
| 875 | + else | ||
| 876 | + this.setLate(false); | ||
| 877 | + } | ||
| 878 | + | ||
| 879 | + public String getRemark() { | ||
| 880 | + return remark; | ||
| 881 | + } | ||
| 882 | + | ||
| 883 | + public void setRemark(String remark) { | ||
| 884 | + this.remark = remark; | ||
| 885 | + } | ||
| 886 | + | ||
| 887 | + public float getLateMinute() { | ||
| 888 | + return lateMinute; | ||
| 889 | + } | ||
| 890 | + | ||
| 891 | + public void setLateMinute(float lateMinute) { | ||
| 892 | + this.lateMinute = lateMinute; | ||
| 893 | + } | ||
| 894 | + | ||
| 895 | + public boolean isLate2() { | ||
| 896 | + return late2; | ||
| 897 | + } | ||
| 898 | + | ||
| 899 | + public void setLate2(boolean late2) { | ||
| 900 | + this.late2 = late2; | ||
| 901 | + } | ||
| 902 | + | ||
| 903 | + public int getFcpSn() { | ||
| 904 | + return fcpSn; | ||
| 905 | + } | ||
| 906 | + | ||
| 907 | + public void setFcpSn(int fcpSn) { | ||
| 908 | + this.fcpSn = fcpSn; | ||
| 909 | + } | ||
| 910 | + | ||
| 911 | + public boolean _isInout(){ | ||
| 912 | + return this.getBcType().equals("out") || this.getBcType().equals("in"); | ||
| 913 | + } | ||
| 914 | + | ||
| 915 | + public boolean isDeleted() { | ||
| 916 | + return deleted; | ||
| 917 | + } | ||
| 918 | + | ||
| 919 | + public void setDeleted(boolean deleted) { | ||
| 920 | + this.deleted = deleted; | ||
| 921 | + } | ||
| 922 | + | ||
| 923 | + public int getSaveFailCount() { | ||
| 924 | + return saveFailCount; | ||
| 925 | + } | ||
| 926 | + | ||
| 927 | + public void setSaveFailCount(int saveFailCount) { | ||
| 928 | + this.saveFailCount = saveFailCount; | ||
| 929 | + } | ||
| 930 | + | ||
| 931 | + public int getSiginCompate() { | ||
| 932 | + return siginCompate; | ||
| 933 | + } | ||
| 934 | + | ||
| 935 | + public void setSiginCompate(int siginCompate) { | ||
| 936 | + this.siginCompate = siginCompate; | ||
| 937 | + } | ||
| 938 | + | ||
| 939 | + public Integer getDriftStatus() { | ||
| 940 | + return driftStatus; | ||
| 941 | + } | ||
| 942 | + | ||
| 943 | + public void setDriftStatus(Integer driftStatus) { | ||
| 944 | + this.driftStatus = driftStatus; | ||
| 945 | + } | ||
| 946 | + | ||
| 947 | + public boolean isCcService() { | ||
| 948 | + return ccService; | ||
| 949 | + } | ||
| 950 | + | ||
| 951 | + public void setCcService(boolean ccService) { | ||
| 952 | + this.ccService = ccService; | ||
| 953 | + } | ||
| 954 | + | ||
| 955 | + public String getMajorStationName() { | ||
| 956 | + return majorStationName; | ||
| 957 | + } | ||
| 958 | + | ||
| 959 | + public void setMajorStationName(String majorStationName) { | ||
| 960 | + this.majorStationName = majorStationName; | ||
| 961 | + } | ||
| 962 | +} | ||
| 963 | + |
src/main/java/com/bsth/entity/result/CalcWaybill.java
| 1 | -package com.bsth.entity.result; | ||
| 2 | - | ||
| 3 | -import java.util.Date; | ||
| 4 | - | ||
| 5 | -public class CalcWaybill { | ||
| 6 | - /* 主键*/ | ||
| 7 | - private Long id; | ||
| 8 | - /* 公司代码*/ | ||
| 9 | - private String gsdm; | ||
| 10 | - /* 公司名称*/ | ||
| 11 | - private String gsname; | ||
| 12 | - /* 分公司代码*/ | ||
| 13 | - private String fgsdm; | ||
| 14 | - /* 分公司名称*/ | ||
| 15 | - private String fgsname; | ||
| 16 | - /* 日期*/ | ||
| 17 | - private Date rq; | ||
| 18 | - /* 日期字符串*/ | ||
| 19 | - private String rqStr; | ||
| 20 | - /* 线路编码*/ | ||
| 21 | - private String xl; | ||
| 22 | - /* 线路名称*/ | ||
| 23 | - private String xlName; | ||
| 24 | - /* 车辆自编号*/ | ||
| 25 | - private String cl; | ||
| 26 | - /* 路牌名字*/ | ||
| 27 | - private String lp; | ||
| 28 | - /* 驾驶员工号*/ | ||
| 29 | - private String jGh; | ||
| 30 | - /* 驾驶员名字*/ | ||
| 31 | - private String jName; | ||
| 32 | - /* 售票员工号*/ | ||
| 33 | - private String sGh; | ||
| 34 | - /* 售票员名字*/ | ||
| 35 | - private String sName; | ||
| 36 | - /* 计划营运班次*/ | ||
| 37 | - private int jhyybc; | ||
| 38 | - /* 计划早高峰营运班次*/ | ||
| 39 | - private int jhyybczgf; | ||
| 40 | - /* 计划晚高峰营运班次*/ | ||
| 41 | - private int jhyybcwgf; | ||
| 42 | - /* 计划空驶班次*/ | ||
| 43 | - private int jhksbc; | ||
| 44 | - /* 计划进出场班次*/ | ||
| 45 | - private int jhjccbc; | ||
| 46 | - /* 计划营运里程*/ | ||
| 47 | - private Double jhyylc; | ||
| 48 | - /* 计划空驶里程*/ | ||
| 49 | - private Double jhkslc; | ||
| 50 | - /* 计划进出场里程*/ | ||
| 51 | - private Double jhjcclc; | ||
| 52 | - /* 实际营运班次*/ | ||
| 53 | - private int sjyybc; | ||
| 54 | - /* 实际早高峰营运班次*/ | ||
| 55 | - private int sjyybczgf; | ||
| 56 | - /* 实际晚高峰营运班次*/ | ||
| 57 | - private int sjyybcwgf; | ||
| 58 | - /* 实际空驶班次*/ | ||
| 59 | - private int sjksbc; | ||
| 60 | - /* 实际进出场班次*/ | ||
| 61 | - private int sjjccbc; | ||
| 62 | - /* 实际营运里程*/ | ||
| 63 | - private Double sjyylc; | ||
| 64 | - /* 实际空驶里程*/ | ||
| 65 | - private Double sjkslc; | ||
| 66 | - /* 实际进出场里程*/ | ||
| 67 | - private Double sjjcclc; | ||
| 68 | - /* 临加班次*/ | ||
| 69 | - private int ljbc; | ||
| 70 | - /* 临加早高峰班次*/ | ||
| 71 | - private int ljbczgf; | ||
| 72 | - /* 临加晚高峰班次*/ | ||
| 73 | - private int ljbcwgf; | ||
| 74 | - /* 临加营运里程*/ | ||
| 75 | - private Double ljyylc; | ||
| 76 | - /* 临加空驶里程*/ | ||
| 77 | - private Double ljkslc; | ||
| 78 | - /* 临加进出场里程*/ | ||
| 79 | - private Double ljjcclc; | ||
| 80 | - /* 烂班班次*/ | ||
| 81 | - private int lbbc; | ||
| 82 | - /* 烂班里程*/ | ||
| 83 | - private Double lblc; | ||
| 84 | - /* 路阻*/ | ||
| 85 | - private Double lblcLz; | ||
| 86 | - /* 吊慢*/ | ||
| 87 | - private Double lblcDm; | ||
| 88 | - /* 故障*/ | ||
| 89 | - private Double lblcGz; | ||
| 90 | - /* 纠纷*/ | ||
| 91 | - private Double lblcJf; | ||
| 92 | - /* 肇事*/ | ||
| 93 | - private Double lblcZs; | ||
| 94 | - /* 缺人*/ | ||
| 95 | - private Double lblcQr; | ||
| 96 | - /* 缺车*/ | ||
| 97 | - private Double lblcQc; | ||
| 98 | - /* 客稀*/ | ||
| 99 | - private Double lblcKx; | ||
| 100 | - /* 气候*/ | ||
| 101 | - private Double lblcQh; | ||
| 102 | - /* 援外*/ | ||
| 103 | - private Double lblcYw; | ||
| 104 | - /* 其他*/ | ||
| 105 | - private Double lblcQt; | ||
| 106 | - /* 放站班次*/ | ||
| 107 | - private int fzbc; | ||
| 108 | - /* 放站早高峰班次*/ | ||
| 109 | - private int fzbczgf; | ||
| 110 | - /* 放站晚高峰班次*/ | ||
| 111 | - private int fgbcwgf; | ||
| 112 | - /* 掉头班次*/ | ||
| 113 | - private int dtbc; | ||
| 114 | - /* 掉头早高峰班次*/ | ||
| 115 | - private int dtbczgf; | ||
| 116 | - /* 掉头晚高峰班次*/ | ||
| 117 | - private int dtbcwgf; | ||
| 118 | - /* 计划内营运公里*/ | ||
| 119 | - private Double jhnyygl; | ||
| 120 | - /* 计划外营运公里*/ | ||
| 121 | - private Double jhwyygl; | ||
| 122 | - /* 计划内进出场空驶*/ | ||
| 123 | - private Double jhnjcc; | ||
| 124 | - /* 计划外进出场空驶*/ | ||
| 125 | - private Double jhwjcc; | ||
| 126 | - /* 故障进出场*/ | ||
| 127 | - private Double gzjcc; | ||
| 128 | - /* 肇事进出场*/ | ||
| 129 | - private Double zsjcc; | ||
| 130 | - /* 纠纷进出场*/ | ||
| 131 | - private Double jfjcc; | ||
| 132 | - /* 其他进出场*/ | ||
| 133 | - private Double qtjcc; | ||
| 134 | - /* 实际空放空驶*/ | ||
| 135 | - private Double kfks; | ||
| 136 | - /* 创建时间*/ | ||
| 137 | - private Date createTime; | ||
| 138 | - /* 修改时间*/ | ||
| 139 | - private Date updateTime; | ||
| 140 | - public Long getId() { | ||
| 141 | - return id; | ||
| 142 | - } | ||
| 143 | - public void setId(Long id) { | ||
| 144 | - this.id = id; | ||
| 145 | - } | ||
| 146 | - public String getGsdm() { | ||
| 147 | - return gsdm; | ||
| 148 | - } | ||
| 149 | - public void setGsdm(String gsdm) { | ||
| 150 | - this.gsdm = gsdm; | ||
| 151 | - } | ||
| 152 | - public String getGsname() { | ||
| 153 | - return gsname; | ||
| 154 | - } | ||
| 155 | - public void setGsname(String gsname) { | ||
| 156 | - this.gsname = gsname; | ||
| 157 | - } | ||
| 158 | - public String getFgsdm() { | ||
| 159 | - return fgsdm; | ||
| 160 | - } | ||
| 161 | - public void setFgsdm(String fgsdm) { | ||
| 162 | - this.fgsdm = fgsdm; | ||
| 163 | - } | ||
| 164 | - public String getFgsname() { | ||
| 165 | - return fgsname; | ||
| 166 | - } | ||
| 167 | - public void setFgsname(String fgsname) { | ||
| 168 | - this.fgsname = fgsname; | ||
| 169 | - } | ||
| 170 | - public Date getRq() { | ||
| 171 | - return rq; | ||
| 172 | - } | ||
| 173 | - public void setRq(Date rq) { | ||
| 174 | - this.rq = rq; | ||
| 175 | - } | ||
| 176 | - public String getRqStr() { | ||
| 177 | - return rqStr; | ||
| 178 | - } | ||
| 179 | - public void setRqStr(String rqStr) { | ||
| 180 | - this.rqStr = rqStr; | ||
| 181 | - } | ||
| 182 | - public String getXl() { | ||
| 183 | - return xl; | ||
| 184 | - } | ||
| 185 | - public void setXl(String xl) { | ||
| 186 | - this.xl = xl; | ||
| 187 | - } | ||
| 188 | - public String getXlName() { | ||
| 189 | - return xlName; | ||
| 190 | - } | ||
| 191 | - public void setXlName(String xlName) { | ||
| 192 | - this.xlName = xlName; | ||
| 193 | - } | ||
| 194 | - public String getCl() { | ||
| 195 | - return cl; | ||
| 196 | - } | ||
| 197 | - public void setCl(String cl) { | ||
| 198 | - this.cl = cl; | ||
| 199 | - } | ||
| 200 | - public String getLp() { | ||
| 201 | - return lp; | ||
| 202 | - } | ||
| 203 | - public void setLp(String lp) { | ||
| 204 | - this.lp = lp; | ||
| 205 | - } | ||
| 206 | - public String getjGh() { | ||
| 207 | - return jGh; | ||
| 208 | - } | ||
| 209 | - public void setjGh(String jGh) { | ||
| 210 | - this.jGh = jGh; | ||
| 211 | - } | ||
| 212 | - public String getjName() { | ||
| 213 | - return jName; | ||
| 214 | - } | ||
| 215 | - public void setjName(String jName) { | ||
| 216 | - this.jName = jName; | ||
| 217 | - } | ||
| 218 | - public String getsGh() { | ||
| 219 | - return sGh; | ||
| 220 | - } | ||
| 221 | - public void setsGh(String sGh) { | ||
| 222 | - this.sGh = sGh; | ||
| 223 | - } | ||
| 224 | - public String getsName() { | ||
| 225 | - return sName; | ||
| 226 | - } | ||
| 227 | - public void setsName(String sName) { | ||
| 228 | - this.sName = sName; | ||
| 229 | - } | ||
| 230 | - public int getJhyybc() { | ||
| 231 | - return jhyybc; | ||
| 232 | - } | ||
| 233 | - public void setJhyybc(int jhyybc) { | ||
| 234 | - this.jhyybc = jhyybc; | ||
| 235 | - } | ||
| 236 | - public int getJhyybczgf() { | ||
| 237 | - return jhyybczgf; | ||
| 238 | - } | ||
| 239 | - public void setJhyybczgf(int jhyybczgf) { | ||
| 240 | - this.jhyybczgf = jhyybczgf; | ||
| 241 | - } | ||
| 242 | - public int getJhyybcwgf() { | ||
| 243 | - return jhyybcwgf; | ||
| 244 | - } | ||
| 245 | - public void setJhyybcwgf(int jhyybcwgf) { | ||
| 246 | - this.jhyybcwgf = jhyybcwgf; | ||
| 247 | - } | ||
| 248 | - public int getJhksbc() { | ||
| 249 | - return jhksbc; | ||
| 250 | - } | ||
| 251 | - public void setJhksbc(int jhksbc) { | ||
| 252 | - this.jhksbc = jhksbc; | ||
| 253 | - } | ||
| 254 | - public int getJhjccbc() { | ||
| 255 | - return jhjccbc; | ||
| 256 | - } | ||
| 257 | - public void setJhjccbc(int jhjccbc) { | ||
| 258 | - this.jhjccbc = jhjccbc; | ||
| 259 | - } | ||
| 260 | - public Double getJhyylc() { | ||
| 261 | - return jhyylc; | ||
| 262 | - } | ||
| 263 | - public void setJhyylc(Double jhyylc) { | ||
| 264 | - this.jhyylc = jhyylc; | ||
| 265 | - } | ||
| 266 | - public Double getJhkslc() { | ||
| 267 | - return jhkslc; | ||
| 268 | - } | ||
| 269 | - public void setJhkslc(Double jhkslc) { | ||
| 270 | - this.jhkslc = jhkslc; | ||
| 271 | - } | ||
| 272 | - public Double getJhjcclc() { | ||
| 273 | - return jhjcclc; | ||
| 274 | - } | ||
| 275 | - public void setJhjcclc(Double jhjcclc) { | ||
| 276 | - this.jhjcclc = jhjcclc; | ||
| 277 | - } | ||
| 278 | - public int getSjyybc() { | ||
| 279 | - return sjyybc; | ||
| 280 | - } | ||
| 281 | - public void setSjyybc(int sjyybc) { | ||
| 282 | - this.sjyybc = sjyybc; | ||
| 283 | - } | ||
| 284 | - public int getSjyybczgf() { | ||
| 285 | - return sjyybczgf; | ||
| 286 | - } | ||
| 287 | - public void setSjyybczgf(int sjyybczgf) { | ||
| 288 | - this.sjyybczgf = sjyybczgf; | ||
| 289 | - } | ||
| 290 | - public int getSjyybcwgf() { | ||
| 291 | - return sjyybcwgf; | ||
| 292 | - } | ||
| 293 | - public void setSjyybcwgf(int sjyybcwgf) { | ||
| 294 | - this.sjyybcwgf = sjyybcwgf; | ||
| 295 | - } | ||
| 296 | - public int getSjksbc() { | ||
| 297 | - return sjksbc; | ||
| 298 | - } | ||
| 299 | - public void setSjksbc(int sjksbc) { | ||
| 300 | - this.sjksbc = sjksbc; | ||
| 301 | - } | ||
| 302 | - public int getSjjccbc() { | ||
| 303 | - return sjjccbc; | ||
| 304 | - } | ||
| 305 | - public void setSjjccbc(int sjjccbc) { | ||
| 306 | - this.sjjccbc = sjjccbc; | ||
| 307 | - } | ||
| 308 | - public Double getSjyylc() { | ||
| 309 | - return sjyylc; | ||
| 310 | - } | ||
| 311 | - public void setSjyylc(Double sjyylc) { | ||
| 312 | - this.sjyylc = sjyylc; | ||
| 313 | - } | ||
| 314 | - public Double getSjkslc() { | ||
| 315 | - return sjkslc; | ||
| 316 | - } | ||
| 317 | - public void setSjkslc(Double sjkslc) { | ||
| 318 | - this.sjkslc = sjkslc; | ||
| 319 | - } | ||
| 320 | - public Double getSjjcclc() { | ||
| 321 | - return sjjcclc; | ||
| 322 | - } | ||
| 323 | - public void setSjjcclc(Double sjjcclc) { | ||
| 324 | - this.sjjcclc = sjjcclc; | ||
| 325 | - } | ||
| 326 | - public int getLjbc() { | ||
| 327 | - return ljbc; | ||
| 328 | - } | ||
| 329 | - public void setLjbc(int ljbc) { | ||
| 330 | - this.ljbc = ljbc; | ||
| 331 | - } | ||
| 332 | - public int getLjbczgf() { | ||
| 333 | - return ljbczgf; | ||
| 334 | - } | ||
| 335 | - public void setLjbczgf(int ljbczgf) { | ||
| 336 | - this.ljbczgf = ljbczgf; | ||
| 337 | - } | ||
| 338 | - public int getLjbcwgf() { | ||
| 339 | - return ljbcwgf; | ||
| 340 | - } | ||
| 341 | - public void setLjbcwgf(int ljbcwgf) { | ||
| 342 | - this.ljbcwgf = ljbcwgf; | ||
| 343 | - } | ||
| 344 | - public Double getLjyylc() { | ||
| 345 | - return ljyylc; | ||
| 346 | - } | ||
| 347 | - public void setLjyylc(Double ljyylc) { | ||
| 348 | - this.ljyylc = ljyylc; | ||
| 349 | - } | ||
| 350 | - public Double getLjkslc() { | ||
| 351 | - return ljkslc; | ||
| 352 | - } | ||
| 353 | - public void setLjkslc(Double ljkslc) { | ||
| 354 | - this.ljkslc = ljkslc; | ||
| 355 | - } | ||
| 356 | - public Double getLjjcclc() { | ||
| 357 | - return ljjcclc; | ||
| 358 | - } | ||
| 359 | - public void setLjjcclc(Double ljjcclc) { | ||
| 360 | - this.ljjcclc = ljjcclc; | ||
| 361 | - } | ||
| 362 | - public int getLbbc() { | ||
| 363 | - return lbbc; | ||
| 364 | - } | ||
| 365 | - public void setLbbc(int lbbc) { | ||
| 366 | - this.lbbc = lbbc; | ||
| 367 | - } | ||
| 368 | - public Double getLblc() { | ||
| 369 | - return lblc; | ||
| 370 | - } | ||
| 371 | - public void setLblc(Double lblc) { | ||
| 372 | - this.lblc = lblc; | ||
| 373 | - } | ||
| 374 | - public Double getLblcLz() { | ||
| 375 | - return lblcLz; | ||
| 376 | - } | ||
| 377 | - public void setLblcLz(Double lblcLz) { | ||
| 378 | - this.lblcLz = lblcLz; | ||
| 379 | - } | ||
| 380 | - public Double getLblcDm() { | ||
| 381 | - return lblcDm; | ||
| 382 | - } | ||
| 383 | - public void setLblcDm(Double lblcDm) { | ||
| 384 | - this.lblcDm = lblcDm; | ||
| 385 | - } | ||
| 386 | - public Double getLblcGz() { | ||
| 387 | - return lblcGz; | ||
| 388 | - } | ||
| 389 | - public void setLblcGz(Double lblcGz) { | ||
| 390 | - this.lblcGz = lblcGz; | ||
| 391 | - } | ||
| 392 | - public Double getLblcJf() { | ||
| 393 | - return lblcJf; | ||
| 394 | - } | ||
| 395 | - public void setLblcJf(Double lblcJf) { | ||
| 396 | - this.lblcJf = lblcJf; | ||
| 397 | - } | ||
| 398 | - public Double getLblcZs() { | ||
| 399 | - return lblcZs; | ||
| 400 | - } | ||
| 401 | - public void setLblcZs(Double lblcZs) { | ||
| 402 | - this.lblcZs = lblcZs; | ||
| 403 | - } | ||
| 404 | - public Double getLblcQr() { | ||
| 405 | - return lblcQr; | ||
| 406 | - } | ||
| 407 | - public void setLblcQr(Double lblcQr) { | ||
| 408 | - this.lblcQr = lblcQr; | ||
| 409 | - } | ||
| 410 | - public Double getLblcQc() { | ||
| 411 | - return lblcQc; | ||
| 412 | - } | ||
| 413 | - public void setLblcQc(Double lblcQc) { | ||
| 414 | - this.lblcQc = lblcQc; | ||
| 415 | - } | ||
| 416 | - public Double getLblcKx() { | ||
| 417 | - return lblcKx; | ||
| 418 | - } | ||
| 419 | - public void setLblcKx(Double lblcKx) { | ||
| 420 | - this.lblcKx = lblcKx; | ||
| 421 | - } | ||
| 422 | - public Double getLblcQh() { | ||
| 423 | - return lblcQh; | ||
| 424 | - } | ||
| 425 | - public void setLblcQh(Double lblcQh) { | ||
| 426 | - this.lblcQh = lblcQh; | ||
| 427 | - } | ||
| 428 | - public Double getLblcYw() { | ||
| 429 | - return lblcYw; | ||
| 430 | - } | ||
| 431 | - public void setLblcYw(Double lblcYw) { | ||
| 432 | - this.lblcYw = lblcYw; | ||
| 433 | - } | ||
| 434 | - public Double getLblcQt() { | ||
| 435 | - return lblcQt; | ||
| 436 | - } | ||
| 437 | - public void setLblcQt(Double lblcQt) { | ||
| 438 | - this.lblcQt = lblcQt; | ||
| 439 | - } | ||
| 440 | - public int getFzbc() { | ||
| 441 | - return fzbc; | ||
| 442 | - } | ||
| 443 | - public void setFzbc(int fzbc) { | ||
| 444 | - this.fzbc = fzbc; | ||
| 445 | - } | ||
| 446 | - public int getFzbczgf() { | ||
| 447 | - return fzbczgf; | ||
| 448 | - } | ||
| 449 | - public void setFzbczgf(int fzbczgf) { | ||
| 450 | - this.fzbczgf = fzbczgf; | ||
| 451 | - } | ||
| 452 | - public int getFgbcwgf() { | ||
| 453 | - return fgbcwgf; | ||
| 454 | - } | ||
| 455 | - public void setFgbcwgf(int fgbcwgf) { | ||
| 456 | - this.fgbcwgf = fgbcwgf; | ||
| 457 | - } | ||
| 458 | - public int getDtbc() { | ||
| 459 | - return dtbc; | ||
| 460 | - } | ||
| 461 | - public void setDtbc(int dtbc) { | ||
| 462 | - this.dtbc = dtbc; | ||
| 463 | - } | ||
| 464 | - public int getDtbczgf() { | ||
| 465 | - return dtbczgf; | ||
| 466 | - } | ||
| 467 | - public void setDtbczgf(int dtbczgf) { | ||
| 468 | - this.dtbczgf = dtbczgf; | ||
| 469 | - } | ||
| 470 | - public int getDtbcwgf() { | ||
| 471 | - return dtbcwgf; | ||
| 472 | - } | ||
| 473 | - public void setDtbcwgf(int dtbcwgf) { | ||
| 474 | - this.dtbcwgf = dtbcwgf; | ||
| 475 | - } | ||
| 476 | - public Double getJhnyygl() { | ||
| 477 | - return jhnyygl; | ||
| 478 | - } | ||
| 479 | - public void setJhnyygl(Double jhnyygl) { | ||
| 480 | - this.jhnyygl = jhnyygl; | ||
| 481 | - } | ||
| 482 | - public Double getJhwyygl() { | ||
| 483 | - return jhwyygl; | ||
| 484 | - } | ||
| 485 | - public void setJhwyygl(Double jhwyygl) { | ||
| 486 | - this.jhwyygl = jhwyygl; | ||
| 487 | - } | ||
| 488 | - public Double getJhnjcc() { | ||
| 489 | - return jhnjcc; | ||
| 490 | - } | ||
| 491 | - public void setJhnjcc(Double jhnjcc) { | ||
| 492 | - this.jhnjcc = jhnjcc; | ||
| 493 | - } | ||
| 494 | - public Double getJhwjcc() { | ||
| 495 | - return jhwjcc; | ||
| 496 | - } | ||
| 497 | - public void setJhwjcc(Double jhwjcc) { | ||
| 498 | - this.jhwjcc = jhwjcc; | ||
| 499 | - } | ||
| 500 | - public Double getGzjcc() { | ||
| 501 | - return gzjcc; | ||
| 502 | - } | ||
| 503 | - public void setGzjcc(Double gzjcc) { | ||
| 504 | - this.gzjcc = gzjcc; | ||
| 505 | - } | ||
| 506 | - public Double getZsjcc() { | ||
| 507 | - return zsjcc; | ||
| 508 | - } | ||
| 509 | - public void setZsjcc(Double zsjcc) { | ||
| 510 | - this.zsjcc = zsjcc; | ||
| 511 | - } | ||
| 512 | - public Double getJfjcc() { | ||
| 513 | - return jfjcc; | ||
| 514 | - } | ||
| 515 | - public void setJfjcc(Double jfjcc) { | ||
| 516 | - this.jfjcc = jfjcc; | ||
| 517 | - } | ||
| 518 | - public Double getQtjcc() { | ||
| 519 | - return qtjcc; | ||
| 520 | - } | ||
| 521 | - public void setQtjcc(Double qtjcc) { | ||
| 522 | - this.qtjcc = qtjcc; | ||
| 523 | - } | ||
| 524 | - public Double getKfks() { | ||
| 525 | - return kfks; | ||
| 526 | - } | ||
| 527 | - public void setKfks(Double kfks) { | ||
| 528 | - this.kfks = kfks; | ||
| 529 | - } | ||
| 530 | - public Date getCreateTime() { | ||
| 531 | - return createTime; | ||
| 532 | - } | ||
| 533 | - public void setCreateTime(Date createTime) { | ||
| 534 | - this.createTime = createTime; | ||
| 535 | - } | ||
| 536 | - public Date getUpdateTime() { | ||
| 537 | - return updateTime; | ||
| 538 | - } | ||
| 539 | - public void setUpdateTime(Date updateTime) { | ||
| 540 | - this.updateTime = updateTime; | ||
| 541 | - } | ||
| 542 | - | ||
| 543 | - | ||
| 544 | - | ||
| 545 | -} | 1 | +package com.bsth.entity.result; |
| 2 | + | ||
| 3 | +import java.util.Date; | ||
| 4 | + | ||
| 5 | +public class CalcWaybill { | ||
| 6 | + /* 主键*/ | ||
| 7 | + private Long id; | ||
| 8 | + /* 公司代码*/ | ||
| 9 | + private String gsdm; | ||
| 10 | + /* 公司名称*/ | ||
| 11 | + private String gsname; | ||
| 12 | + /* 分公司代码*/ | ||
| 13 | + private String fgsdm; | ||
| 14 | + /* 分公司名称*/ | ||
| 15 | + private String fgsname; | ||
| 16 | + /* 日期*/ | ||
| 17 | + private Date rq; | ||
| 18 | + /* 日期字符串*/ | ||
| 19 | + private String rqStr; | ||
| 20 | + /* 线路编码*/ | ||
| 21 | + private String xl; | ||
| 22 | + /* 线路名称*/ | ||
| 23 | + private String xlName; | ||
| 24 | + /* 车辆自编号*/ | ||
| 25 | + private String cl; | ||
| 26 | + /* 路牌名字*/ | ||
| 27 | + private String lp; | ||
| 28 | + /* 驾驶员工号*/ | ||
| 29 | + private String jGh; | ||
| 30 | + /* 驾驶员名字*/ | ||
| 31 | + private String jName; | ||
| 32 | + /* 售票员工号*/ | ||
| 33 | + private String sGh; | ||
| 34 | + /* 售票员名字*/ | ||
| 35 | + private String sName; | ||
| 36 | + /* 计划营运班次*/ | ||
| 37 | + private int jhyybc; | ||
| 38 | + /* 计划早高峰营运班次*/ | ||
| 39 | + private int jhyybczgf; | ||
| 40 | + /* 计划晚高峰营运班次*/ | ||
| 41 | + private int jhyybcwgf; | ||
| 42 | + /* 计划非营运班次*/ | ||
| 43 | + private int jhfyybc; | ||
| 44 | + /* 计划营运里程*/ | ||
| 45 | + private Double jhyylc; | ||
| 46 | + /* 计划非营运里程*/ | ||
| 47 | + private Double jhfyylc; | ||
| 48 | + /* 实际营运班次*/ | ||
| 49 | + private int sjyybc; | ||
| 50 | + /* 实际早高峰营运班次*/ | ||
| 51 | + private int sjyybczgf; | ||
| 52 | + /* 实际晚高峰营运班次*/ | ||
| 53 | + private int sjyybcwgf; | ||
| 54 | + /* 实际非营运班次*/ | ||
| 55 | + private int sjfyybc; | ||
| 56 | + /* 实际营运里程*/ | ||
| 57 | + private Double sjyylc; | ||
| 58 | + /* 实际非营运里程*/ | ||
| 59 | + private Double sjfyylc; | ||
| 60 | + /* 临加班次*/ | ||
| 61 | + private int ljbc; | ||
| 62 | + /* 临加早高峰班次*/ | ||
| 63 | + private int ljbczgf; | ||
| 64 | + /* 临加晚高峰班次*/ | ||
| 65 | + private int ljbcwgf; | ||
| 66 | + /* 临加营运里程*/ | ||
| 67 | + private Double ljyylc; | ||
| 68 | + /* 临加非营运里程*/ | ||
| 69 | + private Double ljfyylc; | ||
| 70 | + /* 烂班班次*/ | ||
| 71 | + private int lbbc; | ||
| 72 | + /* 烂班里程*/ | ||
| 73 | + private Double lblc; | ||
| 74 | + /* 路阻*/ | ||
| 75 | + private Double lblcLz; | ||
| 76 | + /* 吊慢*/ | ||
| 77 | + private Double lblcDm; | ||
| 78 | + /* 故障*/ | ||
| 79 | + private Double lblcGz; | ||
| 80 | + /* 纠纷*/ | ||
| 81 | + private Double lblcJf; | ||
| 82 | + /* 肇事*/ | ||
| 83 | + private Double lblcZs; | ||
| 84 | + /* 缺人*/ | ||
| 85 | + private Double lblcQr; | ||
| 86 | + /* 缺车*/ | ||
| 87 | + private Double lblcQc; | ||
| 88 | + /* 客稀*/ | ||
| 89 | + private Double lblcKx; | ||
| 90 | + /* 气候*/ | ||
| 91 | + private Double lblcQh; | ||
| 92 | + /* 援外*/ | ||
| 93 | + private Double lblcYw; | ||
| 94 | + /* 其他*/ | ||
| 95 | + private Double lblcQt; | ||
| 96 | + /* 放站班次*/ | ||
| 97 | + private int fzbc; | ||
| 98 | + /* 放站早高峰班次*/ | ||
| 99 | + private int fzbczgf; | ||
| 100 | + /* 放站晚高峰班次*/ | ||
| 101 | + private int fzbcwgf; | ||
| 102 | + /* 掉头班次*/ | ||
| 103 | + private int dtbc; | ||
| 104 | + /* 掉头早高峰班次*/ | ||
| 105 | + private int dtbczgf; | ||
| 106 | + /* 掉头晚高峰班次*/ | ||
| 107 | + private int dtbcwgf; | ||
| 108 | + /* 创建时间*/ | ||
| 109 | + private Date createTime; | ||
| 110 | + /* 修改时间*/ | ||
| 111 | + private Date updateTime; | ||
| 112 | + public Long getId() { | ||
| 113 | + return id; | ||
| 114 | + } | ||
| 115 | + public void setId(Long id) { | ||
| 116 | + this.id = id; | ||
| 117 | + } | ||
| 118 | + public String getGsdm() { | ||
| 119 | + return gsdm; | ||
| 120 | + } | ||
| 121 | + public void setGsdm(String gsdm) { | ||
| 122 | + this.gsdm = gsdm; | ||
| 123 | + } | ||
| 124 | + public String getGsname() { | ||
| 125 | + return gsname; | ||
| 126 | + } | ||
| 127 | + public void setGsname(String gsname) { | ||
| 128 | + this.gsname = gsname; | ||
| 129 | + } | ||
| 130 | + public String getFgsdm() { | ||
| 131 | + return fgsdm; | ||
| 132 | + } | ||
| 133 | + public void setFgsdm(String fgsdm) { | ||
| 134 | + this.fgsdm = fgsdm; | ||
| 135 | + } | ||
| 136 | + public String getFgsname() { | ||
| 137 | + return fgsname; | ||
| 138 | + } | ||
| 139 | + public void setFgsname(String fgsname) { | ||
| 140 | + this.fgsname = fgsname; | ||
| 141 | + } | ||
| 142 | + public Date getRq() { | ||
| 143 | + return rq; | ||
| 144 | + } | ||
| 145 | + public void setRq(Date rq) { | ||
| 146 | + this.rq = rq; | ||
| 147 | + } | ||
| 148 | + public String getRqStr() { | ||
| 149 | + return rqStr; | ||
| 150 | + } | ||
| 151 | + public void setRqStr(String rqStr) { | ||
| 152 | + this.rqStr = rqStr; | ||
| 153 | + } | ||
| 154 | + public String getXl() { | ||
| 155 | + return xl; | ||
| 156 | + } | ||
| 157 | + public void setXl(String xl) { | ||
| 158 | + this.xl = xl; | ||
| 159 | + } | ||
| 160 | + public String getXlName() { | ||
| 161 | + return xlName; | ||
| 162 | + } | ||
| 163 | + public void setXlName(String xlName) { | ||
| 164 | + this.xlName = xlName; | ||
| 165 | + } | ||
| 166 | + public String getCl() { | ||
| 167 | + return cl; | ||
| 168 | + } | ||
| 169 | + public void setCl(String cl) { | ||
| 170 | + this.cl = cl; | ||
| 171 | + } | ||
| 172 | + public String getLp() { | ||
| 173 | + return lp; | ||
| 174 | + } | ||
| 175 | + public void setLp(String lp) { | ||
| 176 | + this.lp = lp; | ||
| 177 | + } | ||
| 178 | + public String getjGh() { | ||
| 179 | + return jGh; | ||
| 180 | + } | ||
| 181 | + public void setjGh(String jGh) { | ||
| 182 | + this.jGh = jGh; | ||
| 183 | + } | ||
| 184 | + public String getjName() { | ||
| 185 | + return jName; | ||
| 186 | + } | ||
| 187 | + public void setjName(String jName) { | ||
| 188 | + this.jName = jName; | ||
| 189 | + } | ||
| 190 | + public String getsGh() { | ||
| 191 | + return sGh; | ||
| 192 | + } | ||
| 193 | + public void setsGh(String sGh) { | ||
| 194 | + this.sGh = sGh; | ||
| 195 | + } | ||
| 196 | + public String getsName() { | ||
| 197 | + return sName; | ||
| 198 | + } | ||
| 199 | + public void setsName(String sName) { | ||
| 200 | + this.sName = sName; | ||
| 201 | + } | ||
| 202 | + public int getJhyybc() { | ||
| 203 | + return jhyybc; | ||
| 204 | + } | ||
| 205 | + public void setJhyybc(int jhyybc) { | ||
| 206 | + this.jhyybc = jhyybc; | ||
| 207 | + } | ||
| 208 | + public int getJhyybczgf() { | ||
| 209 | + return jhyybczgf; | ||
| 210 | + } | ||
| 211 | + public void setJhyybczgf(int jhyybczgf) { | ||
| 212 | + this.jhyybczgf = jhyybczgf; | ||
| 213 | + } | ||
| 214 | + public int getJhyybcwgf() { | ||
| 215 | + return jhyybcwgf; | ||
| 216 | + } | ||
| 217 | + public void setJhyybcwgf(int jhyybcwgf) { | ||
| 218 | + this.jhyybcwgf = jhyybcwgf; | ||
| 219 | + } | ||
| 220 | + public int getJhfyybc() { | ||
| 221 | + return jhfyybc; | ||
| 222 | + } | ||
| 223 | + public void setJhfyybc(int jhfyybc) { | ||
| 224 | + this.jhfyybc = jhfyybc; | ||
| 225 | + } | ||
| 226 | + public Double getJhyylc() { | ||
| 227 | + return jhyylc; | ||
| 228 | + } | ||
| 229 | + public void setJhyylc(Double jhyylc) { | ||
| 230 | + this.jhyylc = jhyylc; | ||
| 231 | + } | ||
| 232 | + public Double getJhfyylc() { | ||
| 233 | + return jhfyylc; | ||
| 234 | + } | ||
| 235 | + public void setJhfyylc(Double jhfyylc) { | ||
| 236 | + this.jhfyylc = jhfyylc; | ||
| 237 | + } | ||
| 238 | + public int getSjyybc() { | ||
| 239 | + return sjyybc; | ||
| 240 | + } | ||
| 241 | + public void setSjyybc(int sjyybc) { | ||
| 242 | + this.sjyybc = sjyybc; | ||
| 243 | + } | ||
| 244 | + public int getSjyybczgf() { | ||
| 245 | + return sjyybczgf; | ||
| 246 | + } | ||
| 247 | + public void setSjyybczgf(int sjyybczgf) { | ||
| 248 | + this.sjyybczgf = sjyybczgf; | ||
| 249 | + } | ||
| 250 | + public int getSjyybcwgf() { | ||
| 251 | + return sjyybcwgf; | ||
| 252 | + } | ||
| 253 | + public void setSjyybcwgf(int sjyybcwgf) { | ||
| 254 | + this.sjyybcwgf = sjyybcwgf; | ||
| 255 | + } | ||
| 256 | + public int getSjfyybc() { | ||
| 257 | + return sjfyybc; | ||
| 258 | + } | ||
| 259 | + public void setSjfyybc(int sjfyybc) { | ||
| 260 | + this.sjfyybc = sjfyybc; | ||
| 261 | + } | ||
| 262 | + public Double getSjyylc() { | ||
| 263 | + return sjyylc; | ||
| 264 | + } | ||
| 265 | + public void setSjyylc(Double sjyylc) { | ||
| 266 | + this.sjyylc = sjyylc; | ||
| 267 | + } | ||
| 268 | + public Double getSjfyylc() { | ||
| 269 | + return sjfyylc; | ||
| 270 | + } | ||
| 271 | + public void setSjfyylc(Double sjfyylc) { | ||
| 272 | + this.sjfyylc = sjfyylc; | ||
| 273 | + } | ||
| 274 | + public int getLjbc() { | ||
| 275 | + return ljbc; | ||
| 276 | + } | ||
| 277 | + public void setLjbc(int ljbc) { | ||
| 278 | + this.ljbc = ljbc; | ||
| 279 | + } | ||
| 280 | + public int getLjbczgf() { | ||
| 281 | + return ljbczgf; | ||
| 282 | + } | ||
| 283 | + public void setLjbczgf(int ljbczgf) { | ||
| 284 | + this.ljbczgf = ljbczgf; | ||
| 285 | + } | ||
| 286 | + public int getLjbcwgf() { | ||
| 287 | + return ljbcwgf; | ||
| 288 | + } | ||
| 289 | + public void setLjbcwgf(int ljbcwgf) { | ||
| 290 | + this.ljbcwgf = ljbcwgf; | ||
| 291 | + } | ||
| 292 | + public Double getLjyylc() { | ||
| 293 | + return ljyylc; | ||
| 294 | + } | ||
| 295 | + public void setLjyylc(Double ljyylc) { | ||
| 296 | + this.ljyylc = ljyylc; | ||
| 297 | + } | ||
| 298 | + public Double getLjfyylc() { | ||
| 299 | + return ljfyylc; | ||
| 300 | + } | ||
| 301 | + public void setLjfyylc(Double ljfyylc) { | ||
| 302 | + this.ljfyylc = ljfyylc; | ||
| 303 | + } | ||
| 304 | + public int getLbbc() { | ||
| 305 | + return lbbc; | ||
| 306 | + } | ||
| 307 | + public void setLbbc(int lbbc) { | ||
| 308 | + this.lbbc = lbbc; | ||
| 309 | + } | ||
| 310 | + public Double getLblc() { | ||
| 311 | + return lblc; | ||
| 312 | + } | ||
| 313 | + public void setLblc(Double lblc) { | ||
| 314 | + this.lblc = lblc; | ||
| 315 | + } | ||
| 316 | + public Double getLblcLz() { | ||
| 317 | + return lblcLz; | ||
| 318 | + } | ||
| 319 | + public void setLblcLz(Double lblcLz) { | ||
| 320 | + this.lblcLz = lblcLz; | ||
| 321 | + } | ||
| 322 | + public Double getLblcDm() { | ||
| 323 | + return lblcDm; | ||
| 324 | + } | ||
| 325 | + public void setLblcDm(Double lblcDm) { | ||
| 326 | + this.lblcDm = lblcDm; | ||
| 327 | + } | ||
| 328 | + public Double getLblcGz() { | ||
| 329 | + return lblcGz; | ||
| 330 | + } | ||
| 331 | + public void setLblcGz(Double lblcGz) { | ||
| 332 | + this.lblcGz = lblcGz; | ||
| 333 | + } | ||
| 334 | + public Double getLblcJf() { | ||
| 335 | + return lblcJf; | ||
| 336 | + } | ||
| 337 | + public void setLblcJf(Double lblcJf) { | ||
| 338 | + this.lblcJf = lblcJf; | ||
| 339 | + } | ||
| 340 | + public Double getLblcZs() { | ||
| 341 | + return lblcZs; | ||
| 342 | + } | ||
| 343 | + public void setLblcZs(Double lblcZs) { | ||
| 344 | + this.lblcZs = lblcZs; | ||
| 345 | + } | ||
| 346 | + public Double getLblcQr() { | ||
| 347 | + return lblcQr; | ||
| 348 | + } | ||
| 349 | + public void setLblcQr(Double lblcQr) { | ||
| 350 | + this.lblcQr = lblcQr; | ||
| 351 | + } | ||
| 352 | + public Double getLblcQc() { | ||
| 353 | + return lblcQc; | ||
| 354 | + } | ||
| 355 | + public void setLblcQc(Double lblcQc) { | ||
| 356 | + this.lblcQc = lblcQc; | ||
| 357 | + } | ||
| 358 | + public Double getLblcKx() { | ||
| 359 | + return lblcKx; | ||
| 360 | + } | ||
| 361 | + public void setLblcKx(Double lblcKx) { | ||
| 362 | + this.lblcKx = lblcKx; | ||
| 363 | + } | ||
| 364 | + public Double getLblcQh() { | ||
| 365 | + return lblcQh; | ||
| 366 | + } | ||
| 367 | + public void setLblcQh(Double lblcQh) { | ||
| 368 | + this.lblcQh = lblcQh; | ||
| 369 | + } | ||
| 370 | + public Double getLblcYw() { | ||
| 371 | + return lblcYw; | ||
| 372 | + } | ||
| 373 | + public void setLblcYw(Double lblcYw) { | ||
| 374 | + this.lblcYw = lblcYw; | ||
| 375 | + } | ||
| 376 | + public Double getLblcQt() { | ||
| 377 | + return lblcQt; | ||
| 378 | + } | ||
| 379 | + public void setLblcQt(Double lblcQt) { | ||
| 380 | + this.lblcQt = lblcQt; | ||
| 381 | + } | ||
| 382 | + public int getFzbc() { | ||
| 383 | + return fzbc; | ||
| 384 | + } | ||
| 385 | + public void setFzbc(int fzbc) { | ||
| 386 | + this.fzbc = fzbc; | ||
| 387 | + } | ||
| 388 | + public int getFzbczgf() { | ||
| 389 | + return fzbczgf; | ||
| 390 | + } | ||
| 391 | + public void setFzbczgf(int fzbczgf) { | ||
| 392 | + this.fzbczgf = fzbczgf; | ||
| 393 | + } | ||
| 394 | + public int getFzbcwgf() { | ||
| 395 | + return fzbcwgf; | ||
| 396 | + } | ||
| 397 | + public void setFzbcwgf(int fzbcwgf) { | ||
| 398 | + this.fzbcwgf = fzbcwgf; | ||
| 399 | + } | ||
| 400 | + public int getDtbc() { | ||
| 401 | + return dtbc; | ||
| 402 | + } | ||
| 403 | + public void setDtbc(int dtbc) { | ||
| 404 | + this.dtbc = dtbc; | ||
| 405 | + } | ||
| 406 | + public int getDtbczgf() { | ||
| 407 | + return dtbczgf; | ||
| 408 | + } | ||
| 409 | + public void setDtbczgf(int dtbczgf) { | ||
| 410 | + this.dtbczgf = dtbczgf; | ||
| 411 | + } | ||
| 412 | + public int getDtbcwgf() { | ||
| 413 | + return dtbcwgf; | ||
| 414 | + } | ||
| 415 | + public void setDtbcwgf(int dtbcwgf) { | ||
| 416 | + this.dtbcwgf = dtbcwgf; | ||
| 417 | + } | ||
| 418 | + public Date getCreateTime() { | ||
| 419 | + return createTime; | ||
| 420 | + } | ||
| 421 | + public void setCreateTime(Date createTime) { | ||
| 422 | + this.createTime = createTime; | ||
| 423 | + } | ||
| 424 | + public Date getUpdateTime() { | ||
| 425 | + return updateTime; | ||
| 426 | + } | ||
| 427 | + public void setUpdateTime(Date updateTime) { | ||
| 428 | + this.updateTime = updateTime; | ||
| 429 | + } | ||
| 430 | + | ||
| 431 | + | ||
| 432 | + | ||
| 433 | +} |
src/main/java/com/bsth/handler/UserCarCountHandler.java
| 1 | -package com.bsth.handler; | ||
| 2 | - | ||
| 3 | -import com.bsth.entity.LineConfig; | ||
| 4 | -import com.bsth.entity.ScheduleRealInfo; | ||
| 5 | -import com.bsth.entity.result.WorkingHours_jsy; | ||
| 6 | -import com.bsth.service.LineConfigService; | ||
| 7 | -import com.bsth.service.ScheduleRealInfoService; | ||
| 8 | -import com.bsth.util.ConvertUtil; | ||
| 9 | -import com.google.common.collect.ArrayListMultimap; | ||
| 10 | -import com.mysql.fabric.xmlrpc.base.Data; | ||
| 11 | - | ||
| 12 | -import org.joda.time.DateTime; | ||
| 13 | -import org.slf4j.Logger; | ||
| 14 | -import org.slf4j.LoggerFactory; | ||
| 15 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 16 | -import org.springframework.jdbc.core.BatchPreparedStatementSetter; | ||
| 17 | -import org.springframework.jdbc.core.JdbcTemplate; | ||
| 18 | -import org.springframework.jdbc.datasource.DataSourceTransactionManager; | ||
| 19 | -import org.springframework.stereotype.Component; | ||
| 20 | -import org.springframework.transaction.TransactionDefinition; | ||
| 21 | -import org.springframework.transaction.TransactionStatus; | ||
| 22 | -import org.springframework.transaction.support.DefaultTransactionDefinition; | ||
| 23 | - | ||
| 24 | -import java.lang.reflect.Field; | ||
| 25 | -import java.sql.PreparedStatement; | ||
| 26 | -import java.sql.SQLException; | ||
| 27 | -import java.text.SimpleDateFormat; | ||
| 28 | -import java.util.*; | ||
| 29 | - | ||
| 30 | -/** | ||
| 31 | - * 人员车辆班次里程处理程序 | ||
| 32 | - */ | ||
| 33 | -@Component | ||
| 34 | -public class UserCarCountHandler { | ||
| 35 | - | ||
| 36 | - /** | ||
| 37 | - * 结算规则, 周几 ——> 结算前几天 (考虑间隔) | ||
| 38 | - */ | ||
| 39 | - private static Map<Integer, Integer> runRuleMap; | ||
| 40 | - | ||
| 41 | - /** | ||
| 42 | - * 间隔1天(留一天的时间给各个公司检查路单) | ||
| 43 | - */ | ||
| 44 | - private final static int DAY_SPACE = 1; | ||
| 45 | - | ||
| 46 | - /** | ||
| 47 | - * 判定分班时间阈值 | ||
| 48 | - */ | ||
| 49 | - private final static long FB_THRESHOLD_TIME = 1000 * 60 * 60 * 2; | ||
| 50 | - | ||
| 51 | - @Autowired | ||
| 52 | - ScheduleRealInfoService scheduleRealInfoService; | ||
| 53 | - @Autowired | ||
| 54 | - LineConfigService lineConfigService; | ||
| 55 | - | ||
| 56 | - @Autowired | ||
| 57 | - JdbcTemplate jdbcTemplate; | ||
| 58 | - | ||
| 59 | - Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 60 | - | ||
| 61 | - static { | ||
| 62 | - //0 是周天 | ||
| 63 | - runRuleMap = new HashMap<>(); | ||
| 64 | - runRuleMap.put(1, 0); | ||
| 65 | - runRuleMap.put(2, 3); | ||
| 66 | - runRuleMap.put(3, 1); | ||
| 67 | - runRuleMap.put(4, 1); | ||
| 68 | - runRuleMap.put(5, 1); | ||
| 69 | - runRuleMap.put(6, 1); | ||
| 70 | - runRuleMap.put(0, 0); | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | - /*public void calc() { | ||
| 74 | - DateTime dt = DateTime.now(); | ||
| 75 | - Calendar calendar = Calendar.getInstance(); | ||
| 76 | - calendar.setTime(dt.toDate()); | ||
| 77 | - //今天要结算多少天的工时 | ||
| 78 | - int count = runRuleMap.get(calendar.get(Calendar.DAY_OF_WEEK) - 1); | ||
| 79 | - | ||
| 80 | - dt = dt.minusDays(DAY_SPACE + count); | ||
| 81 | - String rq; | ||
| 82 | - for (int i = 0; i < count; i++) { | ||
| 83 | - rq = dt.toString("yyyy-MM-dd"); | ||
| 84 | - calc(rq); | ||
| 85 | - dt = dt.plusDays(1); | ||
| 86 | - } | ||
| 87 | - }*/ | ||
| 88 | - | ||
| 89 | - public void calcLast(){ | ||
| 90 | - //计算前一天班次里程 | ||
| 91 | - Date dNow = new Date(); | ||
| 92 | - Calendar calendar = Calendar.getInstance(); | ||
| 93 | - calendar.setTime(dNow); | ||
| 94 | - calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天 | ||
| 95 | - Date dBefore = calendar.getTime(); //得到前一天的时间 | ||
| 96 | - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); //设置时间格式 | ||
| 97 | - SimpleDateFormat sdf2=new SimpleDateFormat(" HH:mm");//得到当前时间 | ||
| 98 | - String lastRq = sdf.format(dBefore); //格式化前一天 | ||
| 99 | - String time=sdf2.format(dNow); //格式化当前时间 | ||
| 100 | - String times[] =time.split(":"); | ||
| 101 | - time=times[0]+times[1]; | ||
| 102 | - int t=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]); | ||
| 103 | - calc(lastRq,t); | ||
| 104 | - | ||
| 105 | - } | ||
| 106 | - | ||
| 107 | - private void calc(String rq,int t){ | ||
| 108 | - try { | ||
| 109 | - List<LineConfig> listLineConfig=lineConfigService.findAllList(); | ||
| 110 | - for (int i = 0; i < listLineConfig.size(); i++) { | ||
| 111 | - LineConfig lineConfig=listLineConfig.get(i); | ||
| 112 | - String lineCode=lineConfig.getLineCode(); | ||
| 113 | - String startOpt=lineConfig.getStartOpt(); | ||
| 114 | - String times[] =startOpt.split(":"); | ||
| 115 | - int time=Integer.parseInt(times[0])*60+Integer.parseInt(times[1])-30; | ||
| 116 | - //线路重新排版前30分钟 统计该线路前一天的 班次 里程 | ||
| 117 | - if(time>t){ | ||
| 118 | - //查询该线路前一天的排班 | ||
| 119 | - } | ||
| 120 | - | ||
| 121 | - } | ||
| 122 | - | ||
| 123 | - }catch (Exception e) { | ||
| 124 | - logger.error("", e); | ||
| 125 | - } | ||
| 126 | - } | ||
| 127 | - | ||
| 128 | - /*private void calc(String rq) { | ||
| 129 | - try { | ||
| 130 | - logger.info("开始结算工时: " + rq); | ||
| 131 | - List<WorkingHours_jsy> list = new ArrayList<>(); | ||
| 132 | - //实际班次,路单数据 | ||
| 133 | - List<ScheduleRealInfo> sjList = scheduleRealInfoService.findAll(rq); | ||
| 134 | - //计划班次,计调数据 | ||
| 135 | - List<ScheduleRealInfo> jhList = scheduleRealInfoService.findAll_JH(rq); | ||
| 136 | - | ||
| 137 | - //附加停站时间 | ||
| 138 | - addStopTime(sjList); | ||
| 139 | - addStopTime(jhList); | ||
| 140 | - | ||
| 141 | - //合计工时 | ||
| 142 | - List<WorkingHours_jsy> jhArray = count(jhList, true); | ||
| 143 | - List<WorkingHours_jsy> sjArray = count(sjList, false); | ||
| 144 | - | ||
| 145 | - //合并计划和实际 | ||
| 146 | - Map<String, WorkingHours_jsy> merges = new HashMap<>(); | ||
| 147 | - for (WorkingHours_jsy jh : jhArray) { | ||
| 148 | - jh.setHoursSj(0); | ||
| 149 | - merges.put(jh.keys(), jh); | ||
| 150 | - } | ||
| 151 | - | ||
| 152 | - String key; | ||
| 153 | - for (WorkingHours_jsy sj : sjArray) { | ||
| 154 | - key = sj.keys(); | ||
| 155 | - if (merges.containsKey(key)) { | ||
| 156 | - merges.get(key).setHoursSj(sj.getHoursSj()); | ||
| 157 | - } else { | ||
| 158 | - sj.setHoursJh(0); | ||
| 159 | - merges.put(key, sj); | ||
| 160 | - } | ||
| 161 | - } | ||
| 162 | - //入库 | ||
| 163 | - save(new ArrayList(merges.values())); | ||
| 164 | - logger.info("结算工时成功: " + rq + " -size: " + merges.values().size()); | ||
| 165 | - } catch (Exception e) { | ||
| 166 | - logger.error("", e); | ||
| 167 | - } | ||
| 168 | - }*/ | ||
| 169 | - | ||
| 170 | - private void addStopTime(List<ScheduleRealInfo> list) throws NoSuchFieldException { | ||
| 171 | - Class clazz = ScheduleRealInfo.class; | ||
| 172 | - //按驾驶员分组班次 | ||
| 173 | - ArrayListMultimap<String, ScheduleRealInfo> multimap = new ConvertUtil<ScheduleRealInfo>() | ||
| 174 | - .groupMultiList(list, "", clazz.getDeclaredField("jGh")); | ||
| 175 | - | ||
| 176 | - //为班次附上停站时间 | ||
| 177 | - Set<String> ks = multimap.keySet(); | ||
| 178 | - for (String k : ks) { | ||
| 179 | - calcOne(multimap.get(k)); | ||
| 180 | - } | ||
| 181 | - } | ||
| 182 | - | ||
| 183 | - private List<WorkingHours_jsy> count(List<ScheduleRealInfo> list, boolean isJh) throws NoSuchFieldException { | ||
| 184 | - List<WorkingHours_jsy> rs = new ArrayList<>(); | ||
| 185 | - Class clazz = ScheduleRealInfo.class; | ||
| 186 | - //按 线路_路牌_驾驶员_车辆分组数据 | ||
| 187 | - Field xl_f = clazz.getDeclaredField("xlBm"), | ||
| 188 | - lp_f = clazz.getDeclaredField("lpName"), | ||
| 189 | - jsy_f = clazz.getDeclaredField("jGh"), | ||
| 190 | - cl_f = clazz.getDeclaredField("clZbh"); | ||
| 191 | - | ||
| 192 | - ArrayListMultimap<String, ScheduleRealInfo> multimap = new ConvertUtil<ScheduleRealInfo>() | ||
| 193 | - .groupMultiList(list, "_", xl_f, lp_f, jsy_f, cl_f); | ||
| 194 | - | ||
| 195 | - //合计工时 | ||
| 196 | - Date d = new Date(); | ||
| 197 | - Set<String> ks = multimap.keySet(); | ||
| 198 | - WorkingHours_jsy wh; | ||
| 199 | - for (String k : ks) { | ||
| 200 | - wh = sum(multimap.get(k), isJh); | ||
| 201 | - wh.setCreateDate(d); | ||
| 202 | - rs.add(wh); | ||
| 203 | - } | ||
| 204 | - | ||
| 205 | - return rs; | ||
| 206 | - } | ||
| 207 | - | ||
| 208 | - private void save(final List<WorkingHours_jsy> list) { | ||
| 209 | - String sql = "insert into z_calc_hoursjsy(company_id, sub_company_id, line_code, line_name, jsy, jsy_name, nbbm, lp_name, rq, hours_jh, hours_sj, source, remarks, create_date) " + | ||
| 210 | - " VALUES(?, ?, ?, ?, ?,?, ?, ?,?,?,?,?,?,?)"; | ||
| 211 | - | ||
| 212 | - //编程式事务 | ||
| 213 | - DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemplate.getDataSource()); | ||
| 214 | - DefaultTransactionDefinition def = new DefaultTransactionDefinition(); | ||
| 215 | - def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); | ||
| 216 | - TransactionStatus status = tran.getTransaction(def); | ||
| 217 | - | ||
| 218 | - try { | ||
| 219 | - jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() { | ||
| 220 | - @Override | ||
| 221 | - public void setValues(PreparedStatement ps, int i) throws SQLException { | ||
| 222 | - WorkingHours_jsy wh = list.get(i); | ||
| 223 | - ps.setString(1, wh.getCompanyId()); | ||
| 224 | - ps.setString(2, wh.getSubCompanyId()); | ||
| 225 | - ps.setString(3, wh.getLineCode()); | ||
| 226 | - ps.setString(4, wh.getLineName()); | ||
| 227 | - ps.setString(5, wh.getJsy()); | ||
| 228 | - ps.setString(6, wh.getJsyName()); | ||
| 229 | - ps.setString(7, wh.getNbbm()); | ||
| 230 | - ps.setString(8, wh.getLpName()); | ||
| 231 | - ps.setString(9, wh.getRq()); | ||
| 232 | - ps.setDouble(10, wh.getHoursJh()); | ||
| 233 | - ps.setDouble(11, wh.getHoursSj()); | ||
| 234 | - ps.setInt(12, wh.getSource()); | ||
| 235 | - ps.setString(13, wh.getRemarks()); | ||
| 236 | - ps.setDate(14, new java.sql.Date(wh.getCreateDate().getTime())); | ||
| 237 | - } | ||
| 238 | - | ||
| 239 | - @Override | ||
| 240 | - public int getBatchSize() { | ||
| 241 | - return list.size(); | ||
| 242 | - } | ||
| 243 | - }); | ||
| 244 | - | ||
| 245 | - tran.commit(status); | ||
| 246 | - } catch (Exception e) { | ||
| 247 | - tran.rollback(status); | ||
| 248 | - logger.error("", e); | ||
| 249 | - } | ||
| 250 | - } | ||
| 251 | - | ||
| 252 | - | ||
| 253 | - /** | ||
| 254 | - * 合计工时 | ||
| 255 | - * | ||
| 256 | - * @param list | ||
| 257 | - * @return | ||
| 258 | - */ | ||
| 259 | - private WorkingHours_jsy sum(List<ScheduleRealInfo> list, boolean jh) { | ||
| 260 | - ScheduleRealInfo sch = list.get(0); | ||
| 261 | - WorkingHours_jsy wh = new WorkingHours_jsy(); | ||
| 262 | - | ||
| 263 | - wh.setCompanyId(sch.getGsBm()); | ||
| 264 | - wh.setSubCompanyId(sch.getFgsBm()); | ||
| 265 | - wh.setLineCode(sch.getXlBm()); | ||
| 266 | - wh.setLpName(sch.getLpName()); | ||
| 267 | - wh.setJsy(sch.getjGh()); | ||
| 268 | - wh.setJsyName(sch.getjName()); | ||
| 269 | - wh.setNbbm(sch.getClZbh()); | ||
| 270 | - wh.setLineName(sch.getXlName()); | ||
| 271 | - wh.setRq(sch.getScheduleDateStr()); | ||
| 272 | - //wh.set | ||
| 273 | - Integer sum = 0; | ||
| 274 | - | ||
| 275 | - for (ScheduleRealInfo s : list) { | ||
| 276 | - sum += s.getHours(); | ||
| 277 | - } | ||
| 278 | - | ||
| 279 | - if (jh) | ||
| 280 | - wh.setHoursJh(sum); | ||
| 281 | - else | ||
| 282 | - wh.setHoursSj(sum); | ||
| 283 | - return wh; | ||
| 284 | - } | ||
| 285 | - | ||
| 286 | - /** | ||
| 287 | - * 计算每个班次的工时(包括停站时间) | ||
| 288 | - * | ||
| 289 | - * @param list | ||
| 290 | - */ | ||
| 291 | - private void calcOne(List<ScheduleRealInfo> list) { | ||
| 292 | - if (list.size() <= 1) | ||
| 293 | - return; | ||
| 294 | - | ||
| 295 | - | ||
| 296 | - Collections.sort(list, new Comparator<ScheduleRealInfo>() { | ||
| 297 | - @Override | ||
| 298 | - public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) { | ||
| 299 | - return (int) (s1.getDfsjT() - s2.getDfsjT()); | ||
| 300 | - } | ||
| 301 | - }); | ||
| 302 | - | ||
| 303 | - int len = list.size() - 1; | ||
| 304 | - for (int i = 0; i < len; i++) { | ||
| 305 | - calcToNextHours(list.get(i), list.get(i + 1)); | ||
| 306 | - } | ||
| 307 | - | ||
| 308 | - } | ||
| 309 | - | ||
| 310 | - /** | ||
| 311 | - * 当前班次 和 下一个班次计算工时 | ||
| 312 | - * | ||
| 313 | - * @param sch | ||
| 314 | - * @param next | ||
| 315 | - */ | ||
| 316 | - private void calcToNextHours(ScheduleRealInfo sch, ScheduleRealInfo next) { | ||
| 317 | - /*if(sch.getjGh().equals("008435") && sch.getClZbh().equals("W0F-017")) | ||
| 318 | - System.out.println("aaa");*/ | ||
| 319 | - //分班班次 | ||
| 320 | - /*if (isIn(sch) && isOut(next) ) | ||
| 321 | - return;*/ | ||
| 322 | - | ||
| 323 | - //分班间隔 | ||
| 324 | - if (next.getFcsjT() - sch.getFcsjT() >= FB_THRESHOLD_TIME){ | ||
| 325 | - if(sch.getStatus()==-1) | ||
| 326 | - sch.setHours(0); | ||
| 327 | - return; | ||
| 328 | - } | ||
| 329 | - | ||
| 330 | - //把停站时间算进去 | ||
| 331 | - //sch.setHours((int) ((next.getFcsjT() - sch.getFcsjT()) / 1000 / 60)); | ||
| 332 | - sch.setHours((int) ((next.getFcsjActualTime() - sch.getFcsjActualTime()) / 1000 / 60)); | ||
| 333 | - } | ||
| 334 | - | ||
| 335 | - private boolean isIn(ScheduleRealInfo sch) { | ||
| 336 | - return sch.getBcType().equals("in"); | ||
| 337 | - } | ||
| 338 | - | ||
| 339 | - private boolean isOut(ScheduleRealInfo sch) { | ||
| 340 | - return sch.getBcType().equals("out"); | ||
| 341 | - } | ||
| 342 | -} | 1 | +package com.bsth.handler; |
| 2 | + | ||
| 3 | +import com.bsth.entity.LineConfig; | ||
| 4 | +import com.bsth.entity.ScheduleRealInfo; | ||
| 5 | +import com.bsth.entity.result.WorkingHours_jsy; | ||
| 6 | +import com.bsth.service.LineConfigService; | ||
| 7 | +import com.bsth.service.ScheduleRealInfoService; | ||
| 8 | +import com.bsth.util.ConvertUtil; | ||
| 9 | +import com.google.common.collect.ArrayListMultimap; | ||
| 10 | +import com.mysql.fabric.xmlrpc.base.Data; | ||
| 11 | + | ||
| 12 | +import org.joda.time.DateTime; | ||
| 13 | +import org.slf4j.Logger; | ||
| 14 | +import org.slf4j.LoggerFactory; | ||
| 15 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 16 | +import org.springframework.jdbc.core.BatchPreparedStatementSetter; | ||
| 17 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 18 | +import org.springframework.jdbc.datasource.DataSourceTransactionManager; | ||
| 19 | +import org.springframework.stereotype.Component; | ||
| 20 | +import org.springframework.transaction.TransactionDefinition; | ||
| 21 | +import org.springframework.transaction.TransactionStatus; | ||
| 22 | +import org.springframework.transaction.support.DefaultTransactionDefinition; | ||
| 23 | + | ||
| 24 | +import java.lang.reflect.Field; | ||
| 25 | +import java.sql.PreparedStatement; | ||
| 26 | +import java.sql.SQLException; | ||
| 27 | +import java.text.SimpleDateFormat; | ||
| 28 | +import java.util.*; | ||
| 29 | + | ||
| 30 | +/** | ||
| 31 | + * 人员车辆班次里程处理程序 | ||
| 32 | + */ | ||
| 33 | +@Component | ||
| 34 | +public class UserCarCountHandler { | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 结算规则, 周几 ——> 结算前几天 (考虑间隔) | ||
| 38 | + */ | ||
| 39 | + private static Map<Integer, Integer> runRuleMap; | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * 间隔1天(留一天的时间给各个公司检查路单) | ||
| 43 | + */ | ||
| 44 | + private final static int DAY_SPACE = 1; | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 判定分班时间阈值 | ||
| 48 | + */ | ||
| 49 | + private final static long FB_THRESHOLD_TIME = 1000 * 60 * 60 * 2; | ||
| 50 | + | ||
| 51 | + @Autowired | ||
| 52 | + ScheduleRealInfoService scheduleRealInfoService; | ||
| 53 | + @Autowired | ||
| 54 | + LineConfigService lineConfigService; | ||
| 55 | + | ||
| 56 | + @Autowired | ||
| 57 | + JdbcTemplate jdbcTemplate; | ||
| 58 | + | ||
| 59 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 60 | + | ||
| 61 | + static { | ||
| 62 | + //0 是周天 | ||
| 63 | + runRuleMap = new HashMap<>(); | ||
| 64 | + runRuleMap.put(1, 0); | ||
| 65 | + runRuleMap.put(2, 3); | ||
| 66 | + runRuleMap.put(3, 1); | ||
| 67 | + runRuleMap.put(4, 1); | ||
| 68 | + runRuleMap.put(5, 1); | ||
| 69 | + runRuleMap.put(6, 1); | ||
| 70 | + runRuleMap.put(0, 0); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + /*public void calc() { | ||
| 74 | + DateTime dt = DateTime.now(); | ||
| 75 | + Calendar calendar = Calendar.getInstance(); | ||
| 76 | + calendar.setTime(dt.toDate()); | ||
| 77 | + //今天要结算多少天的工时 | ||
| 78 | + int count = runRuleMap.get(calendar.get(Calendar.DAY_OF_WEEK) - 1); | ||
| 79 | + | ||
| 80 | + dt = dt.minusDays(DAY_SPACE + count); | ||
| 81 | + String rq; | ||
| 82 | + for (int i = 0; i < count; i++) { | ||
| 83 | + rq = dt.toString("yyyy-MM-dd"); | ||
| 84 | + calc(rq); | ||
| 85 | + dt = dt.plusDays(1); | ||
| 86 | + } | ||
| 87 | + }*/ | ||
| 88 | + | ||
| 89 | + public void calcLast(){ | ||
| 90 | + //计算前一天班次里程 | ||
| 91 | + Date dNow = new Date(); | ||
| 92 | + Calendar calendar = Calendar.getInstance(); | ||
| 93 | + calendar.setTime(dNow); | ||
| 94 | + calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天 | ||
| 95 | + Date dBefore = calendar.getTime(); //得到前一天的时间 | ||
| 96 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); //设置时间格式 | ||
| 97 | + SimpleDateFormat sdf2=new SimpleDateFormat(" HH:mm");//得到当前时间 | ||
| 98 | + String lastRq = sdf.format(dBefore); //格式化前一天 | ||
| 99 | + String time=sdf2.format(dNow); //格式化当前时间 | ||
| 100 | + String times[] =time.split(":"); | ||
| 101 | + time=times[0]+times[1]; | ||
| 102 | + int t=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]); | ||
| 103 | + calc(lastRq,t); | ||
| 104 | + | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + private void calc(String rq,int t){ | ||
| 108 | + try { | ||
| 109 | + List<LineConfig> listLineConfig=lineConfigService.findAllList(); | ||
| 110 | + for (int i = 0; i < listLineConfig.size(); i++) { | ||
| 111 | + LineConfig lineConfig=listLineConfig.get(i); | ||
| 112 | + String lineCode=lineConfig.getLineCode(); | ||
| 113 | + String startOpt=lineConfig.getStartOpt(); | ||
| 114 | + String times[] =startOpt.split(":"); | ||
| 115 | + int time=Integer.parseInt(times[0])*60+Integer.parseInt(times[1])-30; | ||
| 116 | + //线路重新排版前30分钟 统计该线路前一天的 班次 里程 | ||
| 117 | + if(time>t){ | ||
| 118 | + //查询该线路前一天的排班 | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + }catch (Exception e) { | ||
| 124 | + logger.error("", e); | ||
| 125 | + } | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + /*private void calc(String rq) { | ||
| 129 | + try { | ||
| 130 | + logger.info("开始结算工时: " + rq); | ||
| 131 | + List<WorkingHours_jsy> list = new ArrayList<>(); | ||
| 132 | + //实际班次,路单数据 | ||
| 133 | + List<ScheduleRealInfo> sjList = scheduleRealInfoService.findAll(rq); | ||
| 134 | + //计划班次,计调数据 | ||
| 135 | + List<ScheduleRealInfo> jhList = scheduleRealInfoService.findAll_JH(rq); | ||
| 136 | + | ||
| 137 | + //附加停站时间 | ||
| 138 | + addStopTime(sjList); | ||
| 139 | + addStopTime(jhList); | ||
| 140 | + | ||
| 141 | + //合计工时 | ||
| 142 | + List<WorkingHours_jsy> jhArray = count(jhList, true); | ||
| 143 | + List<WorkingHours_jsy> sjArray = count(sjList, false); | ||
| 144 | + | ||
| 145 | + //合并计划和实际 | ||
| 146 | + Map<String, WorkingHours_jsy> merges = new HashMap<>(); | ||
| 147 | + for (WorkingHours_jsy jh : jhArray) { | ||
| 148 | + jh.setHoursSj(0); | ||
| 149 | + merges.put(jh.keys(), jh); | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + String key; | ||
| 153 | + for (WorkingHours_jsy sj : sjArray) { | ||
| 154 | + key = sj.keys(); | ||
| 155 | + if (merges.containsKey(key)) { | ||
| 156 | + merges.get(key).setHoursSj(sj.getHoursSj()); | ||
| 157 | + } else { | ||
| 158 | + sj.setHoursJh(0); | ||
| 159 | + merges.put(key, sj); | ||
| 160 | + } | ||
| 161 | + } | ||
| 162 | + //入库 | ||
| 163 | + save(new ArrayList(merges.values())); | ||
| 164 | + logger.info("结算工时成功: " + rq + " -size: " + merges.values().size()); | ||
| 165 | + } catch (Exception e) { | ||
| 166 | + logger.error("", e); | ||
| 167 | + } | ||
| 168 | + }*/ | ||
| 169 | + | ||
| 170 | + private void addStopTime(List<ScheduleRealInfo> list) throws NoSuchFieldException { | ||
| 171 | + Class clazz = ScheduleRealInfo.class; | ||
| 172 | + //按驾驶员分组班次 | ||
| 173 | + ArrayListMultimap<String, ScheduleRealInfo> multimap = new ConvertUtil<ScheduleRealInfo>() | ||
| 174 | + .groupMultiList(list, "", clazz.getDeclaredField("jGh")); | ||
| 175 | + | ||
| 176 | + //为班次附上停站时间 | ||
| 177 | + Set<String> ks = multimap.keySet(); | ||
| 178 | + for (String k : ks) { | ||
| 179 | + calcOne(multimap.get(k)); | ||
| 180 | + } | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + private List<WorkingHours_jsy> count(List<ScheduleRealInfo> list, boolean isJh) throws NoSuchFieldException { | ||
| 184 | + List<WorkingHours_jsy> rs = new ArrayList<>(); | ||
| 185 | + Class clazz = ScheduleRealInfo.class; | ||
| 186 | + //按 线路_路牌_驾驶员_车辆分组数据 | ||
| 187 | + Field xl_f = clazz.getDeclaredField("xlBm"), | ||
| 188 | + lp_f = clazz.getDeclaredField("lpName"), | ||
| 189 | + jsy_f = clazz.getDeclaredField("jGh"), | ||
| 190 | + cl_f = clazz.getDeclaredField("clZbh"); | ||
| 191 | + | ||
| 192 | + ArrayListMultimap<String, ScheduleRealInfo> multimap = new ConvertUtil<ScheduleRealInfo>() | ||
| 193 | + .groupMultiList(list, "_", xl_f, lp_f, jsy_f, cl_f); | ||
| 194 | + | ||
| 195 | + //合计工时 | ||
| 196 | + Date d = new Date(); | ||
| 197 | + Set<String> ks = multimap.keySet(); | ||
| 198 | + WorkingHours_jsy wh; | ||
| 199 | + for (String k : ks) { | ||
| 200 | + wh = sum(multimap.get(k), isJh); | ||
| 201 | + wh.setCreateDate(d); | ||
| 202 | + rs.add(wh); | ||
| 203 | + } | ||
| 204 | + | ||
| 205 | + return rs; | ||
| 206 | + } | ||
| 207 | + | ||
| 208 | + private void save(final List<WorkingHours_jsy> list) { | ||
| 209 | + String sql = "insert into z_calc_hoursjsy(company_id, sub_company_id, line_code, line_name, jsy, jsy_name, nbbm, lp_name, rq, hours_jh, hours_sj, source, remarks, create_date) " + | ||
| 210 | + " VALUES(?, ?, ?, ?, ?,?, ?, ?,?,?,?,?,?,?)"; | ||
| 211 | + | ||
| 212 | + //编程式事务 | ||
| 213 | + DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemplate.getDataSource()); | ||
| 214 | + DefaultTransactionDefinition def = new DefaultTransactionDefinition(); | ||
| 215 | + def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); | ||
| 216 | + TransactionStatus status = tran.getTransaction(def); | ||
| 217 | + | ||
| 218 | + try { | ||
| 219 | + jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() { | ||
| 220 | + @Override | ||
| 221 | + public void setValues(PreparedStatement ps, int i) throws SQLException { | ||
| 222 | + WorkingHours_jsy wh = list.get(i); | ||
| 223 | + ps.setString(1, wh.getCompanyId()); | ||
| 224 | + ps.setString(2, wh.getSubCompanyId()); | ||
| 225 | + ps.setString(3, wh.getLineCode()); | ||
| 226 | + ps.setString(4, wh.getLineName()); | ||
| 227 | + ps.setString(5, wh.getJsy()); | ||
| 228 | + ps.setString(6, wh.getJsyName()); | ||
| 229 | + ps.setString(7, wh.getNbbm()); | ||
| 230 | + ps.setString(8, wh.getLpName()); | ||
| 231 | + ps.setString(9, wh.getRq()); | ||
| 232 | + ps.setDouble(10, wh.getHoursJh()); | ||
| 233 | + ps.setDouble(11, wh.getHoursSj()); | ||
| 234 | + ps.setInt(12, wh.getSource()); | ||
| 235 | + ps.setString(13, wh.getRemarks()); | ||
| 236 | + ps.setDate(14, new java.sql.Date(wh.getCreateDate().getTime())); | ||
| 237 | + } | ||
| 238 | + | ||
| 239 | + @Override | ||
| 240 | + public int getBatchSize() { | ||
| 241 | + return list.size(); | ||
| 242 | + } | ||
| 243 | + }); | ||
| 244 | + | ||
| 245 | + tran.commit(status); | ||
| 246 | + } catch (Exception e) { | ||
| 247 | + tran.rollback(status); | ||
| 248 | + logger.error("", e); | ||
| 249 | + } | ||
| 250 | + } | ||
| 251 | + | ||
| 252 | + | ||
| 253 | + /** | ||
| 254 | + * 合计工时 | ||
| 255 | + * | ||
| 256 | + * @param list | ||
| 257 | + * @return | ||
| 258 | + */ | ||
| 259 | + private WorkingHours_jsy sum(List<ScheduleRealInfo> list, boolean jh) { | ||
| 260 | + ScheduleRealInfo sch = list.get(0); | ||
| 261 | + WorkingHours_jsy wh = new WorkingHours_jsy(); | ||
| 262 | + | ||
| 263 | + wh.setCompanyId(sch.getGsBm()); | ||
| 264 | + wh.setSubCompanyId(sch.getFgsBm()); | ||
| 265 | + wh.setLineCode(sch.getXlBm()); | ||
| 266 | + wh.setLpName(sch.getLpName()); | ||
| 267 | + wh.setJsy(sch.getjGh()); | ||
| 268 | + wh.setJsyName(sch.getjName()); | ||
| 269 | + wh.setNbbm(sch.getClZbh()); | ||
| 270 | + wh.setLineName(sch.getXlName()); | ||
| 271 | + wh.setRq(sch.getScheduleDateStr()); | ||
| 272 | + //wh.set | ||
| 273 | + Integer sum = 0; | ||
| 274 | + | ||
| 275 | + for (ScheduleRealInfo s : list) { | ||
| 276 | +// sum += s.getHours(); | ||
| 277 | + } | ||
| 278 | + | ||
| 279 | + if (jh) | ||
| 280 | + wh.setHoursJh(sum); | ||
| 281 | + else | ||
| 282 | + wh.setHoursSj(sum); | ||
| 283 | + return wh; | ||
| 284 | + } | ||
| 285 | + | ||
| 286 | + /** | ||
| 287 | + * 计算每个班次的工时(包括停站时间) | ||
| 288 | + * | ||
| 289 | + * @param list | ||
| 290 | + */ | ||
| 291 | + private void calcOne(List<ScheduleRealInfo> list) { | ||
| 292 | + if (list.size() <= 1) | ||
| 293 | + return; | ||
| 294 | + | ||
| 295 | + | ||
| 296 | + Collections.sort(list, new Comparator<ScheduleRealInfo>() { | ||
| 297 | + @Override | ||
| 298 | + public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) { | ||
| 299 | + return (int) (s1.getDfsjT() - s2.getDfsjT()); | ||
| 300 | + } | ||
| 301 | + }); | ||
| 302 | + | ||
| 303 | + int len = list.size() - 1; | ||
| 304 | + for (int i = 0; i < len; i++) { | ||
| 305 | + calcToNextHours(list.get(i), list.get(i + 1)); | ||
| 306 | + } | ||
| 307 | + | ||
| 308 | + } | ||
| 309 | + | ||
| 310 | + /** | ||
| 311 | + * 当前班次 和 下一个班次计算工时 | ||
| 312 | + * | ||
| 313 | + * @param sch | ||
| 314 | + * @param next | ||
| 315 | + */ | ||
| 316 | + private void calcToNextHours(ScheduleRealInfo sch, ScheduleRealInfo next) { | ||
| 317 | + /*if(sch.getjGh().equals("008435") && sch.getClZbh().equals("W0F-017")) | ||
| 318 | + System.out.println("aaa");*/ | ||
| 319 | + //分班班次 | ||
| 320 | + /*if (isIn(sch) && isOut(next) ) | ||
| 321 | + return;*/ | ||
| 322 | + | ||
| 323 | + //分班间隔 | ||
| 324 | + if (next.getFcsjT() - sch.getFcsjT() >= FB_THRESHOLD_TIME){ | ||
| 325 | + if(sch.getStatus()==-1) | ||
| 326 | +// sch.setHours(0); | ||
| 327 | + return; | ||
| 328 | + } | ||
| 329 | + | ||
| 330 | + //把停站时间算进去 | ||
| 331 | + //sch.setHours((int) ((next.getFcsjT() - sch.getFcsjT()) / 1000 / 60)); | ||
| 332 | +// sch.setHours((int) ((next.getFcsjActualTime() - sch.getFcsjActualTime()) / 1000 / 60)); | ||
| 333 | + } | ||
| 334 | + | ||
| 335 | + private boolean isIn(ScheduleRealInfo sch) { | ||
| 336 | + return sch.getBcType().equals("in"); | ||
| 337 | + } | ||
| 338 | + | ||
| 339 | + private boolean isOut(ScheduleRealInfo sch) { | ||
| 340 | + return sch.getBcType().equals("out"); | ||
| 341 | + } | ||
| 342 | +} |
src/main/java/com/bsth/service/CulateMileageService.java
0 → 100644
| 1 | +package com.bsth.service; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import java.util.Map; | ||
| 5 | + | ||
| 6 | +import com.bsth.entity.ScheduleRealInfo; | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +public interface CulateMileageService { | ||
| 10 | + | ||
| 11 | + int culateJhyybc(List<ScheduleRealInfo> lists,String item);//计划营运班次 | ||
| 12 | + double culateJhyylc(List<ScheduleRealInfo> lists);//计划营运里程 | ||
| 13 | + int culateJhfyybc(List<ScheduleRealInfo> lists);//计划非营运班次 | ||
| 14 | + double culateJhfyylc(List<ScheduleRealInfo> lists);//计划非营运里程 | ||
| 15 | + int culateSjyybc(List<ScheduleRealInfo> lists,String item);//实际班次 | ||
| 16 | + double culateSjyylc(List<ScheduleRealInfo> lists);//实际营运里程(驾售) | ||
| 17 | + double culateSjyylc_j(List<ScheduleRealInfo> lists);//实际营运里程(驾) | ||
| 18 | + double culateSjfyylc(List<ScheduleRealInfo> lists);//实际非营运里程(驾售) | ||
| 19 | + double culateSjfyylc_j(List<ScheduleRealInfo> lists);//实际非营运里程(驾售) | ||
| 20 | + int culateLjbc(List<ScheduleRealInfo> lists,String item);//临加营运班次 | ||
| 21 | + double culateLjyylc(List<ScheduleRealInfo> lists);//临加营运里程(驾售) | ||
| 22 | + double culateLjyylc_j(List<ScheduleRealInfo> lists);//临加营运里程(驾) | ||
| 23 | + double culateLjfyylc(List<ScheduleRealInfo> lists);//临加非营运里程(驾售) | ||
| 24 | + double culateLjfyylc_j(List<ScheduleRealInfo> lists);//临加非营运里程(驾) | ||
| 25 | + int culateLbbc(List<ScheduleRealInfo> lists);//烂班班次 | ||
| 26 | + double culateLbgl(List<ScheduleRealInfo> lists);//烂班公里 | ||
| 27 | + double culateCJLC(List<ScheduleRealInfo> lists,String item);//烂班公里详细 | ||
| 28 | + int culateDtfzbc(List<ScheduleRealInfo> lists,String type,String item);//掉头放站班次 | ||
| 29 | + | ||
| 30 | +} | ||
| 31 | + |
src/main/java/com/bsth/service/impl/CulateMileageServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.impl; | ||
| 2 | + | ||
| 3 | +import java.util.ArrayList; | ||
| 4 | +import java.util.HashMap; | ||
| 5 | +import java.util.Iterator; | ||
| 6 | +import java.util.List; | ||
| 7 | +import java.util.Map; | ||
| 8 | +import java.util.Set; | ||
| 9 | + | ||
| 10 | +import org.apache.commons.lang.StringUtils; | ||
| 11 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 12 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 13 | +import org.springframework.stereotype.Service; | ||
| 14 | + | ||
| 15 | +import com.bsth.entity.ChildTaskPlan; | ||
| 16 | +import com.bsth.entity.ScheduleRealInfo; | ||
| 17 | +import com.bsth.service.CulateMileageService; | ||
| 18 | +import com.bsth.util.Arith; | ||
| 19 | + | ||
| 20 | +@Service | ||
| 21 | +public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 22 | + @Autowired | ||
| 23 | + JdbcTemplate jdbcTemplate; | ||
| 24 | + private static long zgf1 = 6 * 60 + 31, | ||
| 25 | + zgf2 = 8 * 60 + 30, | ||
| 26 | + wgf1 = 16 * 60 + 1, | ||
| 27 | + wgf2 = 18 * 60; | ||
| 28 | + public static boolean isInOut(ScheduleRealInfo s){ | ||
| 29 | + boolean fage=false; | ||
| 30 | + if(s.getBcType().equals("in")){ | ||
| 31 | + fage=true; | ||
| 32 | + } | ||
| 33 | + if(s.getBcType().equals("out")){ | ||
| 34 | + fage=true; | ||
| 35 | + } | ||
| 36 | + if(s.getBcType().equals("ldks")){ | ||
| 37 | + fage=true; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + return fage; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + @Override | ||
| 44 | + public int culateJhyybc(List<ScheduleRealInfo> lists,String item) { | ||
| 45 | + //计划班次 | ||
| 46 | + int jhbc=0; | ||
| 47 | + for (int i = 0; i < lists.size(); i++) { | ||
| 48 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 49 | + if (!isInOut(scheduleRealInfo)) { | ||
| 50 | + if(!scheduleRealInfo.isSflj()){ | ||
| 51 | + String[] fcsjStr = scheduleRealInfo.getFcsj().split(":"); | ||
| 52 | + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | ||
| 53 | + if(item.equals("zgf")){ | ||
| 54 | + if(fcsj>=zgf1 && fcsj<=zgf2) | ||
| 55 | + jhbc++; | ||
| 56 | + }else if(item.equals("wgf")){ | ||
| 57 | + if(fcsj>=wgf1 && fcsj<=wgf2) | ||
| 58 | + jhbc++; | ||
| 59 | + }else{ | ||
| 60 | + jhbc++; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | + return jhbc; | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + @Override | ||
| 70 | + public double culateJhyylc(List<ScheduleRealInfo> lists) { | ||
| 71 | + //计划营运里程 | ||
| 72 | + double jhgl=0; | ||
| 73 | + for (int i = 0; i < lists.size(); i++) { | ||
| 74 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 75 | + if (!isInOut(scheduleRealInfo)) { | ||
| 76 | + if(!scheduleRealInfo.isSflj()){ | ||
| 77 | + jhgl=Arith.add(jhgl,scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); | ||
| 78 | + } | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + return jhgl; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + @Override | ||
| 85 | + public int culateJhfyybc(List<ScheduleRealInfo> lists) { | ||
| 86 | + // 计划非营运里程 | ||
| 87 | + int fyybc =0; | ||
| 88 | + for (int i = 0; i < lists.size(); i++) { | ||
| 89 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 90 | + if(!scheduleRealInfo.isSflj()){ | ||
| 91 | + if (scheduleRealInfo.getBcType().equals("in") | ||
| 92 | + || scheduleRealInfo.getBcType().equals("out")|| scheduleRealInfo.getBcType().equals("ldks")) { | ||
| 93 | + if(!scheduleRealInfo.isSflj()){ | ||
| 94 | + fyybc++; | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | + } | ||
| 98 | + } | ||
| 99 | + return fyybc; | ||
| 100 | + } | ||
| 101 | + @Override | ||
| 102 | + public double culateJhfyylc(List<ScheduleRealInfo> lists) { | ||
| 103 | + // 计划非营运里程 | ||
| 104 | + double fyylc =0; | ||
| 105 | + for (int i = 0; i < lists.size(); i++) { | ||
| 106 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 107 | + if(!scheduleRealInfo.isSflj()){ | ||
| 108 | + if (scheduleRealInfo.getBcType().equals("in") | ||
| 109 | + || scheduleRealInfo.getBcType().equals("out")|| scheduleRealInfo.getBcType().equals("ldks")) { | ||
| 110 | + if(!scheduleRealInfo.isSflj()){ | ||
| 111 | + fyylc =Arith.add(fyylc, scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); | ||
| 112 | + } | ||
| 113 | + } | ||
| 114 | + } | ||
| 115 | + } | ||
| 116 | + return fyylc; | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + @Override | ||
| 120 | + public int culateSjyybc(List<ScheduleRealInfo> lists,String item) { | ||
| 121 | + // 实际班次 | ||
| 122 | + int sjbc=0; | ||
| 123 | + for (int i = 0; i < lists.size(); i++) { | ||
| 124 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 125 | + if (!isInOut(scheduleRealInfo)) { | ||
| 126 | + if(!scheduleRealInfo.isSflj()){ | ||
| 127 | + String time=""; | ||
| 128 | + if(item.equals("zgf") || item.equals("wgf")){ | ||
| 129 | + if(scheduleRealInfo.getFcsjActual()!=null){ | ||
| 130 | + time=scheduleRealInfo.getFcsjActual(); | ||
| 131 | + } | ||
| 132 | + if(time.equals("")){ | ||
| 133 | + if(scheduleRealInfo.getDfsj()!=null){ | ||
| 134 | + time=scheduleRealInfo.getDfsj(); | ||
| 135 | + } | ||
| 136 | + } | ||
| 137 | + }else{ | ||
| 138 | + time=scheduleRealInfo.getFcsj(); | ||
| 139 | + } | ||
| 140 | + if(!time.equals("")){ | ||
| 141 | + String[] fcsjStr = time.split(":"); | ||
| 142 | + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | ||
| 143 | + if(scheduleRealInfo.getStatus()!=-1){ | ||
| 144 | + if(item.equals("zgf")){ | ||
| 145 | + if(fcsj>=zgf1 && fcsj<=zgf2){ | ||
| 146 | + sjbc++; | ||
| 147 | + } | ||
| 148 | + }else if(item.equals("wgf")){ | ||
| 149 | + if(fcsj>=wgf1 && fcsj<=wgf2){ | ||
| 150 | + sjbc++; | ||
| 151 | + } | ||
| 152 | + }else{ | ||
| 153 | + sjbc++; | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | + } | ||
| 159 | + } | ||
| 160 | + } | ||
| 161 | + return sjbc; | ||
| 162 | + } | ||
| 163 | + | ||
| 164 | + @Override | ||
| 165 | + public double culateSjyylc(List<ScheduleRealInfo> lists) { | ||
| 166 | + // 实际营运里程 | ||
| 167 | + double sjgl =0; | ||
| 168 | + for (int i = 0; i < lists.size(); i++) { | ||
| 169 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 170 | + if (!isInOut(scheduleRealInfo)) { | ||
| 171 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 172 | + if(!scheduleRealInfo.isSflj()){ | ||
| 173 | + if(childTaskPlans.isEmpty()){ | ||
| 174 | + if(!scheduleRealInfo.isDestroy()){ | ||
| 175 | + double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig(); | ||
| 176 | + double jhlc=scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | ||
| 177 | + if(jhlc-jhlcOrig>0){ | ||
| 178 | + sjgl=Arith.add(sjgl,jhlcOrig); | ||
| 179 | + }else{ | ||
| 180 | + sjgl=Arith.add(sjgl,jhlc); | ||
| 181 | + } | ||
| 182 | + } | ||
| 183 | + }else{ | ||
| 184 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 185 | + while (it.hasNext()) { | ||
| 186 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 187 | + if(childTaskPlan.getMileageType().equals("service")&&"正常".equals(childTaskPlan.getType1()) | ||
| 188 | + && (!childTaskPlan.isNoClerk())){ | ||
| 189 | + if (!childTaskPlan.isDestroy()) { | ||
| 190 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 191 | + sjgl=Arith.add(sjgl,jhgl); | ||
| 192 | + } | ||
| 193 | + } | ||
| 194 | + } | ||
| 195 | + } | ||
| 196 | + } | ||
| 197 | + } | ||
| 198 | + } | ||
| 199 | + return sjgl; | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + @Override | ||
| 203 | + public double culateSjyylc_j(List<ScheduleRealInfo> lists) { | ||
| 204 | + // 实际营运里程 | ||
| 205 | + double sjgl =0; | ||
| 206 | + for (int i = 0; i < lists.size(); i++) { | ||
| 207 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 208 | + if (!isInOut(scheduleRealInfo)) { | ||
| 209 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 210 | + if(!scheduleRealInfo.isSflj()){ | ||
| 211 | + if(!childTaskPlans.isEmpty()){ | ||
| 212 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 213 | + while (it.hasNext()) { | ||
| 214 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 215 | + if(childTaskPlan.getMileageType().equals("service")&&"正常".equals(childTaskPlan.getType1()) | ||
| 216 | + && childTaskPlan.isNoClerk()){ | ||
| 217 | + if (!childTaskPlan.isDestroy()) { | ||
| 218 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 219 | + sjgl=Arith.add(sjgl,jhgl); | ||
| 220 | + } | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + } | ||
| 224 | + } | ||
| 225 | + } | ||
| 226 | + } | ||
| 227 | + return sjgl; | ||
| 228 | + } | ||
| 229 | + | ||
| 230 | + @Override | ||
| 231 | + public double culateSjfyylc(List<ScheduleRealInfo> lists) { | ||
| 232 | + // 实际非营运里程(驾售) | ||
| 233 | + double sjgl =0; | ||
| 234 | + for (int i = 0; i < lists.size(); i++) { | ||
| 235 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 236 | + if(!scheduleRealInfo.isSflj()){ | ||
| 237 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 238 | + if(childTaskPlans.isEmpty()){ | ||
| 239 | + if (!isInOut(scheduleRealInfo)) { | ||
| 240 | + if(!scheduleRealInfo.isDestroy()){ | ||
| 241 | + double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig(); | ||
| 242 | + double jhlc=scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | ||
| 243 | + if(jhlc-jhlcOrig>0){ | ||
| 244 | + sjgl=Arith.add(sjgl,jhlcOrig); | ||
| 245 | + }else{ | ||
| 246 | + sjgl=Arith.add(sjgl,jhlc); | ||
| 247 | + } | ||
| 248 | + } | ||
| 249 | + } | ||
| 250 | + }else{ | ||
| 251 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 252 | + while (it.hasNext()) { | ||
| 253 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 254 | + if(childTaskPlan.getMileageType().equals("empty")&&"正常".equals(childTaskPlan.getType1()) | ||
| 255 | + && (!childTaskPlan.isNoClerk())){ | ||
| 256 | + if (!childTaskPlan.isDestroy()) { | ||
| 257 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 258 | + sjgl=Arith.add(sjgl,jhgl); | ||
| 259 | + } | ||
| 260 | + } | ||
| 261 | + } | ||
| 262 | + } | ||
| 263 | + } | ||
| 264 | + } | ||
| 265 | + return sjgl; | ||
| 266 | + } | ||
| 267 | + | ||
| 268 | + @Override | ||
| 269 | + public double culateSjfyylc_j(List<ScheduleRealInfo> lists) { | ||
| 270 | + // 实际非营运里程(驾) | ||
| 271 | + double sjgl =0; | ||
| 272 | + for (int i = 0; i < lists.size(); i++) { | ||
| 273 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 274 | + if(!scheduleRealInfo.isSflj()){ | ||
| 275 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 276 | + if(!childTaskPlans.isEmpty()){ | ||
| 277 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 278 | + while (it.hasNext()) { | ||
| 279 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 280 | + if(childTaskPlan.getMileageType().equals("empty")&&"正常".equals(childTaskPlan.getType1()) | ||
| 281 | + && childTaskPlan.isNoClerk()){ | ||
| 282 | + if (!childTaskPlan.isDestroy()) { | ||
| 283 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 284 | + sjgl=Arith.add(sjgl,jhgl); | ||
| 285 | + } | ||
| 286 | + } | ||
| 287 | + } | ||
| 288 | + } | ||
| 289 | + } | ||
| 290 | + } | ||
| 291 | + return sjgl; | ||
| 292 | + } | ||
| 293 | + | ||
| 294 | + @Override | ||
| 295 | + public int culateLjbc(List<ScheduleRealInfo> lists,String item) { | ||
| 296 | + // 临加班次 | ||
| 297 | + int ljbc=0; | ||
| 298 | + for (int i = 0; i < lists.size(); i++) { | ||
| 299 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 300 | + if (!isInOut(scheduleRealInfo)) { | ||
| 301 | + if(scheduleRealInfo.isSflj()){ | ||
| 302 | + if(item.equals("zgf") || item.equals("wgf")){ | ||
| 303 | + String time=""; | ||
| 304 | + if(scheduleRealInfo.getFcsjActual()!=null) | ||
| 305 | + time=scheduleRealInfo.getFcsjActual(); | ||
| 306 | + if(time.equals("")){ | ||
| 307 | + if(scheduleRealInfo.getDfsj()!=null) | ||
| 308 | + time=scheduleRealInfo.getDfsj(); | ||
| 309 | + } | ||
| 310 | + if(!time.equals("")){ | ||
| 311 | + String[] fcsjStr = time.split(":"); | ||
| 312 | + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | ||
| 313 | + if(item.equals("zgf")){ | ||
| 314 | + if(fcsj>=zgf1 && fcsj<=zgf2) | ||
| 315 | + ljbc++; | ||
| 316 | + }else if(item.equals("wgf")){ | ||
| 317 | + if(fcsj>=wgf1 && fcsj<=wgf2) | ||
| 318 | + ljbc++; | ||
| 319 | + } | ||
| 320 | + } | ||
| 321 | + }else{ | ||
| 322 | + ljbc++; | ||
| 323 | + } | ||
| 324 | + } | ||
| 325 | + } | ||
| 326 | + } | ||
| 327 | + return ljbc; | ||
| 328 | + } | ||
| 329 | + | ||
| 330 | + | ||
| 331 | + @Override | ||
| 332 | + public double culateLjyylc(List<ScheduleRealInfo> lists) { | ||
| 333 | + // 临加营运里程(驾售) | ||
| 334 | + double ljgl =0; | ||
| 335 | + for (int i = 0; i < lists.size(); i++) { | ||
| 336 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 337 | + if (!isInOut(scheduleRealInfo)) { | ||
| 338 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 339 | + if(scheduleRealInfo.isSflj()){ | ||
| 340 | + if(childTaskPlans.isEmpty()){ | ||
| 341 | + if(!scheduleRealInfo.isDestroy()) | ||
| 342 | + ljgl=Arith.add(ljgl,scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc()); | ||
| 343 | + }else{ | ||
| 344 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 345 | + while (it.hasNext()) { | ||
| 346 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 347 | + if(childTaskPlan.getMileageType().equals("service") | ||
| 348 | + && (!childTaskPlan.isNoClerk())){ | ||
| 349 | + if (!childTaskPlan.isDestroy()) { | ||
| 350 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 351 | + ljgl=Arith.add(ljgl,jhgl); | ||
| 352 | + } | ||
| 353 | + } | ||
| 354 | + } | ||
| 355 | + } | ||
| 356 | + }else{ | ||
| 357 | + if(childTaskPlans.isEmpty()){ | ||
| 358 | + double jhlc=scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | ||
| 359 | + double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig(); | ||
| 360 | + double zjlc=Arith.sub(jhlc, jhlcOrig); | ||
| 361 | + if(zjlc>0){ | ||
| 362 | + ljgl=Arith.add(zjlc, ljgl); | ||
| 363 | + } | ||
| 364 | + }else{ | ||
| 365 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 366 | + while (it.hasNext()) { | ||
| 367 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 368 | + if("service".equals(childTaskPlan.getMileageType()) | ||
| 369 | + &&"临加".equals(childTaskPlan.getType1()) | ||
| 370 | + && (!childTaskPlan.isNoClerk())){ | ||
| 371 | + if (!childTaskPlan.isDestroy()) { | ||
| 372 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 373 | + ljgl=Arith.add(ljgl,jhgl); | ||
| 374 | + } | ||
| 375 | + } | ||
| 376 | + } | ||
| 377 | + } | ||
| 378 | + } | ||
| 379 | + } | ||
| 380 | + } | ||
| 381 | + return ljgl; | ||
| 382 | + } | ||
| 383 | + | ||
| 384 | + @Override | ||
| 385 | + public double culateLjyylc_j(List<ScheduleRealInfo> lists) { | ||
| 386 | + // 临加营运里程(驾) | ||
| 387 | + double ljgl =0; | ||
| 388 | + for (int i = 0; i < lists.size(); i++) { | ||
| 389 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 390 | + if (!isInOut(scheduleRealInfo)) { | ||
| 391 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 392 | + if(scheduleRealInfo.isSflj()){ | ||
| 393 | + if(!childTaskPlans.isEmpty()){ | ||
| 394 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 395 | + while (it.hasNext()) { | ||
| 396 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 397 | + if(childTaskPlan.getMileageType().equals("service") | ||
| 398 | + && childTaskPlan.isNoClerk()){ | ||
| 399 | + if (!childTaskPlan.isDestroy()) { | ||
| 400 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 401 | + ljgl=Arith.add(ljgl,jhgl); | ||
| 402 | + } | ||
| 403 | + } | ||
| 404 | + } | ||
| 405 | + } | ||
| 406 | + }else{ | ||
| 407 | + if(childTaskPlans.isEmpty()){ | ||
| 408 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 409 | + while (it.hasNext()) { | ||
| 410 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 411 | + if("service".equals(childTaskPlan.getMileageType()) | ||
| 412 | + &&"临加".equals(childTaskPlan.getType1()) | ||
| 413 | + && childTaskPlan.isNoClerk()){ | ||
| 414 | + if (!childTaskPlan.isDestroy()) { | ||
| 415 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 416 | + ljgl=Arith.add(ljgl,jhgl); | ||
| 417 | + } | ||
| 418 | + } | ||
| 419 | + } | ||
| 420 | + } | ||
| 421 | + } | ||
| 422 | + } | ||
| 423 | + } | ||
| 424 | + return ljgl; | ||
| 425 | + } | ||
| 426 | + | ||
| 427 | + @Override | ||
| 428 | + public double culateLjfyylc(List<ScheduleRealInfo> lists) { | ||
| 429 | + // 临加非营运里程(驾售) | ||
| 430 | + double ljgl =0; | ||
| 431 | + for (int i = 0; i < lists.size(); i++) { | ||
| 432 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 433 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 434 | + if (isInOut(scheduleRealInfo)) { | ||
| 435 | + if(scheduleRealInfo.isSflj()){ | ||
| 436 | + if(childTaskPlans.isEmpty()){ | ||
| 437 | + if(!scheduleRealInfo.isDestroy()) | ||
| 438 | + ljgl=Arith.add(ljgl,scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc()); | ||
| 439 | + }else{ | ||
| 440 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 441 | + while (it.hasNext()) { | ||
| 442 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 443 | + if(childTaskPlan.getMileageType().equals("empty") | ||
| 444 | + && (!childTaskPlan.isNoClerk())){ | ||
| 445 | + if (!childTaskPlan.isDestroy()) { | ||
| 446 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 447 | + ljgl=Arith.add(ljgl,jhgl); | ||
| 448 | + } | ||
| 449 | + } | ||
| 450 | + } | ||
| 451 | + } | ||
| 452 | + }else{ | ||
| 453 | + if(childTaskPlans.isEmpty()){ | ||
| 454 | + double jhlc=scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | ||
| 455 | + double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig(); | ||
| 456 | + double zjlc=Arith.sub(jhlc, jhlcOrig); | ||
| 457 | + if(zjlc>0){ | ||
| 458 | + ljgl=Arith.add(zjlc, ljgl); | ||
| 459 | + } | ||
| 460 | + }else{ | ||
| 461 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 462 | + while (it.hasNext()) { | ||
| 463 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 464 | + if("empty".equals(childTaskPlan.getMileageType()) | ||
| 465 | + &&"临加".equals(childTaskPlan.getType1()) | ||
| 466 | + && (!childTaskPlan.isNoClerk())){ | ||
| 467 | + if (!childTaskPlan.isDestroy()) { | ||
| 468 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 469 | + ljgl=Arith.add(ljgl,jhgl); | ||
| 470 | + } | ||
| 471 | + } | ||
| 472 | + } | ||
| 473 | + } | ||
| 474 | + } | ||
| 475 | + }else{ | ||
| 476 | + if (!childTaskPlans.isEmpty()) { | ||
| 477 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 478 | + while (it.hasNext()) { | ||
| 479 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 480 | + if ("empty".equals(childTaskPlan.getMileageType()) && "临加".equals(childTaskPlan.getType1()) | ||
| 481 | + && (!childTaskPlan.isNoClerk())) { | ||
| 482 | + if (!childTaskPlan.isDestroy()) { | ||
| 483 | + Float jhgl = childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage(); | ||
| 484 | + ljgl = Arith.add(ljgl, jhgl); | ||
| 485 | + } | ||
| 486 | + } | ||
| 487 | + } | ||
| 488 | + } | ||
| 489 | + } | ||
| 490 | + } | ||
| 491 | + return ljgl; | ||
| 492 | + } | ||
| 493 | + | ||
| 494 | + @Override | ||
| 495 | + public double culateLjfyylc_j(List<ScheduleRealInfo> lists) { | ||
| 496 | + // 临加非营运里程(驾) | ||
| 497 | + double ljgl =0; | ||
| 498 | + for (int i = 0; i < lists.size(); i++) { | ||
| 499 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 500 | + if (!isInOut(scheduleRealInfo)) { | ||
| 501 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 502 | + if(scheduleRealInfo.isSflj()){ | ||
| 503 | + if(!childTaskPlans.isEmpty()){ | ||
| 504 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 505 | + while (it.hasNext()) { | ||
| 506 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 507 | + if(childTaskPlan.getMileageType().equals("empty") | ||
| 508 | + && childTaskPlan.isNoClerk()){ | ||
| 509 | + if (!childTaskPlan.isDestroy()) { | ||
| 510 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 511 | + ljgl=Arith.add(ljgl,jhgl); | ||
| 512 | + } | ||
| 513 | + } | ||
| 514 | + } | ||
| 515 | + } | ||
| 516 | + }else{ | ||
| 517 | + if(childTaskPlans.isEmpty()){ | ||
| 518 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 519 | + while (it.hasNext()) { | ||
| 520 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 521 | + if("empty".equals(childTaskPlan.getMileageType()) | ||
| 522 | + &&"临加".equals(childTaskPlan.getType1()) | ||
| 523 | + && childTaskPlan.isNoClerk()){ | ||
| 524 | + if (!childTaskPlan.isDestroy()) { | ||
| 525 | + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 526 | + ljgl=Arith.add(ljgl,jhgl); | ||
| 527 | + } | ||
| 528 | + } | ||
| 529 | + } | ||
| 530 | + } | ||
| 531 | + } | ||
| 532 | + } | ||
| 533 | + } | ||
| 534 | + return ljgl; | ||
| 535 | + } | ||
| 536 | + | ||
| 537 | + @Override | ||
| 538 | + public int culateLbbc(List<ScheduleRealInfo> lists) { | ||
| 539 | + // 烂班班次 | ||
| 540 | + int lbbc=0; | ||
| 541 | + for (int i = 0; i < lists.size(); i++) { | ||
| 542 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 543 | + if (!isInOut(scheduleRealInfo)) { | ||
| 544 | + if(scheduleRealInfo.getStatus() == -1){ | ||
| 545 | + lbbc++; | ||
| 546 | + } | ||
| 547 | + } | ||
| 548 | + } | ||
| 549 | + return lbbc; | ||
| 550 | + } | ||
| 551 | + | ||
| 552 | + @Override | ||
| 553 | + public double culateLbgl(List<ScheduleRealInfo> lists) { | ||
| 554 | + // TODO Auto-generated method stub | ||
| 555 | + double zlblc =0.0; | ||
| 556 | + for (int i = 0; i < lists.size(); i++) { | ||
| 557 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 558 | + if (!isInOut(scheduleRealInfo)) { | ||
| 559 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 560 | + if(childTaskPlans.isEmpty()){ | ||
| 561 | + if(scheduleRealInfo.isDestroy()){ | ||
| 562 | + zlblc=Arith.add(zlblc,scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); | ||
| 563 | + }else{ | ||
| 564 | + double jhlc=scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | ||
| 565 | + double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig(); | ||
| 566 | + double cjlc=Arith.sub(jhlcOrig,jhlc); | ||
| 567 | + if(cjlc>0){ | ||
| 568 | + zlblc=Arith.add(zlblc, cjlc); | ||
| 569 | + } | ||
| 570 | + } | ||
| 571 | + }else{ | ||
| 572 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 573 | + while (it.hasNext()) { | ||
| 574 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 575 | + if(childTaskPlan.getMileageType().equals("service")){ | ||
| 576 | + if (childTaskPlan.isDestroy()) { | ||
| 577 | + zlblc=Arith.add(zlblc,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage()); | ||
| 578 | + } | ||
| 579 | + } | ||
| 580 | + } | ||
| 581 | + } | ||
| 582 | + } | ||
| 583 | + } | ||
| 584 | + return zlblc; | ||
| 585 | + } | ||
| 586 | + | ||
| 587 | + @Override | ||
| 588 | + public double culateCJLC(List<ScheduleRealInfo> list, String item) { | ||
| 589 | + // TODO Auto-generated method stub | ||
| 590 | + double sum = 0; | ||
| 591 | + Set<ChildTaskPlan> cts; | ||
| 592 | + for(ScheduleRealInfo sch : list){ | ||
| 593 | + if (sch.isSflj()) | ||
| 594 | + continue; | ||
| 595 | + cts = sch.getcTasks(); | ||
| 596 | + //有子任务 | ||
| 597 | + if (cts != null && cts.size() > 0) { | ||
| 598 | + for(ChildTaskPlan c : cts){ | ||
| 599 | + if(item.equals("其他")){ | ||
| 600 | + if(c.isDestroy() && | ||
| 601 | + ((c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)|| | ||
| 602 | + (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(""))) | ||
| 603 | + sum = Arith.add(sum, c.getMileage()); | ||
| 604 | + }else{ | ||
| 605 | + if(c.isDestroy() && (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)) | ||
| 606 | + sum = Arith.add(sum, c.getMileage()); | ||
| 607 | + } | ||
| 608 | + | ||
| 609 | + } | ||
| 610 | + } | ||
| 611 | + else if(isInOut(sch)) | ||
| 612 | + continue; | ||
| 613 | + //主任务烂班 | ||
| 614 | + else if(sch.getStatus() == -1){ | ||
| 615 | + if(sch.getAdjustExps().equals(item) || | ||
| 616 | + (StringUtils.isEmpty(sch.getAdjustExps()) && item.equals("其他"))){ | ||
| 617 | + sum = Arith.add(sum, sch.getJhlcOrig()); | ||
| 618 | + } | ||
| 619 | + } | ||
| 620 | + else if(item.equals("其他")){ | ||
| 621 | + double diff = Arith.sub(sch.getJhlcOrig(), sch.getJhlc()); | ||
| 622 | + if(diff > 0){ | ||
| 623 | + sum = Arith.add(sum, diff); | ||
| 624 | + } | ||
| 625 | + } | ||
| 626 | + } | ||
| 627 | + return sum; | ||
| 628 | + } | ||
| 629 | + | ||
| 630 | + @Override | ||
| 631 | + public int culateDtfzbc(List<ScheduleRealInfo> lists,String type,String item){ | ||
| 632 | + int bc=0; | ||
| 633 | + for (int i = 0; i < lists.size(); i++) { | ||
| 634 | + ScheduleRealInfo s=lists.get(i); | ||
| 635 | + if (s.getBcType().equals(type)) { | ||
| 636 | + if (s.getFcsjActual() != null) { | ||
| 637 | + if (!s.isDestroy()) { | ||
| 638 | + String fcsjs = s.getFcsjActual(); | ||
| 639 | + String[] fcsjStr = fcsjs.split(":"); | ||
| 640 | + long fcsj = Long.parseLong(fcsjStr[0]) * 60 + Long.parseLong(fcsjStr[1]); | ||
| 641 | + if (item.equals("zgf")) { | ||
| 642 | + if (fcsj > zgf1 && fcsj < zgf2) | ||
| 643 | + bc++; | ||
| 644 | + } else if (item.equals("wgf")) { | ||
| 645 | + if (fcsj > wgf1 && fcsj < wgf2) | ||
| 646 | + bc++; | ||
| 647 | + } else { | ||
| 648 | + bc++; | ||
| 649 | + } | ||
| 650 | + } | ||
| 651 | + } | ||
| 652 | + } | ||
| 653 | + } | ||
| 654 | + return bc; | ||
| 655 | + } | ||
| 656 | +} |
src/main/java/com/bsth/service/impl/ScheduleRealInfoServiceImpl.java
| @@ -4,6 +4,7 @@ import com.bsth.entity.ScheduleRealInfo; | @@ -4,6 +4,7 @@ import com.bsth.entity.ScheduleRealInfo; | ||
| 4 | import com.bsth.entity.result.CalcWaybill; | 4 | import com.bsth.entity.result.CalcWaybill; |
| 5 | import com.bsth.repository.ScheduleRealInfoRepository; | 5 | import com.bsth.repository.ScheduleRealInfoRepository; |
| 6 | import com.bsth.service.*; | 6 | import com.bsth.service.*; |
| 7 | +import com.bsth.util.Arith; | ||
| 7 | 8 | ||
| 8 | import org.joda.time.format.DateTimeFormat; | 9 | import org.joda.time.format.DateTimeFormat; |
| 9 | import org.joda.time.format.DateTimeFormatter; | 10 | import org.joda.time.format.DateTimeFormatter; |
| @@ -17,6 +18,7 @@ import org.springframework.stereotype.Service; | @@ -17,6 +18,7 @@ import org.springframework.stereotype.Service; | ||
| 17 | import java.sql.ResultSet; | 18 | import java.sql.ResultSet; |
| 18 | import java.sql.SQLException; | 19 | import java.sql.SQLException; |
| 19 | import java.util.ArrayList; | 20 | import java.util.ArrayList; |
| 21 | +import java.util.Date; | ||
| 20 | import java.util.HashMap; | 22 | import java.util.HashMap; |
| 21 | import java.util.List; | 23 | import java.util.List; |
| 22 | import java.util.Map; | 24 | import java.util.Map; |
| @@ -31,7 +33,8 @@ public class ScheduleRealInfoServiceImpl implements ScheduleRealInfoService { | @@ -31,7 +33,8 @@ public class ScheduleRealInfoServiceImpl implements ScheduleRealInfoService { | ||
| 31 | 33 | ||
| 32 | @Autowired | 34 | @Autowired |
| 33 | ScheduleRealInfoRepository scheduleRealInfoRepository; | 35 | ScheduleRealInfoRepository scheduleRealInfoRepository; |
| 34 | - | 36 | + @Autowired |
| 37 | + CulateMileageService culateMileageService; | ||
| 35 | @Autowired | 38 | @Autowired |
| 36 | JdbcTemplate jdbcTemplate; | 39 | JdbcTemplate jdbcTemplate; |
| 37 | 40 | ||
| @@ -47,6 +50,7 @@ public class ScheduleRealInfoServiceImpl implements ScheduleRealInfoService { | @@ -47,6 +50,7 @@ public class ScheduleRealInfoServiceImpl implements ScheduleRealInfoService { | ||
| 47 | 50 | ||
| 48 | @Override | 51 | @Override |
| 49 | public List<CalcWaybill> findAll(String rq,String lineCode) { | 52 | public List<CalcWaybill> findAll(String rq,String lineCode) { |
| 53 | + List<CalcWaybill> listCal=new ArrayList<CalcWaybill>(); | ||
| 50 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.findAll(rq,lineCode); | 54 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.findAll(rq,lineCode); |
| 51 | String sql ="select r.j_gh ,r.s_gh,r.cl_zbh,r.xl_bm, r.lp_name FROM" | 55 | String sql ="select r.j_gh ,r.s_gh,r.cl_zbh,r.xl_bm, r.lp_name FROM" |
| 52 | + " bsth_c_s_sp_info_real r where " | 56 | + " bsth_c_s_sp_info_real r where " |
| @@ -98,9 +102,179 @@ public class ScheduleRealInfoServiceImpl implements ScheduleRealInfoService { | @@ -98,9 +102,179 @@ public class ScheduleRealInfoServiceImpl implements ScheduleRealInfoService { | ||
| 98 | } | 102 | } |
| 99 | } | 103 | } |
| 100 | 104 | ||
| 101 | - | 105 | + //计算方法 |
| 106 | + if(list_.size()>0){ | ||
| 107 | + listCal.addAll(this.cul(list_, lists_)); | ||
| 108 | + } | ||
| 102 | } | 109 | } |
| 103 | - return null; | 110 | + return listCal; |
| 104 | } | 111 | } |
| 105 | 112 | ||
| 113 | + //list_ 全部班次 lists_执行了的班次(实到实发不为空) | ||
| 114 | + private List<CalcWaybill> cul(List<ScheduleRealInfo> list_,List<ScheduleRealInfo> lists_){ | ||
| 115 | + List<CalcWaybill> list=new ArrayList<CalcWaybill>(); | ||
| 116 | + if(list_.size()>0){ | ||
| 117 | + Date date=list_.get(0).getScheduleDate(); | ||
| 118 | + String dateStr=list_.get(0).getScheduleDateStr(); | ||
| 119 | + String gsdm=list_.get(0).getGsBm(); | ||
| 120 | + String gsname=list_.get(0).getGsName(); | ||
| 121 | + String fgsdm=list_.get(0).getFgsBm(); | ||
| 122 | + String fgsname=list_.get(0).getFgsName(); | ||
| 123 | + String xlbm=list_.get(0).getXlBm(); | ||
| 124 | + String xlname=list_.get(0).getXlName(); | ||
| 125 | + String lp=list_.get(0).getLpName(); | ||
| 126 | + String jgh=list_.get(0).getjGh(); | ||
| 127 | + String jname=list_.get(0).getjName(); | ||
| 128 | + String sgh=list_.get(0).getsGh(); | ||
| 129 | + String sname=list_.get(0).getsName(); | ||
| 130 | + String clzbh=list_.get(0).getClZbh(); | ||
| 131 | + int jhyybc=culateMileageService.culateJhyybc(list_, ""); | ||
| 132 | + int jhyybcZgf=culateMileageService.culateJhyybc(list_, "zgf"); | ||
| 133 | + int jhyybcWgf=culateMileageService.culateJhyybc(list_, "wgf"); | ||
| 134 | + double jhyylc=culateMileageService.culateJhyylc(list_); | ||
| 135 | + double jhfyylc=culateMileageService.culateJhfyylc(list_); | ||
| 136 | + int sjyybc=culateMileageService.culateSjyybc(lists_, ""); | ||
| 137 | + int sjyybcZgf=culateMileageService.culateSjyybc(lists_, "zgf"); | ||
| 138 | + int sjyybcWgf=culateMileageService.culateSjyybc(lists_, "wgf"); | ||
| 139 | + double sjyylc=culateMileageService.culateSjyylc(lists_);//驾售共有 | ||
| 140 | + double sjyylc_j=culateMileageService.culateSjyylc_j(lists_);//无售 | ||
| 141 | + double sjfyylc=culateMileageService.culateSjfyylc(lists_);//驾售 | ||
| 142 | + double sjfyylc_j=culateMileageService.culateSjfyylc_j(lists_);//无售 | ||
| 143 | + int ljbc=culateMileageService.culateLjbc(lists_, ""); | ||
| 144 | + int ljbcZgf=culateMileageService.culateLjbc(lists_, "zgf"); | ||
| 145 | + int ljbcWgf=culateMileageService.culateLjbc(lists_, "wgf"); | ||
| 146 | + double ljyylc=culateMileageService.culateLjyylc(lists_);//驾售 | ||
| 147 | + double ljyylc_j=culateMileageService.culateLjyylc(lists_);//无售 | ||
| 148 | + double ljfyylc=culateMileageService.culateLjfyylc(lists_);//驾售 | ||
| 149 | + double ljfyylc_j=culateMileageService.culateLjfyylc_j(lists_);//无售 | ||
| 150 | + int lbbc=culateMileageService.culateLbbc(list_); | ||
| 151 | + double lblc=culateMileageService.culateLbgl(list_); | ||
| 152 | + double ssgl_lz= culateMileageService.culateCJLC(list_, "路阻"); | ||
| 153 | + double ssgl_dm= culateMileageService.culateCJLC(list_, "吊慢"); | ||
| 154 | + double ssgl_gz= culateMileageService.culateCJLC(list_, "故障"); | ||
| 155 | + double ssgl_jf= culateMileageService.culateCJLC(list_, "纠纷"); | ||
| 156 | + double ssgl_zs= culateMileageService.culateCJLC(list_, "肇事"); | ||
| 157 | + double ssgl_qr= culateMileageService.culateCJLC(list_, "缺人"); | ||
| 158 | + double ssgl_qc= culateMileageService.culateCJLC(list_, "缺车"); | ||
| 159 | + double ssgl_kx= culateMileageService.culateCJLC(list_, "客稀"); | ||
| 160 | + double ssgl_qh= culateMileageService.culateCJLC(list_, "气候"); | ||
| 161 | + double ssgl_yw= culateMileageService.culateCJLC(list_, "援外"); | ||
| 162 | + | ||
| 163 | + double ssgl_pc=culateMileageService.culateCJLC(list_, "配车"); | ||
| 164 | + double ssgl_by=culateMileageService.culateCJLC(list_, "保养"); | ||
| 165 | + double ssgl_cj=culateMileageService.culateCJLC(list_, "抽减"); | ||
| 166 | + double ssgl_qt=culateMileageService.culateCJLC(list_, "其他"); | ||
| 167 | + double ssgl_qtz=Arith.add(Arith.add(ssgl_pc, ssgl_by), Arith.add(ssgl_cj,ssgl_qt)); | ||
| 168 | + int fzbc=culateMileageService.culateDtfzbc(lists_, "major", "");//放站 | ||
| 169 | + int fzbcZgf=culateMileageService.culateDtfzbc(lists_, "major", "zgf"); | ||
| 170 | + int fzbcWgf=culateMileageService.culateDtfzbc(lists_, "major", "wgf"); | ||
| 171 | + int zfbc=culateMileageService.culateDtfzbc(lists_, "venting", "");//直放 | ||
| 172 | + int zfbcZgf=culateMileageService.culateDtfzbc(lists_, "venting", "zgf"); | ||
| 173 | + int zfbcWgf=culateMileageService.culateDtfzbc(lists_, "venting", "wgf"); | ||
| 174 | + CalcWaybill t=new CalcWaybill(); | ||
| 175 | + t.setRq(date); | ||
| 176 | + t.setRqStr(dateStr); | ||
| 177 | + t.setGsdm(gsdm); | ||
| 178 | + t.setGsname(gsname); | ||
| 179 | + t.setFgsdm(fgsdm); | ||
| 180 | + t.setFgsname(fgsname); | ||
| 181 | + t.setXl(xlbm); | ||
| 182 | + t.setXlName(xlname); | ||
| 183 | + t.setLp(lp); | ||
| 184 | + t.setCl(clzbh); | ||
| 185 | + t.setjGh(jgh); | ||
| 186 | + t.setjName(jname); | ||
| 187 | + t.setsGh(sgh); | ||
| 188 | + t.setsName(sname); | ||
| 189 | + t.setJhyybc(jhyybc); | ||
| 190 | + t.setJhyybczgf(jhyybcZgf); | ||
| 191 | + t.setJhyybcwgf(jhyybcWgf); | ||
| 192 | + t.setJhyylc(jhyylc); | ||
| 193 | + t.setJhfyylc(jhfyylc); | ||
| 194 | + t.setSjyybc(sjyybc); | ||
| 195 | + t.setSjyybczgf(sjyybcZgf); | ||
| 196 | + t.setSjyybcwgf(sjyybcWgf); | ||
| 197 | + t.setSjyylc(sjyylc); | ||
| 198 | + t.setSjfyylc(sjfyylc); | ||
| 199 | + t.setLjbc(ljbc); | ||
| 200 | + t.setLjbczgf(ljbcZgf); | ||
| 201 | + t.setLjbcwgf(ljbcWgf); | ||
| 202 | + t.setLjyylc(ljyylc); | ||
| 203 | + t.setLjfyylc(ljfyylc); | ||
| 204 | + t.setLbbc(lbbc); | ||
| 205 | + t.setLblc(lblc); | ||
| 206 | + t.setLblcLz(ssgl_lz); | ||
| 207 | + t.setLblcDm(ssgl_dm); | ||
| 208 | + t.setLblcGz(ssgl_gz); | ||
| 209 | + t.setLblcJf(ssgl_jf); | ||
| 210 | + t.setLblcZs(ssgl_zs); | ||
| 211 | + t.setLblcQr(ssgl_qr); | ||
| 212 | + t.setLblcQc(ssgl_qc); | ||
| 213 | + t.setLblcKx(ssgl_kx); | ||
| 214 | + t.setLblcQh(ssgl_qh); | ||
| 215 | + t.setLblcYw(ssgl_yw); | ||
| 216 | + t.setLblcQt(ssgl_qtz); | ||
| 217 | + t.setFzbc(fzbc+zfbc); | ||
| 218 | + t.setFzbczgf(fzbcZgf+zfbcZgf); | ||
| 219 | + t.setFzbcwgf(fzbcWgf+zfbcWgf); | ||
| 220 | + t.setDtbc(0); | ||
| 221 | + t.setDtbczgf(0); | ||
| 222 | + t.setDtbcwgf(0); | ||
| 223 | + list.add(t); | ||
| 224 | + //驾驶员单独行驶里程 | ||
| 225 | + if(sjyylc_j>0||sjfyylc_j>0||ljyylc_j>0||ljfyylc_j>0){ | ||
| 226 | + CalcWaybill t_=new CalcWaybill(); | ||
| 227 | + t_.setRq(date); | ||
| 228 | + t_.setRqStr(dateStr); | ||
| 229 | + t_.setGsdm(gsdm); | ||
| 230 | + t_.setGsname(gsname); | ||
| 231 | + t_.setFgsdm(fgsdm); | ||
| 232 | + t_.setFgsname(fgsname); | ||
| 233 | + t_.setXl(xlbm); | ||
| 234 | + t_.setXlName(xlname); | ||
| 235 | + t_.setLp(lp); | ||
| 236 | + t_.setCl(clzbh); | ||
| 237 | + t_.setjGh(jgh); | ||
| 238 | + t_.setjName(jname); | ||
| 239 | + t_.setSjyylc(sjyylc_j); | ||
| 240 | + t_.setSjfyylc(sjfyylc_j); | ||
| 241 | + t_.setLjyylc(ljyylc_j); | ||
| 242 | + t_.setLjfyylc(ljfyylc_j); | ||
| 243 | + t_.setsGh(""); | ||
| 244 | + t_.setsName(""); | ||
| 245 | + t_.setJhyybc(0); | ||
| 246 | + t_.setJhyybczgf(0); | ||
| 247 | + t_.setJhyybcwgf(0); | ||
| 248 | + t_.setJhyylc(0.0); | ||
| 249 | + t_.setJhfyylc(0.0); | ||
| 250 | + t_.setSjyybc(0); | ||
| 251 | + t_.setSjyybczgf(0); | ||
| 252 | + t_.setSjyybcwgf(0); | ||
| 253 | + t_.setLjbc(0); | ||
| 254 | + t_.setLjbczgf(0); | ||
| 255 | + t_.setLjbcwgf(0); | ||
| 256 | + t_.setLbbc(0); | ||
| 257 | + t_.setLblc(0.0); | ||
| 258 | + t_.setLblcLz(0.0); | ||
| 259 | + t_.setLblcDm(0.0); | ||
| 260 | + t_.setLblcGz(0.0); | ||
| 261 | + t_.setLblcJf(0.0); | ||
| 262 | + t_.setLblcZs(0.0); | ||
| 263 | + t_.setLblcQr(0.0); | ||
| 264 | + t_.setLblcQc(0.0); | ||
| 265 | + t_.setLblcKx(0.0); | ||
| 266 | + t_.setLblcQh(0.0); | ||
| 267 | + t_.setLblcYw(0.0); | ||
| 268 | + t_.setLblcQt(0.0); | ||
| 269 | + t_.setFzbc(0); | ||
| 270 | + t_.setFzbczgf(0); | ||
| 271 | + t_.setFzbcwgf(0); | ||
| 272 | + t_.setDtbc(0); | ||
| 273 | + t_.setDtbczgf(0); | ||
| 274 | + t_.setDtbcwgf(0); | ||
| 275 | + list.add(t_); | ||
| 276 | + } | ||
| 277 | + } | ||
| 278 | + return list; | ||
| 279 | + } | ||
| 106 | } | 280 | } |