Commit c20eb9f293dcea64c60bb0fcba2c4d06f76535a9
1 parent
4413865a
double 去掉0
Showing
1 changed file
with
7 additions
and
2 deletions
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
| ... | ... | @@ -2,6 +2,7 @@ package com.bsth.service.oil.impl; |
| 2 | 2 | |
| 3 | 3 | import java.sql.ResultSet; |
| 4 | 4 | import java.sql.SQLException; |
| 5 | +import java.text.DecimalFormat; | |
| 5 | 6 | import java.text.ParseException; |
| 6 | 7 | import java.text.SimpleDateFormat; |
| 7 | 8 | import java.util.ArrayList; |
| ... | ... | @@ -130,6 +131,8 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements |
| 130 | 131 | // Ylxxb ylxxb=repository.findOne(id); |
| 131 | 132 | // ylxxb.setJsy(jsy); |
| 132 | 133 | // repository.save(ylxxb); |
| 134 | + DecimalFormat decimalFormat = new DecimalFormat("###################.###########"); | |
| 135 | + | |
| 133 | 136 | String json =StringEscapeUtils.unescapeHtml4(map.get("ylbList").toString()); |
| 134 | 137 | JSONArray jsonArray=JSONArray.parseArray(json); |
| 135 | 138 | JSONObject jsonObject; |
| ... | ... | @@ -150,7 +153,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements |
| 150 | 153 | ylxxbUpdate.setNbbm(ylxxb.getNbbm()); |
| 151 | 154 | ylxxbUpdate.setYyrq(ylxxb.getYyrq()); |
| 152 | 155 | ylxxbUpdate.setCreatetime(new Date()); |
| 153 | - ylxxbUpdate.setTj(ylxxb.getNbbm()+"_"+ylxxb.getJsy()+"_"+String.valueOf(ylxxb.getJzl())); | |
| 156 | + ylxxbUpdate.setTj(ylxxb.getNbbm()+"_"+ylxxb.getJsy()+"_"+decimalFormat.format(ylxxb.getJzl())); | |
| 154 | 157 | ylxxbUpdate.setZt(3); |
| 155 | 158 | updateRepository.save(ylxxbUpdate); |
| 156 | 159 | ylxxb.setJsy(jsy); |
| ... | ... | @@ -232,6 +235,8 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements |
| 232 | 235 | // repository.save(ylxxb); |
| 233 | 236 | String json =StringEscapeUtils.unescapeHtml4(map.get("ylbList").toString()); |
| 234 | 237 | JSONArray jsonArray=JSONArray.parseArray(json); |
| 238 | + DecimalFormat decimalFormat = new DecimalFormat("###################.###########"); | |
| 239 | + | |
| 235 | 240 | JSONObject jsonObject; |
| 236 | 241 | for (int x = 0; x < jsonArray.size(); x++) { |
| 237 | 242 | jsonObject=jsonArray.getJSONObject(x); |
| ... | ... | @@ -250,7 +255,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements |
| 250 | 255 | ylxxbUpdate.setNbbm(nbbm); |
| 251 | 256 | ylxxbUpdate.setYyrq(ylxxb.getYyrq()); |
| 252 | 257 | ylxxbUpdate.setCreatetime(new Date()); |
| 253 | - ylxxbUpdate.setTj(nbbm+"_"+ylxxb.getJsy()+"_"+String.valueOf(ylxxb.getJzl())); | |
| 258 | + ylxxbUpdate.setTj(nbbm+"_"+ylxxb.getJsy()+"_"+decimalFormat.format(ylxxb.getJzl())); | |
| 254 | 259 | ylxxbUpdate.setZt(2); |
| 255 | 260 | updateRepository.save(ylxxbUpdate); |
| 256 | 261 | } | ... | ... |