Skip to content

meetjeff/ERP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ERP system

直覺易用、智能分析、雙向互動的人力資源管理與潛在訂單追蹤系統,降低組織導入成本,高維度的數據分析,更有效率的洞見缺失與機會。

🧑‍💻 Backend Developer | Architect

學習資源

demo.mp4

Landing Page

🔗 人力資源管理 : http://hr.foresii.com
🔗 潛在訂單追蹤 : http://crm.foresii.com

Product Launch

IMAGE ALT TEXT

Skills

🔧 Nginx 靜態渲染、設定網域轉發與反向代理
🔧 X-Forwarded-For 將客戶端 IP 傳送至後端主機紀錄
🔧 Flask 建置推薦系統及 RESTful API,subprocess 異步觸發爬蟲程序
🔧 Gunicorn 架設後端 WSGI server, gevent worker 實現 coroutine
🔧 Systemd 運行 Linux daemon service,Crontab 排程管理

API

/api_doc

-GET-

api documentation

/login

-GET-

自動帶入基本資料 ( 群組、姓名、ID、Email )

Input Parameters :

  • group   ( 班級,e.g., fn101 )
  • name    ( 姓名,不分大小寫,e.g., jeff )

Success Example

{
  "data": {
    "Class": "DV102",
    "Email": "jill@ntc.im",
    "Id": 2,
    "Name": "Albee"
  },
  "datatime": "2022-07-31T19:28:18.829190",
  "message": "success"
}
-POST-

登入 ( 群組、帳號、密碼 )
Return Authorization Bearer Token

Input Parameters :

  • group    ( 群組。企業用戶 : ent,管理者 : manager,一般使用者 : 班級,e.g., fn101 )
  • account    ( 姓名,不分大小寫,e.g., jeff )
  • password     ( 密碼,區分大小寫,e.g., Jeff123 )

Success Example

{
  "data": {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTY1OTIxMzM5NiwianRpIjoiNmZlNmMzYmQtMTc5YS00YmY1LTg0N2EtYjM0ZWJlMjUxYjgzIiwidHlwZSI6ImFjY2VzcyIsInN1YiI6W3siQWNjZXNzIjoiMSIsIkNsYXNzIjoiZm4xMDEiLCJOYW1lIjoiQW15In1dLCJuYmYiOjE2NTkyMTMzOTYsImV4cCI6MTY1OTIxNjk5Nn0.UhUCdVkuCfTVjxtfWhnFjL8S6lSQWsU5n2U3XgAh8VM",
    "message": "Welcome Amy"
  },
  "datatime": "2022-07-30T20:36:36.432231",
  "message": "success"
}

/count

-GET、POST-

依班級、姓名、當日或當月、日期範圍篩選統計數字
( 每日遲到、早退、缺席、未打卡、請假、出席數,應出席、出席、缺席、請假時數,範圍總合及總人數 )

Input Parameters :

  • group   ( 班級,e.g., fn101 )
  • name    ( 姓名,不分大小寫,e.g., jeff )
  • cur      ( 當日或當月。當日 : today,當月 : month )
  • startdate ( 起始日期,e.g., 2022-01-01 )
  • stopdate ( 結束日期,e.g., 2022-01-01 )

Success Example

{
  "data": [
    {
      "absent": 5,
      "attendancehours": "190.5832",
      "day": "2022-04-11",
      "excused": 2,
      "lackhours": "72.9168",
      "late": 11,
      "leave": 1,
      "leavehours": "8.5000",
      "miss": 3,
      "number of people": 31,
      "regular": 13,
      "totalhours": "263.5000"
    },
    .
    .
    .
    {
      "absent": 21,
      "attendancehours": "33.9333",
      "day": "2022-05-26",
      "excused": 1,
      "lackhours": "198.5667",
      "late": 5,
      "leave": 0,
      "leavehours": "0.0000",
      "miss": 4,
      "number of people": 31,
      "regular": 3,
      "totalhours": "232.5000"
    },
    {
      "absent": 864,
      "attendancehours": "17547.1662",
      "day": "total",
      "excused": 113,
      "lackhours": "8996.3338",
      "late": 872,
      "leave": 29,
      "leavehours": "145.5000",
      "miss": 166,
      "number of people": 31,
      "regular": 1444,
      "totalhours": "26543.5000"
    }
  ],
  "datatime": "2022-07-22T05:41:36.720744",
  "message": "success"
}

