From 22b97944b326bca3104e459d88ed7bce16545ae0 Mon Sep 17 00:00:00 2001 From: zhongjun96 Date: Tue, 26 Apr 2022 14:53:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1):OA-?= =?UTF-8?q?=E6=89=93=E5=8D=A1-=E5=BD=95=E5=85=A5=E6=89=93=E5=8D=A1?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BA=BA=E8=84=B8=E4=BF=A1=E6=81=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weixin/common/error/WxCpErrorMsgEnum.java | 20 +++++++++++++++++++ .../chanjar/weixin/cp/api/WxCpOaService.java | 13 ++++++++++++ .../weixin/cp/api/impl/WxCpOaServiceImpl.java | 9 +++++++++ .../weixin/cp/constant/WxCpApiPathConsts.java | 1 + 4 files changed, 43 insertions(+) diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxCpErrorMsgEnum.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxCpErrorMsgEnum.java index 0b6c774e06..ea1e9e7c68 100644 --- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxCpErrorMsgEnum.java +++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxCpErrorMsgEnum.java @@ -1096,6 +1096,26 @@ public enum WxCpErrorMsgEnum { * 通用错误码,提交审批单内部接口失败 */ CODE_301057(301057, "通用错误码,提交审批单内部接口失败"), + /** + * 输入userid无对应成员 + */ + CODE_301069(301069,"输入userid无对应成员"), + /** + * 系统错误,请稍后再试 + */ + CODE_301070(301070,"系统错误,请稍后再试"), + /** + * 企业内有其他人员有相似人脸,此情况下人脸仍然会录入成功 + */ + CODE_301071(301071,"企业内有其他人员有相似人脸,此情况下人脸仍然会录入成功"), + /** + * 人脸图像数据错误请更换图片 + */ + CODE_301072(301072,"企业内有其他人员有相似人脸,此情况下人脸仍然会录入成功"), + /** + * 输入参数错误 + */ + CODE_301075(301075,"输入参数错误"), /** * 批量导入任务的文件中userid有重复. */ diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaService.java index 9dcea51746..69fabb5694 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaService.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaService.java @@ -255,4 +255,17 @@ List getDialRecord(Date startTime, Date endTime, Integer offset, * @throws WxErrorException the wx error exception */ void setCheckinScheduleList(WxCpSetCheckinSchedule wxCpSetCheckinSchedule) throws WxErrorException; + /** + *
+   * 录入打卡人员人脸信息
+   * 企业可通过打卡应用Secret调用本接口,为企业打卡人员录入人脸信息,人脸信息仅用于人脸打卡。
+   * 上传图片大小限制:图片数据不超过1M
+   * 请求方式:POST(HTTPS)
+   * 请求地址:https://qyapi.weixin.qq.com/cgi-bin/checkin/addcheckinuserface?access_token=ACCESS_TOKEN
+   * 文档地址:https://developer.work.weixin.qq.com/document/path/93378
+   * 
+   * @param userId 需要录入的用户id
+   * @param userFace 需要录入的人脸图片数据,需要将图片数据base64处理后填入,对已录入的人脸会进行更新处理
+   */
+  void addCheckInUserFace(String userId, String userFace) throws WxErrorException;
 }
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImpl.java
index 0e227c8874..244bcdef84 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImpl.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImpl.java
@@ -354,4 +354,13 @@ public void setCheckinScheduleList(WxCpSetCheckinSchedule wxCpSetCheckinSchedule
     final String url = this.mainService.getWxCpConfigStorage().getApiUrl(SET_CHECKIN_SCHEDULE_DATA);
     this.mainService.post(url, WxCpGsonBuilder.create().toJson(wxCpSetCheckinSchedule));
   }
+
+  @Override
+  public void addCheckInUserFace(String userId, String userFace) throws WxErrorException {
+    JsonObject jsonObject = new JsonObject();
+    jsonObject.addProperty("userid", userId);
+    jsonObject.addProperty("userface", userFace);
+    String url = this.mainService.getWxCpConfigStorage().getApiUrl(ADD_CHECK_IN_USER_FACE);
+    this.mainService.post(url, jsonObject.toString());
+  }
 }
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
index 2923d8f45a..cad78c1f4d 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
@@ -103,6 +103,7 @@ interface Oa {
     String GET_CHECKIN_MONTH_DATA = "/cgi-bin/checkin/getcheckin_monthdata";
     String GET_CHECKIN_SCHEDULE_DATA = "/cgi-bin/checkin/getcheckinschedulist";
     String SET_CHECKIN_SCHEDULE_DATA = "/cgi-bin/checkin/setcheckinschedulist";
+    String ADD_CHECK_IN_USER_FACE = "/cgi-bin/checkin/addcheckinuserface";
 
     /**
      * 审批