Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

wangchao 4 lat temu
rodzic
commit
0cb4921082

+ 2 - 1
ebc-middle-platform/src/conf/services.js

@ -148,7 +148,8 @@ export default {
148 148
    GET_ONE_MAP_TAG: '/mapTag/queryOneMapTagInfo', // 查询地图标记信息
149 149
    ADD_MAP_TAG: '/mapTag/addMapTagInfo', // 新增地图标记信息
150 150
    DEL_MAP_TAG: '/mapTag/deleteMapTagInfo', // 删除地图标记信息
151
    UPD_MAP_TAG: '/mapTag/modifyMapTagInfo' // 查询地图标记信息用作修改
151
    UPD_MAP_TAG: '/mapTag/modifyMapTagInfo', // 查询地图标记信息用作修改
152
    MAP_TAG_TYPE: '/mapTag/queryMapAreaTypeList' // 查询标记类型下拉列表
152 153
  },
153 154
  equipment: {
154 155
    EQUIPMENT_TYPE: '/equipment/loadAllResourceToolType', // 获取所有设备类型

+ 6 - 3
ebc-middle-platform/src/modules/system-management/map-mark.scss

@ -15,8 +15,7 @@
15 15
      display: flex;
16 16
      justify-content: space-between;
17 17
      >div{
18
        display: flex; 
19
        margin: 0 20px 16px 0;    
18
        display: flex;  
20 19
        line-height: 2;
21 20
        .label-content{
22 21
          display: flex; 
@ -36,7 +35,7 @@
36 35
        }
37 36
      }
38 37
      .btns{
39
        min-width: 330px;
38
        min-width: 415px;
40 39
        button{
41 40
          margin: 0 2px;
42 41
        }
@ -47,6 +46,10 @@
47 46
    margin: 20px auto;
48 47
  }
49 48
}
49
.loading--fix{
50
  color: #000;
51
  background-color: rgba(255, 255, 255, 0.8);
52
}
50 53
.modal{
51 54
  .top{
52 55
    display: flex;

+ 171 - 174
ebc-middle-platform/src/modules/system-management/map-mark.vue

@ -7,17 +7,30 @@
7 7
            <div class="label">部门:</div>
8 8
            <div class="input-rule">
9 9
              <t-select-tree
10
                v-model="queryCondition.department"
10
                v-model="queryCondition.entityId"
11 11
                :node-data="cloneNodes"
12 12
                node-key="id"
13 13
              ></t-select-tree>
14 14
            </div>
15 15
          </div>
16 16
          <div class="label-content">
17
            <div class="label">标记类型:</div>
18
            <div class="input-rule">
19
              <t-select v-model="queryCondition.mapAreaType" placeholder="请输入...">
20
                <t-option
21
                  v-for="item in markTypes"
22
                  :key="item.mapAreaTypeId"
23
                  :value="item.mapAreaTypeId"
24
                >{{ item.mapAreaTypeName }}</t-option
25
                >
26
              </t-select>
27
            </div>
28
          </div>
29
          <div class="label-content">
17 30
            <div class="label">标记名称:</div>
18 31
            <div class="input-rule">
19 32
              <t-input
20
                v-model="queryCondition.userName"
33
                v-model="queryCondition.mapAreaName"
21 34
                placeholder="请输入..."
22 35
              ></t-input>
23 36
            </div>
@ -26,38 +39,27 @@
26 39
            <t-button color="success" icon="search-outline" @click="onSearch">查询</t-button>
27 40
            <t-button color="secondary" icon="loading" class="reset-btn" @click="onReset">重置</t-button>
28 41
            <t-button color="secondary" icon="upload-outline" @click="toExport">导出至Excel</t-button>
42
            <t-button color="secondary" icon="delete-outline" @click="batchDelete">删除</t-button>
29 43
          </div>
30 44
        </div>
45
      </div>
46
      <div class="search-ctn" style="justify-content: flex-end;">
31 47
        <div class="btns">
32
          <t-button color="success" icon="plus-outline" @click="markModal(1)"
33
          >考勤区域</t-button
34
          >
35
          <t-button color="success" icon="plus-outline" @click="markModal(2)"
36
          >作业区域</t-button
37
          >
38
          <t-button color="success" icon="plus-outline" @click="markModal(3)"
39
          >电子围栏</t-button
40
          >
41
          <t-button color="success" icon="plus-outline" @click="markModal(4)"
42
          >定点</t-button
48
          <t-button v-for="(item,index) in markTypes" :key="index+'type'" color="success" icon="plus-outline" @click="markModal(item.mapAreaTypeId)"
49
          >{{ item.mapAreaTypeName }}</t-button
43 50
          >
44 51
        </div>
45 52
      </div>
46 53
    </div>
47 54
    <div>
48
      <t-table :data="table.data">
49
        <t-table-column prop="MAP_TAG_NAME" label="标记名称"></t-table-column>
50
        <t-table-column label="类型">
51
          <template slot-scope="scope">
52
            <div v-if="scope.row.MAP_TAG_TYPE == 1">考勤区域</div>
53
            <div v-if="scope.row.MAP_TAG_TYPE == 2">作业区域</div>
54
            <div v-if="scope.row.MAP_TAG_TYPE == 3">电子围栏</div>
55
            <div v-if="scope.row.MAP_TAG_TYPE == 4">定点</div>
56
          </template>
55
      <t-table :data="table.data" :loading="tableLoading" @selection-change="handleSelectionChange">
56
        <t-table-column type="selection" width="70"></t-table-column>
57
        <t-table-column prop="mapAreaName" label="标记名称"></t-table-column>
58
        <t-table-column :formatter="type_formatter" label="类型">
57 59
        </t-table-column>
58 60
        <t-table-column
59 61
          :formatter="timestampToTime"
60
          prop="CREATE_DATE"
62
          prop="creatDate"
61 63
          label="创建时间"
62 64
        ></t-table-column>
63 65
        <t-table-column fixed="right" label="操作" width="120">
@ -102,10 +104,10 @@
102 104
        <div>
103 105
          <div class="label">部门:</div>
104 106
          <div class="input-rule">
105
            <t-select-tree v-model="department"
107
            <t-select-tree v-model="department" :disabled="update"
106 108
                           :node-data="cloneNodes"
107
                           style="width:200px"
108 109
                           node-key="id"
110
                           style="width:200px"
109 111
            ></t-select-tree>
110 112
          </div>
111 113
        </div>
@ -115,9 +117,9 @@
115 117
            <t-select v-model="markType" style="width:100px" placeholder="请输入...">
116 118
              <t-option
117 119
                v-for="item in markTypes"
118
                :key="item.id"
119
                :value="item.id"
120
              >{{ item.type }}</t-option
120
                :key="item.mapAreaTypeId"
121
                :value="item.mapAreaTypeId"
122
              >{{ item.mapAreaTypeName }}</t-option
121 123
              >
122 124
            </t-select>
123 125
          </div>
@ -198,6 +200,7 @@
198 200
        <div id="modalMap" class="right"></div>
199 201
      </div>
200 202
    </t-modal>
203
    <t-loading v-model="fullLoading" fullscreen tip="加载中...."></t-loading>
201 204
  </div>
202 205
</template>
203 206
<script>
@ -215,10 +218,13 @@ export default {
215 218
          total: 0
216 219
        }
217 220
      },
221
      tableLoading: true,
222
      fullLoading: false,
218 223
      departments: [],
219 224
      queryCondition: {
220
        department: '',
221
        userName: ''
225
        entityId: null,
226
        mapAreaName: null,
227
        mapAreaType: null
222 228
      },
223 229
      rangeDate: '',
224 230
      addMark: false,
@ -226,40 +232,25 @@ export default {
226 232
      markName: '',
227 233
      residenceTimeLength: '',
228 234
      markType: 1,
229
      markTypes: [
230
        {
231
          id: 1,
232
          type: '考勤区域'
233
        },
234
        {
235
          id: 2,
236
          type: '作业区域'
237
        },
238
        {
239
          id: 3,
240
          type: '电子围栏'
241
        },
242
        {
243
          id: 4,
244
          type: '定点'
245
        }
246
      ],
235
      markTypes: [],
236
      department: '',
247 237
      modalData: [],
248 238
      map: null,
249
      polygonDrawer: null
239
      polygonDrawer: null,
240
      selection: []
250 241
    }
251 242
  },
