Commit b547a8aaef4f2ba3f9c972ed40c36cd4a334ff77
1 parent
7acde535
油量信息和行车路单
Showing
7 changed files
with
115 additions
and
17 deletions
src/main/java/com/bsth/controller/oil/YlbController.java
| ... | ... | @@ -106,6 +106,7 @@ public class YlbController extends BaseController<Ylb, Integer>{ |
| 106 | 106 | @RequestParam(defaultValue = "DESC") String direction){ |
| 107 | 107 | |
| 108 | 108 | Direction d; |
| 109 | + map.put("xlbm_like", map.get("xlbm_like").toString().trim()); | |
| 109 | 110 | // try { |
| 110 | 111 | String rq=map.get("rq").toString(); |
| 111 | 112 | if(!(rq=="")){ | ... | ... |
src/main/java/com/bsth/repository/oil/CylRepository.java
| 1 | 1 | package com.bsth.repository.oil; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +import java.util.List; | |
| 5 | + | |
| 6 | +import org.springframework.data.jpa.repository.Modifying; | |
| 7 | +import org.springframework.data.jpa.repository.Query; | |
| 4 | 8 | import org.springframework.stereotype.Repository; |
| 9 | +import org.springframework.transaction.annotation.Transactional; | |
| 10 | + | |
| 5 | 11 | import com.bsth.entity.oil.Cyl; |
| 6 | 12 | import com.bsth.repository.BaseRepository; |
| 7 | 13 | |
| 8 | 14 | @Repository |
| 9 | 15 | public interface CylRepository extends BaseRepository<Cyl, Integer>{ |
| 10 | - | |
| 16 | + @Transactional | |
| 17 | + @Modifying | |
| 18 | + @Query(value="SELECT * FROM bsth_c_cyl ",nativeQuery=true) | |
| 19 | + List<Cyl> obtainCyl(); | |
| 11 | 20 | } | ... | ... |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -133,7 +133,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 133 | 133 | @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m') = ?2 and s.bcType not in ('in','out') order by s.xlBm") |
| 134 | 134 | List<ScheduleRealInfo> scheduleByDateAndLine3(String line,String date); |
| 135 | 135 | |
| 136 | - @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY realExecDate,fcsj,xlBm,clZbh") | |
| 136 | + @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY xlBm,clZbh") | |
| 137 | 137 | List<Map<String,Object>> yesterdayDataList(String line,String date); |
| 138 | 138 | |
| 139 | 139 | @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir") | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -85,6 +85,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 85 | 85 | // List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq); |
| 86 | 86 | //前一天所有车辆最后进场班次信息 |
| 87 | 87 | List<Ylb> ylListBe=repository.obtainYlbefore(rq); |
| 88 | + List<Cyl> clyList=cylRepository.obtainCyl(); | |
| 88 | 89 | //从排班表中计算出行驶的总里程 |
| 89 | 90 | List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("",rq); |
| 90 | 91 | |
| ... | ... | @@ -106,13 +107,21 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 106 | 107 | try { |
| 107 | 108 | //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 |
| 108 | 109 | if(map.get("seqNumber").toString().equals("1")){ |
| 109 | - for (int y = 0; y < ylListBe.size(); y++) { | |
| 110 | - Ylb ylb=ylListBe.get(y); | |
| 111 | - if(map.get("clZbh").toString().equals(ylb.getNbbm())){ | |
| 112 | - t.setCzyl(ylb.getJzyl()); | |
| 110 | + for (int y = 0; y < clyList.size(); y++) { | |
| 111 | + Cyl cyl=clyList.get(y); | |
| 112 | + if(map.get("clZbh").toString().equals(cyl.getNbbm())){ | |
| 113 | + t.setCzyl(cyl.getCyl()); | |
| 113 | 114 | break; |
| 114 | 115 | }else{ |
| 115 | - t.setCzyl(0.0); | |
| 116 | + for (int i = 0; i < ylListBe.size(); i++) { | |
| 117 | + Ylb ylb=ylListBe.get(i); | |
| 118 | + if(map.get("clZbh").toString().equals(ylb.getNbbm())){ | |
| 119 | + t.setCzyl(ylb.getJzyl()); | |
| 120 | + break; | |
| 121 | + }else{ | |
| 122 | + t.setCzyl(0.0); | |
| 123 | + } | |
| 124 | + } | |
| 116 | 125 | } |
| 117 | 126 | } |
| 118 | 127 | } |
| ... | ... | @@ -171,6 +180,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 171 | 180 | List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq); |
| 172 | 181 | //前一天所有车辆最后进场班次信息 |
| 173 | 182 | List<Ylb> ylListBe=repository.obtainYlbefore(rq); |
| 183 | + List<Cyl> clyList=cylRepository.obtainCyl(); | |
| 174 | 184 | //从排班表中计算出行驶的总里程 |
| 175 | 185 | List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq); |
| 176 | 186 | |
| ... | ... | @@ -192,13 +202,21 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 192 | 202 | try { |
| 193 | 203 | //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 |
| 194 | 204 | if(map.get("seqNumber").toString().equals("1")){ |
| 195 | - for (int y = 0; y < ylListBe.size(); y++) { | |
| 196 | - Ylb ylb=ylListBe.get(y); | |
| 197 | - if(map.get("clZbh").toString().equals(ylb.getNbbm())){ | |
| 198 | - t.setCzyl(ylb.getJzyl()); | |
| 205 | + for (int y = 0; y < clyList.size(); y++) { | |
| 206 | + Cyl cyl=clyList.get(y); | |
| 207 | + if(map.get("clZbh").toString().equals(cyl.getNbbm())){ | |
| 208 | + t.setCzyl(cyl.getCyl()); | |
| 199 | 209 | break; |
| 200 | 210 | }else{ |
| 201 | - t.setCzyl(0.0); | |
| 211 | + for (int i = 0; i < ylListBe.size(); i++) { | |
| 212 | + Ylb ylb=ylListBe.get(i); | |
| 213 | + if(map.get("clZbh").toString().equals(ylb.getNbbm())){ | |
| 214 | + t.setCzyl(ylb.getJzyl()); | |
| 215 | + break; | |
| 216 | + }else{ | |
| 217 | + t.setCzyl(0.0); | |
| 218 | + } | |
| 219 | + } | |
| 202 | 220 | } |
| 203 | 221 | } |
| 204 | 222 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -67,6 +67,7 @@ import java.text.DecimalFormat; |
| 67 | 67 | import java.text.ParseException; |
| 68 | 68 | import java.text.SimpleDateFormat; |
| 69 | 69 | import java.util.*; |
| 70 | +import java.util.regex.Pattern; | |
| 70 | 71 | import java.util.zip.ZipEntry; |
| 71 | 72 | import java.util.zip.ZipOutputStream; |
| 72 | 73 | |
| ... | ... | @@ -461,6 +462,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 461 | 462 | public List<ScheduleRealInfo> queryUserInfoPx(String line, String date, String state,String type) { |
| 462 | 463 | // List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>(); |
| 463 | 464 | state=state+""; |
| 465 | + String lpname=state; | |
| 466 | + String px=type; | |
| 467 | + if(state.equals("lpName")){ | |
| 468 | + state =state+"+1"; | |
| 469 | + type="asc"; | |
| 470 | + } | |
| 464 | 471 | String sqlPlan="select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh," |
| 465 | 472 | + " s.lp_Name as lpName,s.j_Name as jName,s.s_Gh as sGh,s.s_Name as sName" |
| 466 | 473 | + " from bsth_c_s_sp_info_real s " |
| ... | ... | @@ -482,7 +489,60 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 482 | 489 | return t; |
| 483 | 490 | } |
| 484 | 491 | }); |
| 492 | + if(lpname.equals("lpName")){ | |
| 493 | + List<ScheduleRealInfo> listNew=new ArrayList<ScheduleRealInfo>(); | |
| 494 | + Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); | |
| 495 | + if(px.equals("desc")){ | |
| 496 | + int zt=0; | |
| 497 | + for (int l = 0; l < 3; l++) { | |
| 498 | + for (int i = 0; i < list.size(); i++) { | |
| 499 | + ScheduleRealInfo t=list.get(i); | |
| 500 | + if(t.getLpName().indexOf("+")!=-1){ | |
| 501 | + if(zt==0){ | |
| 502 | + listNew.add(t); | |
| 503 | + } | |
| 504 | + | |
| 505 | + }else if(pattern.matcher(t.getLpName()).matches()){ | |
| 506 | + if(zt==1){ | |
| 507 | + listNew.add(t); | |
| 508 | + } | |
| 509 | + }else{ | |
| 510 | + if(zt==2){ | |
| 511 | + listNew.add(t); | |
| 512 | + } | |
| 513 | + } | |
| 514 | + } | |
| 515 | + zt++; | |
| 516 | + } | |
| 517 | + }else{ | |
| 518 | + int zt=0; | |
| 519 | + for (int l = 0; l < 3; l++) { | |
| 520 | + for (int i = 0; i < list.size(); i++) { | |
| 521 | + ScheduleRealInfo t=list.get(i); | |
| 522 | + if(t.getLpName().indexOf("+")!=-1){ | |
| 523 | + if(zt==2){ | |
| 524 | + listNew.add(t); | |
| 525 | + } | |
| 526 | + | |
| 527 | + }else if(pattern.matcher(t.getLpName()).matches()){ | |
| 528 | + if(zt==1){ | |
| 529 | + listNew.add(t); | |
| 530 | + } | |
| 531 | + }else{ | |
| 532 | + if(zt==0){ | |
| 533 | + listNew.add(t); | |
| 534 | + } | |
| 535 | + } | |
| 536 | + } | |
| 537 | + zt++; | |
| 538 | + } | |
| 539 | + | |
| 540 | + } | |
| 541 | + return listNew; | |
| 542 | + }else{ | |
| 485 | 543 | return list; |
| 544 | + } | |
| 545 | + | |
| 486 | 546 | } |
| 487 | 547 | |
| 488 | 548 | /** |
| ... | ... | @@ -1226,7 +1286,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1226 | 1286 | if (childTaskPlans.isEmpty()) { |
| 1227 | 1287 | if (scheduleRealInfo.getBcType().equals("in") || |
| 1228 | 1288 | scheduleRealInfo.getBcType().equals("out")) { |
| 1229 | - jcclc += tempJhlc; | |
| 1289 | + if(scheduleRealInfo.getStatus() != -1){ | |
| 1290 | + jcclc += tempJhlc; | |
| 1291 | + } | |
| 1292 | + | |
| 1230 | 1293 | } |
| 1231 | 1294 | //主任务 放空班次属于营运 |
| 1232 | 1295 | // else if(scheduleRealInfo.getBcType().equals("venting")){ | ... | ... |
src/main/resources/static/pages/forms/statement/waybill.html
| ... | ... | @@ -207,7 +207,7 @@ |
| 207 | 207 | line = $("#line").val(); |
| 208 | 208 | date = $("#date").val(); |
| 209 | 209 | $(".hidden").removeClass("hidden"); |
| 210 | - $get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"(lpName+1)",type:type},function(result){ | |
| 210 | + $get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"lpName",type:type},function(result){ | |
| 211 | 211 | if(type=="desc"){ |
| 212 | 212 | type ="asc"; |
| 213 | 213 | }else{ | ... | ... |
src/main/resources/static/pages/oil/list_ph.html
| ... | ... | @@ -82,7 +82,7 @@ |
| 82 | 82 | 线路: |
| 83 | 83 | </td> |
| 84 | 84 | <td colspan="3"> |
| 85 | - <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select> | |
| 85 | + <select class="form-control" name="xlbm_like" id="xlbm" style="width: 120px;"></select> | |
| 86 | 86 | |
| 87 | 87 | </td> |
| 88 | 88 | <td > |
| ... | ... | @@ -231,7 +231,9 @@ |
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | }); |
| 234 | + var i = layer.load(2); | |
| 234 | 235 | $get('/ylb/checkYl', params, function () { |
| 236 | + layer.close(i); | |
| 235 | 237 | jsDoQuery(null, true); |
| 236 | 238 | }); |
| 237 | 239 | } else { |
| ... | ... | @@ -255,7 +257,9 @@ |
| 255 | 257 | } |
| 256 | 258 | } |
| 257 | 259 | }); |
| 260 | + var i = layer.load(2); | |
| 258 | 261 | $get('/ylb/outAndIn', params, function () { |
| 262 | + layer.close(i); | |
| 259 | 263 | jsDoQuery(null, true); |
| 260 | 264 | }); |
| 261 | 265 | } else { |
| ... | ... | @@ -273,11 +277,12 @@ |
| 273 | 277 | //获取输入的进场存油 |
| 274 | 278 | var jzyl = $('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').html(); |
| 275 | 279 | // $("#jzyl" + id).html(); |
| 276 | - console.log(jzyl); | |
| 277 | 280 | var params = {}; |
| 278 | 281 | params['jzyl'] = jzyl; |
| 279 | 282 | params['id'] = id; |
| 283 | + var i = layer.load(2); | |
| 280 | 284 | $get('/ylb/sort', params, function () { |
| 285 | + layer.close(i); | |
| 281 | 286 | jsDoQuery(null, true); |
| 282 | 287 | }); |
| 283 | 288 | |
| ... | ... | @@ -302,7 +307,9 @@ |
| 302 | 307 | } |
| 303 | 308 | } |
| 304 | 309 | }); |
| 310 | + var i = layer.load(2); | |
| 305 | 311 | $get('/ylb/obtain', params, function () { |
| 312 | + layer.close(i); | |
| 306 | 313 | jsDoQuery(params, true); |
| 307 | 314 | }); |
| 308 | 315 | } else { |
| ... | ... | @@ -530,7 +537,7 @@ |
| 530 | 537 | //搜索线路 |
| 531 | 538 | $.get('/basic/lineCode2Name',function(result){ |
| 532 | 539 | var data=[]; |
| 533 | - | |
| 540 | + data.push({id: " ", text: "全部线路"}); | |
| 534 | 541 | for(var code in result){ |
| 535 | 542 | data.push({id: code, text: result[code]}); |
| 536 | 543 | } | ... | ... |