> For the complete documentation index, see [llms.txt](https://104ha-docs.gitbook.io/104-ha-openapi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://104ha-docs.gitbook.io/104-ha-openapi/clients/104-hr-max/jia-ban-guan-li.md).

# 加班管理

涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。

## 取得員工加班主檔

> \`\`\`\
> emp\_ot = {\
> &#x20; "EMP\_OT\_ID": number,        //ID\
> &#x20; "CO\_ID": number,            //公司\_ID\
> &#x20; "EMP\_ID": number,           //員工\_ID\
> &#x20; "OT\_START":date,            //加班申請起始時間\
> &#x20; "OT\_END":date,              //加班申請結束時間\
> &#x20; "OT\_DATE":date,             //加班歸屬日期\
> &#x20; "REASON":string,            //加班原因\
> &#x20; "UNIT":string,              //加班當時單位\
> &#x20; "OT\_VALUE": number,         //合計加班數\
> &#x20; "DED\_MINS": number,         //合計扣除分鐘數\
> &#x20; "PAY\_VALUE": number,        //合計支領加班費\
> &#x20; "CL\_VALUE": number,         //合計支領補休\
> &#x20; "FILES\_UUID":string,        //附件\
> &#x20; "NOTE":string,              //備註\
> &#x20; "OT\_SOURCE": number,        //資料來源\
> &#x20; "WF\_NO":string,             //WORKFLOW 表單編號\
> &#x20; "WF\_RESULT": number,        //表單狀態\
> &#x20; "WF\_SIGN\_TIME":date,        //簽核完成時間\
> &#x20; "CAL\_STATUS": number,       //結算狀態\
> &#x20; "SALARY\_CLOSE\_ID": number,  //薪資結檔主檔\_ID\
> &#x20; "CALENDAR\_LEAVE\_ID": number, //員工行事曆類別\_ID\
> &#x20; "OT\_COEF\_JSON": array,      //折現倍率JSON\
> &#x20; "C\_DATETIME":date,          //新增\_日期\
> &#x20; "E\_DATETIME":date,          //修改\_日期\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/am/emp_ot":{"post":{"tags":["加班管理"],"summary":"取得員工加班主檔","description":"```\nemp_ot = {\n  \"EMP_OT_ID\": number,        //ID\n  \"CO_ID\": number,            //公司_ID\n  \"EMP_ID\": number,           //員工_ID\n  \"OT_START\":date,            //加班申請起始時間\n  \"OT_END\":date,              //加班申請結束時間\n  \"OT_DATE\":date,             //加班歸屬日期\n  \"REASON\":string,            //加班原因\n  \"UNIT\":string,              //加班當時單位\n  \"OT_VALUE\": number,         //合計加班數\n  \"DED_MINS\": number,         //合計扣除分鐘數\n  \"PAY_VALUE\": number,        //合計支領加班費\n  \"CL_VALUE\": number,         //合計支領補休\n  \"FILES_UUID\":string,        //附件\n  \"NOTE\":string,              //備註\n  \"OT_SOURCE\": number,        //資料來源\n  \"WF_NO\":string,             //WORKFLOW 表單編號\n  \"WF_RESULT\": number,        //表單狀態\n  \"WF_SIGN_TIME\":date,        //簽核完成時間\n  \"CAL_STATUS\": number,       //結算狀態\n  \"SALARY_CLOSE_ID\": number,  //薪資結檔主檔_ID\n  \"CALENDAR_LEAVE_ID\": number, //員工行事曆類別_ID\n  \"OT_COEF_JSON\": array,      //折現倍率JSON\n  \"C_DATETIME\":date,          //新增_日期\n  \"E_DATETIME\":date,          //修改_日期\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","OT_SDATE","OT_EDATE","EMP_ID"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"OT_SDATE":{"type":["string","date"],"description":"加班起始日"},"OT_EDATE":{"type":["string","date"],"description":"加班結束日"},"EMP_ID":{"type":"integer","description":"員工ID"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200, \n  data: [emp_ot, emp_ot, ...]\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 加班檢查

> \`\`\`\
> checkOt = {\
> &#x20; "OT\_VALUE": number,        //加班時數\
> &#x20; "OT\_VALUE\_UNIT": string,   //加班時數單位\
> &#x20; "OT\_MINS": integer,        //加班分鐘數\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf020/checkOt":{"post":{"tags":["加班管理"],"summary":"加班檢查","description":"```\ncheckOt = {\n  \"OT_VALUE\": number,        //加班時數\n  \"OT_VALUE_UNIT\": string,   //加班時數單位\n  \"OT_MINS\": integer,        //加班分鐘數\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","EMP_ID","OT_SDATE","OT_EDATE","PAY_TYPE","REASON","FILES","NOTE","EMP_OT_ID","EMP_PREOT_ID"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"EMP_ID":{"type":"integer","description":"員工ID"},"OT_SDATE":{"type":["string","date"],"description":"加班起始時間"},"OT_EDATE":{"type":["string","date"],"description":"加班結束時間"},"PAY_TYPE":{"type":"string","description":"加班支領方式"},"REASON":{"type":"string","description":"加班原因"},"FILES":{"type":"array","description":"附件"},"NOTE":{"type":"string","description":"備註"},"EMP_OT_ID":{"type":"integer","description":"加班主檔id"},"EMP_PREOT_ID":{"type":"integer","description":"預先加班主檔id"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200,\n  data: {checkOt},\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"490":{"description":"失敗\n```\n{\n  code: 490,\n  msg: string,   // 失敗原因\n}\n```\n"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 加班寫入

> \`\`\`\
> insertOt = {\
> &#x20; "EMP\_OT\_ID": number,         //寫入成功的加班主檔ID\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"499":{"description":"DB錯誤 `{ code: 499, msg: string }`"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf020/insertOt":{"post":{"tags":["加班管理"],"summary":"加班寫入","description":"```\ninsertOt = {\n  \"EMP_OT_ID\": number,         //寫入成功的加班主檔ID\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","EMP_ID","OT_SDATE","OT_EDATE","PAY_TYPE","REASON","FILES","NOTE","EMP_OT_ID","WF_NO","WF_RESULT","EMP_PREOT_ID"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"EMP_ID":{"type":"integer","description":"員工ID"},"OT_SDATE":{"type":["string","date"],"description":"加班起始時間"},"OT_EDATE":{"type":["string","date"],"description":"加班結束時間"},"PAY_TYPE":{"type":"string","description":"加班支領方式"},"REASON":{"type":"string","description":"加班原因"},"FILES":{"type":"array","description":"附件"},"NOTE":{"type":"string","description":"備註"},"EMP_OT_ID":{"type":"integer","description":"加班主檔id"},"WF_NO":{"type":"string","description":"WORKFLOW 表單編號"},"WF_RESULT":{"type":"integer","description":"表單狀態"},"EMP_PREOT_ID":{"type":"integer","description":"預先加班主檔id"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200,\n  data: {insertOt},\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"490":{"description":"失敗\n```\n{\n  code: 490,\n  msg: string,   // 失敗原因\n}\n```\n"},"499":{"$ref":"#/components/responses/499"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 加班刪除列表

> \`\`\`\
> deleteOtList = {\
> &#x20; "CO\_ID": number,         //公司\_ID\
> &#x20; "EMP\_ID": number,        //員工\_ID\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"499":{"description":"DB錯誤 `{ code: 499, msg: string }`"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf020/deleteOtList":{"post":{"tags":["加班管理"],"summary":"加班刪除列表","description":"```\ndeleteOtList = {\n  \"CO_ID\": number,         //公司_ID\n  \"EMP_ID\": number,        //員工_ID\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","EMP_ID"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"EMP_ID":{"type":"integer","description":"員工ID"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200,\n  data: {deleteOtList},\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"499":{"$ref":"#/components/responses/499"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 加班刪除檢查

> \`\`\`\
> checkDeleteOt = {\
> &#x20; "RETURN\_CODE": number,  //回傳訊息代號\
> &#x20; "RETURN\_MSG": string,   //回傳訊息\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf020/checkDeleteOt":{"post":{"tags":["加班管理"],"summary":"加班刪除檢查","description":"```\ncheckDeleteOt = {\n  \"RETURN_CODE\": number,  //回傳訊息代號\n  \"RETURN_MSG\": string,   //回傳訊息\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","EMP_ID","EMP_OT_ID"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"EMP_ID":{"type":"integer","description":"員工ID"},"EMP_OT_ID":{"type":"integer","description":"加班主檔id"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200,\n  data: [checkDeleteOt, checkDeleteOt, ...],\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"490":{"description":"失敗\n```\n{\n  code: 490,\n  msg: string,   // 失敗原因\n}\n```\n"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 加班刪除

> \`\`\`\
> deleteOt = {\
> &#x20; "RETURN\_CODE": number,  //回傳訊息代號\
> &#x20; "RETURN\_MSG": string,   //回傳訊息\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"499":{"description":"DB錯誤 `{ code: 499, msg: string }`"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf020/deleteOt":{"post":{"tags":["加班管理"],"summary":"加班刪除","description":"```\ndeleteOt = {\n  \"RETURN_CODE\": number,  //回傳訊息代號\n  \"RETURN_MSG\": string,   //回傳訊息\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","EMP_ID","EMP_OT_ID"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"EMP_ID":{"type":"integer","description":"員工ID"},"EMP_OT_ID":{"type":"integer","description":"加班主檔id"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200,\n  data: [deleteOt, deleteOt, ...],\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"490":{"description":"失敗\n```\n{\n  code: 490,\n  msg: string,   // 失敗原因\n}\n```\n"},"499":{"$ref":"#/components/responses/499"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 取得剩餘加班時數

> \`\`\`\
> otTime = {\
> &#x20; "OT\_VALUE": number,        //加班時數\
> &#x20; "OT\_VALUE\_UNIT": string,   //加班時數單位\
> &#x20; "OT\_MINS": integer,        //加班分鐘數\
> &#x20; "OT\_REASON": number,       //加班原因是否必填\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf020/otTime":{"post":{"tags":["加班管理"],"summary":"取得剩餘加班時數","description":"```\notTime = {\n  \"OT_VALUE\": number,        //加班時數\n  \"OT_VALUE_UNIT\": string,   //加班時數單位\n  \"OT_MINS\": integer,        //加班分鐘數\n  \"OT_REASON\": number,       //加班原因是否必填\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","EMP_ID","OT_SDATE","OT_EDATE"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"EMP_ID":{"type":"integer","description":"員工ID"},"OT_SDATE":{"type":["string","date"],"description":"加班起始時間"},"OT_EDATE":{"type":["string","date"],"description":"加班結束時間"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200,\n  data: {otTime},\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"490":{"description":"失敗\n```\n{\n  code: 490,\n  msg: string,   // 失敗原因\n}\n```\n"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 預先加班檢查

> \`\`\`\
> checkPreOt = {\
> &#x20; "OT\_VALUE": number,        //預先加班時數\
> &#x20; "OT\_VALUE\_UNIT": string,   //預先加班時數單位\
> &#x20; "OT\_MINS": integer,        //預先加班分鐘數\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf022/checkPreOt":{"post":{"tags":["加班管理"],"summary":"預先加班檢查","description":"```\ncheckPreOt = {\n  \"OT_VALUE\": number,        //預先加班時數\n  \"OT_VALUE_UNIT\": string,   //預先加班時數單位\n  \"OT_MINS\": integer,        //預先加班分鐘數\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","EMP_ID","OT_SDATE","OT_EDATE","PAY_TYPE","REASON","FILES","NOTE","EMP_OT_ID"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"EMP_ID":{"type":"integer","description":"員工ID"},"OT_SDATE":{"type":["string","date"],"description":"預先加班起始時間"},"OT_EDATE":{"type":["string","date"],"description":"預先加班結束時間"},"PAY_TYPE":{"type":"string","description":"預先加班支領方式"},"REASON":{"type":"string","description":"預先加班原因"},"FILES":{"type":"array","description":"附件"},"NOTE":{"type":"string","description":"備註"},"EMP_PREOT_ID":{"type":"integer","description":"預先加班主檔id"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200,\n  data: {checkPreOt},\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"490":{"description":"失敗\n```\n{\n  code: 490,\n  msg: string,   // 失敗原因\n}\n```\n"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 預先加班寫入

> \`\`\`\
> insertPreOt = {\
> &#x20; "EMP\_PREOT\_ID": number,         //寫入成功的預先加班主檔ID\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"499":{"description":"DB錯誤 `{ code: 499, msg: string }`"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf022/insertPreOt":{"post":{"tags":["加班管理"],"summary":"預先加班寫入","description":"```\ninsertPreOt = {\n  \"EMP_PREOT_ID\": number,         //寫入成功的預先加班主檔ID\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","EMP_ID","OT_SDATE","OT_EDATE","PAY_TYPE","REASON","FILES","NOTE","EMP_PREOT_ID","WF_NO","WF_RESULT"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"EMP_ID":{"type":"integer","description":"員工ID"},"OT_SDATE":{"type":["string","date"],"description":"預先加班起始時間"},"OT_EDATE":{"type":["string","date"],"description":"預先加班結束時間"},"PAY_TYPE":{"type":"string","description":"預先加班支領方式"},"REASON":{"type":"string","description":"預先加班原因"},"FILES":{"type":"array","description":"附件"},"NOTE":{"type":"string","description":"備註"},"EMP_PREOT_ID":{"type":"integer","description":"預先加班主檔id"},"WF_NO":{"type":"string","description":"WORKFLOW 表單編號"},"WF_RESULT":{"type":"integer","description":"表單狀態"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200,\n  data: {insertPreOt},\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"490":{"description":"失敗\n```\n{\n  code: 490,\n  msg: string,   // 失敗原因\n}\n```\n"},"499":{"$ref":"#/components/responses/499"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 預先加班刪除檢查

> \`\`\`\
> checkDeletePreOt = {\
> &#x20; "RETURN\_CODE": number,  //回傳訊息代號\
> &#x20; "RETURN\_MSG": string,   //回傳訊息\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf022/checkDeletePreOt":{"post":{"tags":["加班管理"],"summary":"預先加班刪除檢查","description":"```\ncheckDeletePreOt = {\n  \"RETURN_CODE\": number,  //回傳訊息代號\n  \"RETURN_MSG\": string,   //回傳訊息\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","EMP_ID","EMP_PREOT_ID"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"EMP_ID":{"type":"integer","description":"員工ID"},"EMP_PREOT_ID":{"type":"integer","description":"預先加班主檔id"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200,\n  data: [checkDeletePreOt, checkDeletePreOt, ...],\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"490":{"description":"失敗\n```\n{\n  code: 490,\n  msg: string,   // 失敗原因\n}\n```\n"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 預先加班刪除

> \`\`\`\
> deletePreOt = {\
> &#x20; "RETURN\_CODE": number,  //回傳訊息代號\
> &#x20; "RETURN\_MSG": string,   //回傳訊息\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"499":{"description":"DB錯誤 `{ code: 499, msg: string }`"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf022/deletePreOt":{"post":{"tags":["加班管理"],"summary":"預先加班刪除","description":"```\ndeletePreOt = {\n  \"RETURN_CODE\": number,  //回傳訊息代號\n  \"RETURN_MSG\": string,   //回傳訊息\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","EMP_ID","EMP_PREOT_ID"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"EMP_ID":{"type":"integer","description":"員工ID"},"EMP_PREOT_ID":{"type":"integer","description":"預先加班主檔id"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200,\n  data: [deletePreOt, deletePreOt, ...],\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"490":{"description":"失敗\n```\n{\n  code: 490,\n  msg: string,   // 失敗原因\n}\n```\n"},"499":{"$ref":"#/components/responses/499"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 取得預先加班單列表

> \`\`\`\
> preOtList = {\
> &#x20; "EM\_PPREOT\_ID": number, //預先加班ID\
> &#x20; "CO\_ID": number, //公司\_ID\
> &#x20; "EMP\_ID": number, //員工\_ID\
> &#x20; "OT\_START": string,     //加班開始\
> &#x20; "OT\_END": string,       //加班結束\
> &#x20; "UNIT": string,         //單位\
> &#x20; "OT\_VALUE": number,     //加班時數\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf022/preOtList":{"post":{"tags":["加班管理"],"summary":"取得預先加班單列表","description":"```\npreOtList = {\n  \"EM_PPREOT_ID\": number, //預先加班ID\n  \"CO_ID\": number, //公司_ID\n  \"EMP_ID\": number, //員工_ID\n  \"OT_START\": string,     //加班開始\n  \"OT_END\": string,       //加班結束\n  \"UNIT\": string,         //單位\n  \"OT_VALUE\": number,     //加班時數\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","EMP_ID"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"EMP_ID":{"type":"integer","description":"員工ID"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200,\n  data: {preOtList},\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"490":{"description":"失敗\n```\n{\n  code: 490,\n  msg: string,   // 失敗原因\n}\n```\n"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 取得剩餘預先加班時數

> \`\`\`\
> otTime = {\
> &#x20; "OT\_VALUE": number,        //加班時數\
> &#x20; "OT\_VALUE\_UNIT": string,   //加班時數單位\
> &#x20; "OT\_MINS": integer,        //加班分鐘數\
> &#x20; "OT\_REASON": number,       //加班原因是否必填\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf022/preOtTime":{"post":{"tags":["加班管理"],"summary":"取得剩餘預先加班時數","description":"```\notTime = {\n  \"OT_VALUE\": number,        //加班時數\n  \"OT_VALUE_UNIT\": string,   //加班時數單位\n  \"OT_MINS\": integer,        //加班分鐘數\n  \"OT_REASON\": number,       //加班原因是否必填\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","EMP_ID","OT_SDATE","OT_EDATE"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"EMP_ID":{"type":"integer","description":"員工ID"},"OT_SDATE":{"type":["string","date"],"description":"加班起始時間"},"OT_EDATE":{"type":["string","date"],"description":"加班結束時間"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200,\n  data: {otTime},\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"490":{"description":"失敗\n```\n{\n  code: 490,\n  msg: string,   // 失敗原因\n}\n```\n"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 預先加班刪除列表

> \`\`\`\
> deletePreOtList = {\
> &#x20; "CO\_ID": number,         //公司\_ID\
> &#x20; "EMP\_ID": number,        //員工\_ID\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"499":{"description":"DB錯誤 `{ code: 499, msg: string }`"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf022/deletePreOtList":{"post":{"tags":["加班管理"],"summary":"預先加班刪除列表","description":"```\ndeletePreOtList = {\n  \"CO_ID\": number,         //公司_ID\n  \"EMP_ID\": number,        //員工_ID\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","EMP_ID"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"EMP_ID":{"type":"integer","description":"員工ID"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200,\n  data: {deletePreOtList},\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"499":{"$ref":"#/components/responses/499"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## POST /api/wf/wf021/batchOtNew

> 批次加班單新增

```json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"499":{"description":"DB錯誤 `{ code: 499, msg: string }`"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf021/batchOtNew":{"post":{"tags":["加班管理"],"summary":"批次加班單新增","requestBody":{"require":true,"content":{"application/json":{"schema":{"type":"object","properties":{"CO_ID":{"type":"number","description":"公司_ID"},"SESSION_KEY":{"type":"string","description":"執行階段的KEY"},"OT_DATA":{"type":"array","description":"員工加班資料","item":{"type":"object","properties":{"EMP_ID":{"type":"number"},"OT_START":{"type":"datetime"},"OT_END":{"type":"datetime"},"PAY_TYPE":{"type":"number"},"IS_MEAL":{"type":"number"},"IS_CARDMATCH":{"type":"number"},"REASON":{"type":"string"}}}},"FILES":{"type":"array","description":"附件","items":{"type":"object","properties":{"fileUUID":{"type":"string","description":"file uuid"},"fileName":{"type":"string","description":"file name"},"fileSize":{"type":"number","description":"file size"},"fileMime":{"type":"string","description":"file mime"},"isTmp":{"type":"number","description":"是否暫存"}}}},"WF_NO":{"type":"string","description":"WORKFLOW 表單編號"}}}}}},"responses":{"200":{"description":"更新成功"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"490":{"description":"SESSION_KEY 不可重複"},"491":{"description":"加班檢查異常 `{ code: 491, msg?: string }`"},"492":{"description":"附件寫入錯誤"},"499":{"$ref":"#/components/responses/499"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## POST /api/wf/wf021/batchOtSign

> 批次加班單簽核完成

```json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"499":{"description":"DB錯誤 `{ code: 499, msg: string }`"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf021/batchOtSign":{"post":{"tags":["加班管理"],"summary":"批次加班單簽核完成","requestBody":{"require":true,"content":{"application/json":{"schema":{"type":"object","properties":{"CO_ID":{"type":"number","description":"公司_ID"},"SESSION_KEY":{"type":"string","description":"執行階段的KEY"},"WF_NO":{"type":"string","description":"WORKFLOW 表單編號"}}}}}},"responses":{"200":{"description":"更新成功"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"490":{"description":"加班檢查異常 `{ code: 490, msg?: string }`"},"499":{"$ref":"#/components/responses/499"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## POST /api/wf/wf021/batchOtDelete

> 批次加班單刪除

```json
{"openapi":"3.0.0","tags":[{"name":"加班管理","description":"涵蓋各類加班單的申請與查詢，包括：加班資料查詢、加班單寫入、預先加班單寫入、批次加班單寫入。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"499":{"description":"DB錯誤 `{ code: 499, msg: string }`"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/wf/wf021/batchOtDelete":{"post":{"tags":["加班管理"],"summary":"批次加班單刪除","requestBody":{"require":true,"content":{"application/json":{"schema":{"type":"object","properties":{"CO_ID":{"type":"number","description":"公司_ID"},"SESSION_KEY":{"type":"string","description":"執行階段的KEY"},"WF_NO":{"type":"string","description":"WORKFLOW 表單編號"}}}}}},"responses":{"200":{"description":"更新成功"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"490":{"description":"批次加班單刪除失敗"},"499":{"$ref":"#/components/responses/499"},"500":{"$ref":"#/components/responses/500"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://104ha-docs.gitbook.io/104-ha-openapi/clients/104-hr-max/jia-ban-guan-li.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
