日程表を表示するためのデータを取得するAPI
返却する際に下記の条件によって上から順に担当者の順番を並び替える
| schedule_date required | string 取得対象日 |
{- "message": "Success",
- "data": [
- {
- "id": 1,
- "site_status": 1,
- "order_id": 1,
- "informal_site_name": "A現場",
- "user_name": [
- "田中",
- "佐藤",
- "鈴木"
]
}, - {
- "id": 2,
- "site_status": 1,
- "order_id": 2,
- "informal_site_name": "B現場",
- "user_name": [
- "吉田",
- "山田"
]
}, - {
- "id": 4,
- "site_status": 2,
- "order_id": null,
- "informal_site_name": null,
- "user_name": [
- "高橋"
]
}
]
}日程を登録するAPI
site_status が 1 の場合は order_id は必須
departure_time HH:MM:00
is_processing_work がリクエストに存在しない場合は false と同様に扱う
| schedule_date required | string 日程対象日(登録年月日) |
| site_status required | integer 現場ステータス 1:現場 2:学校 3:休み |
| order_id | integer Nullable 受注ID、現場ステータスが1の場合は必須 |
| user_id required | Array of integers 従業員のIDを配列で渡す |
| departure_time | string Nullable 出発時間 |
| is_processing_work | integer Nullable 加工作業フラグ 1(true) or 0(false) |
| other_contacts | string Nullable その他連絡事項 |
{ "schedule_date": "2022-05-01", "site_status": 1, "order_id": 4, "user_id": [ 1, 3, 6 ], "departure_time": null, "is_processing_work": 0, "other_contacts": null }
{- "message": "OK",
- "data": { }
}{- "message": "Success",
- "data": {
- "schedule_id": 1,
- "schedule_date": "2022-05-01",
- "site_status": 1,
- "order_id": 1,
- "user_id": [
- 1,
- 2,
- 3,
- 4
], - "departure_time": null,
- "is_processing_work": true,
- "other_contacts": null
}
}日程を更新するAPI
| id required | integer 日程ID |
| schedule_date | string 対象日 |
| site_status | integer 現場ステータス |
| order_id | integer Nullable 受注ID(現場ステータスが1のときのみ必須) |
| user_id | Array of integers 従業員ID配列 |
| departure_time | string Nullable 出発時間 |
| is_processing_work | boolean 加工作業フラグ |
| other_contacts | string Nullable その他連絡事項 |
{ "schedule_date": "2022-05-01", "site_status": 2, "order_id": null, "user_id": [ 5, 9 ], "departure_time": null, "is_processing_work": false, "other_contacts": null }
{- "message": "OK",
- "data": { }
}例:登録対象日が月曜日、前回登録が金曜日だった場合、金曜日のデータをコピーする
| schedule_date required | string 登録対象日 |
{- "message": "Success",
- "data": [
- {
- "id": 1,
- "site_status": 1,
- "informal_site_name": "A現場",
- "user_name": [
- "田中",
- "佐藤",
- "鈴木"
]
}, - {
- "id": 2,
- "site_status": 1,
- "informal_site_name": "B現場",
- "user_name": [
- "吉田",
- "山田"
]
}, - {
- "id": 4,
- "site_status": 2,
- "informal_site_name": null,
- "user_name": [
- "高橋"
]
}
]
}日程登録/更新時に使用する
ユーザ種別(user_kind)が作業員(2)のデータのみを返却する
ソート順
| schedule_date required | string 日程対象日 |
| schedule_id | integer 日程ID |
{- "message": "Success",
- "data": [
- {
- "id": 1,
- "user_name": "鈴木",
- "employment_classification": 1,
- "is_in_use": true
}, - {
- "id": 2,
- "user_name": "山田",
- "employment_classification": 1,
- "is_in_use": true
}, - {
- "id": 4,
- "user_name": "佐藤",
- "employment_classification": 2,
- "is_in_use": false
}, - {
- "id": 3,
- "user_name": "斎藤",
- "employment_classification": 3,
- "is_in_use": true
}
]
}略称現場名を取得して返却する
受注ID(order_id)がnullまたはパラメータが存在しない場合
受注ID(order_id)が指定されている場合
is_aggregateがtrueの場合は集計用現場名を返却する(全件返却)
※ schedule_date が指定されていない場合、対象日は当日とする
| schedule_date | string 登録・編集対象日 |
| order_id | integer 受注ID |
| is_aggregate | boolean 集計用か |
{- "message": "Success",
- "data": [
- {
- "id": 1,
- "informal_site_name": "A現場"
}, - {
- "id": 2,
- "informal_site_name": "B現場"
}
]
}対象日の連絡事項を取得する
日程別連絡事項も同時に取得する
出発時間がある場合
「現場名 時間 出発」
加工作業フラグがtrueの場合
「現場名 加工」
その他連絡事項がある場合
「現場名 連絡事項」
| schedule_date required | string 日程対象日 |
{- "message": "Success",
- "data": {
- "id": 1,
- "contact_info": "山本、中村は休み",
- "schedule_contact_info": [
- "A現場 加工",
- "B現場 9:00 出発",
- "C現場 防塵マスクを忘れずに"
]
}
}対象日の連絡事項を登録する
| schedule_date required | string 登録対象日 |
| contact_info | string 連絡事項 |
{ "schedule_date": "2022-05-01", "contact_info": "田中、中村は休み" }
{- "message": "OK",
- "data": { }
}対象日の連絡事項を更新する
| id required | integer 連絡事項ID |
| contact_info | string 連絡事項 |
{ "contact_info": "田中、中村が休み" }
{- "message": "OK",
- "data": { }
}受注一覧を取得するAPI
IDの降順
デフォルト(初回表示)の返却
当月以前に受注されているかつステータスが完了になっていない受注を全て返却する
検索機能
年月: デフォルト当月
受注開始日が年月以前の受注を絞り込んで返却する
受注ステータス: デフォルト空(null)
パラメータで受注ステータスが指定されている場合は受注ステータスで絞り込んで返却する
受注(2) 出来高(3) 請求済み(4) 工事完了(6) 完了(5)
顧客ID: デフォルト空(null)
指定されている場合は顧客IDに一致する受注を絞り込んで返却する
完了した受注を表示:デフォルトfalse
true の場合は完了した受注を含めて返却する
※年月が指定されている場合、年月よりも完了日が前の場合は表示しない
パラメータが一つも指定されていない場合は未完了の受注を全件返却する
複数パラメータが指定された場合はそのすべてに一致する受注を返却する(AND)
(実装中に仕様が変わる可能性有)
| search_date | string 検索年月(初期値当月) |
| order_status | string 検索受注ステータス |
| client_id | string 顧客ID |
| is_show_completed | string 完了した受注を表示するか否か |
{- "message": "Success",
- "data": [
- {
- "id": 2,
- "client_name": "株式会社BBB",
- "informal_site_name": "BBB",
- "order_status": 2
}, - {
- "id": 1,
- "client_name": "株式会社AAA",
- "informal_site_name": "AAA",
- "order_status": 2
}
]
}受注を登録するAPI
※リクエスト以外の保存内容
orders.order_start_date に作成日(現在の日付)を入れる
受注ステータスが完了の場合 orders.completed_date に現在の日付を入れる
| client_id required | integer 顧客ID |
| client_contact_name | string <= 20 characters 担当者(顧客) |
| formal_site_name | string <= 100 characters 現場名(正式名称) |
| informal_site_name required | string <= 50 characters 現場名(略称) |
| estimated_number | string <= 255 characters 見積もり番号 |
| user_id | integer 従業員ID |
| estimated_amount | string <= 15 characters 見積金額 |
| contract_amount | string <= 15 characters 請負金額 |
| exists_purchase_order required | boolean 注文書ありフラグ |
| construction_start_date required | string 工期開始日 |
| construction_end_date required | string 工期終了日 |
| complete_plan_date | string 完成予定日 |
| personal_cost | string <= 15 characters 人件費単位 |
| order_status required | integer 受注ステータス:受注(2) 出来高(3) 請求済み(4) 工事完了(6) 完了(5) |
{- "client_id": 1,
- "client_contact_name": "斎藤",
- "formal_site_name": "AAA案件A現場名",
- "informal_site_name": "A現場",
- "estimated_number": "1",
- "user_id": 1,
- "estimated_amount": "10000000",
- "contract_amount": "9000000",
- "exists_purchase_order": true,
- "construction_start_date": "2020-01-01",
- "construction_end_date": "2020-12-31",
- "complete_plan_date": "2020-12-25",
- "personal_cost": "25000",
- "order_status": 1
}{- "message": "OK",
- "data": { }
}{- "id": 1,
- "client_id": 1,
- "client_contact_name": "田中",
- "formal_site_name": "AAA現場",
- "informal_site_name": "A現場",
- "estimated_number": "1",
- "user_id": 1,
- "estimated_amount": "10000000",
- "contract_amount": "9000000",
- "exists_purchase_order": true,
- "construction_start_date": "2022-06-01",
- "construction_end_date": "2023-06-01",
- "complete_plan_date": "2023-06-30",
- "personal_cost": "50000",
- "order_status": 1
}受注を更新するAPI
完了ステータス以外から完了に変更された場合、orders.complete_date に現在の日付を入れる
完了ステータスからそれ以外に変更された場合、orders.complete_date に null を入れる
| id required | integer 受注ID |
| client_id required | integer 顧客ID |
| client_contact_name | string <= 20 characters 担当者(顧客) |
| formal_site_name | string <= 100 characters 現場名(正式名称) |
| informal_site_name required | string <= 50 characters 現場名(略称) |
| estimated_number | string <= 255 characters 見積もり番号 |
| user_id | integer 従業員ID |
| estimated_amount | string <= 15 characters 見積金額 |
| contract_amount | string <= 15 characters 請負金額 |
| exists_purchase_order required | boolean 注文書ありフラグ |
| construction_start_date required | string 工期開始日 |
| construction_end_date required | string 工期終了日 |
| complete_plan_date | string 完成予定日 |
| personal_cost | string <= 15 characters 人件費単位 |
| order_status required | integer 受注ステータス:受注(2) 出来高(3) 請求済み(4) 工事完了(6) 完了(5) |
{- "client_id": 1,
- "client_contact_name": "斎藤",
- "formal_site_name": "AAA案件A現場名",
- "informal_site_name": "A現場",
- "estimated_number": "1",
- "user_id": 1,
- "estimated_amount": "10000000",
- "contract_amount": "9000000",
- "exists_purchase_order": true,
- "construction_start_date": "2020-01-01",
- "construction_end_date": "2020-12-31",
- "complete_plan_date": "2020-12-25",
- "personal_cost": "25000",
- "order_status": 1
}{- "message": "OK",
- "data": { }
}{- "message": "Success",
- "data": [
- {
- "id": 1,
- "material_name": "塩ビ管",
- "quantity": "1",
- "unit": "式",
- "unit_price": "200000",
- "use_year": "2020-08",
- "remark": ""
}, - {
- "id": 2,
- "material_name": "塩ビ管",
- "quantity": "1",
- "unit": "式",
- "unit_price": "200000",
- "use_year": "2020-09",
- "remark": null
}
]
}使用材料を更新する
| order_id required | string |
| order_id required | integer |
| material_name required | string <= 100 characters |
| quantity required | string <= 15 characters |
| unit required | string <= 10 characters |
| unit_price required | string <= 15 characters |
| use_year required | string |
| remark | string Nullable |
[- {
- "order_id": 1,
- "material_name": "塩ビ管",
- "quantity": "1",
- "unit": "式",
- "unit_price": "100000",
- "use_year": "2022-06",
- "remark": null
}
]{- "message": "OK",
- "data": { }
}受注IDを基データを返却する
headcount
その他算出要素に関してはフロント側で計算を行う
| order_id required | string |
{- "message": "Success",
- "data": {
- "formal_site_name": "AAA案件A現場",
- "client_name": "佐々木",
- "client_contavt_name": "田中",
- "complete_plan_date": "2022年6月1日",
- "personal_cost": 25000,
- "headcount": [
- {
- "year_and_month": "2022年4月",
- "daily_headcount": [
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- null
], - "monthly_headcount": 0
}, - {
- "year_and_month": "2022年5月",
- "daily_headcount": [
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 5,
- 5,
- 5,
- 5,
- 5,
- 5,
- 5
], - "monthly_headcount": 35
}
], - "estimated_amount": 10000000,
- "contract_amount": 9000000
}
}※年月出来高一覧と出来高一覧は間違いやすいので注意
年月出来高一覧は、指定年月に出来高がある受注の一覧(出来高管理画面で使用する)
started_orders
not_started_orders
| search_date | string 検索年月日 |
{- "message": "Success",
- "data": {
- "started_orders": [
- {
- "id": 1,
- "order_id": 1,
- "estimated_number": "1",
- "client_name": "株式会社AAA",
- "informal_site_name": "AAA現場",
- "client_contact_name": "田中",
- "exists_purchase_order": true,
- "closing_date": "末",
- "complete_plan_date": "2022-07-31",
- "contract_amount": 30000000,
- "billing_amount": 3000000,
- "already_billed_amount": 6000000
}
], - "not_started_orders": [
- {
- "informal_site_name": "BBB現場",
- "construction_start_date": "2022-08-01",
- "construction_end_date": "2023-01-01"
}
]
}
}※年月出来高一覧と出来高一覧は間違いやすいので注意
出来高一覧は、指定受注の出来高一覧(出来高編集画面で使用する)
受注IDに一致する受注の出来高を受注開始日~当月までの毎月の出来高を返却する(既に完了している受注の場合は完了日まで)
出来高テーブルに値がある月はそのデータを、無い月はidと請求額をnullで返却する
| order_id required | string |
{- "message": "Success",
- "data": {
- "order": {
- "id": 1,
- "client_id": 1,
- "client_name": "株式会社AAA",
- "client_contact_name": "田中",
- "informal_site_name": "A現場",
- "contract_amount": 9000000,
- "complete_plan_date": "2022-07-19"
}, - "earned_values": [
- {
- "id": 3,
- "billing_date": "2022-05",
- "billing_year": 2022,
- "billing_month": 5,
- "billing_amount_": 3000000,
- "is_not_billed": false
}, - {
- "id": null,
- "billing_date": "2022-06",
- "billing_year": 2022,
- "billing_month": 6,
- "billing_amount_": null,
- "is_not_billed": false
}
]
}
}出来高を登録するAPI
422について
| order_id required | string |
| billing_date required | string 請求年月 |
| billing_amount | integer Nullable 請求額 |
| is_not_billed required | boolean 請求なしフラグ |
{- "billing_date": "2022-06",
- "billing_amount": 3220000,
- "is_not_billed": false
}{- "message": "OK",
- "data": { }
}出来高を更新するAPI
422について
| id required | integer |
| order_id required | integer |
| billing_date required | string 請求年月 |
| billing_amount | integer Nullable 請求額 |
| is_not_billed required | boolean 請求なしフラグ |
{- "billing_date": "2022-05",
- "billing_amount": null,
- "is_not_billed": true
}{- "message": "OK",
- "data": { }
}{- "message": "Success",
- "data": [
- {
- "id": 4,
- "client_name": "株式会社あああああ",
- "client_name_kana": "かぶしきがいしゃあああああ",
- "postal_code": "000-0000",
- "client_address": "青森県八戸市XXXX",
- "closing_date": "当月10日",
- "payment_date": "当月末日",
- "remarks": "1日必着"
}, - {
- "id": 1,
- "client_name": "株式会社あいうえお",
- "client_name_kana": "かぶしきがいしゃあいうえお",
- "postal_code": "000-0000",
- "client_address": "青森県八戸市XXXX",
- "closing_date": "当月10日",
- "payment_date": "当月末日",
- "remarks": null
}, - {
- "id": 2,
- "client_name": "株式会社あいうえお",
- "client_name_kana": "かぶしきがいしゃあいうえお",
- "postal_code": "000-0000",
- "client_address": "青森県八戸市XXXX",
- "closing_date": "当月10日",
- "payment_date": "当月末日",
- "remarks": null
}
]
}顧客を登録する
| client_name required | string 会社名 |
| client_name_kana required | string 会社名(ふりがな) |
| postal_code | string Nullable 郵便番号 |
| client_address | string Nullable 住所 |
| closing_date | string Nullable 締め日 |
| payment_date | string Nullable 支払日 |
| remarks | string Nullable 備考 |
{ "client_name": "株式会社あいうえお", "client_name_kana": "かぶしきがいしゃあいうえお", "postal_code": "000-0000", "client_address": "青森県八戸市XXXX", "closing_date": "当月15", "payment_date": "当月末", "remarks": null }
{- "message": "OK",
- "data": { }
}{- "message": "Success",
- "data": {
- "id": 1,
- "client_name": "株式会社あいうえお",
- "client_name_kana": "かぶしきがいしゃあいうえお",
- "postal_code": "000-0000",
- "client_address": "青森県八戸市XXXXX",
- "closing_date": "当月15",
- "payment_date": "当月末",
- "remarks": null
}
}顧客情報を更新する
| id required | integer 顧客ID |
| client_name required | string 会社名 |
| client_name_kana required | string 会社名(ふりがな) |
| postal_code | string Nullable 郵便番号 |
| client_address | string Nullable 住所 |
| closing_date | string Nullable 締め日 |
| payment_date | string Nullable 支払日 |
| remarks | string Nullable 備考 |
{ "client_name": "株式会社あいうえお", "client_name_kana": "かぶしきがいしゃあいうえお", "postal_code": null, "client_address": null, "closing_date": null, "payment_date": null, "remarks": null }
{- "message": "OK",
- "data": { }
}非表示の従業員を除いた全件取得する
※id(@param)が指定されている場合は非表示ユーザーでもそのユーザーを除かない
ソート順
user_authority
user_kind
employment_classification
| id | number 従業員ID |
{- "message": "Success",
- "data": [
- {
- "id": 3,
- "user_name": "田中太郎",
- "user_authority": 1,
- "user_kind": 1,
- "employment_classification": 1
}, - {
- "id": 2,
- "user_name": "山田花子",
- "user_authority": 1,
- "user_kind": 1,
- "employment_classification": 2
}
]
}従業員を登録する
| login_id required | string ログインID |
| login_password required | string パスワード |
| confirm_password required | string パスワード確認 |
| user_name required | string 従業員名 |
| user_authority required | integer 権限 |
| user_kind required | integer 種別 |
| employment_classification required | integer 雇用区分 |
{ "login_id": "admin", "login_password": "password", "confirm_password": "password", "user_name": "山田太郎", "user_authority": 1, "user_kind": 1, "employment_classification": 1 }
{- "message": "OK",
- "data": { }
}従業員の情報を更新する
| id required | integer 従業員ID |
| login_password required | string パスワード |
| confirm_password required | string パスワード確認 |
| user_name required | string 従業員名 |
| user_authority required | integer 権限 |
| user_kind required | integer 種別 |
| employment_classification required | integer 雇用区分 |
{ "login_password": "password", "confirm_password": "password", "user_name": "山田太郎", "user_authority": 2, "user_kind": 2, "employment_classification": 1 }
{- "message": "OK",
- "data": { }
}従業員を削除する
以下のいずれかに当てはまった場合削除を行わない。(405)
※結果によって405レスポンスメッセージを変更する
message = "管理者が残り1人のため削除できません"message = "受注で使用されているため削除できません"message = "日程表で使用されているため削除できません"message = "受注と日程表に使用されているため削除できません"| id required | integer 従業員ID |
{- "message": "OK",
- "data": { }
}集計年(@param)に一致する日程データや使用材料データを基に1月から12月の集計を行い返却する
受注ID(@param)が指定されている場合は、一致する受注のみの集計を行う
集計年が指定されていない場合は、現在の年で集計して返却する
| year | string 集計年 |
| order_id | string 受注ID |
{- "message": "Success",
- "data": [
- {
- "month": "1月",
- "cost": 0,
- "people": 0
}, - {
- "month": "2月",
- "cost": 250000,
- "people": 0
}, - {
- "month": "3月",
- "cost": 300000,
- "people": 0
}, - {
- "month": "4月",
- "cost": 900000,
- "people": 0
}, - {
- "month": "5月",
- "cost": 1000000,
- "people": 0
}, - {
- "month": "6月",
- "cost": 400000,
- "people": 0
}, - {
- "month": "7月",
- "cost": 30000,
- "people": 0
}, - {
- "month": "8月",
- "cost": 0,
- "people": 0
}, - {
- "month": "9月",
- "cost": 0,
- "people": 0
}, - {
- "month": "10月",
- "cost": 0,
- "people": 0
}, - {
- "month": "11月",
- "cost": 0,
- "people": 0
}, - {
- "month": "12月",
- "cost": 0,
- "people": 0
}
]
}IDとパスワードを使用してマスタに一致するユーザが存在するかチェックする
一致したユーザが存在した場合はユーザ情報を返却する
※IDとパスワードが一致していたとしても、is_hidden が true のユーザーはログイン不可とすること
| login_id | string |
| login_password | string |
{- "login_id": "string",
- "login_password": "string"
}{- "message": "Success",
- "data": {
- "id": 1,
- "user_name": "山田太郎",
- "user_authority": 1,
- "user_kind": 1,
- "employment_classification": 1,
- "is_hidden": false
}, - "token": "xxxxxxxxxxxxxxxxxxxxxx"
}