Bladeren bron

控规数据批量导入调整;

songxy 1 jaar geleden
bovenliggende
commit
3acb3138da
26 gewijzigde bestanden met toevoegingen van 118 en 29 verwijderingen
  1. 6 3
      BJYSYBZ_S/src/main/java/com/zjugis/ysgzybz/dao/BjkgMapper.java
  2. 9 6
      BJYSYBZ_S/src/main/java/com/zjugis/ysgzybz/domain/entity/BjKgDO.java
  3. 2 0
      BJYSYBZ_S/src/main/java/com/zjugis/ysgzybz/service/BjkgService.java
  4. 66 1
      BJYSYBZ_S/src/main/java/com/zjugis/ysgzybz/service/impl/BjkgServiceImpl.java
  5. BIN
      WEB-VIEW/src/assets/images/webview/dian.png
  6. 5 0
      WEB-VIEW/src/views/components/BigScreenMap/index.vue
  7. 12 10
      WEB-VIEW/src/webview.vue
  8. BIN
      WEB-VIEW2/src/assets/images/webview/dian.png
  9. 6 1
      WEB-VIEW2/src/views/components/BigScreenMap/index.vue
  10. 12 6
      WEB-VIEW2/src/webview.vue
  11. 0 1
      YSGZYBZ_WXAPP/pages/receivedDetail/index.vue
  12. 0 0
      YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map
  13. 0 0
      YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/components/SlideCard/SlideCard.js.map
  14. 0 0
      YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/components/navigationBar/navigationBar.js.map
  15. 0 0
      YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/pages/login/index.js.map
  16. 0 0
      YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/pages/main/index.js.map
  17. 0 0
      YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/pages/nocheckDetail/index.js.map
  18. 0 0
      YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/pages/received/index.js.map
  19. 0 0
      YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/pages/receivedDetail/index.js.map
  20. 0 0
      YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.js.map
  21. 0 0
      YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.js.map
  22. 0 0
      YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.js.map
  23. 0 0
      YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.js.map
  24. 0 0
      YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.js.map
  25. 0 0
      YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-icons/components/uni-icons/uni-icons.js.map
  26. 0 1
      YSGZYBZ_WXAPP/unpackage/dist/dev/mp-weixin/pages/receivedDetail/index.js

