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