wangzhibo
昨天 6484c72be4230e89ab45dc928250de9d5f3326ca
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { Body, Inject, Post } from '@midwayjs/core';
import { CoolController, BaseController } from '@cool-midway/core';
import { MapsLiveService } from '../../service/live';
 
/**
 * 地图实时位置与轨迹
 */
@CoolController()
export class AdminMapsLiveController extends BaseController {
  @Inject()
  mapsLiveService: MapsLiveService;
 
  @Post('/sites', { summary: '站点地图点位' })
  async sites() {
    return this.ok(await this.mapsLiveService.sites());
  }
 
  @Post('/siteWeight', { summary: '站点称重历史' })
  async siteWeight(
    @Body('businessId') businessId: string,
    @Body('startTime') startTime: string,
    @Body('endTime') endTime: string
  ) {
    return this.ok(await this.mapsLiveService.siteWeight(businessId, startTime, endTime));
  }
 
  @Post('/sorterOnline', { summary: '在线分拣员位置' })
  async sorterOnline() {
    return this.ok(await this.mapsLiveService.sorterOnline());
  }
 
  @Post('/sorterTrack', { summary: '分拣员历史轨迹' })
  async sorterTrack(
    @Body('idCard') idCard: string,
    @Body('startTime') startTime: string,
    @Body('endTime') endTime: string
  ) {
    return this.ok(await this.mapsLiveService.sorterTrack(idCard, startTime, endTime));
  }
 
  @Post('/sorterHealth', { summary: '分拣员健康与告警' })
  async sorterHealth(@Body('idCard') idCard: string) {
    return this.ok(await this.mapsLiveService.sorterHealth(idCard));
  }
 
  @Post('/vehicleOnline', { summary: '在线车辆位置' })
  async vehicleOnline() {
    return this.ok(await this.mapsLiveService.vehicleOnline());
  }
 
  @Post('/vehicleTrack', { summary: '车辆历史轨迹' })
  async vehicleTrack(
    @Body('vehicleNo') vehicleNo: string,
    @Body('startTime') startTime: string,
    @Body('endTime') endTime: string
  ) {
    return this.ok(await this.mapsLiveService.vehicleTrack(vehicleNo, startTime, endTime));
  }
 
  @Post('/vehicleEvents', { summary: '车辆司机行为消息' })
  async vehicleEvents(@Body('vehicleNo') vehicleNo: string) {
    return this.ok(await this.mapsLiveService.vehicleEvents(vehicleNo));
  }
}