Commit 1c69f89d3c99609baa1251415c8b4f2e7768e28f
1 parent
47367ea6
能耗表计算能耗时只保留两位小数;路单数据线路明细月报、年报表保留三位小数。
Showing
4 changed files
with
17 additions
and
21 deletions
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
| ... | ... | @@ -2395,7 +2395,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2395 | 2395 | } |
| 2396 | 2396 | |
| 2397 | 2397 | int i=1; |
| 2398 | - DecimalFormat df = new DecimalFormat("0.00");//格式化小数 | |
| 2398 | + DecimalFormat df = new DecimalFormat("0.000");//格式化小数 | |
| 2399 | 2399 | double allNum = 0.0; |
| 2400 | 2400 | while (iter.hasNext()) { |
| 2401 | 2401 | Map.Entry entry = (Map.Entry) iter.next(); |
| ... | ... | @@ -2433,7 +2433,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2433 | 2433 | listStr.add(c.getTs()+""); |
| 2434 | 2434 | // 把列合计的数添加到最后一个 |
| 2435 | 2435 | cList.add(c); |
| 2436 | - // DecimalFormat df = new DecimalFormat("0.00");//格式化小数 | |
| 2437 | 2436 | for (CalcWaybillDetail c1:cList) { |
| 2438 | 2437 | if(StringUtils.isEmpty(c1.getXl())) { |
| 2439 | 2438 | listStr.add(""); | ... | ... |
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
| ... | ... | @@ -108,7 +108,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 108 | 108 | String rq=sdf.format(dBefore); |
| 109 | 109 | // String rq="2017-11-02"; |
| 110 | 110 | String line=""; |
| 111 | - //保留两位小数 | |
| 111 | + //公里保留三位小数 | |
| 112 | 112 | DecimalFormat df = new DecimalFormat("#.000"); |
| 113 | 113 | // TODO Auto-generated method stub |
| 114 | 114 | Map<String, Object> newMap=new HashMap<String,Object>(); |
| ... | ... | @@ -264,8 +264,8 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 264 | 264 | nbbm=map2.get("nbbm_eq").toString(); |
| 265 | 265 | } |
| 266 | 266 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 267 | - // 保留两位小数 | |
| 268 | - DecimalFormat df = new DecimalFormat("#.000"); | |
| 267 | + // 加注量与能耗保留两位小数 | |
| 268 | + DecimalFormat df = new DecimalFormat("0.##"); | |
| 269 | 269 | // TODO Auto-generated method stub |
| 270 | 270 | // 当天DLB信息 |
| 271 | 271 | List<Dlb> dlList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm"); |
| ... | ... | @@ -1056,8 +1056,8 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 1056 | 1056 | // TODO Auto-generated method stub |
| 1057 | 1057 | Map<String, List<Dlb>> mapList=new HashMap<String,List<Dlb>>(); |
| 1058 | 1058 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); |
| 1059 | - // 保留两位小数 | |
| 1060 | - DecimalFormat df = new DecimalFormat("#.000"); | |
| 1059 | + // 加注量与能耗保留两位小数 | |
| 1060 | + DecimalFormat df = new DecimalFormat("0.##"); | |
| 1061 | 1061 | List<Dlb> dlbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm"); |
| 1062 | 1062 | List<Dlb> dlbList_upd=new ArrayList<Dlb>(); |
| 1063 | 1063 | List<Dlb> dlbList_del=new ArrayList<Dlb>(); | ... | ... |
src/main/java/com/bsth/service/oil/impl/QlbServiceImpl.java
| ... | ... | @@ -90,7 +90,7 @@ public class QlbServiceImpl extends BaseServiceImpl<Qlb,Integer> implements QlbS |
| 90 | 90 | String rq=sdf.format(dBefore); |
| 91 | 91 | // String rq="2017-11-02"; |
| 92 | 92 | String line=""; |
| 93 | - //保留两位小数 | |
| 93 | + //公里保留三位小数 | |
| 94 | 94 | DecimalFormat df = new DecimalFormat("#.000"); |
| 95 | 95 | // TODO Auto-generated method stub |
| 96 | 96 | Map<String, Object> newMap=new HashMap<String,Object>(); |
| ... | ... | @@ -228,8 +228,8 @@ public class QlbServiceImpl extends BaseServiceImpl<Qlb,Integer> implements QlbS |
| 228 | 228 | nbbm=map2.get("nbbm_eq").toString(); |
| 229 | 229 | } |
| 230 | 230 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 231 | - // 保留两位小数 | |
| 232 | - DecimalFormat df = new DecimalFormat("#.000"); | |
| 231 | + // 加注量与能耗保留两位小数 | |
| 232 | + DecimalFormat df = new DecimalFormat("0.##"); | |
| 233 | 233 | // TODO Auto-generated method stub |
| 234 | 234 | // 当天QLB信息 |
| 235 | 235 | List<Qlb> qlList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm"); |
| ... | ... | @@ -1019,8 +1019,8 @@ public class QlbServiceImpl extends BaseServiceImpl<Qlb,Integer> implements QlbS |
| 1019 | 1019 | // TODO Auto-generated method stub |
| 1020 | 1020 | Map<String, List<Qlb>> mapList=new HashMap<String,List<Qlb>>(); |
| 1021 | 1021 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); |
| 1022 | - // 保留两位小数 | |
| 1023 | - DecimalFormat df = new DecimalFormat("#.000"); | |
| 1022 | + // 加注量与能耗保留两位小数 | |
| 1023 | + DecimalFormat df = new DecimalFormat("0.##"); | |
| 1024 | 1024 | List<Qlb> qlbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm"); |
| 1025 | 1025 | List<Qlb> qlbList_upd=new ArrayList<Qlb>(); |
| 1026 | 1026 | List<Qlb> qlbList_del=new ArrayList<Qlb>(); | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -119,8 +119,6 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 119 | 119 | calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天 |
| 120 | 120 | dBefore = calendar.getTime(); //得到前一天的时间 |
| 121 | 121 | String rq=sdf.format(dBefore); |
| 122 | - //保留两位小数 | |
| 123 | - DecimalFormat df = new DecimalFormat("#.000"); | |
| 124 | 122 | // TODO Auto-generated method stub |
| 125 | 123 | Map<String, Object> newMap=new HashMap<String,Object>(); |
| 126 | 124 | //当天YLB信息 |
| ... | ... | @@ -269,8 +267,6 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 269 | 267 | nbbm=map2.get("nbbm_eq").toString(); |
| 270 | 268 | } |
| 271 | 269 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 272 | - // 保留两位小数 | |
| 273 | - DecimalFormat df = new DecimalFormat("#.000"); | |
| 274 | 270 | // TODO Auto-generated method stub |
| 275 | 271 | // 当天YLB信息 |
| 276 | 272 | List<Ylb> ylList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm"); |
| ... | ... | @@ -667,8 +663,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 667 | 663 | zsh = Arith.add(zsh, Double.valueOf(sumList.get(j)[2].toString())); |
| 668 | 664 | } |
| 669 | 665 | // jzl = Arith.sub(jzl, zsh); |
| 670 | - // 保留两位小数 | |
| 671 | - DecimalFormat df = new DecimalFormat("#.000"); | |
| 666 | + // 加注量与能耗保留两位小数 | |
| 667 | + DecimalFormat df = new DecimalFormat("0.##"); | |
| 672 | 668 | Double zyl = 0.0; |
| 673 | 669 | Double nextJzyl = 0.0; |
| 674 | 670 | // 保存已经计算过的车辆,相同车辆编号的车不在计算 |
| ... | ... | @@ -1481,7 +1477,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1481 | 1477 | |
| 1482 | 1478 | // repository.obtainYl(sdf.format(rq_eq),ylb.getSsgsdm(),ylb.getFgsdm(),"", |
| 1483 | 1479 | // ylb.getNbbm(),"jcsx"); |
| 1484 | - DecimalFormat df = new DecimalFormat("#.000"); | |
| 1480 | + // 加注量与能耗保留两位小数 | |
| 1481 | + DecimalFormat df = new DecimalFormat("0.##"); | |
| 1485 | 1482 | Double zyl = 0.0; |
| 1486 | 1483 | Double nextJzyl = 0.0; |
| 1487 | 1484 | // 车的,进,出油量及耗油 |
| ... | ... | @@ -1983,8 +1980,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1983 | 1980 | jzl = Arith.add(jzl, Double.valueOf(sumList.get(j)[0].toString())); |
| 1984 | 1981 | zlc = Arith.add(zlc, Double.valueOf(sumList.get(j)[1].toString())); |
| 1985 | 1982 | } |
| 1986 | - // 保留两位小数 | |
| 1987 | - DecimalFormat df = new DecimalFormat("#.000"); | |
| 1983 | + // 加注量与能耗保留两位小数 | |
| 1984 | + DecimalFormat df = new DecimalFormat("0.##"); | |
| 1988 | 1985 | Double zyl = 0.0; |
| 1989 | 1986 | Double nextJzyl = 0.0; |
| 1990 | 1987 | for (int j = 0; j < iterator2.size(); j++) { | ... | ... |