# 绩效管理模块

# 绩效表单模板

# 获取绩效表单模板单据列表

# 接口描述

用于获取绩效表单模板单据列表

# 接口调用说明

  1. 请求说明

    URL http://[server]/jsf/rfws/search/search
    HTTP 请求方式 GET
    编码类型 UTF-8
  2. URL 参数

    参数 类型 必填 说明
    authorization String (Header) Y 通过 OAuth 获取的 Access Token
    client_id String (Header) Y M18 授权应用列表中的 Client ID
    stSearch String (Query) Y Lookup Type. 可在 UDF Lookup 中找到。
    (Eg: apxFormTemp ......)
    formatId long (Query) N Lookup Query 中的格式 ID
    (若未指定该参数,则使用默认格式)
    startRow int (Query) N 返回结果的开始行
    endRow int (Query) N 返回结果的结束行
    quickSearchStr String (Query) N 设定关键字查找数据
  3. 请求示例

    CloseableHttpClient client = HttpClientBuilder.create().build();
    CloseableHttpResponse res = null;
    try {
    
        String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
    
        StringBuilder paramStrBuilder = new StringBuilder();
        paramStrBuilder.append("&stSearch=").append("apxFormTemp");
        paramStrBuilder.append("&startRow=").append(0);
        paramStrBuilder.append("&endRow=").append(10);
    
        HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString());
        get.addHeader("authorization", access_token);
        get.addHeader("client_id", ClientID);
        res = client.execute(get);
        if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
            JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
    
            System.out.println(json);
        }
    
        get.releaseConnection();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        try {
            if (res != null) {
                res.close();
            }
            if (client != null) {
                client.close();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
  4. 返回示例

    {
        "stSearch": "apxFormTemp",
    	"size": 21,
    	"stSearchDisplay": "绩效表单模板",
    	"values": [
    		{
    			"code": "APX0001",
    			"desc": "APX0001",
    			"effDate": "2021-09-01",
    			"apxFormTemp.apxTypeId.apxType.desc__lang": "EL",
    			"status": "Y",
    			"iRev": 31,
    			"lastModifyDate": "2021-10-28 12:39:49",
    			"apxFormTemp.lastModifyUid.simpleUser.desc__lang": "admin",
    			"id": 1,
    			"st_desc": "APX0001",
    			"st_id": 1,
    			"st_code": "APX0001"
    		},
    		{
    			"code": "Jltest",
    			"desc": "Jltest",
    			"effDate": "2000-01-01",
    			"apxFormTemp.apxTypeId.apxType.desc__lang": "EL",
    			"status": "Y",
    			"iRev": 19,
    			"lastModifyDate": "2022-03-14 17:51:32",
    			"apxFormTemp.lastModifyUid.simpleUser.desc__lang": "admin",
    			"id": 3,
    			"st_desc": "Jltest",
    			"st_id": 3,
    			"st_code": "Jltest"
    		}
        ]
    }
    

# 新增绩效表单模板

# 接口描述

用于新增绩效表单模板

# 接口调用说明

  1. 请求说明

    URL http://[server]/jsf/rfws/root/api/save/apxFormTemp
    HTTP 请求方式 PUT
    编码类型 UTF-8
  2. URL 参数

    参数 类型 必填 说明
    authorization String (Header) Y 通过 OAuth 获取的 Access Token
    client_id String (Header) Y M18 授权应用列表中的 Client ID
    menuCode String (Query) Y 可在 Data Dictionary 中找到
    Eg: apxFormTemp
    entity String (Body) Y JSON (可参考请求示例中的相关参数)
  3. 请求示例

    long recordId = 0;
    
    CloseableHttpClient client = HttpClientBuilder.create().build();
    CloseableHttpResponse res = null;
    try {
    
        String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/apxFormTemp";
    
        StringBuilder paramStrBuilder = new StringBuilder();
        paramStrBuilder.append("&menuCode=").append("apxFormTemp");
    
        HttpPut put = new HttpPut(url + "?" + paramStrBuilder.toString());
        put.addHeader("authorization", access_token);
        put.addHeader("client_id", ClientID);
    
        StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
        entity.setContentEncoding("UTF-8");
        put.setEntity(entity);
    
        res = client.execute(put);
        if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
            JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
    
            if (json != null) {
                recordId = json.getLongValue("recordId");
            }
    
            System.out.println(json);
        }
    
        put.releaseConnection();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        try {
            if (res != null) {
                res.close();
            }
            if (client != null) {
                client.close();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    

    其中 Entity 的 JSON 格式如下:

    {
         "apxformtemp": {
            "values": [
                {
                    "code": "TEST04",
                    "desc": "TEST04",
                    "apxSerNum": 2,
                    "year": 2021,
                    "apxTypeId": 17,
                    "effDate": "2021-12-01",
                    "enableConfirmProcess": 0
                }
            ]
        },
        "apxformserpic": {
            "values": [
                {
                    "apxSerN": 0,
                    "relationSrc": "emp",
                    "relationShip": "self",
                    "picTypeId": 0,
                    "reqAppraise": 1,
                    "editGoal": 0,
                    "editKpi": 0,
                    "editCore": 0,
                    "allowAmendAdj": 0,
                    "editQuantTar": 0,
                    "allowRemoveOtherAdd": 0,
                    "allowEditApxPeriod": 0,
                    "reqAttach": 0
                }
            ]
        }
    }
    
  4. 返回示例

    {
        "recordId": 26,
        "messages": [],
        "status": true
    }
    
    {
        "recordId": 0,
    	"messages": [
    		{
    			"msgDetail": "<绩效类型>和<生效日期>必须唯一(apxformtemp.apxTypeId,apxformtemp.effDate)",
    			"msgCode": "ch01_apx_apxFormTemp_100001"
    		}
    	],
    	"status": false
    }
    

# 读取绩效表单模板

# 接口描述

根据 ID 读取绩效表单模板详情

# 接口调用说明

  1. 请求说明

    URL http://[server]/jsf/rfws/root/api/read/apxFormTemp
    HTTP 请求方式 GET
    编码类型 UTF-8
  2. URL 参数

    参数 类型 必填 说明
    authorization String (Header) Y 通过 OAuth 获取的 Access Token
    client_id String (Header) Y M18 授权应用列表中的 Client ID
    menuCode String (Query) Y 可在 Data Dictionary 中找到
    Eg: apxFormTemp
    id long (Query) Y 绩效表单模板ID,可参考获取绩效表单模板单据列表返回的 ID
    iRev long (Query) N 版本号,用于读取历史记录 / 已删除的记录
  3. 请求示例

    JSONObject json = null;
    CloseableHttpClient client = HttpClientBuilder.create().build();
    CloseableHttpResponse res = null;
    try {
        String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/apxFormTemp";
    
        StringBuilder paramStrBuilder = new StringBuilder();
        paramStrBuilder.append("&menuCode=").append("apxFormTemp");
        paramStrBuilder.append("&id=").append(id);
    
        HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString());
        get.addHeader("authorization", access_token);
        get.addHeader("client_id", ClientID);
        res = client.execute(get);
        if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
            json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
    
            System.out.println(json);
        }
    
        get.releaseConnection();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        try {
            if (res != null) {
                res.close();
            }
            if (client != null) {
                client.close();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
  4. 返回示例

    {
        "data": {
            "apxformtemp": [
    			{
    				"attachmentNo": 0,
    				"lastModifyUid": 4,
    				"code": "KWE",
    				"allowApxSeeSeeApxSer": true,
    				"useAccess": false,
    				"year": 2021,
    				"expiredDate": -2209017600000,
    				"allowEmpExportExcel": true,
    				"iRev": 7,
    				"sysJson": "",
    				"apxSerNum": 3,
    				"viewCode": "apxFormTemp",
    				"fixPayId": 0,
    				"beId": 0,
    				"effDate": 1609430400000,
    				"apxFormDesc": "",
    				"expired": false,
    				"allowApxSerSeeApxSee": true,
    				"printCount": 0,
    				"useAccessBl": false,
    				"showApxSeeComment": false,
    				"showApxSerComment": false,
    				"id": 7,
    				"statusModifyDate": 1640159691000,
    				"locked": false,
    				"desc_en": "",
    				"lastModifyDate": 1640160683000,
    				"createUid": 4,
    				"createDate": 1640159691000,
    				"desc_zh-CN": "KWE",
    				"desc_udf": "",
    				"lastApproveUid": 4,
    				"excludeNotApp": false,
    				"apxTypeId": 8,
    				"expiredUid": 0,
    				"useAccessWl": false,
    				"allowSerSeeOtherSer": true,
    				"enableCompApvProcess": true,
    				"enableConfirmProcess": true,
    				"i18nField": "{\"desc_zh-CN\": \"KWE\"}",
    				"enablePayInfo": false,
    				"reqApxSeeComment": false,
    				"udffqStr": "",
    				"desc_zh-TW": "",
    				"reqApxSerComment": false,
    				"useAccessAutoCalc": false,
    				"status": "Y",
    				"desc": "KWE"
    			}
    		],
    		"apxformcompt": [
    			{
    				"confirmProcess": false,
    				"iRev": 7,
    				"sectionOrder": 1,
    				"itemNo": "     1",
    				"editBy": "",
    				"sectionName": "",
    				"requireSeeComment": false,
    				"requireSerComment": false,
    				"weightAddItem": "evenly",
    				"apxComponent": "intQus",
    				"enableUdfFooterField": false,
    				"id": 841,
    				"scoreDesc": "",
    				"showQuantTar": false,
    				"hId": 7,
    				"maxGoalNum": 0,
    				"minScore": 0,
    				"minGoalNum": 0,
    				"showExample": false,
    				"maxScore": 0,
    				"showApxerSubWeight": false,
    				"enableWeight": false,
    				"enableMaxSubTotal": false,
    				"footerKey": 3,
    				"showNotApp": false,
    				"inputStyle": "",
    				"maxSubTotal": 0,
    				"showApxeeSubWeight": false,
    				"editApxerSubWeight": false,
    				"sectionWeight": 100
    			},
    			{
    				"confirmProcess": false,
    				"iRev": 7,
    				"sectionOrder": 1,
    				"itemNo": "     1",
    				"editBy": "apxSer",
    				"sectionName": "",
    				"requireSeeComment": false,
    				"requireSerComment": false,
    				"weightAddItem": "evenly",
    				"apxComponent": "coreComp",
    				"enableUdfFooterField": false,
    				"id": 840,
    				"scoreDesc": "5    Outstanding\r\n4    Commendable\r\n3    Competent\r\n2    Need Improvement\r\n1    Unacceptable",
    				"showQuantTar": false,
    				"hId": 7,
    				"maxGoalNum": 0,
    				"minScore": 1,
    				"minGoalNum": 0,
    				"showExample": true,
    				"maxScore": 5,
    				"showApxerSubWeight": true,
    				"enableWeight": false,
    				"enableMaxSubTotal": false,
    				"footerKey": 2,
    				"showNotApp": false,
    				"inputStyle": "",
    				"maxSubTotal": 0,
    				"showApxeeSubWeight": false,
    				"editApxerSubWeight": false,
    				"sectionWeight": 60
    			},
    		],
    	},
    	"messages": [],
    	"status": true
    }
    
    {
        "data": {},
        "messages": [
            {
                "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限",
                "msgCode": "core_141019"
            }
        ],
        "status": false
    }
    

# 保存绩效表单模板

# 接口描述

用于保存绩效表单模板

# 接口调用说明

  1. 请求说明

    URL http://[server]/jsf/rfws/root/api/save/apxFormTemp
    HTTP 请求方式 PUT
    编码类型 UTF-8
  2. URL 参数

    参数 类型 必填 说明
    authorization String (Header) Y 通过 OAuth 获取的 Access Token
    client_id String (Header) Y M18 授权应用列表中的 Client ID
    menuCode String (Query) Y 可在 Data Dictionary 中找到
    Eg: apxFormTemp
    entity String (Body) Y JSON (可参考请求示例中的相关参数)
  3. 请求示例

    long recordId = 0;
    
    CloseableHttpClient client = HttpClientBuilder.create().build();
    CloseableHttpResponse res = null;
    try {
    
        String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/apxFormTemp";
    
        StringBuilder paramStrBuilder = new StringBuilder();
        paramStrBuilder.append("&menuCode=").append("apxFormTemp");
    
        HttpPut put = new HttpPut(url + "?" + paramStrBuilder.toString());
        put.addHeader("authorization", access_token);
        put.addHeader("client_id", ClientID);
    
        StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
        entity.setContentEncoding("UTF-8");
        put.setEntity(entity);
    
        res = client.execute(put);
        if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
            JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
    
            if (json != null) {
                recordId = json.getLongValue("recordId");
            }
    
            System.out.println(json);
        }
    
        put.releaseConnection();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        try {
            if (res != null) {
                res.close();
            }
            if (client != null) {
                client.close();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    

    其中 Entity 的 JSON 格式如下:

    {
        "apxformtemp": {
            "values": [
                {
                    "id": 23,
                    "desc": "TEST03_3",
                    "apxSerNum": 2,
                    "year": 2022,
                    "apxTypeId": 17,
                    "effDate": "2022-03-01"
                }
            ]
        }
    }
    
  4. 返回示例

    {
    	"recordId": 23,
    	"messages": [],
    	"status": true
    }
    
    {
        "recordId": 0,
        "messages": [
            {
                "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限",
                "msgCode": "core_141019"
            }
        ],
        "status": false
    }
    

# 删除绩效表单模板

# 接口描述

用于删除指定 ID 的绩效表单模板

# 接口调用说明

  1. 请求说明

    URL http://[server]/jsf/rfws/root/api/delete/apxFormTemp
    HTTP 请求方式 DELETE
    编码类型 UTF-8
  2. URL 参数

    参数 类型 必填 说明
    authorization String (Header) Y 通过 OAuth 获取的 Access Token
    client_id String (Header) Y M18 授权应用列表中的 Client ID
    menuCode String (Query) Y 可在 Data Dictionary 中找到
    Eg: apxFormTemp
    id long (Query) Y 绩效表单模板 ID,可参考获取绩效表单模板单据列表返回的 ID
  3. 请求示例

    CloseableHttpClient client = HttpClientBuilder.create().build();
    CloseableHttpResponse res = null;
    try {
    
        String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/apxFormTemp";
    
        StringBuilder paramStrBuilder = new StringBuilder();
        paramStrBuilder.append("&menuCode=").append("apxFormTemp");
        paramStrBuilder.append("&id=").append(id);
    
        HttpDelete delete = new HttpDelete(url + "?" + paramStrBuilder.toString());
        delete.addHeader("authorization", access_token);
        delete.addHeader("client_id", ClientID);
    
        res = client.execute(delete);
        if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
            JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
    
            System.out.println(json);
        }
    
        delete.releaseConnection();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        try {
            if (res != null) {
                res.close();
            }
            if (client != null) {
                client.close();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
  4. 返回示例

    {
        "messages": [],
        "status": true
    }
    
    {
        "messages": [
            {
                "msgDetail": "单据已被删除",
                "msgCode": "core_101017"
            }
        ],
        "status": false
    }
    

# 绩效记录

# 获取绩效记录单据列表

# 接口描述

用于获取绩效记录单据列表

# 接口调用说明

  1. 请求说明

    URL http://[server]/jsf/rfws/search/search
    HTTP 请求方式 GET
    编码类型 UTF-8
  2. URL 参数

    参数 类型 必填 说明
    authorization String (Header) Y 通过 OAuth 获取的 Access Token
    client_id String (Header) Y M18 授权应用列表中的 Client ID
    stSearch String (Query) Y Lookup Type. 可在 UDF Lookup 中找到。
    (Eg: apxRecord ......)
    formatId long (Query) N Lookup Query 中的格式 ID
    (若未指定该参数,则使用默认格式)
    startRow int (Query) N 返回结果的开始行
    endRow int (Query) N 返回结果的结束行
    quickSearchStr String (Query) N 设定关键字查找数据
  3. 请求示例

    CloseableHttpClient client = HttpClientBuilder.create().build();
    CloseableHttpResponse res = null;
    try {
    
        String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
    
        StringBuilder paramStrBuilder = new StringBuilder();
        paramStrBuilder.append("&stSearch=").append("apxRecord");
        paramStrBuilder.append("&startRow=").append(0);
        paramStrBuilder.append("&endRow=").append(10);
    
        HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString());
        get.addHeader("authorization", access_token);
        get.addHeader("client_id", ClientID);
        res = client.execute(get);
        if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
            JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
    
            System.out.println(json);
        }
    
        get.releaseConnection();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        try {
            if (res != null) {
                res.close();
            }
            if (client != null) {
                client.close();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
  4. 返回示例

    {
        "stSearch": "apxRecord",
    	"size": 207,
    	"stSearchDisplay": "绩效记录",
    	"values": [
    		{
    			"code": "APX21090001",
    			"year": 2021,
    			"apxRecord.apxTypeId.apxType.desc__lang": "EL",
    			"apxRecord.empId.employee.code": "EL002",
    			"apxRecord.empId.employee.desc__lang": "EL002",
    			"apxRecord.empId.employee.dept.dept.desc__lang": "ss",
    			"apxRecord.empId.employee.position.position.desc__lang": "006",
    			"apxPeriodFrom": "2021-09-28",
    			"apxPeriodTo": "2021-09-28",
    			"overallScore": 0,
    			"overallGrade": "D",
    			"status": "I",
    			"iRev": 5,
    			"lastModifyDate": "2021-09-28 13:03:50",
    			"apxRecord.lastModifyUid.simpleUser.desc__lang": "EL004",
    			"id": 58,
    			"st_desc": "APX21090001",
    			"st_id": 58,
    			"st_code": "APX21090001"
    		},
    		{
    			"code": "APX21090007",
    			"year": 2021,
    			"apxRecord.apxTypeId.apxType.desc__lang": "YOT",
    			"apxRecord.empId.employee.code": "EL003",
    			"apxRecord.empId.employee.desc__lang": "EL003",
    			"apxRecord.empId.employee.dept.dept.desc__lang": "ss",
    			"apxRecord.empId.employee.position.position.desc__lang": "",
    			"apxPeriodFrom": "2021-10-01",
    			"apxPeriodTo": "2021-10-31",
    			"overallScore": 90,
    			"overallGrade": "B",
    			"status": "Y",
    			"iRev": 13,
    			"lastModifyDate": "2022-04-19 17:57:47",
    			"apxRecord.lastModifyUid.simpleUser.desc__lang": "admin",
    			"id": 64,
    			"st_desc": "APX21090007",
    			"st_id": 64,
    			"st_code": "APX21090007"
    		}
        ]
    }
    

# 读取绩效记录

# 接口描述

根据 ID 读取绩效记录详情

# 接口调用说明

  1. 请求说明

    URL http://[server]/jsf/rfws/root/api/read/apxRecord
    HTTP 请求方式 GET
    编码类型 UTF-8
  2. URL 参数

    参数 类型 必填 说明
    authorization String (Header) Y 通过 OAuth 获取的 Access Token
    client_id String (Header) Y M18 授权应用列表中的 Client ID
    menuCode String (Query) Y 可在 Data Dictionary 中找到
    Eg: apxRecord
    id long (Query) Y 绩效记录ID,可参考获取绩效记录单据列表返回的 ID
    iRev long (Query) N 版本号,用于读取历史记录 / 已删除的记录
  3. 请求示例

    JSONObject json = null;
    CloseableHttpClient client = HttpClientBuilder.create().build();
    CloseableHttpResponse res = null;
    try {
        String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/apxRecord";
    
        StringBuilder paramStrBuilder = new StringBuilder();
        paramStrBuilder.append("&menuCode=").append("apxRecord");
        paramStrBuilder.append("&id=").append(id);
    
        HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString());
        get.addHeader("authorization", access_token);
        get.addHeader("client_id", ClientID);
        res = client.execute(get);
        if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
            json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
    
            System.out.println(json);
        }
    
        get.releaseConnection();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        try {
            if (res != null) {
                res.close();
            }
            if (client != null) {
                client.close();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
  4. 返回示例

    {
        "data": {
            "apxrecord": [
    			{
    				"attachmentNo": 0,
    				"empId": 13688,
    				"lastModifyUid": 12268,
    				"code": "A_210915103212827384",
    				"apxSeeComment": "<p>ffff</p>",
    				"allowApxSeeSeeApxSer": true,
    				"useAccess": false,
    				"apxFormTempId": 1,
    				"year": 2021,
    				"adjScore": 0,
    				"allowEmpExportExcel": true,
    				"iRev": 9,
    				"overallGrade": "",
    				"sysJson": "",
    				"apxSerNum": 1,
    				"viewCode": "apxRecord",
    				"beId": 0,
    				"apxPeriodFrom": 1631635200000,
    				"apxFormDesc": "",
    				"allowApxSerSeeApxSee": true,
    				"printCount": 0,
    				"useAccessBl": false,
    				"showApxSeeComment": false,
    				"showApxSerComment": false,
    				"id": 9,
    				"statusModifyDate": 1631673321000,
    				"forceDistGrade": "",
    				"lastModifyDate": 1631680033000,
    				"createUid": 4,
    				"createDate": 1631673133000,
    				"lastApproveUid": 0,
    				"overallScore": 0,
    				"excludeNotApp": false,
    				"apxTypeId": 1,
    				"apxSerComment": "",
    				"useAccessWl": false,
    				"allowSerSeeOtherSer": true,
    				"adjGrade": "",
    				"apxPeriodTo": 1631635200000,
    				"enablePayInfo": false,
    				"reqApxSeeComment": false,
    				"udffqStr": "",
    				"reqApxSerComment": false,
    				"useAccessAutoCalc": false,
    				"status": "I"
    			}
    		],
    		"apxrecordqusanswer": [
    			{
    				"hId": 9,
    				"appraiseAction": "apxSee",
    				"question": "Who are you?",
    				"iRev": 9,
    				"sectionOrder": 1,
    				"qusType": "openQus",
    				"apxSerN": 0,
    				"itemNo": "",
    				"qusNum": 1,
    				"footerKey": 4,
    				"confirmAnswer": false,
    				"qusAnswer": "AAA",
    				"id": 37
    			},
    			{
    				"hId": 9,
    				"appraiseAction": "apxSer",
    				"question": "Who are you?",
    				"iRev": 9,
    				"sectionOrder": 1,
    				"qusType": "openQus",
    				"apxSerN": 1,
    				"itemNo": "",
    				"qusNum": 1,
    				"footerKey": 4,
    				"confirmAnswer": false,
    				"qusAnswer": "",
    				"id": 38
    			},
    		],
    	},
    	"messages": [],
    	"status": true
    }
    
    {
        "data": {},
        "messages": [
            {
                "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限",
                "msgCode": "core_141019"
            }
        ],
        "status": false
    }
    

# 保存绩效记录

# 接口描述

用于保存绩效记录

# 接口调用说明

  1. 请求说明

    URL http://[server]/jsf/rfws/root/api/save/apxRecord
    HTTP 请求方式 PUT
    编码类型 UTF-8
  2. URL 参数

    参数 类型 必填 说明
    authorization String (Header) Y 通过 OAuth 获取的 Access Token
    client_id String (Header) Y M18 授权应用列表中的 Client ID
    menuCode String (Query) Y 可在 Data Dictionary 中找到
    Eg: apxRecord
    entity String (Body) Y JSON (可参考请求示例中的相关参数)
  3. 请求示例

    long recordId = 0;
    
    CloseableHttpClient client = HttpClientBuilder.create().build();
    CloseableHttpResponse res = null;
    try {
    
        String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/apxRecord";
    
        StringBuilder paramStrBuilder = new StringBuilder();
        paramStrBuilder.append("&menuCode=").append("apxRecord");
    
        HttpPut put = new HttpPut(url + "?" + paramStrBuilder.toString());
        put.addHeader("authorization", access_token);
        put.addHeader("client_id", ClientID);
    
        StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
        entity.setContentEncoding("UTF-8");
        put.setEntity(entity);
    
        res = client.execute(put);
        if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
            JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
    
            if (json != null) {
                recordId = json.getLongValue("recordId");
            }
    
            System.out.println(json);
        }
    
        put.releaseConnection();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        try {
            if (res != null) {
                res.close();
            }
            if (client != null) {
                client.close();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    

    其中 Entity 的 JSON 格式如下:

    {
        "apxrecord": {
            "values": [
                {
                    "id": 18,
                    "adjScore": 37.5,
                    "adjGrade": "D"
                }
            ]
        }
    }
    
  4. 返回示例

    {
    	"recordId": 18,
    	"messages": [],
    	"status": true
    }
    
    {
        "recordId": 0,
        "messages": [
            {
                "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限",
                "msgCode": "core_141019"
            }
        ],
        "status": false
    }
    

# 删除绩效记录

# 接口描述

用于删除指定 ID 的绩效记录

# 接口调用说明

  1. 请求说明

    URL http://[server]/jsf/rfws/root/api/delete/apxRecord
    HTTP 请求方式 DELETE
    编码类型 UTF-8
  2. URL 参数

    参数 类型 必填 说明
    authorization String (Header) Y 通过 OAuth 获取的 Access Token
    client_id String (Header) Y M18 授权应用列表中的 Client ID
    menuCode String (Query) Y 可在 Data Dictionary 中找到
    Eg: apxRecord
    id long (Query) Y 绩效记录 ID,可参考获取绩效记录单据列表返回的 ID
  3. 请求示例

    CloseableHttpClient client = HttpClientBuilder.create().build();
    CloseableHttpResponse res = null;
    try {
    
        String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/apxRecord";
    
        StringBuilder paramStrBuilder = new StringBuilder();
        paramStrBuilder.append("&menuCode=").append("apxRecord");
        paramStrBuilder.append("&id=").append(id);
    
        HttpDelete delete = new HttpDelete(url + "?" + paramStrBuilder.toString());
        delete.addHeader("authorization", access_token);
        delete.addHeader("client_id", ClientID);
    
        res = client.execute(delete);
        if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
            JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
    
            System.out.println(json);
        }
    
        delete.releaseConnection();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        try {
            if (res != null) {
                res.close();
            }
            if (client != null) {
                client.close();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
  4. 返回示例

    {
        "messages": [],
        "status": true
    }
    
    {
        "messages": [
            {
                "msgDetail": "单据已被删除",
                "msgCode": "core_101017"
            }
        ],
        "status": false
    }
    

# 读取EBI数据

# 绩效报告

# 接口描述

用于按照指定 EBI 格式读取 [绩效报告] EBI,并返回数据

# 接口调用说明

  1. 请求说明

    URL http://[server]/jsf/rfws/ebiWidget/loadReport
    HTTP 请求方式 GET
    编码类型 UTF-8
  2. URL 参数

    参数 类型 必填 说明
    authorization String (Header) Y 通过 OAuth 获取的 Access Token
    client_id String (Header) Y M18 授权应用列表中的 Client ID
    formatId long (Query) Y 通过 EBI 接口获得
    offset int (Query) N 返回结果的开始行
    rows int (Query) N 返回结果行数
  3. 请求示例

    CloseableHttpClient client = HttpClientBuilder.create().build();
    CloseableHttpResponse res = null;
    try {
    
        String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
    
        StringBuilder paramStrBuilder = new StringBuilder();
        paramStrBuilder.append("&formatId=").append(formatId);
        paramStrBuilder.append("&offset=").append(0);
        paramStrBuilder.append("&rows=").append(10);
    
        HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString());
        get.addHeader("authorization", access_token);
        get.addHeader("client_id", ClientID);
        res = client.execute(get);
        if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
            JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
    
            System.out.println(json);
        }
    
        get.releaseConnection();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        try {
            if (res != null) {
                res.close();
            }
            if (client != null) {
                client.close();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
  4. 返回示例

    {
        "size": 1,
        "rows": [
            {
                "T1_A_adjScore": "0.00",
    			"M18ReservedCol_dataIndex": 1,
    			"T1_A_empId": "13695",
    			"T1_A_adjGrade": "",
    			"T1_A_apxPeriodFrom": "2022-07-04",
    			"T1_A_empId_code": "EL005",
    			"T1_A_id": "10670",
    			"T1_A_apxPeriodTo": "2022-07-04",
    			"T2_A_id": "13695",
    			"T2_A_code": "EL005",
    			"T1_A_code": "APX220700002"
            }
        ]
    }
    

ebi_apxrecord