Skip to content
Open
9 changes: 9 additions & 0 deletions weixin-java-cp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<argLine>
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weixin-java-cp/pom.xml:128: These --add-opens JVM args are only supported on Java 9+, so if this module’s tests are ever executed on JDK8 the forked test JVM will fail to start. Consider guarding this configuration so it only applies on JDK9+ runs.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
--add-opens java.base/java.io=ALL-UNNAMED
--add-opens java.base/java.security=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.management/javax.management=ALL-UNNAMED
--add-opens java.naming/javax.naming=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
* 人事助手-员工档案数据(单个员工).
* 人事助手-员工档案数据(单个字段).
*
* @author <a href="https://github.com/leejoker">leejoker</a> created on 2024-01-01
*/
Expand All @@ -18,35 +17,120 @@ public class WxCpHrEmployeeFieldData implements Serializable {
private static final long serialVersionUID = 4593693598671765396L;

/**
* 员工userid.
* 字段ID.
*/
@SerializedName("fieldid")
private Integer fieldId;

/**
* 子字段索引.
*/
@SerializedName("sub_idx")
private Integer subIdx;

/**
* 结果状态,1表示成功.
*/
@SerializedName("result")
private Integer result;

/**
* 值类型:1-字符串,2-uint64,3-uint32,4-int64,5-mobile.
*/
@SerializedName("value_type")
private Integer valueType;

/**
* 字符串值(value_type=1时使用).
*/
@SerializedName("value_string")
private String valueString;

/**
* 无符号32位整数值(value_type=3时使用).
*/
@SerializedName("value_uint32")
private Long valueUint32;

/**
* 有符号64位整数值(value_type=4时使用).
*/
@SerializedName("value_int64")
private Long valueInt64;

/**
* 无符号64位整数值(value_type=2时使用).
*/
@SerializedName("value_uint64")
private Long valueUint64;

/**
* 手机号值(value_type=5时使用).
*/
@SerializedName("value_mobile")
private MobileValue valueMobile;

/**
* 手机号值.
*/
@Data
@NoArgsConstructor
public static class MobileValue implements Serializable {
private static final long serialVersionUID = 1L;

/**
* 国家代码.
*/
@SerializedName("value_country_code")
private String valueCountryCode;

/**
* 手机号.
*/
@SerializedName("value_mobile")
private String valueMobile;
}

/**
* 员工userid(兼容旧版本,实际API不返回此字段).
* @deprecated 此字段在API响应中不存在
*/
@Deprecated
@SerializedName("userid")
private String userid;

/**
* 字段数据列表.
* 字段数据列表(兼容旧版本,实际API不返回此字段).
* @deprecated 此字段在API响应中不存在
*/
@Deprecated
@SerializedName("field_list")
private List<FieldItem> fieldList;
private java.util.List<FieldItem> fieldList;

/**
* 字段数据项.
* 字段数据项(用于更新员工档案).
*/
@Data
@NoArgsConstructor
public static class FieldItem implements Serializable {
private static final long serialVersionUID = 1L;

/**
* 字段key.
* 字段ID.
*/
@SerializedName("field_key")
private String fieldKey;
@SerializedName("fieldid")
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/hr/WxCpHrEmployeeFieldData.java:121: FieldItem no longer has the old fieldKey/field_key property, which is a source-level breaking change for existing update code even though other compatibility shims were added elsewhere. If the API still accepts field_key in some scenarios, consider keeping a deprecated alias to reduce upgrade pain.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

private Integer fieldId;

/**
* 字段值.
* 字段值对象(推荐使用,支持多种类型).
*/
@SerializedName("field_value")
private WxCpHrEmployeeFieldValue fieldValue;

/**
* 字符串值(简化用法,适用于文本类型字段).
*/
@SerializedName("value_string")
private String valueString;
Comment on lines 118 to +134
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,28 @@ public class WxCpHrEmployeeFieldDataResp extends WxCpBaseResp {
private static final long serialVersionUID = 6593693598671765396L;

/**
* 员工档案数据列表.
* 字段数据列表(API实际返回field_info).
*/
@SerializedName("employee_field_list")
private List<WxCpHrEmployeeFieldData> employeeFieldList;
@SerializedName("field_info")
private List<WxCpHrEmployeeFieldData> fieldInfoList;

/**
* 员工档案数据列表(兼容旧版本方法名).
* @deprecated 请使用 getFieldInfoList()
*/
@Deprecated
public List<WxCpHrEmployeeFieldData> getEmployeeFieldList() {
return this.fieldInfoList;
}

/**
* 员工档案数据列表(兼容旧版本方法名).
* @deprecated 请使用 setFieldInfoList()
*/
@Deprecated
public void setEmployeeFieldList(List<WxCpHrEmployeeFieldData> employeeFieldList) {
this.fieldInfoList = employeeFieldList;
}

/**
* From json wx cp hr employee field data resp.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,43 @@ public class WxCpHrEmployeeFieldInfo implements Serializable {
private static final long serialVersionUID = 2593693598671765396L;

/**
* 字段key.
* 字段ID.
*/
@SerializedName("field_key")
private String fieldKey;

/**
* 字段英文名称.
*/
@SerializedName("field_en_name")
private String fieldEnName;
@SerializedName("fieldid")
private Integer fieldId;

/**
* 字段中文名称.
* 字段名称.
*/
@SerializedName("field_zh_name")
private String fieldZhName;
@SerializedName("field_name")
private String fieldName;

/**
* 字段类型.
* 具体取值参见 {@link WxCpHrFieldType}
* 1: 文本
* 2: 单选/多选
* 3: 日期
*/
@SerializedName("field_type")
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/hr/WxCpHrEmployeeFieldInfo.java:38: The new field_type value description (1/2/3) conflicts with WxCpHrFieldType (where 2 maps to DATE, 4/5 map to select types), which could make getFieldTypeEnum() misleading/incorrect. Could you double-check the field_type codes against the actual HR API response and keep the enum/docs consistent?

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

private Integer fieldType;

/**
* 是否必填.
*/
@SerializedName("is_must")
private Boolean isMust;

/**
* 值类型.
* 1: 字符串
* 2: uint64
* 3: uint32
* 4: int64
* 5: mobile
*/
@SerializedName("value_type")
private Integer valueType;

/**
* 获取字段类型枚举.
*
Expand All @@ -52,22 +65,79 @@ public WxCpHrFieldType getFieldTypeEnum() {
}

/**
* 是否系统字段.
* 0: 否
* 1: 是
* 选项列表(单选/多选字段专用).
*/
@SerializedName("option_list")
private List<Option> optionList;

/**
* 选项.
*/
@Data
@NoArgsConstructor
public static class Option implements Serializable {
private static final long serialVersionUID = 1L;

/**
* 选项ID.
*/
@SerializedName("id")
private Integer id;

/**
* 选项值.
*/
@SerializedName("value")
private String value;
Comment on lines +82 to +91
}

// ===== 以下字段为兼容旧版本 =====

/**
* 字段key(兼容旧版本,实际API不返回此字段).
* @deprecated 使用 fieldId 代替
*/
@Deprecated
@SerializedName("field_key")
private String fieldKey;

/**
* 字段英文名称(兼容旧版本,实际API不返回此字段).
* @deprecated 此字段在API响应中不存在
*/
@Deprecated
@SerializedName("field_en_name")
private String fieldEnName;

/**
* 字段中文名称(兼容旧版本).
* @deprecated 使用 fieldName 代替
*/
@Deprecated
@SerializedName("field_zh_name")
private String fieldZhName;

/**
* 是否系统字段(兼容旧版本,实际API不返回此字段).
* @deprecated 此字段在API响应中不存在
*/
@Deprecated
@SerializedName("is_sys")
private Integer isSys;

/**
* 字段详情.
* 字段详情(兼容旧版本).
* @deprecated 使用 optionList 直接访问选项列表
*/
@Deprecated
@SerializedName("field_detail")
private FieldDetail fieldDetail;

/**
* 字段详情.
* 字段详情(兼容旧版本).
* @deprecated 使用 optionList 代替
*/
@Deprecated
@Data
@NoArgsConstructor
public static class FieldDetail implements Serializable {
Expand All @@ -77,15 +147,17 @@ public static class FieldDetail implements Serializable {
* 选项列表(单选/多选字段专用).
*/
@SerializedName("option_list")
private List<Option> optionList;
private List<OldOption> optionList;
}

/**
* 选项.
* 旧版选项(兼容旧版本).
* @deprecated 使用 Option 代替
*/
@Deprecated
@Data
@NoArgsConstructor
public static class Option implements Serializable {
public static class OldOption implements Serializable {
private static final long serialVersionUID = 1L;

/**
Expand Down
Loading