252 243
  computed: {
253 244
    cloneNodes() {
254 245
      return this.departments.map((item) => {
255 246
        let obj = {
256
          label: item.label,
257
          title: item.title,
258
          id: item.id,
259
          data: item.data
247
          label: item.name,
248
          title: item.name,
249
          id: item.code,
250
          data: item.id
260 251
        }
261
        if (item.pid) {
262
          obj.pid = item.pid
252
        if (item.parentCode > 0) {
253
          obj.pid = item.parentCode
263 254
        }
264 255
        return obj
265 256
      })
@ -267,6 +258,7 @@ export default {
267 258
  },
268 259
  created() {
269 260
    this.getDepartmentsList()
261
    this.getTagType()
270 262
    this.getList()
271 263
  },
272 264
  mounted() {
@ -278,26 +270,20 @@ export default {
278 270
        .post(services.workEmployee.GET_ALL_ORGANIZE, {})
279 271
        .then((res) => {
280 272
          // 请求成功处理...
281
          // this.departments = res.data
282
          this.departments = []
283
          for (let i = 0; i < res.data.length; i++) {
284
            if (res.data[i].parentCode > 0) {
285
              this.departments.push({
286
                label: res.data[i].name,
287
                title: res.data[i].name,
288
                id: res.data[i].code,
289
                data: res.data[i].id,
290
                pid: res.data[i].parentCode
291
              })
292
            } else {
293
              this.departments.push({
294
                label: res.data[i].name,
295
                title: res.data[i].name,
296
                id: res.data[i].code,
297
                data: res.data[i].id
298
              })
299
            }
300
          }
273
          this.departments = res.data
274
          // this.onReset()
275
        })
276
        .catch((res) => {
277
          // 请求失败处理...
278
        })
279
    },
280
    getTagType() {
281
      this.$test
282
        .post(services.mapTag.MAP_TAG_TYPE, {})
283
        .then((res) => {
284
          // 请求成功处理...
285
          console.log(res)
286
          this.markTypes = res.data.dataList
301 287
        })
302 288
        .catch((res) => {
303 289
          // 请求失败处理...
@ -337,7 +323,6 @@ export default {
337 323
        this.layer.options.opacity = 1.0
338 324
        this.layer.options.color = color
339 325
        this.layer.options.fillColor = color
340
        // console.log(this.polygonDrawer.getPoints())
341 326
        this.modalData = this.layer._latlngs[0]
342 327
        this.polygonDrawer.editing(this.layer)
343 328
        this.polygonDrawer.disable()
@ -345,36 +330,50 @@ export default {
345 330
      })
346 331
    },
347 332
    getList() {
348
      var params = new FormData()
349
      params.append(
350
        'data',
351
        JSON.stringify({
352
          pageNum: this.table.pager.currentPage,
353
          pageSize: this.table.pager.size,
354
          mapTagName: this.queryCondition.userName
355
        })
356
      )
333
      this.tableLoading = true
334
      this.table.data = []
357 335
      this.$test
358
        .post(services.mapTag.GET_MAP_TAG, params)
336
        .post(services.mapTag.GET_MAP_TAG,
337
          {
338
            pageNumber: this.table.pager.currentPage,
339
            pageSize: this.table.pager.size,
340
            data: this.queryCondition
341
          })
359 342
        .then((res) => {
360 343
          // 请求成功处理...
361
          this.table.data = res.data.dataList
362
          this.table.pager.total = res.data.dataNum
344
          console.log(res)
345
          this.tableLoading = false
346
          this.table.data = res.data.data
347
          this.table.pager.total = res.data.total
363 348
          // this.table.pager.currentPage = pageNum
364 349
        })
365 350
        .catch((res) => {
366 351
          // 请求失败处理...
367 352
        })
368 353
    },
354
    type_formatter(row, column) {
355
      var arr = this.markTypes.filter((item) => {
356
        return item.mapAreaTypeId === row.businessType
357
      })
358
      if (arr[0]) {
359
        return arr[0].mapAreaTypeName
360
      }
361
    },
369 362
    onChange(value) {
370 363
      console.log('date change:' + value)
371 364
    },
372 365
    onReset() {
373
      this.queryCondition.userName = ''
366
      console.log(this.departments)
367
      this.queryCondition = {
368
        entityId: this.departments[0].id,
369
        mapAreaName: null,
370
        mapAreaType: null
371
      }
374 372
      this.table.pager.currentPage = 1
375 373
      this.getList()
376 374
    },
377 375
    onSearch() {
376
      console.log(this.queryCondition)
378 377
      this.table.pager.currentPage = 1
379 378
      this.getList()
380 379
    },
@ -423,6 +422,7 @@ export default {
423 422
      this.update = false
424 423
      this.updateId = null
425 424
      this.markName = ''
425
      this.department = null
426 426
      this.residenceTimeLength = ''
427 427
      this.modalData = []
428 428
      this.polygonDrawer.enable()
@ -435,7 +435,7 @@ export default {
435 435
      }
436 436
    },
437 437
    timestampToTime(cjsj) {
438
      var date = new Date(cjsj.CREATE_DATE) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
438
      var date = new Date(cjsj.creatDate) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
439 439
      var Y = date.getFullYear() + '-'
440 440
      var M =
441 441
          (date.getMonth() + 1 < 10
@ -452,7 +452,8 @@ export default {
452 452
      return Y + M + D + ' ' + h + ':' + m + ':' + s
453 453
    },
454 454
    submitMark() {
455
      if (this.modalData.length == 0) {
455
      console.log(this.layer.getPoints())
456
      if (this.modalData.length === 0) {
456 457
        this.$Confirm.warning({
457 458
          title: '提示',
458 459
          content: '请输添加标记'
@ -467,7 +468,13 @@ export default {
467 468
        })
468 469
        return false
469 470
      }
470
471
      if (this.department === '') {
472
        this.$Confirm.warning({
473
          title: '提示',
474
          content: '请选择部门'
475
        })
476
        return false
477
      }
471 478
      if (this.markType === 4 && !this.residenceTimeLength) {
472 479
        this.$Confirm.warning({
473 480
          title: '提示',
@ -475,55 +482,47 @@ export default {
475 482
        })
476 483
        return false
477 484
      }
478
479
      let arr = ''
480
      for (let i = 0; i < this.modalData.length; i++) {
481
        arr = arr + (this.modalData[i].lng + ' ' + this.modalData[i].lat + ',')
482
      }
483
      arr = arr + (this.modalData[0].lng + ' ' + this.modalData[0].lat)
484
      var params = new FormData()
485
      if (this.update) {
486
        params.append(
487
          'data',
488
          JSON.stringify({
489
            mapTagName: this.markName,
490
            mapTagType: this.markType,
491
            residenceTimeLength: this.residenceTimeLength,
492
            mapTagShape: arr,
493
            mapTagId: this.updateId
494
          })
495
        )
485
      if (this.update) { // 更新
486
        this.fullLoading = true
496 487
        this.$test
497
          .post(services.mapTag.UPD_MAP_TAG, params)
488
          .post(services.mapTag.UPD_MAP_TAG, {
489
            mapAreaId: this.updateId,
490
            mapAreaName: this.markName,
491
            businessType: this.markType,
492
            mapAreaContent: this.layer.getPoints(),
493
            entityId: this.department,
494
            limitDuration: this.residenceTimeLength ? this.residenceTimeLength : null
495
          })
498 496
          .then((res) => {
499 497
            // 请求成功处理...
498
            this.fullLoading = false
500 499
            this.getList()
501 500
            this.polygonDrawer.disable()
502 501
            this.modalData = []
503 502
            this.markName = ''
503
            this.department = null
504 504
            this.$Message.success('操作成功')
505 505
            this.map.removeLayer(this.layer)
506 506
            this.update = false
507 507
          })
508 508
          .catch((res) => {
509
            this.fullLoading = false
509 510
            // 请求失败处理...
510 511
          })
511
      } else {
512
        params.append(
513
          'data',
514
          JSON.stringify({
515
            mapTagName: this.markName,
516
            mapTagType: this.markType,
517
            residenceTimeLength: this.residenceTimeLength,
518
            mapTagShape: arr
519
          })
520
        )
521
512
      } else { // 新增
522 513
        this.update = false
514
        this.fullLoading = true
523 515
        this.$test
524
          .post(services.mapTag.ADD_MAP_TAG, params)
516
          .post(services.mapTag.ADD_MAP_TAG, {
517
            mapAreaName: this.markName,
518
            businessType: this.markType,
519
            mapAreaContent: this.layer.getPoints(),
520
            entityId: this.department,
521
            limitDuration: this.residenceTimeLength ? this.residenceTimeLength : null
522
          })
525 523
          .then((res) => {
526 524
            // 请求成功处理...
525
            this.fullLoading = false
527 526
            this.$Message.success('操作成功')
528 527
            this.map.removeLayer(this.layer)
529 528
            this.polygonDrawer.disable()
@ -533,6 +532,7 @@ export default {
533 532
            this.getList()
534 533
          })
535 534
          .catch((res) => {
535
            this.fullLoading = false
536 536
            // 请求失败处理...
537 537
          })
538 538
      }
@ -569,53 +569,44 @@ export default {
569 569
      this.getList()
570 570
    },
571 571
    handleClick(row) {
572
      var params = new FormData()
573
      params.append(
574
        'data',
575
        JSON.stringify({
576
          mapTagId: row.MAP_TAG_ID
577
        })
578
      )
579 572
      this.$test
580
        .post(services.mapTag.GET_ONE_MAP_TAG, params)
573
        .post(services.mapTag.GET_ONE_MAP_TAG, {
574
          mapTagId: row.mapAreaId
575
        })
581 576
        .then((res) => {
582 577
          // 请求成功处理...
583 578
          this.modalData = []
584
          var coverWktStr_blue = res.data.resultData.MAP_TAG_SHAPE
585
          // debugger
586
          // var arr = coverWktStr_blue.replace('POLYGON((','').split(',')[0].split(' ')
587
          // this.map.setView([arr[1], arr[0]], 10)
588
          console.log(res.data.resultData.MAP_TAG_SHAPE)
589 579
          var color
590
          if (row.MAP_TAG_TYPE == '3') {
580
          if (row.businessType == '3') {
591 581
            color = 'red'
592
          } else if (row.MAP_TAG_TYPE == '2') {
582
          } else if (row.businessType == '2') {
593 583
            color = 'green'
594 584
          } else {
595 585
            color = 'blue'
596 586
          }
597
          var coverLayer_blue = new Ai.Polygon(coverWktStr_blue, {color: color, opacity: 1.0})
587
          var coverLayer = new Ai.Polygon(res.data.resultData.mapAreaContent, {color: color, opacity: 1.0})
598 588
          // this.map.addLayer(coverLayer_blue)
599 589
          // 面设为编辑状态
600
          coverLayer_blue.snapediting = new Ai.PolylineSnap(
590
          coverLayer.snapediting = new Ai.PolylineSnap(
601 591
            this.map,
602
            coverLayer_blue
592
            coverLayer
603 593
          )
604
          coverLayer_blue.snapediting.enable()
605
          this.layer = coverLayer_blue
606
          this.map.addLayer(coverLayer_blue)
594
          coverLayer.snapediting.enable()
595
          this.layer = coverLayer
596
          this.map.addLayer(coverLayer)
607 597
          this.polygonDrawer.editing(this.layer)
608
          this.modalData = coverLayer_blue._latlngs[0]
598
          this.modalData = coverLayer._latlngs[0]
609 599
          this.polygonDrawer.disable()
610 600
          this.map.setViewPort([this.layer])
611 601
        })
612 602
        .catch((res) => {
613 603
          // 请求失败处理...
614 604
        })
615
      this.markName = row.MAP_TAG_NAME
616
      this.markType = parseInt(row.MAP_TAG_TYPE)
617
      this.updateId = row.MAP_TAG_ID
618
      this.residenceTimeLength = row.RESIDENCE_TIME_LENGTH
605
      this.markName = row.mapAreaName
606
      this.markType = row.businessType
607
      this.updateId = row.mapAreaId
608
      this.department = parseInt(row.entityId)
609
      this.residenceTimeLength = row.limitDuration
619 610
      this.addMark = true
620 611
      this.update = true
621 612
      this.polygonDrawer.enable()
@ -694,37 +685,43 @@ export default {
694 685
        that.modalData = coverLayer_blue._latlngs[0]
695 686
        that.polygonDrawer.disable()
696 687
      }
697
      // debugger
698 688
      reader.readAsArrayBuffer(f)
699 689
    },
700 690
    remove(row) {
701
      let that = this
702
      let confirm = {
691
      this.$Confirm.confirm({
703 692
        title: '请确认',
704 693
        content: '删除后不可恢复,确认删除吗?',
705
        ok: function () {
706
          var params = new FormData()
707
          params.append(
708
            'data',
709
            JSON.stringify({
710
              mapTagId: row.MAP_TAG_ID
711
            })
712
          )
713
          // debugger
714
          this.$test
715
            .post(services.mapTag.DEL_MAP_TAG, params)
716
            .then((res) => {
717
              // 请求成功处理...
718
              // debugger
719
              this.$Message.success('操作成功')
720
              that.getList()
721
            })
722
            .catch((res) => {
723
              // 请求失败处理...
724
            })
694
        ok: () => {
695
          this.delete([row.mapAreaId])
725 696
        }
726
      }
727
      this.$Confirm.confirm(confirm)
697
      })
698
    },
699
    handleSelectionChange(val) {
700
      var arr = []
701
      val.forEach(element => {
702
        arr.push(element.mapAreaId)
703
      })
704
      this.selection = arr
705
    },
706
    batchDelete() {
707
      this.delete(this.selection)
708
    },
709
    delete(ids) {
710
      this.fullLoading = true
711
      this.$test
712
        .post(services.mapTag.DEL_MAP_TAG, {
713
          mapTagIds: ids
714
        })
715
        .then((res) => {
716
          // 请求成功处理...
717
          this.fullLoading = false
718
          this.$Message.success('操作成功')
719
          this.getList()
720
        })
721
        .catch((res) => {
722
          this.fullLoading = false
723
          // 请求失败处理...
724
        })
728 725
    }
729 726
  }
730 727
}

+ 4 - 0
ebc-middle-platform/src/modules/system-management/terminal-management.scss

@ -90,4 +90,8 @@
90 90
.submit-button{
91 91
  background-color: #147BD1;
92 92
  color: #ffffff;
93
}
94
.loading--fix{
95
  color: #000;
96
  background-color: rgba(255, 255, 255, 0.8);
93 97
}

+ 7 - 2
location-rescue-service/pom.xml

@ -101,14 +101,19 @@
101 101
                </exclusion>
102 102
            </exclusions>
103 103
        </dependency>
104
104 105
       <!-- uspa登录拦截效验-->
105
        <dependency>
106
<!--        <dependency>
106 107
            <groupId>com.ai.bss</groupId>
107 108
            <artifactId>sso-util</artifactId>
108 109
            <version>1.0.0-RELEASE</version>
110
        </dependency>-->
111
        <dependency>
112
            <groupId>com.wframe</groupId>
113
            <artifactId>sso-util</artifactId>
114
            <version>1.2</version>
109 115
        </dependency>
110 116
111
112 117
        <!-- 缓存 -->
113 118
        <dependency>
114 119
		   <groupId>com.ai.ipu</groupId>

+ 28 - 6
location-rescue-service/src/main/java/com/ai/bss/location/rescue/controller/LocationManagementController.java

@ -1,12 +1,19 @@
1 1
package com.ai.bss.location.rescue.controller;
2 2
3
import java.util.HashMap;
4
import java.util.List;
5
import java.util.Map;
6
7
import org.springframework.beans.factory.annotation.Autowired;
3 8
import org.springframework.stereotype.Controller;
4 9
import org.springframework.web.bind.annotation.RequestBody;
5 10
import org.springframework.web.bind.annotation.RequestMapping;
6 11
import org.springframework.web.bind.annotation.RequestMethod;
7 12
import org.springframework.web.bind.annotation.ResponseBody;
8 13
14
import com.ai.bss.location.rescue.service.impl.LocationManagementServiceImpl;
9 15
import com.ai.bss.location.rescue.util.MirrorSendDateUtil;
16
import com.ai.bss.worker.model.EmployeeTerminalRelaDto;
10 17
11 18
/**
12 19
 * 人员定位管理
@ -17,6 +24,9 @@ import com.ai.bss.location.rescue.util.MirrorSendDateUtil;
17 24
@RequestMapping("/locationManagement")
18 25
public class LocationManagementController {
19 26
27
	@Autowired
28
	LocationManagementServiceImpl locationManagementServiceImpl;
29
20 30
	/**
21 31
	 * 推送镜屏数据测试
22 32
	 * @param msg
@ -25,13 +35,25 @@ public class LocationManagementController {
25 35
	@ResponseBody
26 36
	@RequestMapping(value = "/mirrorSendDataTest", method = RequestMethod.POST)
27 37
	public String mirrorSendDataTest(@RequestBody String msg) {
28
		
38
29 39
		MirrorSendDateUtil.sendData(MirrorSendDateUtil.topic_personnel, msg);
30
		
40
31 41
		return msg;
32 42
	}
33
	
34
	
35
	
36
	
43
44
	/**
45
	 * 获取已绑定终端的人员列表
46
	 * @return
47
	 */
48
	@ResponseBody
49
	@RequestMapping("/queryEmployeeBindDeviceList")
50
	public Map<String, Object> queryEmployeeBindDeviceList() {
51
		Map<String, Object> result = new HashMap<String, Object>();
52
		List<EmployeeTerminalRelaDto> resultList = locationManagementServiceImpl.queryEmployeeBindDeviceList();
53
54
		result.put("dataList", resultList);
55
56
		return result;
57
	}
58
37 59
}

+ 19 - 1
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/impl/LocationManagementServiceImpl.java

@ -1,16 +1,34 @@
1 1
package com.ai.bss.location.rescue.service.impl;
2 2
3
import java.util.List;
4
3 5
import org.slf4j.Logger;
4 6
import org.slf4j.LoggerFactory;
7
import org.springframework.beans.factory.annotation.Autowired;
5 8
import org.springframework.stereotype.Service;
6 9
10
import com.ai.abc.api.model.CommonRequest;
11
import com.ai.abc.api.model.CommonResponse;
7 12
import com.ai.bss.location.rescue.service.interfaces.LocationManagementService;
13
import com.ai.bss.worker.model.EmployeeTerminalRelaDto;
14
import com.ai.bss.worker.service.api.EmployeeTerminalRelaQuery;
8 15
9 16
@Service
10 17
public class LocationManagementServiceImpl implements LocationManagementService {
11 18
	Logger logger = LoggerFactory.getLogger(LocationManagementServiceImpl.class);
12 19
20
	@Autowired
21
	EmployeeTerminalRelaQuery employeeTerminalRelaQuery;
13 22
	
14
	
23
	@Override
24
	public List<EmployeeTerminalRelaDto> queryEmployeeBindDeviceList() {
25
		  String entityId = "0000"; //TODO 组织id
26
		  //根据组织编码查询该组织下绑定了终端的人员信息, 组织编码为空查询所有人员
27
		  CommonRequest<String> param = CommonRequest.<String>builder().data(entityId).build();
28
		  
29
		  CommonResponse<List<EmployeeTerminalRelaDto>> commonResponse = employeeTerminalRelaQuery.queryIndividualDevRelaByOrgCode(param);
30
		
31
		return commonResponse.getData();
32
	}
15 33
	
16 34
}	

+ 10 - 0
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/interfaces/LocationManagementService.java

@ -1,5 +1,9 @@
1 1
package com.ai.bss.location.rescue.service.interfaces;
2 2
3
import java.util.List;
4
5
import com.ai.bss.worker.model.EmployeeTerminalRelaDto;
6
3 7
/**
4 8
 * 人员定位管理
5 9
 * @author konghl@asiainfo.com
@ -7,4 +11,10 @@ package com.ai.bss.location.rescue.service.interfaces;
7 11
 */
8 12
public interface LocationManagementService {
9 13
14
	/**
15
	 * 获取已绑定终端的人员列表
16
	 * @return
17
	 */
18
	List<EmployeeTerminalRelaDto> queryEmployeeBindDeviceList();
19
10 20
}

+ 18 - 0
location-rescue-service/src/main/resources/application.properties

@ -17,6 +17,24 @@ spring.jpa.properties.hibernate.format_sql=true
17 17
spring.jpa.properties.hibernate.generate_statistics=false
18 18
spring.main.allow-bean-definition-overriding=true
19 19
20
#kafka
21
spring.kafka.bootstrap-servers=47.105.160.21:9090
22
spring.kafka.producer.retries=0
23
spring.kafka.producer.batch-size=16384
24
spring.kafka.producer.buffer-memory=33554432
25
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
26
spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
27
spring.kafka.consumer.group-id=spring-boot-demo
28
spring.kafka.consumer.enable-auto-commit=false
29
spring.kafka.consumer.auto-offset-reset=latest
30
spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer
31
spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.StringDeserializer
32
spring.kafka.consumer.properties.session.timeout.ms=60000
33
spring.kafka.listener.log-container-config=false
34
spring.kafka.listener.concurrency=5
35
spring.kafka.listener.ack-mode=manual-immediate
36
37
20 38
# CACHE
21 39
#spring.cache.type=ehcache
22 40
#spring.cache.ehcache.config=ehcache.xml