Explorar o código

滨江要素一本帐,临时用地,上传图形xh重复BUG

liutao hai 7 meses
pai
achega
2dbf9192fa

+ 4 - 9
BJYSYBZ_S/src/main/java/com/zjugis/ysgzybz/service/impl/YbzBJService.java

@@ -277,19 +277,14 @@ public class YbzBJService {
 
         Bjlsyd entity = new Bjlsyd();
         QueryWrapper<Bjlsyd> wrapper = new QueryWrapper<>();
-        wrapper.select("max(id) as id","max(xh) as xh");
+        wrapper.select("max(id) as id", "max(xh) as xh");
         Bjlsyd bjlsyd = bjlsydMapper.selectOne(wrapper);
         float id = bjlsyd.getId() + 1;
-        int xh = (int) id + 100;
-        try {
-            xh = Integer.parseInt(bjlsyd.getXh()) + 1;
-        } catch (NumberFormatException ex) {
-            ex.printStackTrace();
-        }
+        String xh = UUID.randomUUID().toString();
         entity.setId(id);
         entity.setObjectid(id);
-        entity.setXh(String.valueOf(xh));
-        entity.setXh1((float) xh);
+        entity.setXh(xh);
+        entity.setXh1(0F);
         entity.setXmmc(dkmc);
         entity.setSpmj(dkmj * 10000);