Git Product home page Git Product logo

kot_auto_input's Introduction

Open in Visual Studio Code Prettier And Test npm version

AUTO KING OF TIME

You don't want to manage double attendance management, do you?
If your company's attendance management tool is "KING OF TIME", you may be able to solve it with this tool.


勤怠管理を二重に管理をしていないでしょうか?
あなたの会社の勤怠管理ツールが「KING OF TIME」なら、このツールで解決できるかもしれません。

Description

Reports that require daily, weekly and monthly input.

common for SES engineers
In many cases, there are separate attendance management methods for the site and the company
In addition, there may even be separate submission methods.

Such trivial problems in the company
I am creating this tool in the hope that it will be of some help.


毎日、毎週、毎月入力が必要な報告書。

SESエンジニアにとってはよくある
現場と自社で別々の勤怠管理方法であることが多く
更には別々の提出方法が存在することさえあります。

そんな社内でのささいな問題を
このツールが少しでも役に立てればと思い作成しています。

Demo

AUTO_KING_OF_TIME.mp4

Requirement

▶︎ Node.js v16.16.0

Setup

The following procedure summarizes the preparations and preparations in advance

  1. Move this repository to your preferred working directory and git clone

  2. Install modules to run the cloned code

npm install
npx playwright install chromium
  1. Create a .env file with the information necessary for your login with 'KING OF TIME' and set environment variables

    3-1. Copy .env.example to create .env file

    3-2. Add your 'KING OF TIME' login account information to KOT_LOGIN_ID and KOT_LOGIN_PASSWORD in the copied .env file

  2. Output the separately managed attendance management file (a file containing attendance hours etc. outside the company) in CSV format
    *If the format of your attendance report and the format do not match, there are examples on the Wiki tab in this GitHub, so please use that.

  3. If you can match the format, change the CSV file name to input.csv

  4. Place the CSV file of 5. directly under the cloned PJ (directly under the kot_auto_input directory)

Now that the preparations have been completed, please proceed with the Usage item.


事前に準備、用意する内容を以下の手順でまとめました

  1. このリポジトリをあなたの好きな作業ディレクトリに移動した後 git clone します

  2. クローンしたコードを動かすためのモジュールをインストールします

npm install
npx playwright install chromium
  1. 'KING OF TIME'でご自身のログインに必要な情報を .env ファイルを作成後、環境変数を設定します

    3-1. .env.example をコピーして .env ファイルを作成します

    3-2. コピーした .env ファイルの KOT_LOGIN_ID , KOT_LOGIN_PASSWORD に自身の 'KING OF TIME' のログインアカウント情報を加えます

  2. 別で管理している勤怠管理のファイル(自社以外で出勤時間などを記入しているファイル)をCSV形式で出力します
    ※もし、お手持ちの勤怠報告書とフォーマットが大きくずれて合わない場合には、このGitHub内のWikiタブに例を載せていますのでそちらをご使用ください

  3. フォーマットを合わせることができましたら、CSVのファイル名を input.csv に変更してください

  4. 5.のCSVファイルをクローンしたPJ直下(kot_auto_inputディレクトリ直下)に配置してください

以上で事前に準備する内容は完了ですので Usage の項目を実施してください。

Usage

npx ts-node main.ts

License

MIT

kot_auto_input's People

Contributors

ht0323 avatar vanriiiii avatar

Stargazers

Chiba-k avatar Roman avatar  avatar  avatar

Watchers

 avatar

kot_auto_input's Issues

勤怠情報をループで処理できるか動作確認

勤怠情報が格納されている仮の変数objectを作成、これは今後CSVファイルから読み込んだ値で動的に作成できる様に修正を加える
細かい仕様は後で調整する、一旦は下記のobjectをループで処理できるか確認する。

{
    /** 日付 */
    "3": {
      /** 勤務開始時刻 */
      startTime: "1000",

      /** 勤務終了時刻 */
      endTime: "1930",
    },
}

README.mdの作成

README.mdを作成し下記内容を記述する。

  • 必要実行環境
  • セットアップ手順
  • 実行方法

実行結果のスクショ周りの修正

  • example.pngの画像名をresult.pngに変更
  • スクショに画面全体が収まっていないので画面全体が撮れるようにスクショの撮り方を変更する
  • .gitignoreにresult.pngを追加する

ファイルの分離

main.tsからブラウザ操作処理を別ファイルに切り出しmain.tsから処理を呼びように変更する

勤怠情報が入力済みの状態でもツールを動かせるようにする

現状は勤怠情報が入力済みの場合、要素名が変わるのでツールが動かなくなる。
入力済みの状態で再度ツールを動かした場合にimportした情報と入力済みの情報とを比較して勤怠情報に相違がある場合は、importした情報で書き換えるようにツールを動かす。

CSV読み込み処理の正常パターンの実装

  • 本実装はmain.tsとは別ファイルに関数として切り出して定義する。
  • 関数の引数としてはファイル名を貰い、返り値としてはObjectを返却する(Objectの構造について詳しくはコメント追記)
  • CSVファイルの開始時間、終了時間、休憩時間、作業時間、作業内容が全て記入済みの行を打刻対象として扱う
  • 休日など稼働日ではないその日は、返却値であるObjectには含めない

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.