+ 6 - 3
BJYSYBZ_S/src/main/java/com/zjugis/ysgzybz/dao/BjkgMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zjugis.ysgzybz.domain.entity.BjKgDO;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -13,11 +14,13 @@ public interface BjkgMapper extends BaseMapper<BjKgDO> {
     default int insertOrUpdate(List<BjKgDO> lists){
         QueryWrapper<BjKgDO> queryWrapper = new QueryWrapper<>();
         for(BjKgDO bjKgDO: lists){
-            queryWrapper.eq("dkbh", bjKgDO.getDkbh());
-            if(update(bjKgDO, queryWrapper) == 0 ){
-                insert(bjKgDO);
+            queryWrapper.eq("objectid", bjKgDO.getObjectid());
+            if(selectCount(queryWrapper) == 0 ){
+                insertShape(bjKgDO);
             }
         }
         return lists.size();
     }
+
+    Integer insertShape(@Param("entity") BjKgDO entity);
 }

+ 9 - 6
BJYSYBZ_S/src/main/java/com/zjugis/ysgzybz/domain/entity/BjKgDO.java

@@ -7,8 +7,8 @@ import java.math.BigDecimal;
 import java.util.Date;
 
 @Data
-@TableName("ysybz.ybz_bj_kg")
-@KeySequence(value = "ybz_bj_kg_seq")
+@TableName("sde.ybz_bj_kg2")
+@KeySequence(value = "ybz_bj_kg_seq_1")
 public class BjKgDO {
 
     /**
@@ -17,6 +17,9 @@ public class BjKgDO {
     @TableId(type = IdType.AUTO)
     private Long id;
 
+    @TableField("objectid")
+    private Long objectid;
+
     /**
      * 单元名称
      * **/
@@ -197,9 +200,9 @@ public class BjKgDO {
     @TableField("shape")
     private Object shape;
 
-    @TableField("shape_Length")
-    private BigDecimal shape_Length;
+    @TableField("shape_length")
+    private BigDecimal shapeLength;
 
-    @TableField("shape_Area")
-    private BigDecimal shape_Area;
+    @TableField("shape_area")
+    private BigDecimal shapeArea;
 }

+ 2 - 0
BJYSYBZ_S/src/main/java/com/zjugis/ysgzybz/service/BjkgService.java

@@ -8,4 +8,6 @@ public interface BjkgService extends IService<BjKgDO> {
 
     Integer addBath(BjKgReqVO reqVO);
 
+    Integer addBath2(BjKgReqVO reqVO);
+
 }

+ 66 - 1
BJYSYBZ_S/src/main/java/com/zjugis/ysgzybz/service/impl/BjkgServiceImpl.java

@@ -1,6 +1,8 @@
 package com.zjugis.ysgzybz.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.vividsolutions.jts.io.WKBWriter;
+import com.vividsolutions.jts.io.WKTReader;
 import com.zjugis.ysgzybz.dao.BjkgMapper;
 import com.zjugis.ysgzybz.domain.entity.BjKgDO;
 import com.zjugis.ysgzybz.domain.vo.BjKgReqVO;
@@ -14,6 +16,7 @@ import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import java.util.List;
 import java.util.Objects;
+import java.util.stream.Collectors;
 
 @Service
 public class BjkgServiceImpl extends ServiceImpl<BjkgMapper, BjKgDO> implements BjkgService {
@@ -24,6 +27,68 @@ public class BjkgServiceImpl extends ServiceImpl<BjkgMapper, BjKgDO> implements
     @Override
     public Integer addBath(BjKgReqVO reqVO) {
         if(Objects.isNull(reqVO.getData())) throw new NullPointerException("请求data字段数据不能为空!");
-        return bjkgMapper.insertOrUpdate(reqVO.getData());
+        List<BjKgDO> datas = reqVO.getData();
+        System.out.println("获取推送的数据:"+datas.size());
+        List<BjKgDO> bjKgDOS = datas.stream().map(d->{
+            try{
+                com.vividsolutions.jts.geom.Geometry g = new WKTReader().read(d.getShape().toString());
+                byte[] wkb = new WKBWriter().write(g);
+                d.setShape(wkb);
+            }catch (Exception ex){
+                ex.printStackTrace();
+                return null;
+            }
+            return d;
+        }).collect(Collectors.toList());
+        new Thread(()->bjkgMapper.insertOrUpdate(bjKgDOS)).start();
+        return reqVO.getData().size();
+    }
+
+
+    @Autowired
+    private SqlSessionFactory sqlSessionFactory;
+
+    /**
+     * 批量插入功能优化,待定
+     * **/
+    @Override
+    public Integer addBath2(BjKgReqVO reqVO) {
+        if(Objects.isNull(reqVO.getData())) throw new NullPointerException("请求data字段数据不能为空!");
+        List<BjKgDO> datas = reqVO.getData();
+        System.out.println("获取推送的数据:"+datas.size());
+        List<BjKgDO> bjKgDOS = datas.stream().map(d->{
+            try{
+                com.vividsolutions.jts.geom.Geometry g = new WKTReader().read(d.getShape().toString());
+                byte[] wkb = new WKBWriter().write(g);
+                d.setShape(wkb);
+            }catch (Exception ex){
+                ex.printStackTrace();
+                return null;
+            }
+            return d;
+        }).collect(Collectors.toList());
+        if(bjKgDOS.size() > 0){
+            new Thread(()->{
+                Long start = System.currentTimeMillis();
+                SqlSession sqlSession = null;
+                try{
+                    sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
+                    BjkgMapper bjkgMapper1 = sqlSession.getMapper(BjkgMapper.class);
+                    bjkgMapper1.delete(null);
+                    for(BjKgDO item: bjKgDOS){
+                        bjkgMapper1.insert(item);
+                    }
+                    sqlSession.commit();
+                }catch (Exception ex){
+                    sqlSession.rollback();
+                    ex.printStackTrace();
+                }finally {
+                    sqlSession.close();
+                }
+                Long end = System.currentTimeMillis();
+                System.out.println("共耗时:"+(end - start));
+            }).start();
+        }
+        return datas.size();
     }
 }

BIN
WEB-VIEW/src/assets/images/webview/dian.png


+ 5 - 0
WEB-VIEW/src/views/components/BigScreenMap/index.vue

@@ -497,6 +497,11 @@ export default {
       // 将图层添加地图上
       this.pointLayer.setZIndex(1003);
       this.map.addLayer(this.pointLayer);
+      const { longitude, latitude } = city;
+      this.map.getView().animate({
+        center: [longitude, latitude - 0.05],
+        duration: 200
+      });
     },
 
     initHotLayer(field) {

+ 12 - 10
WEB-VIEW/src/webview.vue

@@ -15,6 +15,9 @@
         <div class="searchBtn" @click="queryClick()">
           <img class="icon" src="./assets/images/webview/search.png" />
         </div>
+        <div class="searchBtn" style="margin-left: 10px;" @click="selectLocation()">
+          <img class="icon" src="./assets/images/webview/location.png" />
+        </div>
       </div>
       <div class="overs">
         <div
@@ -84,12 +87,7 @@ export default {
     };
   },
   mounted() {},
-  created() {
-    let that = this;
-    setInterval(() => {
-      that.citys = JSON.parse(that.$route.query.city);
-      that.$vm.$emit('addPoint', that.citys);
-    }, 3000);
+  created () {
     this.userInfo = JSON.parse(this.$route.query.objs);
     if (this.userInfo && this.userInfo.gddw) {
       setTimeout(() => {
@@ -101,6 +99,12 @@ export default {
   },
 
   methods: {
+    selectLocation () {
+      this.citys = JSON.parse(this.$route.query.city);
+      const keys = Object.keys(this.citys);
+      if (keys.length === 0) return;
+      this.$vm.$emit('addPoint', this.citys);
+    },
     mapClickHandle (payload) {
       this.toDetailInfo(payload['dksyh'], 'map')
     },
@@ -177,8 +181,6 @@ export default {
 .webview {
   width: 100%;
   height: 100%;
-  .mapBox {
-  }
   .titleBox {
     display: flex;
     align-items: center;
@@ -186,8 +188,6 @@ export default {
     margin-bottom: 10px;
     width: 100%;
     height: 32px;
-    border: 1px solid #e7eaef;
-    background-color: #f9f9f9;
     border-radius: 4px;
 
     .search {
@@ -196,6 +196,8 @@ export default {
       display: flex;
       align-items: center;
       justify-content: center;
+      border: 1px solid #e7eaef;
+      background-color: #f9f9f9;
       .input {
         width: 100%;
         height: 100%;

BIN
WEB-VIEW2/src/assets/images/webview/dian.png


+ 6 - 1
WEB-VIEW2/src/views/components/BigScreenMap/index.vue

@@ -371,7 +371,7 @@ export default {
     this.echartslayer && this.echartslayer.remove();
   },
   methods: {
-    addPoints(city) {
+    addPoints (city) {
       // 地理坐标数组
       if (this.pointLayer) {
         this.mapPointList = [];
@@ -405,6 +405,11 @@ export default {
       // 将图层添加地图上
       this.pointLayer.setZIndex(1003);
       this.map.addLayer(this.pointLayer);
+      const { longitude, latitude } = city;
+      this.map.getView().animate({
+        center: [longitude, latitude - 0.05],
+        duration: 200
+      });
     },
 
     initHotLayer(field) {

+ 12 - 6
WEB-VIEW2/src/webview.vue

@@ -15,6 +15,9 @@
         <div class="searchBtn" @click="queryClick()">
           <img class="icon" src="./assets/images/webview/search.png" />
         </div>
+        <div class="searchBtn" style="margin-left: 10px;" @click="selectLocation()">
+          <img class="icon" src="./assets/images/webview/location.png" />
+        </div>
       </div>
       <div class="overs">
         <div
@@ -86,6 +89,7 @@ export default {
     };
   },
   created() {
+    this.userInfo = JSON.parse(this.$route.query.objs);
     this.$vm.$on('switchLayerEvent', (payload) => {
       this.xmmc = ''
       this.mapTypeObj = payload;
@@ -93,8 +97,13 @@ export default {
       this.queryStateMachine()
     });
   },
-
   methods: {
+    selectLocation () {
+      this.citys = JSON.parse(this.$route.query.city);
+      const keys = Object.keys(this.citys);
+      if (keys.length === 0) return;
+      this.$vm.$emit('addPoint', this.citys);
+    },
     async queryStateMachine () {
       this.listData = []
       if (this.mapTypeObj['bj-lsyd']) {
@@ -137,7 +146,6 @@ export default {
       });
     },
     toDetailHandle (item) {
-      console.log(item);
       const key = item['mapType']
       this.toDetailInfo(urlMaps[key], item[urlMaps[key]['key']], 'list')
     },
@@ -187,8 +195,6 @@ export default {
 .webview {
   width: 100%;
   height: 100%;
-  .mapBox {
-  }
   .titleBox {
     display: flex;
     align-items: center;
@@ -196,8 +202,6 @@ export default {
     margin-bottom: 10px;
     width: 100%;
     height: 32px;
-    border: 1px solid #e7eaef;
-    background-color: #f9f9f9;
     border-radius: 4px;
 
     .search {
@@ -206,6 +210,8 @@ export default {
       display: flex;
       align-items: center;
       justify-content: center;
+      border: 1px solid #e7eaef;
+      background-color: #f9f9f9;
       .input {
         width: 100%;
         height: 100%;

+ 0 - 1
YSGZYBZ_WXAPP/pages/receivedDetail/index.vue

@@ -136,7 +136,6 @@ export default {
   onLoad(option) {
     const objs = JSON.parse(option['obj']);
 	this.source = option['source'];
-	console.log(this.source)
     this.objs = objs;
     this.initList();
   },

File diff suppressed because it is too large
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map


File diff suppressed because it is too large
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/components/SlideCard/SlideCard.js.map


File diff suppressed because it is too large
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/components/navigationBar/navigationBar.js.map


File diff suppressed because it is too large
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/pages/login/index.js.map


File diff suppressed because it is too large
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/pages/main/index.js.map


File diff suppressed because it is too large
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/pages/nocheckDetail/index.js.map


File diff suppressed because it is too large
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/pages/received/index.js.map


File diff suppressed because it is too large
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/pages/receivedDetail/index.js.map


File diff suppressed because it is too large
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.js.map


File diff suppressed because it is too large
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.js.map


File diff suppressed because it is too large
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.js.map


File diff suppressed because it is too large
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.js.map


File diff suppressed because it is too large
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.js.map


File diff suppressed because it is too large
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-icons/components/uni-icons/uni-icons.js.map


+ 0 - 1
YSGZYBZ_WXAPP/unpackage/dist/dev/mp-weixin/pages/receivedDetail/index.js

@@ -197,7 +197,6 @@ var _default = {
   onLoad: function onLoad(option) {
     var objs = JSON.parse(option['obj']);
     this.source = option['source'];
-    console.log(this.source);
     this.objs = objs;
     this.initList();
   },

Some files were not shown because too many files changed in this diff