Commit 92a30e2c90ec5c6be0f3d9a2c16207f3a739924f
1 parent
4232a158
电量表
Showing
1 changed file
with
8 additions
and
8 deletions
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
| ... | ... | @@ -94,14 +94,14 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 94 | 94 | carsMap.put(c.getInsideCode(), c.getSfdc()); |
| 95 | 95 | } |
| 96 | 96 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); |
| 97 | -// Date dNow = new Date(); //当前时间 | |
| 98 | -// Date dBefore = new Date(); | |
| 99 | -// Calendar calendar = Calendar.getInstance(); //得到日历 | |
| 100 | -// calendar.setTime(dNow);//把当前时间赋给日历 | |
| 101 | -// calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天 | |
| 102 | -// dBefore = calendar.getTime(); //得到前一天的时间 | |
| 103 | -// String rq=sdf.format(dBefore); | |
| 104 | - String rq="2017-11-02"; | |
| 97 | + Date dNow = new Date(); //当前时间 | |
| 98 | + Date dBefore = new Date(); | |
| 99 | + Calendar calendar = Calendar.getInstance(); //得到日历 | |
| 100 | + calendar.setTime(dNow);//把当前时间赋给日历 | |
| 101 | + calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天 | |
| 102 | + dBefore = calendar.getTime(); //得到前一天的时间 | |
| 103 | + String rq=sdf.format(dBefore); | |
| 104 | +// String rq="2017-11-02"; | |
| 105 | 105 | String line=""; |
| 106 | 106 | //保留两位小数 |
| 107 | 107 | DecimalFormat df = new DecimalFormat("#.00"); | ... | ... |