Commit da8632ab154af42ddf3f3ef43531b0a707aab8b7
1 parent
d6b091f5
路单线路明细月报表、年报表,把线路list查询放到后台端;汇总计算方法重写。
Showing
8 changed files
with
1074 additions
and
549 deletions
src/main/java/com/bsth/controller/calc/CalcWaybillController.java
| @@ -416,8 +416,8 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer> | @@ -416,8 +416,8 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer> | ||
| 416 | return calcWaybillService.getBusMileage(line, date, date2, xlName, zt, by, type); | 416 | return calcWaybillService.getBusMileage(line, date, date2, xlName, zt, by, type); |
| 417 | } | 417 | } |
| 418 | 418 | ||
| 419 | - @RequestMapping(value="/calcDetailMonthly") | ||
| 420 | - public List<List<String>> calcDetailMonthly(@RequestParam Map<String, Object> map){ | ||
| 421 | - return calcWaybillService.calcDetailMonthly(map); | 419 | + @RequestMapping(value="/calcDetailMonthlyNew") |
| 420 | + public List<List<String>> calcDetailMonthlyNew(@RequestParam Map<String, Object> map){ | ||
| 421 | + return calcWaybillService.calcDetailMonthlyNew(map); | ||
| 422 | } | 422 | } |
| 423 | } | 423 | } |
src/main/java/com/bsth/entity/calc/CalcWaybillDetail.java
| 1 | -package com.bsth.entity.calc; | ||
| 2 | - | ||
| 3 | -import java.util.Date; | ||
| 4 | -// calcDetailMonthly.html 返回类 | ||
| 5 | -public class CalcWaybillDetail { | ||
| 6 | - private Long id; | ||
| 7 | - /* 公司代码*/ | ||
| 8 | - private String gsdm; | ||
| 9 | - /* 公司名称*/ | ||
| 10 | - private String gsname; | ||
| 11 | - /* 分公司代码*/ | ||
| 12 | - private String fgsdm; | ||
| 13 | - /* 分公司名称*/ | ||
| 14 | - private String fgsname; | ||
| 15 | - /* 日期*/ | ||
| 16 | - private Date rq; | ||
| 17 | - /* 日期字符串*/ | ||
| 18 | - private String rqStr; | ||
| 19 | - /* 线路编码*/ | ||
| 20 | - private String xl; | ||
| 21 | - /* 线路名称*/ | ||
| 22 | - private String xlName; | ||
| 23 | - /* 车辆自编号*/ | ||
| 24 | - private String cl; | ||
| 25 | - /* 路牌名字*/ | ||
| 26 | - private String lp; | ||
| 27 | - /* 驾驶员工号*/ | ||
| 28 | - private String jGh; | ||
| 29 | - /* 驾驶员名字*/ | ||
| 30 | - private String jName; | ||
| 31 | - /* 售票员工号*/ | ||
| 32 | - private String sGh; | ||
| 33 | - /* 售票员名字*/ | ||
| 34 | - private String sName; | ||
| 35 | - /* 计划营运班次*/ | ||
| 36 | - private int jhyybc=0; | ||
| 37 | - /* 计划早高峰营运班次*/ | ||
| 38 | - private int jhyybczgf=0; | ||
| 39 | - /* 计划晚高峰营运班次*/ | ||
| 40 | - private int jhyybcwgf=0; | ||
| 41 | - /* 计划非营运班次*/ | ||
| 42 | - private int jhfyybc=0; | ||
| 43 | - /* 计划营运里程*/ | ||
| 44 | - private Double jhyylc=0.0; | ||
| 45 | - /* 计划非营运里程*/ | ||
| 46 | - private Double jhfyylc=0.0; | ||
| 47 | - /* 实际营运班次*/ | ||
| 48 | - private int sjyybc=0; | ||
| 49 | - /* 实际早高峰营运班次*/ | ||
| 50 | - private int sjyybczgf=0; | ||
| 51 | - /* 实际晚高峰营运班次*/ | ||
| 52 | - private int sjyybcwgf=0; | ||
| 53 | - /* 实际非营运班次*/ | ||
| 54 | - private int sjfyybc=0; | ||
| 55 | - /* 实际营运里程*/ | ||
| 56 | - private Double sjyylc=0.0; | ||
| 57 | - /* 实际非营运里程*/ | ||
| 58 | - private Double sjfyylc=0.0; | ||
| 59 | - /* 临加班次*/ | ||
| 60 | - private int ljbc=0; | ||
| 61 | - /* 临加早高峰班次*/ | ||
| 62 | - private int ljbczgf=0; | ||
| 63 | - /* 临加晚高峰班次*/ | ||
| 64 | - private int ljbcwgf=0; | ||
| 65 | - /* 临加营运里程*/ | ||
| 66 | - private Double ljyylc=0.0; | ||
| 67 | - /* 临加非营运里程*/ | ||
| 68 | - private Double ljfyylc=0.0; | ||
| 69 | - /* 烂班班次*/ | ||
| 70 | - private int lbbc=0; | ||
| 71 | - /* 烂班里程*/ | ||
| 72 | - private Double lblc=0.0; | ||
| 73 | - | ||
| 74 | - | ||
| 75 | - // 总里程 | ||
| 76 | - private Double zlc=0.0; | ||
| 77 | - private Double czlc=0.0; | ||
| 78 | - private Double jzlc=0.0; | ||
| 79 | - // 出场油量 | ||
| 80 | - private Double czyl=0.0; | ||
| 81 | - // 进场油量 | ||
| 82 | - private Double jzyl=0.0; | ||
| 83 | - // 加注量 | ||
| 84 | - private Double jzl=0.0; | ||
| 85 | - // 加注量 0号柴油 | ||
| 86 | - private Double jzl0=0.0; | ||
| 87 | - // 加注量 -10#号柴油 | ||
| 88 | - private Double jzl10=0.0; | ||
| 89 | - // 油耗 | ||
| 90 | - private Double yh=0.0; | ||
| 91 | - // 百公里油耗 | ||
| 92 | - private Double bglyh=0.0; | ||
| 93 | - // 损耗 | ||
| 94 | - private Double sh=0.0; | ||
| 95 | - // 燃油类型 | ||
| 96 | - private String rylx; | ||
| 97 | - | ||
| 98 | - //出站存电 | ||
| 99 | - private Double czcd=0.0; | ||
| 100 | - //进站存电 | ||
| 101 | - private Double jzcd=0.0; | ||
| 102 | - //充电量 | ||
| 103 | - private Double cdl=0.0; | ||
| 104 | - //耗电 | ||
| 105 | - private Double hd=0.0; | ||
| 106 | - //百公里耗电 | ||
| 107 | - private Double bglhd=0.0; | ||
| 108 | - | ||
| 109 | - // 天数记录 | ||
| 110 | - private int ts; | ||
| 111 | - | ||
| 112 | - /* 创建时间*/ | ||
| 113 | - private Date createTime; | ||
| 114 | - /* 修改时间*/ | ||
| 115 | - private Date updateTime; | ||
| 116 | - public Long getId() { | ||
| 117 | - return id; | ||
| 118 | - } | ||
| 119 | - public void setId(Long id) { | ||
| 120 | - this.id = id; | ||
| 121 | - } | ||
| 122 | - public String getGsdm() { | ||
| 123 | - return gsdm; | ||
| 124 | - } | ||
| 125 | - public void setGsdm(String gsdm) { | ||
| 126 | - this.gsdm = gsdm; | ||
| 127 | - } | ||
| 128 | - public String getGsname() { | ||
| 129 | - return gsname; | ||
| 130 | - } | ||
| 131 | - public void setGsname(String gsname) { | ||
| 132 | - this.gsname = gsname; | ||
| 133 | - } | ||
| 134 | - public String getFgsdm() { | ||
| 135 | - return fgsdm; | ||
| 136 | - } | ||
| 137 | - public void setFgsdm(String fgsdm) { | ||
| 138 | - this.fgsdm = fgsdm; | ||
| 139 | - } | ||
| 140 | - public String getFgsname() { | ||
| 141 | - return fgsname; | ||
| 142 | - } | ||
| 143 | - public void setFgsname(String fgsname) { | ||
| 144 | - this.fgsname = fgsname; | ||
| 145 | - } | ||
| 146 | - public Date getRq() { | ||
| 147 | - return rq; | ||
| 148 | - } | ||
| 149 | - public void setRq(Date rq) { | ||
| 150 | - this.rq = rq; | ||
| 151 | - } | ||
| 152 | - public String getRqStr() { | ||
| 153 | - return rqStr; | ||
| 154 | - } | ||
| 155 | - public void setRqStr(String rqStr) { | ||
| 156 | - this.rqStr = rqStr; | ||
| 157 | - } | ||
| 158 | - public String getXl() { | ||
| 159 | - return xl; | ||
| 160 | - } | ||
| 161 | - public void setXl(String xl) { | ||
| 162 | - this.xl = xl; | ||
| 163 | - } | ||
| 164 | - public String getXlName() { | ||
| 165 | - return xlName; | ||
| 166 | - } | ||
| 167 | - public void setXlName(String xlName) { | ||
| 168 | - this.xlName = xlName; | ||
| 169 | - } | ||
| 170 | - public String getCl() { | ||
| 171 | - return cl; | ||
| 172 | - } | ||
| 173 | - public void setCl(String cl) { | ||
| 174 | - this.cl = cl; | ||
| 175 | - } | ||
| 176 | - public String getLp() { | ||
| 177 | - return lp; | ||
| 178 | - } | ||
| 179 | - public void setLp(String lp) { | ||
| 180 | - this.lp = lp; | ||
| 181 | - } | ||
| 182 | - public String getjGh() { | ||
| 183 | - return jGh; | ||
| 184 | - } | ||
| 185 | - public void setjGh(String jGh) { | ||
| 186 | - this.jGh = jGh; | ||
| 187 | - } | ||
| 188 | - public String getjName() { | ||
| 189 | - return jName; | ||
| 190 | - } | ||
| 191 | - public void setjName(String jName) { | ||
| 192 | - this.jName = jName; | ||
| 193 | - } | ||
| 194 | - public String getsGh() { | ||
| 195 | - return sGh; | ||
| 196 | - } | ||
| 197 | - public void setsGh(String sGh) { | ||
| 198 | - this.sGh = sGh; | ||
| 199 | - } | ||
| 200 | - public String getsName() { | ||
| 201 | - return sName; | ||
| 202 | - } | ||
| 203 | - public void setsName(String sName) { | ||
| 204 | - this.sName = sName; | ||
| 205 | - } | ||
| 206 | - public int getJhyybc() { | ||
| 207 | - return jhyybc; | ||
| 208 | - } | ||
| 209 | - public void setJhyybc(int jhyybc) { | ||
| 210 | - this.jhyybc = jhyybc; | ||
| 211 | - } | ||
| 212 | - public int getJhyybczgf() { | ||
| 213 | - return jhyybczgf; | ||
| 214 | - } | ||
| 215 | - public void setJhyybczgf(int jhyybczgf) { | ||
| 216 | - this.jhyybczgf = jhyybczgf; | ||
| 217 | - } | ||
| 218 | - public int getJhyybcwgf() { | ||
| 219 | - return jhyybcwgf; | ||
| 220 | - } | ||
| 221 | - public void setJhyybcwgf(int jhyybcwgf) { | ||
| 222 | - this.jhyybcwgf = jhyybcwgf; | ||
| 223 | - } | ||
| 224 | - public int getJhfyybc() { | ||
| 225 | - return jhfyybc; | ||
| 226 | - } | ||
| 227 | - public void setJhfyybc(int jhfyybc) { | ||
| 228 | - this.jhfyybc = jhfyybc; | ||
| 229 | - } | ||
| 230 | - public Double getJhyylc() { | ||
| 231 | - return jhyylc; | ||
| 232 | - } | ||
| 233 | - public void setJhyylc(Double jhyylc) { | ||
| 234 | - this.jhyylc = jhyylc; | ||
| 235 | - } | ||
| 236 | - public Double getJhfyylc() { | ||
| 237 | - return jhfyylc; | ||
| 238 | - } | ||
| 239 | - public void setJhfyylc(Double jhfyylc) { | ||
| 240 | - this.jhfyylc = jhfyylc; | ||
| 241 | - } | ||
| 242 | - public int getSjyybc() { | ||
| 243 | - return sjyybc; | ||
| 244 | - } | ||
| 245 | - public void setSjyybc(int sjyybc) { | ||
| 246 | - this.sjyybc = sjyybc; | ||
| 247 | - } | ||
| 248 | - public int getSjyybczgf() { | ||
| 249 | - return sjyybczgf; | ||
| 250 | - } | ||
| 251 | - public void setSjyybczgf(int sjyybczgf) { | ||
| 252 | - this.sjyybczgf = sjyybczgf; | ||
| 253 | - } | ||
| 254 | - public int getSjyybcwgf() { | ||
| 255 | - return sjyybcwgf; | ||
| 256 | - } | ||
| 257 | - public void setSjyybcwgf(int sjyybcwgf) { | ||
| 258 | - this.sjyybcwgf = sjyybcwgf; | ||
| 259 | - } | ||
| 260 | - public int getSjfyybc() { | ||
| 261 | - return sjfyybc; | ||
| 262 | - } | ||
| 263 | - public void setSjfyybc(int sjfyybc) { | ||
| 264 | - this.sjfyybc = sjfyybc; | ||
| 265 | - } | ||
| 266 | - public Double getSjyylc() { | ||
| 267 | - return sjyylc; | ||
| 268 | - } | ||
| 269 | - public void setSjyylc(Double sjyylc) { | ||
| 270 | - this.sjyylc = sjyylc; | ||
| 271 | - } | ||
| 272 | - public Double getSjfyylc() { | ||
| 273 | - return sjfyylc; | ||
| 274 | - } | ||
| 275 | - public void setSjfyylc(Double sjfyylc) { | ||
| 276 | - this.sjfyylc = sjfyylc; | ||
| 277 | - } | ||
| 278 | - public int getLjbc() { | ||
| 279 | - return ljbc; | ||
| 280 | - } | ||
| 281 | - public void setLjbc(int ljbc) { | ||
| 282 | - this.ljbc = ljbc; | ||
| 283 | - } | ||
| 284 | - public int getLjbczgf() { | ||
| 285 | - return ljbczgf; | ||
| 286 | - } | ||
| 287 | - public void setLjbczgf(int ljbczgf) { | ||
| 288 | - this.ljbczgf = ljbczgf; | ||
| 289 | - } | ||
| 290 | - public int getLjbcwgf() { | ||
| 291 | - return ljbcwgf; | ||
| 292 | - } | ||
| 293 | - public void setLjbcwgf(int ljbcwgf) { | ||
| 294 | - this.ljbcwgf = ljbcwgf; | ||
| 295 | - } | ||
| 296 | - public Double getLjyylc() { | ||
| 297 | - return ljyylc; | ||
| 298 | - } | ||
| 299 | - public void setLjyylc(Double ljyylc) { | ||
| 300 | - this.ljyylc = ljyylc; | ||
| 301 | - } | ||
| 302 | - public Double getLjfyylc() { | ||
| 303 | - return ljfyylc; | ||
| 304 | - } | ||
| 305 | - public void setLjfyylc(Double ljfyylc) { | ||
| 306 | - this.ljfyylc = ljfyylc; | ||
| 307 | - } | ||
| 308 | - public int getLbbc() { | ||
| 309 | - return lbbc; | ||
| 310 | - } | ||
| 311 | - public void setLbbc(int lbbc) { | ||
| 312 | - this.lbbc = lbbc; | ||
| 313 | - } | ||
| 314 | - public Double getLblc() { | ||
| 315 | - return lblc; | ||
| 316 | - } | ||
| 317 | - public void setLblc(Double lblc) { | ||
| 318 | - this.lblc = lblc; | ||
| 319 | - } | ||
| 320 | - | ||
| 321 | - public Double getZlc() { | ||
| 322 | - return zlc; | ||
| 323 | - } | ||
| 324 | - | ||
| 325 | - public void setZlc(Double zlc) { | ||
| 326 | - this.zlc = zlc; | ||
| 327 | - } | ||
| 328 | - | ||
| 329 | - public Double getCzlc() { | ||
| 330 | - return czlc; | ||
| 331 | - } | ||
| 332 | - | ||
| 333 | - public void setCzlc(Double czlc) { | ||
| 334 | - this.czlc = czlc; | ||
| 335 | - } | ||
| 336 | - | ||
| 337 | - public Double getJzlc() { | ||
| 338 | - return jzlc; | ||
| 339 | - } | ||
| 340 | - | ||
| 341 | - public void setJzlc(Double jzlc) { | ||
| 342 | - this.jzlc = jzlc; | ||
| 343 | - } | ||
| 344 | - | ||
| 345 | - public Double getCzyl() { | ||
| 346 | - return czyl; | ||
| 347 | - } | ||
| 348 | - | ||
| 349 | - public void setCzyl(Double czyl) { | ||
| 350 | - this.czyl = czyl; | ||
| 351 | - } | ||
| 352 | - | ||
| 353 | - public Double getJzyl() { | ||
| 354 | - return jzyl; | ||
| 355 | - } | ||
| 356 | - | ||
| 357 | - public void setJzyl(Double jzyl) { | ||
| 358 | - this.jzyl = jzyl; | ||
| 359 | - } | ||
| 360 | - | ||
| 361 | - public Double getJzl() { | ||
| 362 | - return jzl; | ||
| 363 | - } | ||
| 364 | - | ||
| 365 | - public Double getJzl0() { | ||
| 366 | - return jzl0; | ||
| 367 | - } | ||
| 368 | - | ||
| 369 | - public void setJzl0(Double jzl0) { | ||
| 370 | - this.jzl0 = jzl0; | ||
| 371 | - } | ||
| 372 | - | ||
| 373 | - public Double getJzl10() { | ||
| 374 | - return jzl10; | ||
| 375 | - } | ||
| 376 | - | ||
| 377 | - public void setJzl10(Double jzl10) { | ||
| 378 | - this.jzl10 = jzl10; | ||
| 379 | - } | ||
| 380 | - | ||
| 381 | - public void setJzl(Double jzl) { | ||
| 382 | - this.jzl = jzl; | ||
| 383 | - } | ||
| 384 | - | ||
| 385 | - public Double getYh() { | ||
| 386 | - return yh; | ||
| 387 | - } | ||
| 388 | - | ||
| 389 | - public void setYh(Double yh) { | ||
| 390 | - this.yh = yh; | ||
| 391 | - } | ||
| 392 | - | ||
| 393 | - public Double getBglyh() { | ||
| 394 | - return bglyh; | ||
| 395 | - } | ||
| 396 | - | ||
| 397 | - public void setBglyh(Double bglyh) { | ||
| 398 | - this.bglyh = bglyh; | ||
| 399 | - } | ||
| 400 | - | ||
| 401 | - public Double getSh() { | ||
| 402 | - return sh; | ||
| 403 | - } | ||
| 404 | - | ||
| 405 | - public void setSh(Double sh) { | ||
| 406 | - this.sh = sh; | ||
| 407 | - } | ||
| 408 | - | ||
| 409 | - public String getRylx() { | ||
| 410 | - return rylx; | ||
| 411 | - } | ||
| 412 | - | ||
| 413 | - public void setRylx(String rylx) { | ||
| 414 | - this.rylx = rylx; | ||
| 415 | - } | ||
| 416 | - | ||
| 417 | - public Double getCzcd() { | ||
| 418 | - return czcd; | ||
| 419 | - } | ||
| 420 | - | ||
| 421 | - public void setCzcd(Double czcd) { | ||
| 422 | - this.czcd = czcd; | ||
| 423 | - } | ||
| 424 | - | ||
| 425 | - public Double getJzcd() { | ||
| 426 | - return jzcd; | ||
| 427 | - } | ||
| 428 | - | ||
| 429 | - public void setJzcd(Double jzcd) { | ||
| 430 | - this.jzcd = jzcd; | ||
| 431 | - } | ||
| 432 | - | ||
| 433 | - public Double getCdl() { | ||
| 434 | - return cdl; | ||
| 435 | - } | ||
| 436 | - | ||
| 437 | - public void setCdl(Double cdl) { | ||
| 438 | - this.cdl = cdl; | ||
| 439 | - } | ||
| 440 | - | ||
| 441 | - public Double getHd() { | ||
| 442 | - return hd; | ||
| 443 | - } | ||
| 444 | - | ||
| 445 | - public void setHd(Double hd) { | ||
| 446 | - this.hd = hd; | ||
| 447 | - } | ||
| 448 | - | ||
| 449 | - public Double getBglhd() { | ||
| 450 | - return bglhd; | ||
| 451 | - } | ||
| 452 | - | ||
| 453 | - public void setBglhd(Double bglhd) { | ||
| 454 | - this.bglhd = bglhd; | ||
| 455 | - } | ||
| 456 | - | ||
| 457 | - public int getTs() { | ||
| 458 | - return ts; | ||
| 459 | - } | ||
| 460 | - | ||
| 461 | - public void setTs(int ts) { | ||
| 462 | - this.ts = ts; | ||
| 463 | - } | ||
| 464 | - | ||
| 465 | - public Date getCreateTime() { | ||
| 466 | - return createTime; | ||
| 467 | - } | ||
| 468 | - public void setCreateTime(Date createTime) { | ||
| 469 | - this.createTime = createTime; | ||
| 470 | - } | ||
| 471 | - public Date getUpdateTime() { | ||
| 472 | - return updateTime; | ||
| 473 | - } | ||
| 474 | - public void setUpdateTime(Date updateTime) { | ||
| 475 | - this.updateTime = updateTime; | ||
| 476 | - } | ||
| 477 | - | ||
| 478 | - | ||
| 479 | - | ||
| 480 | -} | 1 | +package com.bsth.entity.calc; |
| 2 | + | ||
| 3 | +import java.util.Date; | ||
| 4 | +// calcDetailMonthly.html 返回类 | ||
| 5 | +public class CalcWaybillDetail { | ||
| 6 | + private Long id; | ||
| 7 | + /* 公司代码*/ | ||
| 8 | + private String gsdm; | ||
| 9 | + /* 公司名称*/ | ||
| 10 | + private String gsname; | ||
| 11 | + /* 分公司代码*/ | ||
| 12 | + private String fgsdm; | ||
| 13 | + /* 分公司名称*/ | ||
| 14 | + private String fgsname; | ||
| 15 | + /* 日期*/ | ||
| 16 | + private Date rq; | ||
| 17 | + /* 日期字符串*/ | ||
| 18 | + private String rqStr; | ||
| 19 | + /* 线路编码*/ | ||
| 20 | + private String xl; | ||
| 21 | + /* 线路名称*/ | ||
| 22 | + private String xlName; | ||
| 23 | + /* 车辆自编号*/ | ||
| 24 | + private String cl; | ||
| 25 | + /* 路牌名字*/ | ||
| 26 | + private String lp; | ||
| 27 | + /* 驾驶员工号*/ | ||
| 28 | + private String jGh; | ||
| 29 | + /* 驾驶员名字*/ | ||
| 30 | + private String jName; | ||
| 31 | + /* 售票员工号*/ | ||
| 32 | + private String sGh; | ||
| 33 | + /* 售票员名字*/ | ||
| 34 | + private String sName; | ||
| 35 | + /* 计划营运班次*/ | ||
| 36 | + private int jhyybc=0; | ||
| 37 | + /* 计划早高峰营运班次*/ | ||
| 38 | + private int jhyybczgf=0; | ||
| 39 | + /* 计划晚高峰营运班次*/ | ||
| 40 | + private int jhyybcwgf=0; | ||
| 41 | + /* 计划非营运班次*/ | ||
| 42 | + private int jhfyybc=0; | ||
| 43 | + /* 计划营运里程*/ | ||
| 44 | + private Double jhyylc=0.0; | ||
| 45 | + /* 计划非营运里程*/ | ||
| 46 | + private Double jhfyylc=0.0; | ||
| 47 | + /* 实际营运班次*/ | ||
| 48 | + private int sjyybc=0; | ||
| 49 | + /* 实际早高峰营运班次*/ | ||
| 50 | + private int sjyybczgf=0; | ||
| 51 | + /* 实际晚高峰营运班次*/ | ||
| 52 | + private int sjyybcwgf=0; | ||
| 53 | + /* 实际非营运班次*/ | ||
| 54 | + private int sjfyybc=0; | ||
| 55 | + /* 实际营运里程*/ | ||
| 56 | + private Double sjyylc=0.0; | ||
| 57 | + /* 实际非营运里程*/ | ||
| 58 | + private Double sjfyylc=0.0; | ||
| 59 | + /* 临加班次*/ | ||
| 60 | + private int ljbc=0; | ||
| 61 | + /* 临加早高峰班次*/ | ||
| 62 | + private int ljbczgf=0; | ||
| 63 | + /* 临加晚高峰班次*/ | ||
| 64 | + private int ljbcwgf=0; | ||
| 65 | + /* 临加营运里程*/ | ||
| 66 | + private Double ljyylc=0.0; | ||
| 67 | + /* 临加非营运里程*/ | ||
| 68 | + private Double ljfyylc=0.0; | ||
| 69 | + /* 烂班班次*/ | ||
| 70 | + private int lbbc=0; | ||
| 71 | + /* 烂班里程*/ | ||
| 72 | + private Double lblc=0.0; | ||
| 73 | + | ||
| 74 | + | ||
| 75 | + // 总里程 | ||
| 76 | + private Double zlc=0.0; | ||
| 77 | + private Double czlc=0.0; | ||
| 78 | + private Double jzlc=0.0; | ||
| 79 | + // 出场油量 | ||
| 80 | + private Double czyl=0.0; | ||
| 81 | + // 进场油量 | ||
| 82 | + private Double jzyl=0.0; | ||
| 83 | + // 加注量 | ||
| 84 | + private Double jzl=0.0; | ||
| 85 | + // 加注量 0号柴油 | ||
| 86 | + private Double jzl0=0.0; | ||
| 87 | + // 加注量 -10#号柴油 | ||
| 88 | + private Double jzl10=0.0; | ||
| 89 | + // 油耗 | ||
| 90 | + private Double yh=0.0; | ||
| 91 | + // 百公里油耗 | ||
| 92 | + private Double bglyh=0.0; | ||
| 93 | + // 损耗 | ||
| 94 | + private Double sh=0.0; | ||
| 95 | + // 燃油类型 | ||
| 96 | + private String rylx; | ||
| 97 | + | ||
| 98 | + //出站存电 | ||
| 99 | + private Double czcd=0.0; | ||
| 100 | + //进站存电 | ||
| 101 | + private Double jzcd=0.0; | ||
| 102 | + //充电量 | ||
| 103 | + private Double cdl=0.0; | ||
| 104 | + //耗电 | ||
| 105 | + private Double hd=0.0; | ||
| 106 | + //百公里耗电 | ||
| 107 | + private Double bglhd=0.0; | ||
| 108 | + | ||
| 109 | + // 天数记录 | ||
| 110 | + private int ts=0; | ||
| 111 | + | ||
| 112 | + /* 创建时间*/ | ||
| 113 | + private Date createTime; | ||
| 114 | + /* 修改时间*/ | ||
| 115 | + private Date updateTime; | ||
| 116 | + public Long getId() { | ||
| 117 | + return id; | ||
| 118 | + } | ||
| 119 | + public void setId(Long id) { | ||
| 120 | + this.id = id; | ||
| 121 | + } | ||
| 122 | + public String getGsdm() { | ||
| 123 | + return gsdm; | ||
| 124 | + } | ||
| 125 | + public void setGsdm(String gsdm) { | ||
| 126 | + this.gsdm = gsdm; | ||
| 127 | + } | ||
| 128 | + public String getGsname() { | ||
| 129 | + return gsname; | ||
| 130 | + } | ||
| 131 | + public void setGsname(String gsname) { | ||
| 132 | + this.gsname = gsname; | ||
| 133 | + } | ||
| 134 | + public String getFgsdm() { | ||
| 135 | + return fgsdm; | ||
| 136 | + } | ||
| 137 | + public void setFgsdm(String fgsdm) { | ||
| 138 | + this.fgsdm = fgsdm; | ||
| 139 | + } | ||
| 140 | + public String getFgsname() { | ||
| 141 | + return fgsname; | ||
| 142 | + } | ||
| 143 | + public void setFgsname(String fgsname) { | ||
| 144 | + this.fgsname = fgsname; | ||
| 145 | + } | ||
| 146 | + public Date getRq() { | ||
| 147 | + return rq; | ||
| 148 | + } | ||
| 149 | + public void setRq(Date rq) { | ||
| 150 | + this.rq = rq; | ||
| 151 | + } | ||
| 152 | + public String getRqStr() { | ||
| 153 | + return rqStr; | ||
| 154 | + } | ||
| 155 | + public void setRqStr(String rqStr) { | ||
| 156 | + this.rqStr = rqStr; | ||
| 157 | + } | ||
| 158 | + public String getXl() { | ||
| 159 | + return xl; | ||
| 160 | + } | ||
| 161 | + public void setXl(String xl) { | ||
| 162 | + this.xl = xl; | ||
| 163 | + } | ||
| 164 | + public String getXlName() { | ||
| 165 | + return xlName; | ||
| 166 | + } | ||
| 167 | + public void setXlName(String xlName) { | ||
| 168 | + this.xlName = xlName; | ||
| 169 | + } | ||
| 170 | + public String getCl() { | ||
| 171 | + return cl; | ||
| 172 | + } | ||
| 173 | + public void setCl(String cl) { | ||
| 174 | + this.cl = cl; | ||
| 175 | + } | ||
| 176 | + public String getLp() { | ||
| 177 | + return lp; | ||
| 178 | + } | ||
| 179 | + public void setLp(String lp) { | ||
| 180 | + this.lp = lp; | ||
| 181 | + } | ||
| 182 | + public String getjGh() { | ||
| 183 | + return jGh; | ||
| 184 | + } | ||
| 185 | + public void setjGh(String jGh) { | ||
| 186 | + this.jGh = jGh; | ||
| 187 | + } | ||
| 188 | + public String getjName() { | ||
| 189 | + return jName; | ||
| 190 | + } | ||
| 191 | + public void setjName(String jName) { | ||
| 192 | + this.jName = jName; | ||
| 193 | + } | ||
| 194 | + public String getsGh() { | ||
| 195 | + return sGh; | ||
| 196 | + } | ||
| 197 | + public void setsGh(String sGh) { | ||
| 198 | + this.sGh = sGh; | ||
| 199 | + } | ||
| 200 | + public String getsName() { | ||
| 201 | + return sName; | ||
| 202 | + } | ||
| 203 | + public void setsName(String sName) { | ||
| 204 | + this.sName = sName; | ||
| 205 | + } | ||
| 206 | + public int getJhyybc() { | ||
| 207 | + return jhyybc; | ||
| 208 | + } | ||
| 209 | + public void setJhyybc(int jhyybc) { | ||
| 210 | + this.jhyybc = jhyybc; | ||
| 211 | + } | ||
| 212 | + public int getJhyybczgf() { | ||
| 213 | + return jhyybczgf; | ||
| 214 | + } | ||
| 215 | + public void setJhyybczgf(int jhyybczgf) { | ||
| 216 | + this.jhyybczgf = jhyybczgf; | ||
| 217 | + } | ||
| 218 | + public int getJhyybcwgf() { | ||
| 219 | + return jhyybcwgf; | ||
| 220 | + } | ||
| 221 | + public void setJhyybcwgf(int jhyybcwgf) { | ||
| 222 | + this.jhyybcwgf = jhyybcwgf; | ||
| 223 | + } | ||
| 224 | + public int getJhfyybc() { | ||
| 225 | + return jhfyybc; | ||
| 226 | + } | ||
| 227 | + public void setJhfyybc(int jhfyybc) { | ||
| 228 | + this.jhfyybc = jhfyybc; | ||
| 229 | + } | ||
| 230 | + public Double getJhyylc() { | ||
| 231 | + return jhyylc; | ||
| 232 | + } | ||
| 233 | + public void setJhyylc(Double jhyylc) { | ||
| 234 | + this.jhyylc = jhyylc; | ||
| 235 | + } | ||
| 236 | + public Double getJhfyylc() { | ||
| 237 | + return jhfyylc; | ||
| 238 | + } | ||
| 239 | + public void setJhfyylc(Double jhfyylc) { | ||
| 240 | + this.jhfyylc = jhfyylc; | ||
| 241 | + } | ||
| 242 | + public int getSjyybc() { | ||
| 243 | + return sjyybc; | ||
| 244 | + } | ||
| 245 | + public void setSjyybc(int sjyybc) { | ||
| 246 | + this.sjyybc = sjyybc; | ||
| 247 | + } | ||
| 248 | + public int getSjyybczgf() { | ||
| 249 | + return sjyybczgf; | ||
| 250 | + } | ||
| 251 | + public void setSjyybczgf(int sjyybczgf) { | ||
| 252 | + this.sjyybczgf = sjyybczgf; | ||
| 253 | + } | ||
| 254 | + public int getSjyybcwgf() { | ||
| 255 | + return sjyybcwgf; | ||
| 256 | + } | ||
| 257 | + public void setSjyybcwgf(int sjyybcwgf) { | ||
| 258 | + this.sjyybcwgf = sjyybcwgf; | ||
| 259 | + } | ||
| 260 | + public int getSjfyybc() { | ||
| 261 | + return sjfyybc; | ||
| 262 | + } | ||
| 263 | + public void setSjfyybc(int sjfyybc) { | ||
| 264 | + this.sjfyybc = sjfyybc; | ||
| 265 | + } | ||
| 266 | + public Double getSjyylc() { | ||
| 267 | + return sjyylc; | ||
| 268 | + } | ||
| 269 | + public void setSjyylc(Double sjyylc) { | ||
| 270 | + this.sjyylc = sjyylc; | ||
| 271 | + } | ||
| 272 | + public Double getSjfyylc() { | ||
| 273 | + return sjfyylc; | ||
| 274 | + } | ||
| 275 | + public void setSjfyylc(Double sjfyylc) { | ||
| 276 | + this.sjfyylc = sjfyylc; | ||
| 277 | + } | ||
| 278 | + public int getLjbc() { | ||
| 279 | + return ljbc; | ||
| 280 | + } | ||
| 281 | + public void setLjbc(int ljbc) { | ||
| 282 | + this.ljbc = ljbc; | ||
| 283 | + } | ||
| 284 | + public int getLjbczgf() { | ||
| 285 | + return ljbczgf; | ||
| 286 | + } | ||
| 287 | + public void setLjbczgf(int ljbczgf) { | ||
| 288 | + this.ljbczgf = ljbczgf; | ||
| 289 | + } | ||
| 290 | + public int getLjbcwgf() { | ||
| 291 | + return ljbcwgf; | ||
| 292 | + } | ||
| 293 | + public void setLjbcwgf(int ljbcwgf) { | ||
| 294 | + this.ljbcwgf = ljbcwgf; | ||
| 295 | + } | ||
| 296 | + public Double getLjyylc() { | ||
| 297 | + return ljyylc; | ||
| 298 | + } | ||
| 299 | + public void setLjyylc(Double ljyylc) { | ||
| 300 | + this.ljyylc = ljyylc; | ||
| 301 | + } | ||
| 302 | + public Double getLjfyylc() { | ||
| 303 | + return ljfyylc; | ||
| 304 | + } | ||
| 305 | + public void setLjfyylc(Double ljfyylc) { | ||
| 306 | + this.ljfyylc = ljfyylc; | ||
| 307 | + } | ||
| 308 | + public int getLbbc() { | ||
| 309 | + return lbbc; | ||
| 310 | + } | ||
| 311 | + public void setLbbc(int lbbc) { | ||
| 312 | + this.lbbc = lbbc; | ||
| 313 | + } | ||
| 314 | + public Double getLblc() { | ||
| 315 | + return lblc; | ||
| 316 | + } | ||
| 317 | + public void setLblc(Double lblc) { | ||
| 318 | + this.lblc = lblc; | ||
| 319 | + } | ||
| 320 | + | ||
| 321 | + public Double getZlc() { | ||
| 322 | + return zlc; | ||
| 323 | + } | ||
| 324 | + | ||
| 325 | + public void setZlc(Double zlc) { | ||
| 326 | + this.zlc = zlc; | ||
| 327 | + } | ||
| 328 | + | ||
| 329 | + public Double getCzlc() { | ||
| 330 | + return czlc; | ||
| 331 | + } | ||
| 332 | + | ||
| 333 | + public void setCzlc(Double czlc) { | ||
| 334 | + this.czlc = czlc; | ||
| 335 | + } | ||
| 336 | + | ||
| 337 | + public Double getJzlc() { | ||
| 338 | + return jzlc; | ||
| 339 | + } | ||
| 340 | + | ||
| 341 | + public void setJzlc(Double jzlc) { | ||
| 342 | + this.jzlc = jzlc; | ||
| 343 | + } | ||
| 344 | + | ||
| 345 | + public Double getCzyl() { | ||
| 346 | + return czyl; | ||
| 347 | + } | ||
| 348 | + | ||
| 349 | + public void setCzyl(Double czyl) { | ||
| 350 | + this.czyl = czyl; | ||
| 351 | + } | ||
| 352 | + | ||
| 353 | + public Double getJzyl() { | ||
| 354 | + return jzyl; | ||
| 355 | + } | ||
| 356 | + | ||
| 357 | + public void setJzyl(Double jzyl) { | ||
| 358 | + this.jzyl = jzyl; | ||
| 359 | + } | ||
| 360 | + | ||
| 361 | + public Double getJzl() { | ||
| 362 | + return jzl; | ||
| 363 | + } | ||
| 364 | + | ||
| 365 | + public Double getJzl0() { | ||
| 366 | + return jzl0; | ||
| 367 | + } | ||
| 368 | + | ||
| 369 | + public void setJzl0(Double jzl0) { | ||
| 370 | + this.jzl0 = jzl0; | ||
| 371 | + } | ||
| 372 | + | ||
| 373 | + public Double getJzl10() { | ||
| 374 | + return jzl10; | ||
| 375 | + } | ||
| 376 | + | ||
| 377 | + public void setJzl10(Double jzl10) { | ||
| 378 | + this.jzl10 = jzl10; | ||
| 379 | + } | ||
| 380 | + | ||
| 381 | + public void setJzl(Double jzl) { | ||
| 382 | + this.jzl = jzl; | ||
| 383 | + } | ||
| 384 | + | ||
| 385 | + public Double getYh() { | ||
| 386 | + return yh; | ||
| 387 | + } | ||
| 388 | + | ||
| 389 | + public void setYh(Double yh) { | ||
| 390 | + this.yh = yh; | ||
| 391 | + } | ||
| 392 | + | ||
| 393 | + public Double getBglyh() { | ||
| 394 | + return bglyh; | ||
| 395 | + } | ||
| 396 | + | ||
| 397 | + public void setBglyh(Double bglyh) { | ||
| 398 | + this.bglyh = bglyh; | ||
| 399 | + } | ||
| 400 | + | ||
| 401 | + public Double getSh() { | ||
| 402 | + return sh; | ||
| 403 | + } | ||
| 404 | + | ||
| 405 | + public void setSh(Double sh) { | ||
| 406 | + this.sh = sh; | ||
| 407 | + } | ||
| 408 | + | ||
| 409 | + public String getRylx() { | ||
| 410 | + return rylx; | ||
| 411 | + } | ||
| 412 | + | ||
| 413 | + public void setRylx(String rylx) { | ||
| 414 | + this.rylx = rylx; | ||
| 415 | + } | ||
| 416 | + | ||
| 417 | + public Double getCzcd() { | ||
| 418 | + return czcd; | ||
| 419 | + } | ||
| 420 | + | ||
| 421 | + public void setCzcd(Double czcd) { | ||
| 422 | + this.czcd = czcd; | ||
| 423 | + } | ||
| 424 | + | ||
| 425 | + public Double getJzcd() { | ||
| 426 | + return jzcd; | ||
| 427 | + } | ||
| 428 | + | ||
| 429 | + public void setJzcd(Double jzcd) { | ||
| 430 | + this.jzcd = jzcd; | ||
| 431 | + } | ||
| 432 | + | ||
| 433 | + public Double getCdl() { | ||
| 434 | + return cdl; | ||
| 435 | + } | ||
| 436 | + | ||
| 437 | + public void setCdl(Double cdl) { | ||
| 438 | + this.cdl = cdl; | ||
| 439 | + } | ||
| 440 | + | ||
| 441 | + public Double getHd() { | ||
| 442 | + return hd; | ||
| 443 | + } | ||
| 444 | + | ||
| 445 | + public void setHd(Double hd) { | ||
| 446 | + this.hd = hd; | ||
| 447 | + } | ||
| 448 | + | ||
| 449 | + public Double getBglhd() { | ||
| 450 | + return bglhd; | ||
| 451 | + } | ||
| 452 | + | ||
| 453 | + public void setBglhd(Double bglhd) { | ||
| 454 | + this.bglhd = bglhd; | ||
| 455 | + } | ||
| 456 | + | ||
| 457 | + public int getTs() { | ||
| 458 | + return ts; | ||
| 459 | + } | ||
| 460 | + | ||
| 461 | + public void setTs(int ts) { | ||
| 462 | + this.ts = ts; | ||
| 463 | + } | ||
| 464 | + | ||
| 465 | + public Date getCreateTime() { | ||
| 466 | + return createTime; | ||
| 467 | + } | ||
| 468 | + public void setCreateTime(Date createTime) { | ||
| 469 | + this.createTime = createTime; | ||
| 470 | + } | ||
| 471 | + public Date getUpdateTime() { | ||
| 472 | + return updateTime; | ||
| 473 | + } | ||
| 474 | + public void setUpdateTime(Date updateTime) { | ||
| 475 | + this.updateTime = updateTime; | ||
| 476 | + } | ||
| 477 | + | ||
| 478 | + | ||
| 479 | + | ||
| 480 | +} |
src/main/java/com/bsth/repository/calc/CalcWaybillRepository.java
| @@ -77,31 +77,41 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ | @@ -77,31 +77,41 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ | ||
| 77 | 77 | ||
| 78 | 78 | ||
| 79 | //按照时间段统计,公司下线路 (驾驶员) | 79 | //按照时间段统计,公司下线路 (驾驶员) |
| 80 | - @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) " + | ||
| 81 | - "and c.xl in (select l.lineCode from Line l where l.destroy in (?6)) order by c.jGh,c.fgsdm,c.xl,c.rqStr") | ||
| 82 | - List<CalcWaybill> scheduleByJsy2(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy); | 80 | + @Query(value="select DISTINCT c from CalcWaybill c where c.rqStr >= ?1 and c.rqStr <= ?2 and c.gsdm in(?3) and c.fgsdm in(?4) " + |
| 81 | + "and c.xl in (select l.lineCode from Line l where l.destroy in (?5) and l.lineCode in (?6)) order by c.jGh,c.fgsdm,c.xl,c.rqStr") | ||
| 82 | + List<CalcWaybill> scheduleByJsy2(String date, String date2, List<String> gsdm, List<String> fgsdm, List<Integer> destroym, List<String> line); | ||
| 83 | //按照时间段统计,公司下线路 (售票员) coalesce(c.sGh,'') | 83 | //按照时间段统计,公司下线路 (售票员) coalesce(c.sGh,'') |
| 84 | - @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) and c.sGh <> null and c.sGh <> '' " + | ||
| 85 | - "and c.xl in (select l.lineCode from Line l where l.destroy in (?6)) order by c.sGh,c.fgsdm,c.xl,c.rqStr") | ||
| 86 | - List<CalcWaybill> scheduleBySpy2(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy); | 84 | + @Query(value="select DISTINCT c from CalcWaybill c where c.rqStr >= ?1 and c.rqStr <= ?2 and c.gsdm in(?3) and c.fgsdm in(?4) and c.sGh <> null and c.sGh <> '' " + |
| 85 | + "and c.xl in (select l.lineCode from Line l where l.destroy in (?5) and l.lineCode in (?6)) order by c.sGh,c.fgsdm,c.xl,c.rqStr") | ||
| 86 | + List<CalcWaybill> scheduleBySpy2(String date, String date2, List<String> gsdm, List<String> fgsdm, List<Integer> destroy, List<String> line); | ||
| 87 | //按照时间段统计,公司下线路 (车辆自编号) | 87 | //按照时间段统计,公司下线路 (车辆自编号) |
| 88 | - @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) " + | ||
| 89 | - "and c.xl in (select l.lineCode from Line l where l.destroy in (?6)) order by c.cl,c.fgsdm,c.xl,c.rqStr") | ||
| 90 | - List<CalcWaybill> scheduleByZbh2(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy); | 88 | + @Query(value="select DISTINCT c from CalcWaybill c where c.rqStr >= ?1 and c.rqStr <= ?2 and c.gsdm in(?3) and c.fgsdm in(?4) " + |
| 89 | + "and c.xl in (select l.lineCode from Line l where l.destroy in (?5) and l.lineCode in (?6)) order by c.cl,c.fgsdm,c.xl,c.rqStr") | ||
| 90 | + List<CalcWaybill> scheduleByZbh2(String date, String date2, List<String> gsdm, List<String> fgsdm, List<Integer> destroy, List<String> line); | ||
| 91 | //按照时间段统计,公司下线路 排序不同 | 91 | //按照时间段统计,公司下线路 排序不同 |
| 92 | - @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) " + | ||
| 93 | - "and c.xl in (select l.lineCode from Line l where l.destroy in (?6)) order by c.fgsdm,c.xl,c.rqStr") | ||
| 94 | - List<CalcWaybill> scheduleByDateAndLineTjPx(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy); | 92 | + @Query(value="select DISTINCT c from CalcWaybill c where c.rqStr >= ?1 and c.rqStr <= ?2 and c.gsdm in(?3) and c.fgsdm in(?4) " + |
| 93 | + "and c.xl in (select l.lineCode from Line l where l.destroy in (?5) and l.lineCode in (?6)) order by c.fgsdm,c.xl,c.rqStr") | ||
| 94 | + List<CalcWaybill> scheduleByDateAndLineTjPx(String date, String date2, List<String> gsdm, List<String> fgsdm, List<Integer> destroy, List<String> line); | ||
| 95 | 95 | ||
| 96 | //路单没有的加油 | 96 | //路单没有的加油 |
| 97 | @Query(value="select DISTINCT y from Ylb y left join CalcWaybill c on y.rq = c.rq and y.xlbm = c.xl and y.jsy = c.jGh and y.nbbm = c.cl " + | 97 | @Query(value="select DISTINCT y from Ylb y left join CalcWaybill c on y.rq = c.rq and y.xlbm = c.xl and y.jsy = c.jGh and y.nbbm = c.cl " + |
| 98 | - "where y.xlbm in(?1) and y.rq between ?2 and ?3 and y.ssgsdm in(?4) and y.fgsdm in(?5) and c.id is null " + | ||
| 99 | - "and y.xlbm in (select l.lineCode from Line l where l.destroy in (?6)) order by y.rq desc") //按日期倒序,方便插入list | ||
| 100 | - List<Ylb> ylbNotSchedule(List<String> line,Date date,Date date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy); | 98 | + "where y.rq >= ?1 and y.rq <= ?2 and y.ssgsdm in(?3) and y.fgsdm in(?4) and c.id is null " + |
| 99 | + "and y.xlbm in (select l.lineCode from Line l where l.destroy in (?5) and l.lineCode in (?6)) order by y.rq desc") //按日期倒序,方便插入list | ||
| 100 | + List<Ylb> ylbNotSchedule(Date date, Date date2, List<String> gsdm, List<String> fgsdm, List<Integer> destroy, List<String> line); | ||
| 101 | 101 | ||
| 102 | //路单没有的加油 | 102 | //路单没有的加油 |
| 103 | @Query(value="select DISTINCT d from Dlb d left join CalcWaybill c on d.rq = c.rq and d.xlbm = c.xl and d.jsy = c.jGh and d.nbbm = c.cl " + | 103 | @Query(value="select DISTINCT d from Dlb d left join CalcWaybill c on d.rq = c.rq and d.xlbm = c.xl and d.jsy = c.jGh and d.nbbm = c.cl " + |
| 104 | - "where d.xlbm in(?1) and d.rq between ?2 and ?3 and d.ssgsdm in(?4) and d.fgsdm in(?5) and c.id is null " + | ||
| 105 | - "and d.xlbm in (select l.lineCode from Line l where l.destroy in (?6)) order by d.rq desc") //按日期倒序,方便插入list | ||
| 106 | - List<Dlb> DlbNotSchedule(List<String> line,Date date,Date date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy); | 104 | + "where d.rq >= ?1 and d.rq <= ?2 and d.ssgsdm in(?3) and d.fgsdm in(?4) and c.id is null " + |
| 105 | + "and d.xlbm in (select l.lineCode from Line l where l.destroy in (?5) and l.lineCode in (?6)) order by d.rq desc") //按日期倒序,方便插入list | ||
| 106 | + List<Dlb> dlbNotSchedule(Date date, Date date2, List<String> gsdm, List<String> fgsdm, List<Integer> destroy, List<String> line); | ||
| 107 | + | ||
| 108 | + @Query(value="select DISTINCT y from Ylb y left join CalcWaybill c on y.rq = c.rq and y.xlbm = c.xl and y.jsy = c.jGh and y.nbbm = c.cl " + | ||
| 109 | + "where y.rq >= ?1 and y.rq <= ?2 and y.ssgsdm in(?3) and y.fgsdm in(?4) " + | ||
| 110 | + "and y.xlbm in (select l.lineCode from Line l where l.destroy in (?5) and l.lineCode in (?6)) order by y.rq desc") //按日期倒序,方便插入list | ||
| 111 | + List<Ylb> ylb(Date date, Date date2, List<String> gsdm, List<String> fgsdm, List<Integer> destroy, List<String> line); | ||
| 112 | + | ||
| 113 | + @Query(value="select DISTINCT d from Dlb d left join CalcWaybill c on d.rq = c.rq and d.xlbm = c.xl and d.jsy = c.jGh and d.nbbm = c.cl " + | ||
| 114 | + "where d.rq >= ?1 and d.rq <= ?2 and d.ssgsdm in(?3) and d.fgsdm in(?4) " + | ||
| 115 | + "and d.xlbm in (select l.lineCode from Line l where l.destroy in (?5) and l.lineCode in (?6)) order by d.rq desc") //按日期倒序,方便插入list | ||
| 116 | + List<Dlb> dlb(Date date, Date date2, List<String> gsdm, List<String> fgsdm, List<Integer> destroy, List<String> line); | ||
| 107 | } | 117 | } |
src/main/java/com/bsth/service/calc/CalcWaybillService.java
| @@ -43,4 +43,6 @@ public interface CalcWaybillService extends BaseService<CalcWaybill, Integer> { | @@ -43,4 +43,6 @@ public interface CalcWaybillService extends BaseService<CalcWaybill, Integer> { | ||
| 43 | List<Map<String, Object>> getBusMileage(String line, String date, String date2, String xlName, String zt, String by, String type); | 43 | List<Map<String, Object>> getBusMileage(String line, String date, String date2, String xlName, String zt, String by, String type); |
| 44 | 44 | ||
| 45 | List<List<String>> calcDetailMonthly(Map<String, Object> map); | 45 | List<List<String>> calcDetailMonthly(Map<String, Object> map); |
| 46 | + | ||
| 47 | + List<List<String>> calcDetailMonthlyNew(Map<String, Object> map); | ||
| 46 | } | 48 | } |
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
| @@ -25,6 +25,8 @@ import com.bsth.repository.calc.CalcLineMileageRepository; | @@ -25,6 +25,8 @@ import com.bsth.repository.calc.CalcLineMileageRepository; | ||
| 25 | import com.bsth.repository.calc.CalcStatisticsRepository; | 25 | import com.bsth.repository.calc.CalcStatisticsRepository; |
| 26 | import com.bsth.repository.calc.CalcWaybillRepository; | 26 | import com.bsth.repository.calc.CalcWaybillRepository; |
| 27 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 27 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 28 | +import com.bsth.repository.sys.RealControAuthorityRepository; | ||
| 29 | +import com.bsth.security.util.SecurityUtils; | ||
| 28 | import com.bsth.service.LineService; | 30 | import com.bsth.service.LineService; |
| 29 | import com.bsth.service.calc.CalcToolService; | 31 | import com.bsth.service.calc.CalcToolService; |
| 30 | import com.bsth.service.calc.CalcWaybillService; | 32 | import com.bsth.service.calc.CalcWaybillService; |
| @@ -50,6 +52,7 @@ import org.springframework.stereotype.Service; | @@ -50,6 +52,7 @@ import org.springframework.stereotype.Service; | ||
| 50 | import javax.transaction.Transactional; | 52 | import javax.transaction.Transactional; |
| 51 | 53 | ||
| 52 | import java.math.BigDecimal; | 54 | import java.math.BigDecimal; |
| 55 | +import java.math.RoundingMode; | ||
| 53 | import java.sql.ResultSet; | 56 | import java.sql.ResultSet; |
| 54 | import java.sql.SQLException; | 57 | import java.sql.SQLException; |
| 55 | import java.text.DecimalFormat; | 58 | import java.text.DecimalFormat; |
| @@ -98,6 +101,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -98,6 +101,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 98 | private ReportService reportService; | 101 | private ReportService reportService; |
| 99 | @Autowired | 102 | @Autowired |
| 100 | CarsRepository carsRepository; | 103 | CarsRepository carsRepository; |
| 104 | + | ||
| 105 | + @Autowired | ||
| 106 | + RealControAuthorityRepository realControAuthorityRepository; | ||
| 101 | 107 | ||
| 102 | @Autowired | 108 | @Autowired |
| 103 | JdbcTemplate jdbcTemplate; | 109 | JdbcTemplate jdbcTemplate; |
| @@ -1933,20 +1939,21 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -1933,20 +1939,21 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 1933 | } | 1939 | } |
| 1934 | List<String> line= new ArrayList<>(); | 1940 | List<String> line= new ArrayList<>(); |
| 1935 | String lineStr = ""; | 1941 | String lineStr = ""; |
| 1936 | - if(map.get("lineCode")!=null){ | ||
| 1937 | - lineStr = map.get("lineCode").toString().trim(); | ||
| 1938 | - String[] lines = lineStr.split(","); | ||
| 1939 | - for (int i = 0; i < lines.length; i++){ | ||
| 1940 | - line.add(lines[i]); | ||
| 1941 | - } | ||
| 1942 | - } | ||
| 1943 | - //查询全部线路(测试时使用) | ||
| 1944 | -// Iterable<Line> findAll = lineService.findAll(); | ||
| 1945 | -// for(Line l : findAll){ | ||
| 1946 | -// line.add(l.getLineCode()); | ||
| 1947 | -// lineStr += l.getLineCode() + ","; | ||
| 1948 | -// } | ||
| 1949 | -// lineStr = lineStr.substring(0, lineStr.length() - 1); | 1942 | + if(map.containsKey("allLine")){ |
| 1943 | + Iterable<Line> findAll = lineService.findAll(); | ||
| 1944 | + for(Line l : findAll){ | ||
| 1945 | + line.add(l.getLineCode()); | ||
| 1946 | + lineStr += l.getLineCode() + ","; | ||
| 1947 | + } | ||
| 1948 | + lineStr = lineStr.substring(0, lineStr.length() - 1); | ||
| 1949 | + } else { | ||
| 1950 | + String lineCodeStr = realControAuthorityRepository.findByUserId(SecurityUtils.getCurrentUser().getId()).getLineCodeStr(); | ||
| 1951 | + lineStr = lineCodeStr.substring(0, lineCodeStr.length() - 1); | ||
| 1952 | + String[] lineStrs = lineStr.split(","); | ||
| 1953 | + for(String s : lineStrs){ | ||
| 1954 | + line.add(s); | ||
| 1955 | + } | ||
| 1956 | + } | ||
| 1950 | 1957 | ||
| 1951 | String startDate=""; | 1958 | String startDate=""; |
| 1952 | if(map.get("startDate")!=null){ | 1959 | if(map.get("startDate")!=null){ |
| @@ -2005,30 +2012,33 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -2005,30 +2012,33 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 2005 | } | 2012 | } |
| 2006 | } | 2013 | } |
| 2007 | 2014 | ||
| 2015 | + System.out.println(new Date()); | ||
| 2008 | int flag = 0; | 2016 | int flag = 0; |
| 2009 | if("jsy".equals(statisticalObj)){ | 2017 | if("jsy".equals(statisticalObj)){ |
| 2010 | flag = 1; | 2018 | flag = 1; |
| 2011 | - list = calcRepository.scheduleByJsy2(line, startDate, endDate, gsdm, fgsdm, destroy); | 2019 | + list = calcRepository.scheduleByJsy2(startDate, endDate, gsdm, fgsdm, destroy, line); |
| 2012 | } else if("cwy".equals(statisticalObj)){ | 2020 | } else if("cwy".equals(statisticalObj)){ |
| 2013 | flag = 2; | 2021 | flag = 2; |
| 2014 | - list = calcRepository.scheduleBySpy2(line, startDate, endDate, gsdm, fgsdm, destroy); | 2022 | + list = calcRepository.scheduleBySpy2(startDate, endDate, gsdm, fgsdm, destroy, line); |
| 2015 | } else if("cl".equals(statisticalObj)){ | 2023 | } else if("cl".equals(statisticalObj)){ |
| 2016 | flag = 3; | 2024 | flag = 3; |
| 2017 | - list = calcRepository.scheduleByZbh2(line, startDate, endDate, gsdm, fgsdm, destroy); | 2025 | + list = calcRepository.scheduleByZbh2( startDate, endDate, gsdm, fgsdm, destroy, line); |
| 2018 | } else if("xl".equals(statisticalObj)){ | 2026 | } else if("xl".equals(statisticalObj)){ |
| 2019 | flag = 4; | 2027 | flag = 4; |
| 2020 | - list = calcRepository.scheduleByDateAndLineTjPx(line,startDate,endDate,gsdm,fgsdm, destroy); | 2028 | + list = calcRepository.scheduleByDateAndLineTjPx(startDate, endDate, gsdm, fgsdm, destroy, line); |
| 2021 | } | 2029 | } |
| 2022 | 2030 | ||
| 2023 | 2031 | ||
| 2024 | // List类转换 | 2032 | // List类转换 |
| 2025 | final List<CalcWaybillDetail> listNew = JSONArray.parseArray(JSON.toJSONString(list), CalcWaybillDetail.class); | 2033 | final List<CalcWaybillDetail> listNew = JSONArray.parseArray(JSON.toJSONString(list), CalcWaybillDetail.class); |
| 2026 | - | 2034 | + |
| 2035 | + System.out.println(new Date()); | ||
| 2027 | if(flag != 2) | 2036 | if(flag != 2) |
| 2028 | try { | 2037 | try { |
| 2029 | //查询出没有路单的加油充电,插入到上面查询的结果集中汇总计算。 | 2038 | //查询出没有路单的加油充电,插入到上面查询的结果集中汇总计算。 |
| 2030 | - List<Ylb> ylbNotSchedule = calcRepository.ylbNotSchedule(line, dateFormat.parse(startDate), dateFormat.parse(endDate), gsdm, fgsdm, destroy); | ||
| 2031 | - List<Dlb> dlbNotSchedule = calcRepository.DlbNotSchedule(line, dateFormat.parse(startDate), dateFormat.parse(endDate), gsdm, fgsdm, destroy); | 2039 | + List<Ylb> ylbNotSchedule = calcRepository.ylbNotSchedule(dateFormat.parse(startDate), dateFormat.parse(endDate), gsdm, fgsdm, destroy, line); |
| 2040 | + List<Dlb> dlbNotSchedule = calcRepository.dlbNotSchedule(dateFormat.parse(startDate), dateFormat.parse(endDate), gsdm, fgsdm, destroy, line); | ||
| 2041 | + System.out.println(new Date()); | ||
| 2032 | for(Ylb y : ylbNotSchedule){ | 2042 | for(Ylb y : ylbNotSchedule){ |
| 2033 | Date ylbrq = y.getRq(); | 2043 | Date ylbrq = y.getRq(); |
| 2034 | String ylbxl = y.getXlbm(); | 2044 | String ylbxl = y.getXlbm(); |
| @@ -2271,6 +2281,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -2271,6 +2281,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 2271 | } catch (Exception e) { | 2281 | } catch (Exception e) { |
| 2272 | // TODO: handle exception | 2282 | // TODO: handle exception |
| 2273 | } | 2283 | } |
| 2284 | + System.out.println(new Date()); | ||
| 2274 | 2285 | ||
| 2275 | if(listNew.size() <= 0){ | 2286 | if(listNew.size() <= 0){ |
| 2276 | return resList; | 2287 | return resList; |
| @@ -2285,6 +2296,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -2285,6 +2296,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 2285 | // 只有在选择 车辆,驾驶员查询时才有 | 2296 | // 只有在选择 车辆,驾驶员查询时才有 |
| 2286 | // 把油量和电量数据查出来,封装成Map,计算时直接取 | 2297 | // 把油量和电量数据查出来,封装成Map,计算时直接取 |
| 2287 | if(flag != 2 ){ | 2298 | if(flag != 2 ){ |
| 2299 | + List<Object> objList = new ArrayList<Object>(); | ||
| 2300 | + objList.add(startDate); | ||
| 2301 | + objList.add(endDate); | ||
| 2288 | String linesql=""; | 2302 | String linesql=""; |
| 2289 | if(!lineStr.equals("")){ | 2303 | if(!lineStr.equals("")){ |
| 2290 | linesql +=" and xlbm in("+lineStr+") "; | 2304 | linesql +=" and xlbm in("+lineStr+") "; |
| @@ -2296,12 +2310,12 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -2296,12 +2310,12 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 2296 | linesql +=" and fgsdm in("+fgsdmStr+") "; | 2310 | linesql +=" and fgsdm in("+fgsdmStr+") "; |
| 2297 | } | 2311 | } |
| 2298 | String ylsql="SELECT * FROM bsth_c_ylb" | 2312 | String ylsql="SELECT * FROM bsth_c_ylb" |
| 2299 | - + " WHERE rq >= '"+startDate+"' and rq <= '"+endDate+"' " | 2313 | + + " WHERE rq >= ? and rq <= ? " |
| 2300 | + linesql; | 2314 | + linesql; |
| 2301 | - String dlSal= " SELECT * FROM bsth_c_dlb" | ||
| 2302 | - + " WHERE rq >= '"+startDate+"' and rq <= '"+endDate+"' " | 2315 | + String dlSql= " SELECT * FROM bsth_c_dlb" |
| 2316 | + + " WHERE rq >= ? and rq <= ? " | ||
| 2303 | + linesql; | 2317 | + linesql; |
| 2304 | - List<Ylb> ylbList = jdbcTemplate.query(ylsql, new RowMapper<Ylb>() { | 2318 | + List<Ylb> ylbList = jdbcTemplate.query(ylsql, objList.toArray(), new RowMapper<Ylb>() { |
| 2305 | @Override | 2319 | @Override |
| 2306 | public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException{ | 2320 | public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException{ |
| 2307 | Ylb ylb = new Ylb(); | 2321 | Ylb ylb = new Ylb(); |
| @@ -2311,7 +2325,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -2311,7 +2325,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 2311 | } catch (ParseException e){ | 2325 | } catch (ParseException e){ |
| 2312 | logger.error(e.toString(),e); | 2326 | logger.error(e.toString(),e); |
| 2313 | } | 2327 | } |
| 2314 | -// Date rq = ft.parse(arg0.getString("rq")); | ||
| 2315 | ylb.setXlbm(arg0.getString("xlbm")); | 2328 | ylb.setXlbm(arg0.getString("xlbm")); |
| 2316 | ylb.setJsy(arg0.getString("jsy")); | 2329 | ylb.setJsy(arg0.getString("jsy")); |
| 2317 | ylb.setJname(arg0.getString("jname")); | 2330 | ylb.setJname(arg0.getString("jname")); |
| @@ -2331,7 +2344,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -2331,7 +2344,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 2331 | return ylb; | 2344 | return ylb; |
| 2332 | } | 2345 | } |
| 2333 | }); | 2346 | }); |
| 2334 | - List<Dlb> dlbList = jdbcTemplate.query(dlSal, new RowMapper<Dlb>() { | 2347 | + List<Dlb> dlbList = jdbcTemplate.query(dlSql, objList.toArray(), new RowMapper<Dlb>() { |
| 2335 | @Override | 2348 | @Override |
| 2336 | public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException { | 2349 | public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 2337 | Dlb dlb = new Dlb();Date rq = null; | 2350 | Dlb dlb = new Dlb();Date rq = null; |
| @@ -2735,7 +2748,496 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -2735,7 +2748,496 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 2735 | // listEnd.add(df.format(allNum)+"/"+df.format(all)); | 2748 | // listEnd.add(df.format(allNum)+"/"+df.format(all)); |
| 2736 | listEnd.add(df.format(all)); | 2749 | listEnd.add(df.format(all)); |
| 2737 | resList.add(listEnd); | 2750 | resList.add(listEnd); |
| 2751 | + System.out.println(new Date()); | ||
| 2752 | + | ||
| 2753 | + return resList; | ||
| 2754 | + } | ||
| 2755 | + | ||
| 2756 | + //240820重写calcDetailMonthly方法 | ||
| 2757 | + @Override | ||
| 2758 | + public List<List<String>> calcDetailMonthlyNew(Map<String, Object> map) { | ||
| 2759 | + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 2760 | + SimpleDateFormat dateFormatMon = new SimpleDateFormat("yyyy-MM"); | ||
| 2761 | + DecimalFormat df = new DecimalFormat("0.000");//格式化小数 | ||
| 2762 | + List<Integer> destroy= new ArrayList<>(); | ||
| 2763 | + String destroyStr = ""; | ||
| 2764 | + if(map.get("destroy")!=null){ | ||
| 2765 | + destroyStr = map.get("destroy").toString().trim(); | ||
| 2766 | + String[] destroys = destroyStr.split(","); | ||
| 2767 | + for (int i = 0; i < destroys.length; i++){ | ||
| 2768 | + destroy.add(Integer.parseInt(destroys[i])); | ||
| 2769 | + } | ||
| 2770 | + } | ||
| 2771 | + List<String> gsdm= new ArrayList<>(); | ||
| 2772 | + String gsdmStr = ""; | ||
| 2773 | + if(map.get("gsdm")!=null){ | ||
| 2774 | + gsdmStr = map.get("gsdm").toString().trim(); | ||
| 2775 | + String[] gsdms = gsdmStr.split(","); | ||
| 2776 | + for (int i = 0; i < gsdms.length; i++){ | ||
| 2777 | + gsdm.add(gsdms[i]); | ||
| 2778 | + } | ||
| 2779 | + } | ||
| 2780 | + List<String> fgsdm= new ArrayList<>(); | ||
| 2781 | + String fgsdmStr = ""; | ||
| 2782 | + if(map.get("fgsdm")!=null){ | ||
| 2783 | + fgsdmStr = map.get("fgsdm").toString().trim(); | ||
| 2784 | + String[] fgsdms = fgsdmStr.split(","); | ||
| 2785 | + for (int i = 0; i < fgsdms.length; i++){ | ||
| 2786 | + fgsdm.add(fgsdms[i]); | ||
| 2787 | + } | ||
| 2788 | + } | ||
| 2789 | + List<String> line= new ArrayList<>(); | ||
| 2790 | + String lineStr = ""; | ||
| 2791 | + if(map.containsKey("allLine")){ | ||
| 2792 | + Iterable<Line> findAll = lineService.findAll(); | ||
| 2793 | + for(Line l : findAll){ | ||
| 2794 | + line.add(l.getLineCode()); | ||
| 2795 | + lineStr += l.getLineCode() + ","; | ||
| 2796 | + } | ||
| 2797 | + lineStr = lineStr.substring(0, lineStr.length() - 1); | ||
| 2798 | + } else { | ||
| 2799 | + String lineCodeStr = realControAuthorityRepository.findByUserId(SecurityUtils.getCurrentUser().getId()).getLineCodeStr(); | ||
| 2800 | + lineStr = lineCodeStr.substring(0, lineCodeStr.length() - 1); | ||
| 2801 | + String[] lineStrs = lineStr.split(","); | ||
| 2802 | + for(String s : lineStrs){ | ||
| 2803 | + line.add(s); | ||
| 2804 | + } | ||
| 2805 | + } | ||
| 2806 | + | ||
| 2807 | + Map<String, String> carsMap = new HashMap<>(); | ||
| 2808 | + List<Cars> carsList = carsRepository.findCars(); | ||
| 2809 | + for (Cars c:carsList) { | ||
| 2810 | + String sfdc = c.getSfdc()+""; | ||
| 2811 | + carsMap.put(c.getInsideCode(), sfdc.equals("true")?"纯电动":"柴油"); | ||
| 2812 | + } | ||
| 2813 | + | ||
| 2814 | + String startDate=""; | ||
| 2815 | + if(map.get("startDate")!=null){ | ||
| 2816 | + startDate=map.get("startDate").toString().trim(); | ||
| 2817 | + } | ||
| 2818 | + String endDate=""; | ||
| 2819 | + if(map.get("endDate")!=null){ | ||
| 2820 | + endDate=map.get("endDate").toString().trim(); | ||
| 2821 | + } | ||
| 2822 | + String type=""; | ||
| 2823 | + if(map.get("type")!=null){ | ||
| 2824 | + type=map.get("type").toString().trim(); | ||
| 2825 | + } | ||
| 2826 | + String statisticalObj=""; | ||
| 2827 | + if(map.get("statisticalObj")!=null){ | ||
| 2828 | + statisticalObj=map.get("statisticalObj").toString().trim(); | ||
| 2829 | + } | ||
| 2830 | + String itemDetails=""; | ||
| 2831 | + if(map.get("itemDetails")!=null){ | ||
| 2832 | + itemDetails=map.get("itemDetails").toString().trim(); | ||
| 2833 | + } | ||
| 2834 | + String timeType=map.get("timeType").toString().trim(); | ||
| 2835 | + | ||
| 2836 | + List<String> dayList = new ArrayList<>(); | ||
| 2837 | + int day = 0, day2 = 0; | ||
| 2838 | + if("m".equals(timeType)){ | ||
| 2839 | + day = Integer.parseInt(startDate.substring(8,10)); | ||
| 2840 | + day2 = Integer.parseInt(endDate.substring(8,10)); | ||
| 2841 | + for(int i = day; i <= day2; i++){ | ||
| 2842 | + dayList.add(startDate.substring(0,7)+"-"+(i<10?"0"+i:i)); | ||
| 2843 | + } | ||
| 2844 | + } else if("y".equals(timeType)){ | ||
| 2845 | + day = Integer.parseInt(startDate.substring(5,7)); | ||
| 2846 | + day2 = Integer.parseInt(endDate.substring(5,7)); | ||
| 2847 | + for(int i = day; i <= day2; i++){ | ||
| 2848 | + dayList.add(startDate.substring(0,5)+(i<10?"0"+i:i)); | ||
| 2849 | + } | ||
| 2850 | + startDate += "-01"; | ||
| 2851 | + try { | ||
| 2852 | + endDate = dateFormat.format(new Date(dateFormat.parse(dateFormat.format(dateFormat.parse(endDate + "-32")).substring(0,7) + "-01").getTime() - 1l*1000*60*60*24)); | ||
| 2853 | + } catch (ParseException e) { | ||
| 2854 | + // TODO Auto-generated catch block | ||
| 2855 | + e.printStackTrace(); | ||
| 2856 | + } | ||
| 2857 | + } | ||
| 2858 | + | ||
| 2859 | + List<List<String>> resList = new ArrayList<>(); // 返回list | ||
| 2860 | + List<CalcWaybill> list = new ArrayList<CalcWaybill>(); | ||
| 2861 | + | ||
| 2862 | + int flag = 0; | ||
| 2863 | + if("jsy".equals(statisticalObj)){ | ||
| 2864 | + flag = 1; | ||
| 2865 | + list = calcRepository.scheduleByJsy2(startDate, endDate, gsdm, fgsdm, destroy, line); | ||
| 2866 | + } else if("cwy".equals(statisticalObj)){ | ||
| 2867 | + flag = 2; | ||
| 2868 | + list = calcRepository.scheduleBySpy2(startDate, endDate, gsdm, fgsdm, destroy, line); | ||
| 2869 | + } else if("cl".equals(statisticalObj)){ | ||
| 2870 | + flag = 3; | ||
| 2871 | + list = calcRepository.scheduleByZbh2( startDate, endDate, gsdm, fgsdm, destroy, line); | ||
| 2872 | + } else if("xl".equals(statisticalObj)){ | ||
| 2873 | + flag = 4; | ||
| 2874 | + list = calcRepository.scheduleByDateAndLineTjPx(startDate, endDate, gsdm, fgsdm, destroy, line); | ||
| 2875 | + } | ||
| 2876 | + | ||
| 2877 | + // List类转换 | ||
| 2878 | + final List<CalcWaybillDetail> listNew = JSONArray.parseArray(JSON.toJSONString(list), CalcWaybillDetail.class); | ||
| 2879 | + | ||
| 2880 | + //先以公司线路分组 | ||
| 2881 | + HashMap<String, List<CalcWaybillDetail>> keyMap = new HashMap<String, List<CalcWaybillDetail>>(); | ||
| 2882 | + ArrayList<String> keyList = new ArrayList<String>(); | ||
| 2883 | + //再以统计对象分组 | ||
| 2884 | + HashMap<String, List<CalcWaybillDetail>> keyMapT = new HashMap<String, List<CalcWaybillDetail>>(); | ||
| 2885 | + ArrayList<String> keyNewList = new ArrayList<String>(); | ||
| 2886 | + | ||
| 2887 | + for(CalcWaybillDetail cwd : listNew){ | ||
| 2888 | + String key = cwd.getGsdm() + "_" + cwd.getFgsdm() + "_" + cwd.getXl(); | ||
| 2889 | + if(!keyMap.containsKey(key)){ | ||
| 2890 | + keyMap.put(key, new ArrayList<CalcWaybillDetail>()); | ||
| 2891 | + keyList.add(key); | ||
| 2892 | + } | ||
| 2893 | + keyMap.get(key).add(cwd); | ||
| 2894 | + } | ||
| 2895 | + | ||
| 2896 | + if(flag != 2){ | ||
| 2897 | + try { | ||
| 2898 | + List<Ylb> ylb = calcRepository.ylb(dateFormat.parse(startDate), dateFormat.parse(endDate), gsdm, fgsdm, destroy, line); | ||
| 2899 | + List<Dlb> dlb = calcRepository.dlb(dateFormat.parse(startDate), dateFormat.parse(endDate), gsdm, fgsdm, destroy, line); | ||
| 2900 | + | ||
| 2901 | + for(Ylb y : ylb){ | ||
| 2902 | + String key = y.getSsgsdm() + "_" + y.getFgsdm() + "_" + y.getXlbm(); | ||
| 2903 | + if(!keyMap.containsKey(key)){ | ||
| 2904 | + keyMap.put(key, new ArrayList<CalcWaybillDetail>()); | ||
| 2905 | + keyList.add(key); | ||
| 2906 | + } | ||
| 2907 | + | ||
| 2908 | + CalcWaybillDetail cNew = new CalcWaybillDetail(); | ||
| 2909 | + cNew.setRq(y.getRq()); | ||
| 2910 | + cNew.setRqStr(dateFormat.format(y.getRq())); | ||
| 2911 | + cNew.setXl(y.getXlbm()); | ||
| 2912 | + cNew.setXlName(BasicData.lineCodeAllNameMap.get(y.getXlbm())); | ||
| 2913 | + cNew.setGsdm(y.getSsgsdm()); | ||
| 2914 | + cNew.setGsname(BasicData.businessCodeNameMap.get(y.getSsgsdm())); | ||
| 2915 | + cNew.setFgsdm(y.getFgsdm()); | ||
| 2916 | + cNew.setFgsname(BasicData.businessFgsCodeNameMap.get(y.getFgsdm()+"_"+y.getSsgsdm())); | ||
| 2917 | + cNew.setCl(y.getNbbm()); | ||
| 2918 | + cNew.setjGh(y.getJsy()); | ||
| 2919 | + if(BasicData.allPerson.get(y.getSsgsdm()+"-"+y.getJsy()) != null){ | ||
| 2920 | + cNew.setjName(BasicData.allPerson.get(y.getSsgsdm()+"-"+y.getJsy())); | ||
| 2921 | + } else { | ||
| 2922 | + cNew.setjName(""); | ||
| 2923 | + } | ||
| 2924 | + cNew.setZlc(y.getZlc()); | ||
| 2925 | + cNew.setYh(y.getYh()); | ||
| 2926 | + cNew.setJzl(y.getJzl()); | ||
| 2927 | + if("0".equals(y.getRylx())){ | ||
| 2928 | + cNew.setJzl0(y.getJzl()); | ||
| 2929 | + }else if("1".equals(y.getRylx())){ | ||
| 2930 | + cNew.setJzl10(y.getJzl()); | ||
| 2931 | + } | ||
| 2932 | + cNew.setJzyl(y.getJzyl()); | ||
| 2933 | + cNew.setCzyl(y.getCzyl()); | ||
| 2934 | + cNew.setRylx(y.getRylx()); | ||
| 2935 | + cNew.setBglyh((y.getZlc()==0? 0:100*y.getYh()/y.getZlc())); | ||
| 2936 | + keyMap.get(key).add(cNew); | ||
| 2937 | + } | ||
| 2938 | + for(Dlb d : dlb){ | ||
| 2939 | + String key = d.getSsgsdm() + "_" + d.getFgsdm() + "_" + d.getXlbm(); | ||
| 2940 | + if(!keyMap.containsKey(key)){ | ||
| 2941 | + keyMap.put(key, new ArrayList<CalcWaybillDetail>()); | ||
| 2942 | + keyList.add(key); | ||
| 2943 | + } | ||
| 2944 | + | ||
| 2945 | + CalcWaybillDetail cNew = new CalcWaybillDetail(); | ||
| 2946 | + cNew.setRq(d.getRq()); | ||
| 2947 | + cNew.setRqStr(dateFormat.format(d.getRq())); | ||
| 2948 | + cNew.setXl(d.getXlbm()); | ||
| 2949 | + cNew.setXlName(BasicData.lineCodeAllNameMap.get(d.getXlbm())); | ||
| 2950 | + cNew.setGsdm(d.getSsgsdm()); | ||
| 2951 | + cNew.setGsname(BasicData.businessCodeNameMap.get(d.getSsgsdm())); | ||
| 2952 | + cNew.setFgsdm(d.getFgsdm()); | ||
| 2953 | + cNew.setFgsname(BasicData.businessFgsCodeNameMap.get(d.getFgsdm()+"_"+d.getSsgsdm())); | ||
| 2954 | + cNew.setCl(d.getNbbm()); | ||
| 2955 | + cNew.setjGh(d.getJsy()); | ||
| 2956 | + if(BasicData.allPerson.get(d.getSsgsdm()+"-"+d.getJsy()) != null){ | ||
| 2957 | + cNew.setjName(BasicData.allPerson.get(d.getSsgsdm()+"-"+d.getJsy())); | ||
| 2958 | + } else { | ||
| 2959 | + cNew.setjName(""); | ||
| 2960 | + } | ||
| 2961 | + cNew.setZlc(d.getZlc()); | ||
| 2962 | + cNew.setHd(d.getHd()); | ||
| 2963 | + cNew.setJzcd(d.getJzcd()); | ||
| 2964 | + cNew.setCzcd(d.getCzcd()); | ||
| 2965 | + cNew.setCdl(d.getCdl()); | ||
| 2966 | + cNew.setBglyh((d.getZlc()==0? 0:100*d.getHd()/d.getZlc())); | ||
| 2967 | + keyMap.get(key).add(cNew); | ||
| 2968 | + } | ||
| 2969 | + | ||
| 2970 | + } catch (ParseException e) { | ||
| 2971 | + // TODO Auto-generated catch block | ||
| 2972 | + e.printStackTrace(); | ||
| 2973 | + } | ||
| 2974 | + } | ||
| 2975 | + | ||
| 2976 | + for(String key : keyList){ | ||
| 2977 | + List<CalcWaybillDetail> cwds = keyMap.get(key); | ||
| 2978 | + for(CalcWaybillDetail cwd : cwds){ | ||
| 2979 | + String keyNew = key; | ||
| 2980 | + if(flag == 1 && cwd.getjGh() != null && cwd.getjName() != null){ | ||
| 2981 | + keyNew += "_" + cwd.getjGh() + "_" + cwd.getjName(); | ||
| 2982 | + } else if(flag == 2 && cwd.getsGh() != null && cwd.getsName() != null){ | ||
| 2983 | + keyNew += "_" + cwd.getsGh() + "_" + cwd.getsName(); | ||
| 2984 | + } else if(flag == 3 && cwd.getCl() != null){ | ||
| 2985 | + keyNew += "_" + cwd.getCl(); | ||
| 2986 | + } else if(flag == 4){ // 4是按线路分组,这里不需要细分 | ||
| 2987 | + } | ||
| 2988 | + if(!keyMapT.containsKey(keyNew)){ | ||
| 2989 | + keyMapT.put(keyNew, new ArrayList<CalcWaybillDetail>()); | ||
| 2990 | + keyNewList.add(keyNew); | ||
| 2991 | + } | ||
| 2992 | + keyMapT.get(keyNew).add(cwd); | ||
| 2993 | + } | ||
| 2994 | + } | ||
| 2995 | + | ||
| 2996 | + //表头 | ||
| 2997 | + List<String> list1 = new ArrayList<>(); | ||
| 2998 | + list1.add("序号"); | ||
| 2999 | + list1.add("所属公司"); | ||
| 3000 | + list1.add("线路"); | ||
| 3001 | + if(flag==1 || flag==2){ | ||
| 3002 | + list1.add("工号"); | ||
| 3003 | + list1.add("姓名"); | ||
| 3004 | + } else if(flag == 3){ | ||
| 3005 | + list1.add("自编号"); | ||
| 3006 | + list1.add("车牌号"); | ||
| 3007 | + list1.add("燃油类型"); | ||
| 3008 | + } | ||
| 3009 | + list1.add("计划公里"); | ||
| 3010 | + list1.add("总公里"); | ||
| 3011 | + list1.add("空驶公里"); | ||
| 3012 | + list1.add("临加公里"); | ||
| 3013 | + list1.add("烂班公里"); | ||
| 3014 | + list1.add("m".equals(timeType)?"天数":"月数"); | ||
| 3015 | + for(int i=day; i<=day2; i++){ | ||
| 3016 | + list1.add((i<10?"0"+i:i)+("m".equals(timeType)?"日":"月")); | ||
| 3017 | + } | ||
| 3018 | + if("bgldh".equals(itemDetails) || "bglyh".equals(itemDetails)){ | ||
| 3019 | + list1.add("平均"); | ||
| 3020 | + } else | ||
| 3021 | + list1.add("合计"); | ||
| 3022 | + resList.add(list1); | ||
| 3023 | + | ||
| 3024 | + List<String> listAll = new ArrayList<>(); // 最下的合计行 | ||
| 3025 | + Double jhglAll = 0d, | ||
| 3026 | + zglAll = 0d, ksglAll = 0d, | ||
| 3027 | + ljglAll = 0d, lbglAll = 0d; | ||
| 3028 | + Long tsAll = 0l; | ||
| 3029 | + Map<String, BigDecimal> tempAll = new HashMap<String, BigDecimal>(); | ||
| 3030 | + Map<String, BigDecimal> temp2All = new HashMap<String, BigDecimal>(); | ||
| 3031 | + Double allNumAll = 0d; // 最右列合计 | ||
| 3032 | + Double allNum2All = 0d; // 最右列合计 | ||
| 3033 | + | ||
| 3034 | + for(String d : dayList){ | ||
| 3035 | + tempAll.put(d, new BigDecimal(0)); | ||
| 3036 | + temp2All.put(d, new BigDecimal(0)); | ||
| 3037 | + } | ||
| 3038 | + | ||
| 3039 | + int no = 1; | ||
| 3040 | + for(String key : keyNewList){ | ||
| 3041 | + List<CalcWaybillDetail> listT = keyMapT.get(key); | ||
| 3042 | + CalcWaybillDetail c = listT.get(0); | ||
| 3043 | + BigDecimal allNum = new BigDecimal("0"); // 最右列合计 | ||
| 3044 | + BigDecimal allNum2 = new BigDecimal("0"); // 最右列合计 | ||
| 3045 | + | ||
| 3046 | + Map<String, String> temp = new HashMap<String, String>(); | ||
| 3047 | + Map<String, String> temp2 = new HashMap<String, String>(); | ||
| 3048 | + for(String d : dayList){ | ||
| 3049 | + temp.put(d, ""); | ||
| 3050 | + temp2.put(d, "0"); | ||
| 3051 | + } | ||
| 3052 | + for(int i = 0; i < listT.size(); i++){ | ||
| 3053 | + CalcWaybillDetail cw = listT.get(i); | ||
| 3054 | + if(i > 0){ | ||
| 3055 | + this.summation2(c, cw); | ||
| 3056 | + } | ||
| 3057 | + | ||
| 3058 | + String dd = ""; | ||
| 3059 | + if("m".equals(timeType)){ | ||
| 3060 | + dd = dateFormat.format(cw.getRq()); | ||
| 3061 | + } else if("y".equals(timeType)){ | ||
| 3062 | + dd = dateFormatMon.format(cw.getRq()); | ||
| 3063 | + } | ||
| 3064 | + if(temp.containsKey(dd)){ | ||
| 3065 | + if("".equals(temp.get(dd))){ | ||
| 3066 | + c.setTs(c.getTs() + 1); | ||
| 3067 | + temp.put(dd, "0"); | ||
| 3068 | + } | ||
| 3069 | + // 根据统计对象和日期区间统计 | ||
| 3070 | + if("jzlAll".equals(itemDetails)){ | ||
| 3071 | + temp.put(dd, Arith.add(temp.get(dd), cw.getJzl()) + ""); | ||
| 3072 | + }else if("jzl0".equals(itemDetails)){ | ||
| 3073 | + temp.put(dd, Arith.add(temp.get(dd), cw.getJzl0()) + ""); | ||
| 3074 | + } else if("jzl-10".equals(itemDetails)){ | ||
| 3075 | + temp.put(dd, Arith.add(temp.get(dd), cw.getJzl10()) + ""); | ||
| 3076 | + } else if("yhl".equals(itemDetails)){ | ||
| 3077 | + temp.put(dd, Arith.add(temp.get(dd), cw.getYh()) + ""); | ||
| 3078 | + } else if("jccy".equals(itemDetails)){ | ||
| 3079 | + temp.put(dd, Arith.add(temp.get(dd), cw.getJzyl()) + ""); | ||
| 3080 | + } else if("cccy".equals(itemDetails)){ | ||
| 3081 | + temp.put(dd, Arith.add(temp.get(dd), cw.getCzyl()) + ""); | ||
| 3082 | + } else if("bglyh".equals(itemDetails)){ | ||
| 3083 | +// temp.put(dd, Arith.add(temp.get(dd), cw.getZlc()==0?0:100*cw.getYh()/cw.getZlc()) + ""); | ||
| 3084 | + temp.put(dd, Arith.add(temp.get(dd), cw.getYh()) + ""); | ||
| 3085 | + temp2.put(dd, Arith.add(temp2.get(dd), cw.getZlc()) + ""); | ||
| 3086 | + } else if("dh".equals(itemDetails)){ | ||
| 3087 | + temp.put(dd, Arith.add(temp.get(dd), cw.getHd()) + ""); | ||
| 3088 | + } else if("cdl".equals(itemDetails)){ | ||
| 3089 | + temp.put(dd, Arith.add(temp.get(dd), cw.getCdl()) + ""); | ||
| 3090 | + } else if("cccd".equals(itemDetails)){ | ||
| 3091 | + temp.put(dd, Arith.add(temp.get(dd), cw.getCzcd()) + ""); | ||
| 3092 | + } else if("jccd".equals(itemDetails)){ | ||
| 3093 | + temp.put(dd, Arith.add(temp.get(dd), cw.getJzcd()) + ""); | ||
| 3094 | + } else if("bgldh".equals(itemDetails)){ | ||
| 3095 | +// temp.put(dd, Arith.add(temp.get(dd), cw.getZlc()==0?0:100*cw.getHd()/cw.getZlc()) + ""); | ||
| 3096 | + temp.put(dd, Arith.add(temp.get(dd), cw.getHd()) + ""); | ||
| 3097 | + temp2.put(dd, Arith.add(temp2.get(dd), cw.getZlc()) + ""); | ||
| 3098 | + } else if("zgl".equals(itemDetails)){ | ||
| 3099 | + temp.put(dd, Arith.add(temp.get(dd), Arith.add(Arith.add(cw.getSjyylc(), cw.getSjfyylc()), | ||
| 3100 | + Arith.add(cw.getLjyylc(), cw.getLjfyylc()))) + ""); | ||
| 3101 | + } else if("jhgl".equals(itemDetails)){ | ||
| 3102 | + temp.put(dd, Arith.add(temp.get(dd), Arith.add(cw.getJhyylc(), cw.getJhfyylc())) + ""); | ||
| 3103 | + } else if("sjbc".equals(itemDetails)){ | ||
| 3104 | + temp.put(dd, Arith.add(temp.get(dd), cw.getSjyybc()+cw.getSjfyybc()+cw.getLjbc()+"") + ""); | ||
| 3105 | + } else if("jhbc".equals(itemDetails)){ | ||
| 3106 | + temp.put(dd, Arith.add(temp.get(dd), cw.getJhyybc()+cw.getJhfyybc()+"") + ""); | ||
| 3107 | + } | ||
| 3108 | + } | ||
| 3109 | + } | ||
| 3110 | + List<String> listStr = new ArrayList<>(); | ||
| 3111 | + listStr.add("" + no++); | ||
| 3112 | + listStr.add(c.getFgsname()); | ||
| 3113 | + listStr.add(c.getXlName()); | ||
| 3114 | + if("jsy".equals(statisticalObj)){ | ||
| 3115 | + listStr.add(c.getjGh()); | ||
| 3116 | + listStr.add(c.getjName()); | ||
| 3117 | + } else if("cwy".equals(statisticalObj)){ | ||
| 3118 | + listStr.add(c.getsGh()); | ||
| 3119 | + listStr.add(c.getsName()); | ||
| 3120 | + } else if("cl".equals(statisticalObj)){ | ||
| 3121 | + listStr.add(c.getCl()); | ||
| 3122 | + if(BasicData.nbbmCompanyPlateMap.get(c.getCl()) != null){ | ||
| 3123 | + listStr.add(BasicData.nbbmCompanyPlateMap.get(c.getCl())+""); | ||
| 3124 | + } else { | ||
| 3125 | + listStr.add(""); | ||
| 3126 | + } | ||
| 3127 | + if(carsMap.containsKey(c.getCl())){ | ||
| 3128 | + listStr.add(carsMap.get(c.getCl())); | ||
| 3129 | + } else { | ||
| 3130 | + listStr.add(""); | ||
| 3131 | + } | ||
| 3132 | + } else if("xl".equals(statisticalObj)){ | ||
| 3133 | + | ||
| 3134 | + } | ||
| 3135 | + Double jhgl = Arith.add(c.getJhyylc(), c.getJhfyylc()); | ||
| 3136 | + Double zgl = Arith.add(Arith.add(c.getSjyylc(), c.getSjfyylc()), | ||
| 3137 | + Arith.add(c.getLjyylc(), c.getLjfyylc())); | ||
| 3138 | + Double ksgl = Arith.add(c.getSjfyylc(), c.getLjfyylc()); | ||
| 3139 | + Double ljgl = Arith.add(c.getLjyylc(), c.getLjfyylc()); | ||
| 3140 | + Double lbgl = c.getLblc(); | ||
| 3141 | + | ||
| 3142 | + listStr.add(df.format(jhgl)); | ||
| 3143 | + listStr.add(df.format(zgl)); | ||
| 3144 | + listStr.add(df.format(ksgl)); | ||
| 3145 | + listStr.add(df.format(ljgl)); | ||
| 3146 | + listStr.add(df.format(lbgl)); | ||
| 3147 | + listStr.add(c.getTs()+""); | ||
| 3148 | + | ||
| 3149 | + BigDecimal hj = new BigDecimal("0"); | ||
| 3150 | + | ||
| 3151 | + for(String d : dayList){ // 把每个日期单位值取出来,并计算合计值 | ||
| 3152 | + String str = temp.get(d); | ||
| 3153 | + if(str.length() > 0){ | ||
| 3154 | + if("bgldh".equals(itemDetails) || "bglyh".equals(itemDetails)){ // 百公里能耗算法不一样 | ||
| 3155 | + String str2 = temp2.get(d); | ||
| 3156 | + if(str2.length() > 0){ | ||
| 3157 | + BigDecimal str_bd = new BigDecimal(str); // 能耗 | ||
| 3158 | + BigDecimal str2_bd = new BigDecimal(str2); // 里程 | ||
| 3159 | + if(str2_bd.compareTo(new BigDecimal(0)) > 0){ | ||
| 3160 | + String val = df.format(str_bd.multiply(new BigDecimal(100)).divide(str2_bd, 3, RoundingMode.HALF_UP)); | ||
| 3161 | + listStr.add(val); | ||
| 3162 | + hj = hj.add(new BigDecimal(val)); | ||
| 3163 | + allNum = allNum.add(str_bd); | ||
| 3164 | + allNum2 = allNum2.add(str2_bd); | ||
| 3165 | + tempAll.put(d, tempAll.get(d).add(str_bd)); | ||
| 3166 | + temp2All.put(d, temp2All.get(d).add(str2_bd)); | ||
| 3167 | + } else { | ||
| 3168 | + listStr.add(""); | ||
| 3169 | + } | ||
| 3170 | + } else { | ||
| 3171 | + listStr.add(""); | ||
| 3172 | + } | ||
| 3173 | + } else { | ||
| 3174 | + BigDecimal str_bd = new BigDecimal(str); | ||
| 3175 | + listStr.add(df.format(str_bd)); | ||
| 3176 | + allNum = allNum.add(str_bd); | ||
| 3177 | + tempAll.put(d, tempAll.get(d).add(str_bd)); | ||
| 3178 | + } | ||
| 3179 | + } else { | ||
| 3180 | + listStr.add(""); | ||
| 3181 | + } | ||
| 3182 | + | ||
| 3183 | + } | ||
| 3184 | + if("bgldh".equals(itemDetails) || "bglyh".equals(itemDetails)){ | ||
| 3185 | + if(c.getTs() > 0){ | ||
| 3186 | + listStr.add(df.format(hj.divide(new BigDecimal(c.getTs()), 3, RoundingMode.HALF_UP))); | ||
| 3187 | + } else { | ||
| 3188 | + listStr.add(df.format(0)); | ||
| 3189 | + } | ||
| 3190 | + } else { | ||
| 3191 | + listStr.add(df.format(allNum)); | ||
| 3192 | + } | ||
| 3193 | + resList.add(listStr); | ||
| 3194 | + | ||
| 3195 | + jhglAll = Arith.add(jhglAll, jhgl); | ||
| 3196 | + zglAll = Arith.add(zglAll, zgl); | ||
| 3197 | + ksglAll = Arith.add(ksglAll, ksgl); | ||
| 3198 | + ljglAll = Arith.add(ljglAll, ljgl); | ||
| 3199 | + lbglAll = Arith.add(lbglAll, lbgl); | ||
| 3200 | + tsAll += c.getTs(); | ||
| 3201 | + allNumAll = Arith.add(allNumAll, allNum); | ||
| 3202 | + allNum2All = Arith.add(allNum2All, allNum2); | ||
| 3203 | + | ||
| 3204 | + } | ||
| 2738 | 3205 | ||
| 3206 | + listAll.add("合计"); | ||
| 3207 | + listAll.add(df.format(jhglAll)); | ||
| 3208 | + listAll.add(df.format(zglAll)); | ||
| 3209 | + listAll.add(df.format(ksglAll)); | ||
| 3210 | + listAll.add(df.format(ljglAll)); | ||
| 3211 | + listAll.add(df.format(lbglAll)); | ||
| 3212 | + listAll.add(tsAll + ""); | ||
| 3213 | + | ||
| 3214 | + BigDecimal hj = new BigDecimal("0"); | ||
| 3215 | + | ||
| 3216 | + if("bgldh".equals(itemDetails) || "bglyh".equals(itemDetails)){ | ||
| 3217 | + for(String d : dayList){ | ||
| 3218 | + BigDecimal bd = tempAll.get(d); | ||
| 3219 | + BigDecimal bd2 = temp2All.get(d); | ||
| 3220 | + if(bd2.compareTo(new BigDecimal(0)) > 0){ | ||
| 3221 | + String val = df.format(bd.multiply(new BigDecimal(100)).divide(bd2, 3, RoundingMode.HALF_UP)); | ||
| 3222 | + listAll.add(val); | ||
| 3223 | + hj = hj.add(new BigDecimal(val)); | ||
| 3224 | + } else { | ||
| 3225 | + listAll.add(df.format(0)); | ||
| 3226 | + } | ||
| 3227 | + } | ||
| 3228 | + if(dayList.size() > 0l){ | ||
| 3229 | + listAll.add(df.format(hj.divide(new BigDecimal(dayList.size()), 3, RoundingMode.HALF_UP))); | ||
| 3230 | + } else { | ||
| 3231 | + listAll.add(df.format(0)); | ||
| 3232 | + } | ||
| 3233 | + } else { | ||
| 3234 | + for(String d : dayList){ | ||
| 3235 | + listAll.add(df.format(tempAll.get(d))); | ||
| 3236 | + } | ||
| 3237 | + listAll.add(df.format(allNumAll)); | ||
| 3238 | + } | ||
| 3239 | + resList.add(listAll); | ||
| 3240 | + | ||
| 2739 | return resList; | 3241 | return resList; |
| 2740 | } | 3242 | } |
| 2741 | 3243 | ||
| @@ -2794,9 +3296,26 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -2794,9 +3296,26 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 2794 | c1.setJzcd(Arith.add(c1.getJzcd(),c2.getJzcd())); | 3296 | c1.setJzcd(Arith.add(c1.getJzcd(),c2.getJzcd())); |
| 2795 | c1.setCdl(Arith.add(c1.getCdl(),c2.getCdl())); | 3297 | c1.setCdl(Arith.add(c1.getCdl(),c2.getCdl())); |
| 2796 | c1.setTs(c1.getTs()+c2.getTs()); | 3298 | c1.setTs(c1.getTs()+c2.getTs()); |
| 2797 | -// c1.setDtbc(c1.getDtbc() + c2.getDtbc()); | ||
| 2798 | return c1; | 3299 | return c1; |
| 2799 | } | 3300 | } |
| 3301 | + | ||
| 3302 | + public CalcWaybillDetail summation2(CalcWaybillDetail c1, CalcWaybillDetail c2){ | ||
| 3303 | + c1.setJhyybc(c1.getJhyybc() + c2.getJhyybc()); | ||
| 3304 | + c1.setJhyylc(Arith.add(c1.getJhyylc(), c2.getJhyylc())); | ||
| 3305 | + c1.setJhfyybc(c1.getJhfyybc() + c2.getJhfyybc()); | ||
| 3306 | + c1.setJhfyylc(Arith.add(c1.getJhfyylc(), c2.getJhfyylc())); | ||
| 3307 | + c1.setSjyybc(c1.getSjyybc() + c2.getSjyybc()); | ||
| 3308 | + c1.setSjyylc(Arith.add(c1.getSjyylc(), c2.getSjyylc())); | ||
| 3309 | + c1.setSjfyybc(c1.getSjfyybc() + c2.getSjfyybc()); | ||
| 3310 | + c1.setSjfyylc(Arith.add(c1.getSjfyylc(), c2.getSjfyylc())); | ||
| 3311 | + c1.setLbbc(c1.getLbbc() + c2.getLbbc()); | ||
| 3312 | + c1.setLblc(Arith.add(c1.getLblc(), c2.getLblc())); | ||
| 3313 | + c1.setLjbc(c1.getLjbc() + c2.getLjbc()); | ||
| 3314 | + c1.setLjyylc(Arith.add(c1.getLjyylc(), c2.getLjyylc())); | ||
| 3315 | + c1.setLjfyylc(Arith.add(c1.getLjfyylc(), c2.getLjfyylc())); | ||
| 3316 | + return c1; | ||
| 3317 | + } | ||
| 3318 | + | ||
| 2800 | } | 3319 | } |
| 2801 | 3320 | ||
| 2802 | class AccountXlbmByping implements Comparator<Map<String, Object>> { | 3321 | class AccountXlbmByping implements Comparator<Map<String, Object>> { |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -4601,7 +4601,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -4601,7 +4601,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 4601 | 4601 | ||
| 4602 | public Map<String,Object> calcDetailMonthlyE(Map<String, Object> map){ | 4602 | public Map<String,Object> calcDetailMonthlyE(Map<String, Object> map){ |
| 4603 | 4603 | ||
| 4604 | - List<List<String>> list = calcWaybillService.calcDetailMonthly(map); | 4604 | +// List<List<String>> list = calcWaybillService.calcDetailMonthly(map); |
| 4605 | + List<List<String>> list = calcWaybillService.calcDetailMonthlyNew(map); | ||
| 4605 | 4606 | ||
| 4606 | Map<String, Object> resultMap = new HashMap<String, Object>(); | 4607 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
| 4607 | try { | 4608 | try { |
src/main/resources/static/pages/forms/calc/calcDetailMonthly.html
| @@ -177,10 +177,10 @@ | @@ -177,10 +177,10 @@ | ||
| 177 | var lineAll=""; | 177 | var lineAll=""; |
| 178 | var datas = {}; //查询条件 | 178 | var datas = {}; //查询条件 |
| 179 | 179 | ||
| 180 | - /**用户分配的线路*/ | ||
| 181 | - $.get('/realControAuthority/findByCurrentUser', function (userAuthor) { | ||
| 182 | - lineAll = userAuthor.lineCodeStr.substring(0,userAuthor.lineCodeStr.length-1); | ||
| 183 | - }); | 180 | +// /**用户分配的线路*/ |
| 181 | +// $.get('/realControAuthority/findByCurrentUser', function (userAuthor) { | ||
| 182 | +// lineAll = userAuthor.lineCodeStr.substring(0,userAuthor.lineCodeStr.length-1); | ||
| 183 | +// }); | ||
| 184 | 184 | ||
| 185 | var tempData = {}; | 185 | var tempData = {}; |
| 186 | 186 | ||
| @@ -273,7 +273,7 @@ | @@ -273,7 +273,7 @@ | ||
| 273 | datas = {}; // 清空之前数据 | 273 | datas = {}; // 清空之前数据 |
| 274 | datas.gsdm = gsdm; | 274 | datas.gsdm = gsdm; |
| 275 | datas.fgsdm = fgsdm; | 275 | datas.fgsdm = fgsdm; |
| 276 | - datas.lineCode = lineAll; | 276 | +// datas.lineCode = lineAll; |
| 277 | datas.timeType = "m"; | 277 | datas.timeType = "m"; |
| 278 | datas.startDate = startDate; | 278 | datas.startDate = startDate; |
| 279 | datas.endDate = endDate; | 279 | datas.endDate = endDate; |
| @@ -328,7 +328,7 @@ | @@ -328,7 +328,7 @@ | ||
| 328 | return; | 328 | return; |
| 329 | } else { | 329 | } else { |
| 330 | var lodingI = layer.load(2); | 330 | var lodingI = layer.load(2); |
| 331 | - $get('/calcWaybill/calcDetailMonthly', datas, function (rs) { | 331 | + $get('/calcWaybill/calcDetailMonthlyNew', datas, function (rs) { |
| 332 | if (rs.length <=0) { | 332 | if (rs.length <=0) { |
| 333 | layer.close(lodingI); | 333 | layer.close(lodingI); |
| 334 | layer.open({ | 334 | layer.open({ |
src/main/resources/static/pages/forms/calc/calcDetailYear.html
| @@ -174,17 +174,10 @@ | @@ -174,17 +174,10 @@ | ||
| 174 | var lineAll="",lineNoD="",lineD=""; | 174 | var lineAll="",lineNoD="",lineD=""; |
| 175 | var datas = {}; //查询条件 | 175 | var datas = {}; //查询条件 |
| 176 | 176 | ||
| 177 | - | ||
| 178 | - /**用户分配的线路*/ | ||
| 179 | - $.get('/realControAuthority/findByCurrentUser', function (userAuthor) { | ||
| 180 | - lineAll = userAuthor.lineCodeStr.substring(0,userAuthor.lineCodeStr.length-1); | ||
| 181 | - /* $.get('/line/all', function (lines) { | ||
| 182 | - $.each(lines,function () { | ||
| 183 | - | ||
| 184 | - }); | ||
| 185 | - | ||
| 186 | - });*/ | ||
| 187 | - }); | 177 | +// /**用户分配的线路*/ |
| 178 | +// $.get('/realControAuthority/findByCurrentUser', function (userAuthor) { | ||
| 179 | +// lineAll = userAuthor.lineCodeStr.substring(0,userAuthor.lineCodeStr.length-1); | ||
| 180 | +// }); | ||
| 188 | 181 | ||
| 189 | var tempData = {}; | 182 | var tempData = {}; |
| 190 | 183 | ||
| @@ -279,7 +272,7 @@ | @@ -279,7 +272,7 @@ | ||
| 279 | datas.timeType = "y"; | 272 | datas.timeType = "y"; |
| 280 | datas.gsdm = gsdm; | 273 | datas.gsdm = gsdm; |
| 281 | datas.fgsdm = fgsdm; | 274 | datas.fgsdm = fgsdm; |
| 282 | - datas.lineCode = lineAll; | 275 | +// datas.lineCode = lineAll; |
| 283 | datas.startDate = startDate; | 276 | datas.startDate = startDate; |
| 284 | datas.endDate = endDate; | 277 | datas.endDate = endDate; |
| 285 | datas.destroy = $("#destroy").val(); | 278 | datas.destroy = $("#destroy").val(); |
| @@ -335,7 +328,7 @@ | @@ -335,7 +328,7 @@ | ||
| 335 | return; | 328 | return; |
| 336 | } else { | 329 | } else { |
| 337 | var lodingI = layer.load(2); | 330 | var lodingI = layer.load(2); |
| 338 | - $get('/calcWaybill/calcDetailMonthly', datas, function (rs) { | 331 | + $get('/calcWaybill/calcDetailMonthlyNew', datas, function (rs) { |
| 339 | if (rs.length <=0) { | 332 | if (rs.length <=0) { |
| 340 | layer.close(lodingI); | 333 | layer.close(lodingI); |
| 341 | layer.open({ | 334 | layer.open({ |