Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

資料分析-A. 相機工作時數 #296

Open
moogoo78 opened this issue Nov 12, 2019 · 2 comments
Open

資料分析-A. 相機工作時數 #296

moogoo78 opened this issue Nov 12, 2019 · 2 comments
Labels
v2.0 tasks to be considered in V2

Comments

@moogoo78
Copy link
Contributor

moogoo78 commented Nov 12, 2019

行程管理中所設定的相機有效開始工作時間及結束時間的範圍相減,計算至小時。
Screen Shot 2019-11-06 at 15 33 42

參數:選取之時間範圍全部 / 每月

指標計算輸出格式_20190830_更正存缺回合長度為天的參數設定.xlsx
指標輸出規劃_表與圖_20190830.xlsx

@kelp404
Copy link
Collaborator

kelp404 commented Nov 16, 2019

功能是這樣對嗎?

要做兩個 API,輸入欄位都有 project id,計算總時數的 API 還需要開始時間結束時間

計算每月工作時數:
螢幕快照 2019-11-12 下午11 06 52
從 ProjectTripModel 以 studyAreas.cameraLocations.cameraLocation 以及月份做 group-by,統計每個月的 startActiveDate 到 endActiveDate 經過的小時數。

計算範圍內總時數:
螢幕快照 2019-11-12 下午11 06 22
從 ProjectTripModel 以 studyAreas.cameraLocations.cameraLocation 做 group-by 在時間範圍內統計 startActiveDate 到 endActiveDate 經過的小時數。

  {
    "_id": "5dce51a92910eb3efeca32f4",
    "project": "5dce48ce2910eb2f12ca315b",
    "sn": "去高雄好開心01",
    "date": "2011-07-19T00:00:00.000Z",
    "member": "吳敦義",
    "mark": "國家機器動得好厲害",
    "studyAreas": [
      {
        "cameraLocations": [
          {
            "projectCameras": [
              {
                "_id": "5dce51a92910eb0137ca32f7",
                "cameraSn": "TEST1115002",
                "cameraState": "active",
                "cameraBatteryType": "鎳氫電池(充電電池)",
                "cameraBatteryRemainingCapacity": "0.01",
                "cameraBrightness": "自動",
                "cameraSensitivity": "",
                "cameraVideoLength": 0.333333,
                "cameraContinuousShots": 2,
                "startActiveDate": "2011-10-06T00:00:00.000Z",
                "endActiveDate": "2011-08-18T00:00:00.000Z",
                "cameraPosition": "30",
                "cameraDepressionAngle": "88",
                "cameraSensingDistance": 65,
                "cameraMemoryCardNumber": 30,
                "cameraMark": "很好很好"
              }
            ],
            "_id": "5dce51a92910eb33faca32f6",
            "cameraLocation": "5dce4b1c2910eb04daca31fc",
            "title": "CF-13",
            "cameraLocationEvent": "setting",
            "cameraLocationMark": "高雄市政府男廁"
          }
        ],
        "_id": "5dce51a92910eb8aa1ca32f5",
        "studyArea": "5dce4a852910ebd566ca31e2",
        "title": "高雄市政府"
      }
    ],
    "createTime": "2019-11-15T07:20:09.688Z",
    "updateTime": "2019-11-15T07:20:09.689Z",
    "__v": 0
  }

@ts00617355
Copy link
Collaborator

輸入欄位

  1. 都有 project id (array)
  2. 開始時間 start_time、結束時間 end_time
  3. 基本上 filter 的條件都要有 (但若太多、其他條件可先不加、之後我們再 query 加上)
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2.0 tasks to be considered in V2
Projects
None yet
Development

No branches or pull requests

3 participants