Commit b547a8aaef4f2ba3f9c972ed40c36cd4a334ff77

Authored by 廖磊
1 parent 7acde535

油量信息和行车路单

src/main/java/com/bsth/controller/oil/YlbController.java
@@ -106,6 +106,7 @@ public class YlbController extends BaseController<Ylb, Integer>{ @@ -106,6 +106,7 @@ public class YlbController extends BaseController<Ylb, Integer>{
106 @RequestParam(defaultValue = "DESC") String direction){ 106 @RequestParam(defaultValue = "DESC") String direction){
107 107
108 Direction d; 108 Direction d;
  109 + map.put("xlbm_like", map.get("xlbm_like").toString().trim());
109 // try { 110 // try {
110 String rq=map.get("rq").toString(); 111 String rq=map.get("rq").toString();
111 if(!(rq=="")){ 112 if(!(rq=="")){
src/main/java/com/bsth/repository/oil/CylRepository.java
1 package com.bsth.repository.oil; 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 import org.springframework.stereotype.Repository; 8 import org.springframework.stereotype.Repository;
  9 +import org.springframework.transaction.annotation.Transactional;
  10 +
5 import com.bsth.entity.oil.Cyl; 11 import com.bsth.entity.oil.Cyl;
6 import com.bsth.repository.BaseRepository; 12 import com.bsth.repository.BaseRepository;
7 13
8 @Repository 14 @Repository
9 public interface CylRepository extends BaseRepository<Cyl, Integer>{ 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&lt;ScheduleRealI @@ -133,7 +133,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
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") 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 List<ScheduleRealInfo> scheduleByDateAndLine3(String line,String date); 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 List<Map<String,Object>> yesterdayDataList(String line,String date); 137 List<Map<String,Object>> yesterdayDataList(String line,String date);
138 138
139 @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir") 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&lt;Ylb,Integer&gt; implements YlbS @@ -85,6 +85,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
85 // List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq); 85 // List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq);
86 //前一天所有车辆最后进场班次信息 86 //前一天所有车辆最后进场班次信息
87 List<Ylb> ylListBe=repository.obtainYlbefore(rq); 87 List<Ylb> ylListBe=repository.obtainYlbefore(rq);
  88 + List<Cyl> clyList=cylRepository.obtainCyl();
88 //从排班表中计算出行驶的总里程 89 //从排班表中计算出行驶的总里程
89 List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("",rq); 90 List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("",rq);
90 91
@@ -106,13 +107,21 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -106,13 +107,21 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
106 try { 107 try {
107 //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 108 //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量
108 if(map.get("seqNumber").toString().equals("1")){ 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 break; 114 break;
114 }else{ 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&lt;Ylb,Integer&gt; implements YlbS @@ -171,6 +180,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
171 List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq); 180 List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq);
172 //前一天所有车辆最后进场班次信息 181 //前一天所有车辆最后进场班次信息
173 List<Ylb> ylListBe=repository.obtainYlbefore(rq); 182 List<Ylb> ylListBe=repository.obtainYlbefore(rq);
  183 + List<Cyl> clyList=cylRepository.obtainCyl();
174 //从排班表中计算出行驶的总里程 184 //从排班表中计算出行驶的总里程
175 List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq); 185 List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq);
176 186
@@ -192,13 +202,21 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -192,13 +202,21 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
192 try { 202 try {
193 //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 203 //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量
194 if(map.get("seqNumber").toString().equals("1")){ 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 break; 209 break;
200 }else{ 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,6 +67,7 @@ import java.text.DecimalFormat;
67 import java.text.ParseException; 67 import java.text.ParseException;
68 import java.text.SimpleDateFormat; 68 import java.text.SimpleDateFormat;
69 import java.util.*; 69 import java.util.*;
  70 +import java.util.regex.Pattern;
70 import java.util.zip.ZipEntry; 71 import java.util.zip.ZipEntry;
71 import java.util.zip.ZipOutputStream; 72 import java.util.zip.ZipOutputStream;
72 73
@@ -461,6 +462,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -461,6 +462,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
461 public List<ScheduleRealInfo> queryUserInfoPx(String line, String date, String state,String type) { 462 public List<ScheduleRealInfo> queryUserInfoPx(String line, String date, String state,String type) {
462 // List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>(); 463 // List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>();
463 state=state+""; 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 String sqlPlan="select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh," 471 String sqlPlan="select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh,"
465 + " s.lp_Name as lpName,s.j_Name as jName,s.s_Gh as sGh,s.s_Name as sName" 472 + " s.lp_Name as lpName,s.j_Name as jName,s.s_Gh as sGh,s.s_Name as sName"
466 + " from bsth_c_s_sp_info_real s " 473 + " from bsth_c_s_sp_info_real s "
@@ -482,7 +489,60 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -482,7 +489,60 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
482 return t; 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 return list; 543 return list;
  544 + }
  545 +
486 } 546 }
487 547
488 /** 548 /**
@@ -1226,7 +1286,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1226,7 +1286,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1226 if (childTaskPlans.isEmpty()) { 1286 if (childTaskPlans.isEmpty()) {
1227 if (scheduleRealInfo.getBcType().equals("in") || 1287 if (scheduleRealInfo.getBcType().equals("in") ||
1228 scheduleRealInfo.getBcType().equals("out")) { 1288 scheduleRealInfo.getBcType().equals("out")) {
1229 - jcclc += tempJhlc; 1289 + if(scheduleRealInfo.getStatus() != -1){
  1290 + jcclc += tempJhlc;
  1291 + }
  1292 +
1230 } 1293 }
1231 //主任务 放空班次属于营运 1294 //主任务 放空班次属于营运
1232 // else if(scheduleRealInfo.getBcType().equals("venting")){ 1295 // else if(scheduleRealInfo.getBcType().equals("venting")){
src/main/resources/static/pages/forms/statement/waybill.html
@@ -207,7 +207,7 @@ @@ -207,7 +207,7 @@
207 line = $("#line").val(); 207 line = $("#line").val();
208 date = $("#date").val(); 208 date = $("#date").val();
209 $(".hidden").removeClass("hidden"); 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 if(type=="desc"){ 211 if(type=="desc"){
212 type ="asc"; 212 type ="asc";
213 }else{ 213 }else{
src/main/resources/static/pages/oil/list_ph.html
@@ -82,7 +82,7 @@ @@ -82,7 +82,7 @@
82 线路: 82 线路:
83 </td> 83 </td>
84 <td colspan="3"> 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 &nbsp; 86 &nbsp;
87 </td> 87 </td>
88 <td > 88 <td >
@@ -231,7 +231,9 @@ @@ -231,7 +231,9 @@
231 } 231 }
232 } 232 }
233 }); 233 });
  234 + var i = layer.load(2);
234 $get('/ylb/checkYl', params, function () { 235 $get('/ylb/checkYl', params, function () {
  236 + layer.close(i);
235 jsDoQuery(null, true); 237 jsDoQuery(null, true);
236 }); 238 });
237 } else { 239 } else {
@@ -255,7 +257,9 @@ @@ -255,7 +257,9 @@
255 } 257 }
256 } 258 }
257 }); 259 });
  260 + var i = layer.load(2);
258 $get('/ylb/outAndIn', params, function () { 261 $get('/ylb/outAndIn', params, function () {
  262 + layer.close(i);
259 jsDoQuery(null, true); 263 jsDoQuery(null, true);
260 }); 264 });
261 } else { 265 } else {
@@ -273,11 +277,12 @@ @@ -273,11 +277,12 @@
273 //获取输入的进场存油 277 //获取输入的进场存油
274 var jzyl = $('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').html(); 278 var jzyl = $('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').html();
275 // $("#jzyl" + id).html(); 279 // $("#jzyl" + id).html();
276 - console.log(jzyl);  
277 var params = {}; 280 var params = {};
278 params['jzyl'] = jzyl; 281 params['jzyl'] = jzyl;
279 params['id'] = id; 282 params['id'] = id;
  283 + var i = layer.load(2);
280 $get('/ylb/sort', params, function () { 284 $get('/ylb/sort', params, function () {
  285 + layer.close(i);
281 jsDoQuery(null, true); 286 jsDoQuery(null, true);
282 }); 287 });
283 288
@@ -302,7 +307,9 @@ @@ -302,7 +307,9 @@
302 } 307 }
303 } 308 }
304 }); 309 });
  310 + var i = layer.load(2);
305 $get('/ylb/obtain', params, function () { 311 $get('/ylb/obtain', params, function () {
  312 + layer.close(i);
306 jsDoQuery(params, true); 313 jsDoQuery(params, true);
307 }); 314 });
308 } else { 315 } else {
@@ -530,7 +537,7 @@ @@ -530,7 +537,7 @@
530 //搜索线路 537 //搜索线路
531 $.get('/basic/lineCode2Name',function(result){ 538 $.get('/basic/lineCode2Name',function(result){
532 var data=[]; 539 var data=[];
533 - 540 + data.push({id: " ", text: "全部线路"});
534 for(var code in result){ 541 for(var code in result){
535 data.push({id: code, text: result[code]}); 542 data.push({id: code, text: result[code]});
536 } 543 }