Commit b72d453e4225c5b9bea3ed12068f1086ecf04927
1 parent
3cad70dd
添加 新的班次类型 油量添加修改时间 修改查询最早发车时间方法
Showing
5 changed files
with
77 additions
and
44 deletions
src/main/java/com/bsth/entity/oil/Ylb.java
| @@ -49,7 +49,9 @@ public class Ylb { | @@ -49,7 +49,9 @@ public class Ylb { | ||
| 49 | private int sjbc; | 49 | private int sjbc; |
| 50 | private String edituser; | 50 | private String edituser; |
| 51 | private Date edittime; | 51 | private Date edittime; |
| 52 | + private Date updatetime; | ||
| 52 | private Date createtime; | 53 | private Date createtime; |
| 54 | + | ||
| 53 | private int nylx; | 55 | private int nylx; |
| 54 | //进场顺序(根据最先出场和最后进场来关联车辆的存油量) | 56 | //进场顺序(根据最先出场和最后进场来关联车辆的存油量) |
| 55 | private int jcsx; | 57 | private int jcsx; |
| @@ -321,6 +323,12 @@ public class Ylb { | @@ -321,6 +323,12 @@ public class Ylb { | ||
| 321 | } | 323 | } |
| 322 | 324 | ||
| 323 | 325 | ||
| 324 | - | 326 | + public Date getUpdatetime() { |
| 327 | + return updatetime; | ||
| 328 | + } | ||
| 329 | + | ||
| 330 | + public void setUpdatetime(Date updatetime) { | ||
| 331 | + this.updatetime = updatetime; | ||
| 332 | + } | ||
| 325 | 333 | ||
| 326 | } | 334 | } |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -79,6 +79,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -79,6 +79,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 79 | public String obtainDsq() throws Exception{ | 79 | public String obtainDsq() throws Exception{ |
| 80 | String result = "failure"; | 80 | String result = "failure"; |
| 81 | try { | 81 | try { |
| 82 | + List<Ylb> addList = new ArrayList<Ylb>(); | ||
| 83 | + String type = ""; | ||
| 82 | List<Cars> carsList=carsRepository.findCars(); | 84 | List<Cars> carsList=carsRepository.findCars(); |
| 83 | Map<String, Boolean> carsMap=new HashMap<String, Boolean>(); | 85 | Map<String, Boolean> carsMap=new HashMap<String, Boolean>(); |
| 84 | for (int i = 0; i < carsList.size(); i++) { | 86 | for (int i = 0; i < carsList.size(); i++) { |
| @@ -126,6 +128,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -126,6 +128,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 126 | &&t1.getXlbm().equals(map.get("xlBm").toString())) | 128 | &&t1.getXlbm().equals(map.get("xlBm").toString())) |
| 127 | { | 129 | { |
| 128 | t=t1; | 130 | t=t1; |
| 131 | + type="update"; | ||
| 129 | } | 132 | } |
| 130 | } | 133 | } |
| 131 | 134 | ||
| @@ -182,13 +185,22 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -182,13 +185,22 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 182 | t.setRq(sdf.parse(rq)); | 185 | t.setRq(sdf.parse(rq)); |
| 183 | t.setCreatetime(dNow); | 186 | t.setCreatetime(dNow); |
| 184 | if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | 187 | if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ |
| 185 | - repository.save(t); | 188 | + if(type.equals("update")){ |
| 189 | + repository.save(t); | ||
| 190 | + }else{ | ||
| 191 | + addList.add(t); | ||
| 192 | + } | ||
| 193 | + | ||
| 186 | } | 194 | } |
| 187 | 195 | ||
| 188 | 196 | ||
| 189 | } | 197 | } |
| 190 | - result = "success"; | 198 | + |
| 191 | } | 199 | } |
| 200 | + if(addList.size()>0){ | ||
| 201 | + new BatchSaveUtils<Ylb>().saveList(addList, Ylb.class); | ||
| 202 | + } | ||
| 203 | + result = "success"; | ||
| 192 | }catch (Exception e) { | 204 | }catch (Exception e) { |
| 193 | // TODO Auto-generated catch block | 205 | // TODO Auto-generated catch block |
| 194 | throw e; | 206 | throw e; |
| @@ -334,11 +346,13 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -334,11 +346,13 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 334 | t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); | 346 | t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); |
| 335 | t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); | 347 | t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); |
| 336 | t.setRq(sdf.parse(rq)); | 348 | t.setRq(sdf.parse(rq)); |
| 337 | - t.setCreatetime(date); | 349 | + |
| 338 | if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | 350 | if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ |
| 339 | if(type.equals("add")){ | 351 | if(type.equals("add")){ |
| 352 | + t.setCreatetime(date); | ||
| 340 | addList.add(t); | 353 | addList.add(t); |
| 341 | }else{ | 354 | }else{ |
| 355 | + t.setUpdatetime(date); | ||
| 342 | updateList.add(t); | 356 | updateList.add(t); |
| 343 | ins += t.getId().toString()+","; | 357 | ins += t.getId().toString()+","; |
| 344 | } | 358 | } |
| @@ -438,6 +452,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -438,6 +452,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 438 | map.put("xlbm_like", ylb.getXlbm()); | 452 | map.put("xlbm_like", ylb.getXlbm()); |
| 439 | // Iterator<Ylb> iterator2 = repository | 453 | // Iterator<Ylb> iterator2 = repository |
| 440 | // .findAll(new CustomerSpecs<Ylb>(map), new Sort(Direction.ASC, "jcsx")).iterator(); | 454 | // .findAll(new CustomerSpecs<Ylb>(map), new Sort(Direction.ASC, "jcsx")).iterator(); |
| 455 | + double czyl=0.0; | ||
| 441 | for (int j = 0; j < iterator2.size(); j++) { | 456 | for (int j = 0; j < iterator2.size(); j++) { |
| 442 | Ylb t = iterator2.get(j); | 457 | Ylb t = iterator2.get(j); |
| 443 | if(t.getNbbm().equals(ylb.getNbbm())){ | 458 | if(t.getNbbm().equals(ylb.getNbbm())){ |
| @@ -445,6 +460,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -445,6 +460,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 445 | // 进场等于出场的操作 既 最后进场存油量等于第一次的出场存油量 | 460 | // 进场等于出场的操作 既 最后进场存油量等于第一次的出场存油量 |
| 446 | // Double yl = t.getCzyl(); | 461 | // Double yl = t.getCzyl(); |
| 447 | // Double jcyl = t.getCzyl(); | 462 | // Double jcyl = t.getCzyl(); |
| 463 | + czyl = t.getCzyl(); | ||
| 448 | zyl =jzl; | 464 | zyl =jzl; |
| 449 | Double yh=0.0; | 465 | Double yh=0.0; |
| 450 | if(zlc>0){ | 466 | if(zlc>0){ |
| @@ -476,10 +492,18 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -476,10 +492,18 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 476 | } | 492 | } |
| 477 | nextJzyl =Arith.sub( Arith.add(Arith.sub(t.getJzl(),t.getSh()),nextJzyl),yh); | 493 | nextJzyl =Arith.sub( Arith.add(Arith.sub(t.getJzl(),t.getSh()),nextJzyl),yh); |
| 478 | if(zlc>0){ | 494 | if(zlc>0){ |
| 479 | - long l=Math.round(nextJzyl); | ||
| 480 | - double ylxs=l*100/100; | ||
| 481 | -// nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); | 495 | + long l=0l; |
| 496 | + double ylxs=0.0; | ||
| 497 | + if(j==iterator2.size()-1){ | ||
| 498 | + ylxs=czyl; | ||
| 499 | + }else{ | ||
| 500 | + l=Math.round(nextJzyl); | ||
| 501 | + ylxs=l*100/100; | ||
| 502 | + | ||
| 503 | + } | ||
| 482 | yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl)); | 504 | yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl)); |
| 505 | +// nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); | ||
| 506 | + | ||
| 483 | t.setYh(yh); | 507 | t.setYh(yh); |
| 484 | t.setJzyl(ylxs); | 508 | t.setJzyl(ylxs); |
| 485 | nextJzyl=ylxs; | 509 | nextJzyl=ylxs; |
| @@ -704,7 +728,6 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -704,7 +728,6 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 704 | } | 728 | } |
| 705 | // List<Ylb> ylListBe=repository.obtainYlbefore(rq, gsbm, "", xlbm, nbbm); | 729 | // List<Ylb> ylListBe=repository.obtainYlbefore(rq, gsbm, "", xlbm, nbbm); |
| 706 | List<Ylb> ylListBe=repository.listMaxRqJcsx(rq, gsbm, fgsbm, xlbm, nbbm); | 730 | List<Ylb> ylListBe=repository.listMaxRqJcsx(rq, gsbm, fgsbm, xlbm, nbbm); |
| 707 | - List<Cyl> cylList=cylRepository.obtainCyl(nbbm, gsbm); | ||
| 708 | List<Ylb> ylbList=repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); | 731 | List<Ylb> ylbList=repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); |
| 709 | List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,0,gsbm); | 732 | List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,0,gsbm); |
| 710 | for (int i = 0; i < ylxxbList.size(); i++) { | 733 | for (int i = 0; i < ylxxbList.size(); i++) { |
| @@ -719,7 +742,6 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -719,7 +742,6 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 719 | } | 742 | } |
| 720 | 743 | ||
| 721 | if(fage){ | 744 | if(fage){ |
| 722 | - Cyl cyl=null; | ||
| 723 | Ylb t=new Ylb(); | 745 | Ylb t=new Ylb(); |
| 724 | t.setNbbm(y1.getNbbm()); | 746 | t.setNbbm(y1.getNbbm()); |
| 725 | t.setRq(y1.getYyrq()); | 747 | t.setRq(y1.getYyrq()); |
| @@ -749,23 +771,13 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -749,23 +771,13 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 749 | } | 771 | } |
| 750 | } | 772 | } |
| 751 | if(status){ | 773 | if(status){ |
| 752 | - for (int j = 0; j < cylList.size(); j++) { | ||
| 753 | - Cyl c=cylList.get(j); | ||
| 754 | - if(c.getNbbm().equals(y1.getNbbm())){ | ||
| 755 | - t.setCzyl(c.getCyl()); | ||
| 756 | - cyl=c; | ||
| 757 | - status=false; | ||
| 758 | - break; | ||
| 759 | - } | ||
| 760 | - } | ||
| 761 | - } | ||
| 762 | - if(status){ | ||
| 763 | t.setCzyl(0.0); | 774 | t.setCzyl(0.0); |
| 764 | } | 775 | } |
| 765 | // double jzyl=Arith.add(t.getJzl(), t.getCzyl()); | 776 | // double jzyl=Arith.add(t.getJzl(), t.getCzyl()); |
| 766 | t.setJzyl(Arith.add(t.getJzl(), t.getCzyl())); | 777 | t.setJzyl(Arith.add(t.getJzl(), t.getCzyl())); |
| 767 | t.setYh(0.0); | 778 | t.setYh(0.0); |
| 768 | if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | 779 | if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ |
| 780 | + t.setCreatetime(new Date()); | ||
| 769 | repository.save(t); | 781 | repository.save(t); |
| 770 | /*if(null!=cyl){ | 782 | /*if(null!=cyl){ |
| 771 | cyl.setCyl(Arith.add(t.getJzl(), t.getCzyl())); | 783 | cyl.setCyl(Arith.add(t.getJzl(), t.getCzyl())); |
| @@ -1141,6 +1153,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1141,6 +1153,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1141 | Double zyl = 0.0; | 1153 | Double zyl = 0.0; |
| 1142 | Double nextJzyl = 0.0; | 1154 | Double nextJzyl = 0.0; |
| 1143 | // 车的,进,出油量及耗油 | 1155 | // 车的,进,出油量及耗油 |
| 1156 | + double czyl=0.0; | ||
| 1144 | for (int i = 0; i < iterator2.size(); i++) { | 1157 | for (int i = 0; i < iterator2.size(); i++) { |
| 1145 | Ylb t = iterator2.get(i); | 1158 | Ylb t = iterator2.get(i); |
| 1146 | if (t.getJcsx() == 1) { | 1159 | if (t.getJcsx() == 1) { |
| @@ -1148,6 +1161,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1148,6 +1161,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1148 | t.setSh(sh); | 1161 | t.setSh(sh); |
| 1149 | t.setShyy(shyy); | 1162 | t.setShyy(shyy); |
| 1150 | } | 1163 | } |
| 1164 | + czyl=t.getCzyl(); | ||
| 1151 | // Double jcyl = t.getCzyl(); | 1165 | // Double jcyl = t.getCzyl(); |
| 1152 | zyl = jzl; | 1166 | zyl = jzl; |
| 1153 | Double yh = 0.0; | 1167 | Double yh = 0.0; |
| @@ -1179,8 +1193,14 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1179,8 +1193,14 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1179 | } | 1193 | } |
| 1180 | nextJzyl = Arith.sub(Arith.add(t.getJzl(), nextJzyl), Arith.add(yh, t.getSh())); | 1194 | nextJzyl = Arith.sub(Arith.add(t.getJzl(), nextJzyl), Arith.add(yh, t.getSh())); |
| 1181 | if(zlc>0){ | 1195 | if(zlc>0){ |
| 1182 | - long l=Math.round(nextJzyl); | ||
| 1183 | - double ylxs=l*100/100; | 1196 | + long l=0l; |
| 1197 | + double ylxs=0.0; | ||
| 1198 | + if(i==iterator2.size()){ | ||
| 1199 | + ylxs=czyl; | ||
| 1200 | + }else{ | ||
| 1201 | + l=Math.round(nextJzyl); | ||
| 1202 | + ylxs=l*100/100; | ||
| 1203 | + } | ||
| 1184 | // nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); | 1204 | // nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); |
| 1185 | yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl)); | 1205 | yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl)); |
| 1186 | t.setYh(yh); | 1206 | t.setYh(yh); |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -1791,8 +1791,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1791,8 +1791,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1791 | List<ScheduleRealInfo> list = null; | 1791 | List<ScheduleRealInfo> list = null; |
| 1792 | list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); | 1792 | list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); |
| 1793 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); | 1793 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| 1794 | - String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'"; | ||
| 1795 | - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | 1794 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " |
| 1795 | + + " id = (" | ||
| 1796 | + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | ||
| 1797 | + + ")"; | ||
| 1798 | + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | ||
| 1796 | String[] minSjs = minfcsj.split(":"); | 1799 | String[] minSjs = minfcsj.split(":"); |
| 1797 | Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]); | 1800 | Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]); |
| 1798 | 1801 |
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
| @@ -151,8 +151,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -151,8 +151,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 151 | int lbbc=0; | 151 | int lbbc=0; |
| 152 | for (int i = 0; i < lists.size(); i++) { | 152 | for (int i = 0; i < lists.size(); i++) { |
| 153 | ScheduleRealInfo scheduleRealInfo=lists.get(i); | 153 | ScheduleRealInfo scheduleRealInfo=lists.get(i); |
| 154 | - if (!(scheduleRealInfo.getBcType().equals("in") | ||
| 155 | - || scheduleRealInfo.getBcType().equals("out"))) { | 154 | + if (!isInOut(scheduleRealInfo)) { |
| 156 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | 155 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 157 | if(childTaskPlans.isEmpty()){ | 156 | if(childTaskPlans.isEmpty()){ |
| 158 | if(scheduleRealInfo.getStatus() == -1){ | 157 | if(scheduleRealInfo.getStatus() == -1){ |
| @@ -187,8 +186,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -187,8 +186,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 187 | List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); | 186 | List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); |
| 188 | for (int i = 0; i < lists.size(); i++) { | 187 | for (int i = 0; i < lists.size(); i++) { |
| 189 | ScheduleRealInfo scheduleRealInfo=lists.get(i); | 188 | ScheduleRealInfo scheduleRealInfo=lists.get(i); |
| 190 | - if (!(scheduleRealInfo.getBcType().equals("in") | ||
| 191 | - || scheduleRealInfo.getBcType().equals("out"))) { | 189 | + if (!isInOut(scheduleRealInfo)) { |
| 192 | // Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | 190 | // Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 193 | // if(childTaskPlans.isEmpty()){ | 191 | // if(childTaskPlans.isEmpty()){ |
| 194 | if(scheduleRealInfo.isSflj()){ | 192 | if(scheduleRealInfo.isSflj()){ |
| @@ -221,8 +219,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -221,8 +219,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 221 | double ljgl=0; | 219 | double ljgl=0; |
| 222 | for (int i = 0; i < lists.size(); i++) { | 220 | for (int i = 0; i < lists.size(); i++) { |
| 223 | ScheduleRealInfo scheduleRealInfo=lists.get(i); | 221 | ScheduleRealInfo scheduleRealInfo=lists.get(i); |
| 224 | - if (!(scheduleRealInfo.getBcType().equals("in") | ||
| 225 | - || scheduleRealInfo.getBcType().equals("out"))) { | 222 | + if (!isInOut(scheduleRealInfo)) { |
| 226 | if(!scheduleRealInfo.isDestroy()){ | 223 | if(!scheduleRealInfo.isDestroy()){ |
| 227 | if(scheduleRealInfo.isSflj()){ | 224 | if(scheduleRealInfo.isSflj()){ |
| 228 | ljgl=Arith.add(ljgl,scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc()); | 225 | ljgl=Arith.add(ljgl,scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc()); |
| @@ -250,8 +247,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -250,8 +247,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 250 | int ljbc=0; | 247 | int ljbc=0; |
| 251 | for (int i = 0; i < lists.size(); i++) { | 248 | for (int i = 0; i < lists.size(); i++) { |
| 252 | ScheduleRealInfo scheduleRealInfo=lists.get(i); | 249 | ScheduleRealInfo scheduleRealInfo=lists.get(i); |
| 253 | - if (!(scheduleRealInfo.getBcType().equals("in") | ||
| 254 | - || scheduleRealInfo.getBcType().equals("out"))) { | 250 | + if (!isInOut(scheduleRealInfo)) { |
| 255 | if(scheduleRealInfo.isSflj()){ | 251 | if(scheduleRealInfo.isSflj()){ |
| 256 | if(item.equals("zgf") || item.equals("wgf")){ | 252 | if(item.equals("zgf") || item.equals("wgf")){ |
| 257 | String time=""; | 253 | String time=""; |
| @@ -292,8 +288,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -292,8 +288,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 292 | double jhgl=0; | 288 | double jhgl=0; |
| 293 | for (int i = 0; i < lists.size(); i++) { | 289 | for (int i = 0; i < lists.size(); i++) { |
| 294 | ScheduleRealInfo scheduleRealInfo=lists.get(i); | 290 | ScheduleRealInfo scheduleRealInfo=lists.get(i); |
| 295 | - if (!(scheduleRealInfo.getBcType().equals("in") | ||
| 296 | - || scheduleRealInfo.getBcType().equals("out"))) { | 291 | + if (!isInOut(scheduleRealInfo)) { |
| 297 | if(!scheduleRealInfo.isSflj()){ | 292 | if(!scheduleRealInfo.isSflj()){ |
| 298 | jhgl=Arith.add(jhgl,scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); | 293 | jhgl=Arith.add(jhgl,scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); |
| 299 | } | 294 | } |
| @@ -308,8 +303,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -308,8 +303,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 308 | int jhbc=0; | 303 | int jhbc=0; |
| 309 | for (int i = 0; i < lists.size(); i++) { | 304 | for (int i = 0; i < lists.size(); i++) { |
| 310 | ScheduleRealInfo scheduleRealInfo=lists.get(i); | 305 | ScheduleRealInfo scheduleRealInfo=lists.get(i); |
| 311 | - if (!(scheduleRealInfo.getBcType().equals("in") | ||
| 312 | - || scheduleRealInfo.getBcType().equals("out"))) { | 306 | + if (!isInOut(scheduleRealInfo)) { |
| 313 | if(!scheduleRealInfo.isSflj()){ | 307 | if(!scheduleRealInfo.isSflj()){ |
| 314 | String[] fcsjStr = scheduleRealInfo.getFcsj().split(":"); | 308 | String[] fcsjStr = scheduleRealInfo.getFcsj().split(":"); |
| 315 | long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | 309 | long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); |
| @@ -375,8 +369,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -375,8 +369,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 375 | int sjbc=0; | 369 | int sjbc=0; |
| 376 | for (int i = 0; i < lists.size(); i++) { | 370 | for (int i = 0; i < lists.size(); i++) { |
| 377 | ScheduleRealInfo scheduleRealInfo=lists.get(i); | 371 | ScheduleRealInfo scheduleRealInfo=lists.get(i); |
| 378 | - if (!(scheduleRealInfo.getBcType().equals("in") | ||
| 379 | - || scheduleRealInfo.getBcType().equals("out"))) { | 372 | + if (!isInOut(scheduleRealInfo)) { |
| 380 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | 373 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 381 | if(!scheduleRealInfo.isSflj()){ | 374 | if(!scheduleRealInfo.isSflj()){ |
| 382 | String time=""; | 375 | String time=""; |
| @@ -491,7 +484,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -491,7 +484,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 491 | for (int i = 0; i < lists.size(); i++) { | 484 | for (int i = 0; i < lists.size(); i++) { |
| 492 | ScheduleRealInfo scheduleRealInfo=lists.get(i); | 485 | ScheduleRealInfo scheduleRealInfo=lists.get(i); |
| 493 | if (scheduleRealInfo.getBcType().equals("in") | 486 | if (scheduleRealInfo.getBcType().equals("in") |
| 494 | - || scheduleRealInfo.getBcType().equals("out")) { | 487 | + || scheduleRealInfo.getBcType().equals("out")||scheduleRealInfo.getBcType().equals("ldks")) { |
| 495 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | 488 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 496 | if(childTaskPlans.isEmpty()){ | 489 | if(childTaskPlans.isEmpty()){ |
| 497 | if(!scheduleRealInfo.isDestroy()) | 490 | if(!scheduleRealInfo.isDestroy()) |
| @@ -521,7 +514,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -521,7 +514,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 521 | ScheduleRealInfo scheduleRealInfo=lists.get(i); | 514 | ScheduleRealInfo scheduleRealInfo=lists.get(i); |
| 522 | if(!scheduleRealInfo.isSflj()){ | 515 | if(!scheduleRealInfo.isSflj()){ |
| 523 | if (scheduleRealInfo.getBcType().equals("in") | 516 | if (scheduleRealInfo.getBcType().equals("in") |
| 524 | - || scheduleRealInfo.getBcType().equals("out")) { | 517 | + || scheduleRealInfo.getBcType().equals("out")|| scheduleRealInfo.getBcType().equals("ldks")) { |
| 525 | double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig(); | 518 | double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig(); |
| 526 | if(jhlcOrig-scheduleRealInfo.getJhlc()>0){ | 519 | if(jhlcOrig-scheduleRealInfo.getJhlc()>0){ |
| 527 | jcclc =Arith.add(jcclc, scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); | 520 | jcclc =Arith.add(jcclc, scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); |
| @@ -542,6 +535,9 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -542,6 +535,9 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 542 | if(s.getBcType().equals("out")){ | 535 | if(s.getBcType().equals("out")){ |
| 543 | fage=true; | 536 | fage=true; |
| 544 | } | 537 | } |
| 538 | + if(s.getBcType().equals("ldks")){ | ||
| 539 | + fage=true; | ||
| 540 | + } | ||
| 545 | 541 | ||
| 546 | return fage; | 542 | return fage; |
| 547 | } | 543 | } |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -369,8 +369,11 @@ public class ReportServiceImpl implements ReportService{ | @@ -369,8 +369,11 @@ public class ReportServiceImpl implements ReportService{ | ||
| 369 | DecimalFormat df = new DecimalFormat("#0.00"); | 369 | DecimalFormat df = new DecimalFormat("#0.00"); |
| 370 | // TODO Auto-generated method stub | 370 | // TODO Auto-generated method stub |
| 371 | //最早营运时间 区分夜宵线 | 371 | //最早营运时间 区分夜宵线 |
| 372 | - String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'"; | ||
| 373 | - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | 372 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " |
| 373 | + + " id = (" | ||
| 374 | + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | ||
| 375 | + + ")"; | ||
| 376 | + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | ||
| 374 | String[] minSjs = minfcsj.split(":"); | 377 | String[] minSjs = minfcsj.split(":"); |
| 375 | int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]); | 378 | int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]); |
| 376 | //查询时间里程 | 379 | //查询时间里程 |
| @@ -564,8 +567,11 @@ public class ReportServiceImpl implements ReportService{ | @@ -564,8 +567,11 @@ public class ReportServiceImpl implements ReportService{ | ||
| 564 | List<Map<String, Object>> list =new ArrayList<>(); | 567 | List<Map<String, Object>> list =new ArrayList<>(); |
| 565 | // TODO Auto-generated method stub | 568 | // TODO Auto-generated method stub |
| 566 | //最早营运时间 区分夜宵线 | 569 | //最早营运时间 区分夜宵线 |
| 567 | - String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'"; | ||
| 568 | - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | 570 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " |
| 571 | + + " id = (" | ||
| 572 | + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | ||
| 573 | + + ")"; | ||
| 574 | + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | ||
| 569 | 575 | ||
| 570 | //查询全程 | 576 | //查询全程 |
| 571 | String sqlqc="select t.*,x.station_name as qdz_name from ( " | 577 | String sqlqc="select t.*,x.station_name as qdz_name from ( " |