Commit 7081357fbf57e6aef2e2da44037661829b25327c
1 parent
cdb2d69a
油量电量设置不为0
Showing
4 changed files
with
71 additions
and
21 deletions
src/main/java/com/bsth/repository/oil/YlbRepository.java
| @@ -49,13 +49,13 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | @@ -49,13 +49,13 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | ||
| 49 | @Query(value="select * from bsth_c_ylb where to_days(?1) -to_days(rq) <30 " | 49 | @Query(value="select * from bsth_c_ylb where to_days(?1) -to_days(rq) <30 " |
| 50 | + " and rq< ?1 and ssgsdm like %?2%" | 50 | + " and rq< ?1 and ssgsdm like %?2%" |
| 51 | + " and fgsdm like %?3% and xlbm like %?4% and nbbm like %?5% " | 51 | + " and fgsdm like %?3% and xlbm like %?4% and nbbm like %?5% " |
| 52 | - + " order by nbbm , rq desc,jcsx desc",nativeQuery=true) | 52 | + + " order by nbbm , rq desc,jcsx desc,lp desc",nativeQuery=true) |
| 53 | List<Ylb> listByRqJcsx(String rq,String gsbm,String fgsbm,String xlbm,String nbbm); | 53 | List<Ylb> listByRqJcsx(String rq,String gsbm,String fgsbm,String xlbm,String nbbm); |
| 54 | 54 | ||
| 55 | @Query(value="select * from bsth_c_ylb where rq>=?1 " | 55 | @Query(value="select * from bsth_c_ylb where rq>=?1 " |
| 56 | + " and rq<= ?2 and ssgsdm =?3" | 56 | + " and rq<= ?2 and ssgsdm =?3" |
| 57 | + " and fgsdm =?4 and xlbm like %?5% " | 57 | + " and fgsdm =?4 and xlbm like %?5% " |
| 58 | - + " order by nbbm , rq desc,jcsx desc",nativeQuery=true) | 58 | + + " order by nbbm , rq desc,jcsx desc,lp desc",nativeQuery=true) |
| 59 | List<Ylb> listByMonthJcsx(String rq,String rq2,String gsbm,String fgsbm,String xlbm); | 59 | List<Ylb> listByMonthJcsx(String rq,String rq2,String gsbm,String fgsbm,String xlbm); |
| 60 | 60 | ||
| 61 | /** | 61 | /** |
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
| @@ -406,12 +406,12 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -406,12 +406,12 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 406 | } | 406 | } |
| 407 | nextJzyl =Arith.sub(zjzl,dh); | 407 | nextJzyl =Arith.sub(zjzl,dh); |
| 408 | if(zlc>0){ | 408 | if(zlc>0){ |
| 409 | - long l=Math.round(nextJzyl); | ||
| 410 | - double ylxs=l*100/100; | 409 | +// long l=Math.round(nextJzyl); |
| 410 | + double ylxs=nextJzyl; | ||
| 411 | dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); | 411 | dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); |
| 412 | if(dh<0){ | 412 | if(dh<0){ |
| 413 | - t.setHd(dh); | ||
| 414 | - t.setCdl(dh); | 413 | + t.setHd(0.0); |
| 414 | + t.setCdl(0.0); | ||
| 415 | nextJzyl=Arith.add(ylxs, dh); | 415 | nextJzyl=Arith.add(ylxs, dh); |
| 416 | }else{ | 416 | }else{ |
| 417 | t.setHd(dh); | 417 | t.setHd(dh); |
| @@ -429,21 +429,21 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -429,21 +429,21 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 429 | } | 429 | } |
| 430 | nextJzyl =Arith.sub( nextJzyl,dh); | 430 | nextJzyl =Arith.sub( nextJzyl,dh); |
| 431 | if(zlc>0){ | 431 | if(zlc>0){ |
| 432 | - long l=0l; | 432 | +// long l=0l; |
| 433 | double ylxs=0.0; | 433 | double ylxs=0.0; |
| 434 | if(i==listpb.size()-1){ | 434 | if(i==listpb.size()-1){ |
| 435 | // ylxs=czyl; | 435 | // ylxs=czyl; |
| 436 | }else{ | 436 | }else{ |
| 437 | if(listpb.get(i+1).get("clZbh").toString().equals(map.get("clZbh").toString())){ | 437 | if(listpb.get(i+1).get("clZbh").toString().equals(map.get("clZbh").toString())){ |
| 438 | - l=Math.round(nextJzyl); | ||
| 439 | - ylxs=l*100/100; | 438 | +// l=Math.round(nextJzyl); |
| 439 | + ylxs=nextJzyl; | ||
| 440 | } | 440 | } |
| 441 | 441 | ||
| 442 | } | 442 | } |
| 443 | dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); | 443 | dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); |
| 444 | if(dh<0){ | 444 | if(dh<0){ |
| 445 | - t.setHd(dh); | ||
| 446 | - t.setCdl(dh); | 445 | + t.setHd(0.0); |
| 446 | + t.setCdl(0.0); | ||
| 447 | nextJzyl=Arith.add(ylxs, dh); | 447 | nextJzyl=Arith.add(ylxs, dh); |
| 448 | }else{ | 448 | }else{ |
| 449 | t.setHd(dh); | 449 | t.setHd(dh); |
| @@ -468,15 +468,21 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -468,15 +468,21 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 468 | t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); | 468 | t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); |
| 469 | t.setRq(sdf.parse(rq)); | 469 | t.setRq(sdf.parse(rq)); |
| 470 | t.setLp(map.get("lpName").toString()); | 470 | t.setLp(map.get("lpName").toString()); |
| 471 | - if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | ||
| 472 | - if(type.equals("add")){ | ||
| 473 | - t.setCreatetime(date); | ||
| 474 | - addList.add(t); | ||
| 475 | - }else{ | ||
| 476 | - t.setUpdatetime(date); | ||
| 477 | - updateList.add(t); | ||
| 478 | - } | ||
| 479 | - } | 471 | + if (!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))) { |
| 472 | + if (t.getHd() < 0) { | ||
| 473 | + t.setHd(0.0); | ||
| 474 | + } | ||
| 475 | + if (t.getCdl() < 0) { | ||
| 476 | + t.setCdl(0.0); | ||
| 477 | + } | ||
| 478 | + if (type.equals("add")) { | ||
| 479 | + t.setCreatetime(date); | ||
| 480 | + addList.add(t); | ||
| 481 | + } else { | ||
| 482 | + t.setUpdatetime(date); | ||
| 483 | + updateList.add(t); | ||
| 484 | + } | ||
| 485 | + } | ||
| 480 | newMap.put("status", ResponseCode.SUCCESS); | 486 | newMap.put("status", ResponseCode.SUCCESS); |
| 481 | } | 487 | } |
| 482 | } | 488 | } |
| @@ -1204,6 +1210,14 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -1204,6 +1210,14 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 1204 | t.setUpdatetime(new Date()); | 1210 | t.setUpdatetime(new Date()); |
| 1205 | } | 1211 | } |
| 1206 | } | 1212 | } |
| 1213 | + | ||
| 1214 | + | ||
| 1215 | + if(t.getHd()<0){ | ||
| 1216 | + t.setHd(0.0); | ||
| 1217 | + } | ||
| 1218 | + if(t.getCdl()<0){ | ||
| 1219 | + t.setCdl(0.0); | ||
| 1220 | + } | ||
| 1207 | updateDlb.add(t); | 1221 | updateDlb.add(t); |
| 1208 | } | 1222 | } |
| 1209 | } | 1223 | } |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -679,6 +679,18 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -679,6 +679,18 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 679 | t.setJzyl(nextJzyl); | 679 | t.setJzyl(nextJzyl); |
| 680 | } | 680 | } |
| 681 | } | 681 | } |
| 682 | + if(t.getJzyl()<0){ | ||
| 683 | + t.setJzyl(0.0); | ||
| 684 | + } | ||
| 685 | + if(t.getCzyl()<0){ | ||
| 686 | + t.setCzyl(0.0); | ||
| 687 | + } | ||
| 688 | + if(t.getYh()<0){ | ||
| 689 | + t.setYh(0.0); | ||
| 690 | + } | ||
| 691 | + if(t.getSh()<0){ | ||
| 692 | + t.setSh(0.0); | ||
| 693 | + } | ||
| 682 | repository.save(t); | 694 | repository.save(t); |
| 683 | } | 695 | } |
| 684 | map2.put("status", ResponseCode.SUCCESS); | 696 | map2.put("status", ResponseCode.SUCCESS); |
| @@ -1404,6 +1416,18 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1404,6 +1416,18 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1404 | t.setJzyl(nextJzyl); | 1416 | t.setJzyl(nextJzyl); |
| 1405 | } | 1417 | } |
| 1406 | } | 1418 | } |
| 1419 | + if(t.getJzyl()<0){ | ||
| 1420 | + t.setJzyl(0.0); | ||
| 1421 | + } | ||
| 1422 | + if(t.getCzyl()<0){ | ||
| 1423 | + t.setCzyl(0.0); | ||
| 1424 | + } | ||
| 1425 | + if(t.getYh()<0){ | ||
| 1426 | + t.setYh(0.0); | ||
| 1427 | + } | ||
| 1428 | + if(t.getSh()<0){ | ||
| 1429 | + t.setSh(0.0); | ||
| 1430 | + } | ||
| 1407 | repository.save(t); | 1431 | repository.save(t); |
| 1408 | } | 1432 | } |
| 1409 | newMap.put("status", ResponseCode.SUCCESS); | 1433 | newMap.put("status", ResponseCode.SUCCESS); |
| @@ -1879,6 +1903,18 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1879,6 +1903,18 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1879 | t.setJzyl(nextJzyl); | 1903 | t.setJzyl(nextJzyl); |
| 1880 | } | 1904 | } |
| 1881 | } | 1905 | } |
| 1906 | + if(t.getJzyl()<0){ | ||
| 1907 | + t.setJzyl(0.0); | ||
| 1908 | + } | ||
| 1909 | + if(t.getCzyl()<0){ | ||
| 1910 | + t.setCzyl(0.0); | ||
| 1911 | + } | ||
| 1912 | + if(t.getYh()<0){ | ||
| 1913 | + t.setYh(0.0); | ||
| 1914 | + } | ||
| 1915 | + if(t.getSh()<0){ | ||
| 1916 | + t.setSh(0.0); | ||
| 1917 | + } | ||
| 1882 | repository.save(t); | 1918 | repository.save(t); |
| 1883 | } | 1919 | } |
| 1884 | } | 1920 | } |
src/main/resources/static/pages/forms/statement/scheduleDailyQp.html
| @@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
| 37 | </div> | 37 | </div> |
| 38 | <div class="form-group"> | 38 | <div class="form-group"> |
| 39 | <input class="btn btn-default" type="button" id="query" value="查询"/> | 39 | <input class="btn btn-default" type="button" id="query" value="查询"/> |
| 40 | - <input class="btn btn-default" type="button" id="month" value="按月查询"/> | 40 | +<!-- <input class="btn btn-default" type="button" id="month" value="按月查询"/> --> |
| 41 | <input class="btn btn-default" type="button" id="export" value="导出"/> | 41 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| 42 | </div> | 42 | </div> |
| 43 | </form> | 43 | </form> |