Commit 41e4b94697b81c2d44f0afc1d1d27aa60548d85c

Authored by 廖磊
1 parent 478ce683

新方法计算车辆最早进场存油量

src/main/java/com/bsth/controller/oil/DlbController.java
... ... @@ -163,6 +163,7 @@ public class DlbController extends BaseController<Dlb, Integer>{
163 163 m.put("hd", y.getHd()<=0?"0":y.getHd());
164 164 String shyy ="无";
165 165 if(y.getShyy()!=null){
  166 + shyy=y.getShyy();
166 167 if(shyy.equals("1")){shyy="票务用油";}
167 168 else if(shyy.equals("2")){shyy="保养用油";}
168 169 else if(shyy.equals("3")){shyy="报废车用油";}
... ...
src/main/java/com/bsth/repository/oil/YlbRepository.java
... ... @@ -46,6 +46,14 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
46 46 + " and y.xlbm like %?4% and y.nbbm like %?5%",nativeQuery=true)
47 47 List<Ylb> listMaxRqJcsx(String rq,String gsbm,String fgsbm,String xlbm,String nbbm);
48 48  
  49 + @Query(value="select * from bsth_c_ylb where to_days(?1) -to_days(rq) <30 "
  50 + + " and rq< ?1 and ssgsdm like %?2%"
  51 + + " and fgsdm like %?3% and xlbm like %?4% and nbbm like %?5% "
  52 + + " order by nbbm , rq desc,jcsx desc",nativeQuery=true)
  53 + List<Ylb> listByRqJcsx(String rq,String gsbm,String fgsbm,String xlbm,String nbbm);
  54 +
  55 +
  56 +
49 57 /**
50 58 * 当天YLB信息
51 59 * @param rq
... ...
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
... ... @@ -118,8 +118,8 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
118 118 //当天YLXXB信息
119 119 // List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq);
120 120 //前一天所有车辆最后进场班次信息
121   -// List<Ylb> ylListBe=repository.obtainYlbefore(rq,"","","","");
122   - List<Ylb> ylListBe=repository.listMaxRqJcsx(rq, "", "", "", "");
  121 + List<Ylb> ylListBe=this.listByRqJcsx(rq,"","","","");
  122 +// List<Ylb> ylListBe=repository.listMaxRqJcsx(rq, "", "", "", "");
123 123 List<Cyl> clyList=cylRepository.obtainCyl("","");
124 124 //从排班表中计算出行驶的总里程
125 125 List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("", rq, "", "", "", "");
... ... @@ -269,8 +269,8 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
269 269 List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0,gsbm);
270 270  
271 271 // 前一天所有车辆最后进场班次信息
272   -// List<Ylb> ylListBe = repository.obtainYlbefore(rq, gsbm, fgsbm, line, nbbm);
273   - List<Ylb> ylListBe =repository.listMaxRqJcsx(rq, gsbm, fgsbm, line, nbbm);
  272 + List<Ylb> ylListBe = this.listByRqJcsx(rq, gsbm, fgsbm, line, nbbm);
  273 +// List<Ylb> ylListBe =repository.listMaxRqJcsx(rq, gsbm, fgsbm, line, nbbm);
274 274  
275 275 List<Cyl> clyList = cylRepository.obtainCyl(nbbm,gsbm);
276 276  
... ... @@ -727,7 +727,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
727 727 nbbm=map.get("nbbm_eq").toString();
728 728 }
729 729 // List<Ylb> ylListBe=repository.obtainYlbefore(rq, gsbm, "", xlbm, nbbm);
730   - List<Ylb> ylListBe=repository.listMaxRqJcsx(rq, gsbm, fgsbm, xlbm, nbbm);
  730 + List<Ylb> ylListBe=this.listByRqJcsx(rq, gsbm, fgsbm, xlbm, nbbm);
731 731 List<Ylb> ylbList=this.listOrderBy(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm");
732 732 // repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm");
733 733 // List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,0,gsbm);
... ... @@ -1653,9 +1653,17 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1653 1653 return newMap;
1654 1654 }
1655 1655  
1656   - public List<Ylb> listByRqJcsx(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,
1657   - String px) {
1658   -
1659   - return null;
  1656 + public List<Ylb> listByRqJcsx(String rq,String gsdm,String fgsdm,String xlbm,String nbbm) {
  1657 + List<Ylb> list=repository.listByRqJcsx(rq, gsdm, fgsdm, xlbm, nbbm);
  1658 + Map<String, Object> m=new HashMap<String,Object>();
  1659 + List<Ylb> list_=new ArrayList<Ylb>();
  1660 + for (int i = 0; i < list.size(); i++) {
  1661 + Ylb t=list.get(i);
  1662 + if(m.get(t.getNbbm())==null){
  1663 + m.put(t.getNbbm(), t.getNbbm());
  1664 + list_.add(t);
  1665 + }
  1666 + }
  1667 + return list_;
1660 1668 }
1661 1669 }
... ...
src/main/resources/static/pages/oil/list_ph.html
... ... @@ -173,7 +173,7 @@
173 173 <thead>
174 174 <tr role="row" class="heading">
175 175 <td width="40px">
176   - <input type="checkbox" id="selectAll" class="group-checkable icheck" >
  176 + <input type="checkbox" id="selectAll" class="group-checkable" >
177 177 </td>
178 178 <td width="40px">序号</td>
179 179 <td width="8%">日期</td>
... ... @@ -327,6 +327,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
327 327 layer.msg('请选择日期.');
328 328 }
329 329 })
  330 +
330 331 //进场等于出场
331 332 $("#outAndIn").on('click', function () {
332 333 // console.log("进场油量等于出场油量");
... ... @@ -970,11 +971,11 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
970 971 //全选 全不选
971 972 $("#selectAll").on("click", function () {
972 973 if ($(this).is(":checked")) {
973   -// $("[name=id]:checkbox").prop("checked", true);
974   - $("input[name='id']").attr('checked', true)
  974 + $("[name=id]:checkbox").prop("checked", true);
  975 +// $("input[name='id']").attr('checked', true)
975 976 } else {
976   -// $("[name=id]:checkbox").prop("checked", false);
977   - $("input[name='id']").attr('checked', false);
  977 + $("[name=id]:checkbox").prop("checked", false);
  978 +// $("input[name='id']").attr('checked', false);
978 979 }
979 980 });
980 981  
... ...