/course

-GET、POST-

依班級、姓名、當日或當月、日期範圍、進行狀態篩選課程
( 各課程總時數、出席時數、總課程時數、課程總數、已進行課程數、課程學習資源 )

Input Parameters :

  • group   ( 班級,e.g., fn101 )
  • name    ( 姓名,不分大小寫,e.g., jeff )
  • cur      ( 當日或當月。當日 : today,當月 : month )
  • startdate ( 起始日期,e.g., 2022-01-01 )
  • stopdate ( 結束日期,e.g., 2022-01-01 )
  • status   ( 課程狀態。已進行 : progress,未開始 : unfinished )
  • course  ( 課程名稱,獲取該課程學習資源 )

Success Example

{
  "data": {
    "course": [
      {
        "course": "JS與Node.js",
        "present": "182.7501",
        "totalhours": "217"
      },
      {
        "course": "個人網頁專題製作",
        "present": "166.4500",
        "totalhours": "217"
      }
    ],
    "total": [
      {
        "progress": 34,
        "totalcourse": 34,
        "totalhours": "697"
      }
    ]
  },
  "datatime": "2022-07-11T07:52:01.456255",
  "message": "success"
}

Input course

{
  "data": {
    "article": [
      {
        "title": "鳥哥私房菜 - Linux 伺服器篇各年份各版本的學習資料",
        "url": "https://linux.vbird.org/linux_server/"
      },
      {
        "title": "鳥哥私房菜 - 第一章、架設伺服器前的準備工作",
        "url": "https://linux.vbird.org/linux_server/centos6/0105beforeserver.php"
      },
      {
        "title": "ubuntu 基礎架站 - Alvin Chen Club",
        "url": "http://www.alvinchen.club/2018/04/12/ubuntu-%E5%9F%BA%E7%A4%8E%E6%9E%B6%E7%AB%99/"
      }
    ],
    "video": [
      {
        "url": "https://www.youtube.com/embed/m7meyDFDGMo"
      },
      {
        "url": "https://www.youtube.com/embed/brP8mgNeg0Q"
      },
      {
        "url": "https://www.youtube.com/embed/BH_2h2ZPVu8"
      }
    ]
  },
  "datatime": "2022-07-23T18:42:49.404920",
  "message": "success"
}

/crawler

-GET-

查看學習資源爬蟲執行狀態 ( 班級、影片、文章、最後更新時間 )

Input Parameters :

  • group   ( 班級,e.g., fn101 )

Success Example

{
  "articles": "in progress",
  "date": "Sat, 23 Jul 2022 18:57:53 GMT",
  "groups": "fn102",
  "videos": "finished"
}
-POST-

手動執行學習資源爬蟲 ( 課表上傳成功會自動觸發 )

Input Parameters :

  • group   ( 班級,e.g., fn101 )

Success Example

{
  "articles": "in progress",
  "date": "Sat, 23 Jul 2022 18:56:09 GMT",
  "groups": "fn102",
  "videos": "in progress"
}

/curriculum

-GET-

依班級、月份篩選課表 ( 日期、時段、課程、時數、教室 )

Input Parameters :

  • group   ( 班級,e.g., fn101 )
  • month  ( 月份,e.g., 2022-04 )

Success Example

{
  "data": [
    {
      "classroom": "123",
      "course": "產品設計輔導",
      "date": "2022-04-01",
      "hours": 3,
      "part": "AM"
    },
    .
    .
    .
    {
      "classroom": "123",
      "course": "企業實習",
      "date": "2022-04-29",
      "hours": 3,
      "part": "PM"
    }
  ],
  "datatime": "2022-07-11T08:02:59.941018",
  "message": "success"
}
-POST-

依班級上傳課表 ( 課程、日期、時起、分起、時訖、分訖、教室 )
上傳成功後觸發學習資源爬蟲

Input Parameters :

  • group   ( 班級,e.g., fn101 )
  • file      ( 課表csv檔、6欄、utf-8編碼,e.g., 課表.csv )

Success Example ( 返回更新後的課表及爬蟲啟動狀態、時間 )

