人员数据治理调整

This commit is contained in:
2026-10-22 14:16:01 +08:00
parent ef9a6eddd5
commit cb1687a5fc
4 changed files with 41 additions and 3 deletions
@@ -68,7 +68,8 @@ public class PersonApiConfigServiceImpl extends BaseServiceImpl<PersonApiConfig>
public Pagination pageData(PageForm pageForm, String configName, String sourceType, Boolean enabled) {
CndPlus cnd = CndPlus.create();
cnd.andEX("configName", "like", Strings.isBlank(configName) ? null : "%" + configName + "%");
cnd.andEX("sourceType", "=", sourceType);
// 兼容其他调用方传入空字符串,空来源类型表示不按来源筛选。
cnd.andEX("sourceType", "=", Strings.isBlank(sourceType) ? null : sourceType.trim());
cnd.andEX("enabled", "=", enabled);
// 历史保存可能将删除标记写为NULL;仅明确标记为true的配置不在列表展示。
cnd.and(Cnd.exps("delFlag", "=", false).or("delFlag", "is", null)).desc("updatedAt");
@@ -12,7 +12,10 @@ $.ajaxSetup({
contentType: "application/x-www-form-urlencoded;charset=utf-8",
success: function (response, textStatus, jqXHR) {
if (response.code !== 0) {
this.$message.error(response.msg)
// AJAX全局回调没有Vue实例上下文,使用Element全局消息组件展示业务错误。
if (window.ELEMENT && ELEMENT.Message) {
ELEMENT.Message.error(response.msg)
}
} else {
return response
}
@@ -108,7 +108,15 @@
methods: {
pageData() {
this.$set(this, 'tableLoading', true)
return $.post(loc() + '/pageData', this.pageForm)
const params = {
pageNumber: this.pageForm.pageNumber,
pageSize: this.pageForm.pageSize,
}
// 未选择的查询条件不提交,避免空来源类型被后端拼成 sourceType=''。
if (this.pageForm.configName) params.configName = this.pageForm.configName
if (this.pageForm.sourceType) params.sourceType = this.pageForm.sourceType
if (this.pageForm.enabled !== '') params.enabled = this.pageForm.enabled
return $.post(loc() + '/pageData', params)
.then((res) => {
if (res.code === 0) {
this.$set(this, 'tableData', res.data.list)
@@ -511,11 +511,37 @@
this.$set(row, 'matchValue', '')
}
},
// 保存前递归检查两类规则树,避免无效规则进入后端后才返回校验异常。
validateRuleGroups(groups, ruleName) {
let message = ''
this.walkGroups(groups, (group) => {
if (message) return
;(group.conditions || []).some((condition) => {
if (!condition.mappedField) {
message = ruleName + '规则请选择映射字段'
return true
}
if (!condition.operator) {
message = ruleName + '规则请选择匹配方式'
return true
}
return false
})
})
return message
},
save() {
if (!this.form.configName || !this.form.apiConfigId) {
this.notifyWarning('请填写配置名称并选择API配置')
return
}
const ruleMessage =
this.validateRuleGroups(this.ruleGroups.UNION_MEMBER, '工会会员') ||
this.validateRuleGroups(this.ruleGroups.WELFARE_MEMBER, '福利会员')
if (ruleMessage) {
this.notifyWarning(ruleMessage)
return
}
this.$set(this, 'formLoading', true)
$.post(memberBase + '/save', {
data: JSON.stringify({