{
  "data": {
    "crawlerstatus": {
      "articles": "in progress",
      "groups": "fn101",
      "updatetime": "Tue, 09 Aug 2022 16:08:58 GMT",
      "videos": "in progress"
    },
    "curriculum": [
      {
        "classroom": "302",
        "course": "開訓典禮",
        "date": "2021-12-15",
        "hours": 3,
        "part": "AM"
      },
    .
    .
    .
      {
        "classroom": "209",
        "course": "產品實做",
        "date": "2022-05-26",
        "hours": 3,
        "part": "PM"
      }
    ]
  },
  "datatime": "2022-07-23T18:45:42.354838",
  "message": "success"
}

/leave

-GET-

依班級、姓名、當日或當月、日期範圍、假別篩選請假列表 ( 姓名、日期、時段、假別、原因 )

Input Parameters :

  • group   ( 班級,e.g., fn101 )
  • name    ( 姓名,不分大小寫,e.g., jeff )
  • cur      ( 當日或當月。當日 : today,當月 : month )
  • startdate ( 起始日期,e.g., 2022-01-01 )
  • stopdate ( 結束日期,e.g., 2022-01-01 )
  • leavetype   ( 假別,e.g., 病假 )

Success Example

{
  "data": [
    {
      "date": "2022-03-29",
      "name": "Mia",
      "reason": "驗PCR\r\n",
      "time": "上午 9:00 ~ 12:00",
      "type": "特殊原因"
    },
    {
      "date": "2022-03-29",
      "name": "Peter",
      "reason": "no reason",
      "time": "下午 13:30~ 課程結束",
      "type": "病假"
    }
  ],
  "datatime": "2022-07-11T07:14:13.042239",
  "message": "success"
}
-POST-

依班級上傳請假表單 ( 姓名、日期、時段、假別、原因 )

Input Parameters :

  • group   ( 班級,e.g., fn101 )
  • file      ( 請假csv檔、5欄、utf-8編碼,e.g., 請假.csv )

Success Example ( 返回更新後的請假表單 )

{
  "data": [
    {
      "date": "2022-03-29",
      "name": "Mia",
      "reason": "驗PCR\r\n",
      "time": "上午 9:00 ~ 12:00",
      "type": "特殊原因"
    },
    .
    .
    .
    {
      "date": "2022-03-29",
      "name": "Peter",
      "reason": "no reason",
      "time": "下午 13:30~ 課程結束",
      "type": "病假"
    }
  ],
  "datatime": "2022-07-11T07:14:13.042239",
  "message": "success"
}

/punch

-GET、POST-

依班級、姓名、當日或當月、日期範圍、打卡狀態篩選出缺勤列表
( 日期、姓名、簽到、簽退、簽到ip、簽退ip、打卡狀態 )
可依單頁筆數進行分頁篩選 ( 回傳總筆數、總頁數 )

Input Parameters :

  • group   ( 班級,e.g., fn101 )
  • name    ( 姓名,不分大小寫,e.g., jeff )
  • cur      ( 當日或當月。當日 : today,當月 : month )
  • startdate ( 起始日期,e.g., 2022-01-01 )
  • stopdate ( 結束日期,e.g., 2022-01-01 )
  • status    ( 打卡狀態。遲到 : late,早退 : excused,缺席 : absent,未打卡 : miss )
  • rows   ( 單頁顯示筆數,預設30,e.g., 100 )
  • page   ( 第幾頁,預設1,e.g., 20 )

Success Example

{
  "data": {
    "pagination": [
      {
        "totalpages": "67",
        "totalrows": 3348
      }
    ],
    "punch": [
      {
        "classdate": "2022-01-24",
        "inip": "61.66.146.110",
        "intime": "09:28:33",
        "outip": "61.66.147.98",
        "outtime": "17:37:23",
        "status": "late",
        "student": "JiaRong"
      },
      .
      .
      .
      {
        "classdate": "2022-01-21",
        "inip": "140.137.222.59",
        "intime": "08:41:04",
        "outip": "140.137.222.59",
        "outtime": "17:37:45",
        "status": "present",
        "student": "Max"
      }
    ]
  },
  "datatime": "2022-07-11T10:28:51.722611",
  "message": "success"
}