feat: 完善人员数据同步与筛选
- 在人员来源表中保存专业技术职务代码 ZYJSZWDM - 支持按所属单位、在职状态和人员类型筛选空数据 - 在获取信息中心数据和更新系统用户数据页面添加搜索重置按钮 - 同步人员时按人员类型或在职状态设置工会会员标记
This commit is contained in:
@@ -14,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
@@ -47,10 +48,10 @@ public class SysDataUserPullController {
|
||||
cnd.andEX(Sys_user_source::getPullTime, "=", pageForm.getPullTime());
|
||||
cnd.and(Cnd.likeEX(Sys_user_source::getUsername, pageForm.getUserName()));
|
||||
cnd.and(Cnd.likeEX(Sys_user_source::getLoginname, pageForm.getLoginName()));
|
||||
cnd.andEX(Sys_user_source::getUnitName, "=", pageForm.getUnitName());
|
||||
cnd.andEX(Sys_user_source::getUserState, "=", pageForm.getUserState());
|
||||
addSourceFilter(cnd, "us.unitName", pageForm.getUnitName());
|
||||
addSourceFilter(cnd, "us.userState", pageForm.getUserState());
|
||||
cnd.andEX(Sys_user_source::getPreparedBy, "=", pageForm.getPreparedBy());
|
||||
cnd.andEX(Sys_user_source::getPersonType, "=", pageForm.getPersonType());
|
||||
addSourceFilter(cnd, "us.personType", pageForm.getPersonType());
|
||||
|
||||
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
@@ -61,6 +62,15 @@ public class SysDataUserPullController {
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
private void addSourceFilter(Cnd cnd, String column, String value) {
|
||||
if ("__EMPTY__".equals(value)) {
|
||||
cnd.and(new Static("(%s IS NULL OR LOWER(%s) REGEXP '^[[:space:]]*(null)?[[:space:]]*$')"
|
||||
.formatted(column, column)));
|
||||
} else {
|
||||
cnd.andEX(column, "=", value);
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("sys.data.user.pull")
|
||||
@ApiOperation("拉取用户数据")
|
||||
|
||||
@@ -7,4 +7,18 @@ import com.budwk.app.sys.param.SysDataUserUpdateParam;
|
||||
*/
|
||||
public interface SysDataUserUpdateService {
|
||||
String update(SysDataUserUpdateParam updateParam);
|
||||
|
||||
static boolean qualifiesAsUnionMember(String personType, String userState) {
|
||||
if ("在岗".equals(userState)) {
|
||||
return true;
|
||||
}
|
||||
if (personType == null) {
|
||||
return false;
|
||||
}
|
||||
return switch (personType) {
|
||||
case "在编", "兰溪编制", "聘用合同制(享受人事代理待遇)",
|
||||
"聘用合同制", "聘用制专家", "人事代理" -> true;
|
||||
default -> false;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,6 +164,9 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
|
||||
// 创建用户对象
|
||||
Sys_user u = new Sys_user();
|
||||
BeanUtils.copyProperties(source, u);
|
||||
if (SysDataUserUpdateService.qualifiesAsUnionMember(u.getPersonType(), u.getUserState())) {
|
||||
u.setMember(true);
|
||||
}
|
||||
|
||||
if (user == null) {
|
||||
// 新增用户,初始化数据
|
||||
|
||||
@@ -123,6 +123,9 @@ public class SysDataUserIncrUpdateServiceImpl implements SysDataUserUpdateServic
|
||||
//加入到系统用户表
|
||||
List<Sys_user> sysUsers = BeanUtil.copyToList(userSources, Sys_user.class);
|
||||
for (Sys_user sysUser : sysUsers) {
|
||||
if (SysDataUserUpdateService.qualifiesAsUnionMember(sysUser.getPersonType(), sysUser.getUserState())) {
|
||||
sysUser.setMember(true);
|
||||
}
|
||||
//重新设置
|
||||
sysUser.setId(R.UU32());
|
||||
String salt = R.UU32();
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<slot></slot>
|
||||
<div class="search-query" v-if="isSearchButton">
|
||||
<el-button type="primary" icon="el-icon-search" @click="$emit('search', null)">搜索</el-button>
|
||||
<slot name="actions"></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -38,13 +38,13 @@ layout("/layouts/platform.html"){
|
||||
<el-input placeholder="请输入工号" clearable v-model="pageForm.loginName" style="width: 100%"></el-input>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select placeholder="请选择所属单位" v-model="pageForm.unitName" clearable filterable>
|
||||
<el-option v-for="item in unitNameOptions" :key="item" :label="item" :value="item"></el-option>
|
||||
<el-select placeholder="全部" v-model="pageForm.unitName" clearable filterable>
|
||||
<el-option v-for="item in unitNameOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="在职状态">
|
||||
<el-select v-model="pageForm.userState" clearable filterable>
|
||||
<el-option v-for="item in userStateOptions" :label="item" :value="item"></el-option>
|
||||
<el-select placeholder="全部" v-model="pageForm.userState" clearable filterable>
|
||||
<el-option v-for="item in userStateOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<!-- 暂停用人方式筛选,保留查询控件供后续恢复。
|
||||
@@ -55,10 +55,11 @@ layout("/layouts/platform.html"){
|
||||
</search-item>
|
||||
-->
|
||||
<search-item label="人员类型">
|
||||
<el-select v-model="pageForm.personType" clearable filterable>
|
||||
<el-option v-for="item in personTypeOptions" :label="item" :value="item"></el-option>
|
||||
<el-select placeholder="全部" v-model="pageForm.personType" clearable filterable>
|
||||
<el-option v-for="item in personTypeOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<el-button slot="actions" icon="el-icon-refresh-left" @click="resetSearch">重置</el-button>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
@@ -125,6 +126,16 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
resetSearch() {
|
||||
this.$set(this.pageForm, "userName", "")
|
||||
this.$set(this.pageForm, "loginName", "")
|
||||
this.$set(this.pageForm, "unitName", "")
|
||||
this.$set(this.pageForm, "userState", "")
|
||||
this.$set(this.pageForm, "personType", "")
|
||||
this.$set(this.pageForm, "preparedBy", "")
|
||||
this.$set(this.pageForm, "pullTime", (this.pullTimeOptions[0] || {}).pullTime || "")
|
||||
this.doSearch()
|
||||
},
|
||||
pull() {
|
||||
// 拉取未结束时不再打开确认框或发送重复请求。
|
||||
if (this.pullLoading) return
|
||||
@@ -149,6 +160,7 @@ layout("/layouts/platform.html"){
|
||||
.then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.getSearchOptions()
|
||||
this.getPullTimeOptions()
|
||||
this.doSearch()
|
||||
}
|
||||
@@ -162,12 +174,24 @@ layout("/layouts/platform.html"){
|
||||
.catch(() => {})
|
||||
},
|
||||
|
||||
buildSearchOptions(values) {
|
||||
const optionValues = new Set(values.map(value =>
|
||||
value == null || /^(?:null)?$/i.test(value.trim()) ? "__EMPTY__" : value
|
||||
))
|
||||
const hasEmpty = optionValues.delete("__EMPTY__")
|
||||
const options = Array.from(optionValues, value => ({ label: value, value }))
|
||||
if (hasEmpty) {
|
||||
options.push({ label: "空数据", value: "__EMPTY__" })
|
||||
}
|
||||
return options
|
||||
},
|
||||
|
||||
getSearchOptions() {
|
||||
this.$axios.post("/platform/sys/data/user/pull/searchOptions").then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.unitNameOptions = resp.data.unitNames
|
||||
this.userStateOptions = resp.data.userStates
|
||||
this.personTypeOptions = resp.data.personTypes
|
||||
this.unitNameOptions = this.buildSearchOptions(resp.data.unitNames)
|
||||
this.userStateOptions = this.buildSearchOptions(resp.data.userStates)
|
||||
this.personTypeOptions = this.buildSearchOptions(resp.data.personTypes)
|
||||
this.preparedByOptions = resp.data.preparedBys
|
||||
}
|
||||
})
|
||||
@@ -206,6 +230,7 @@ layout("/layouts/platform.html"){
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.pullTimeDialogVisible = false
|
||||
this.getSearchOptions()
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -42,6 +42,7 @@ layout("/layouts/platform.html"){
|
||||
<search-item label="人员类型">
|
||||
<dict-select v-model="pageForm.personType" code="USER_PERSON_TYPE" style="width: 100%"></dict-select>
|
||||
</search-item>
|
||||
<el-button slot="actions" icon="el-icon-refresh-left" @click="resetSearch">重置</el-button>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
@@ -173,6 +174,14 @@ layout("/layouts/platform.html"){
|
||||
"member-all-change-info": MEMBER_ALL_CHANGE_INFO
|
||||
},
|
||||
methods: {
|
||||
resetSearch() {
|
||||
this.$set(this.pageForm, "userName", "")
|
||||
this.$set(this.pageForm, "loginName", "")
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
this.$set(this.pageForm, "userState", "")
|
||||
this.$set(this.pageForm, "personType", "")
|
||||
this.doSearch()
|
||||
},
|
||||
// 更新单位数据
|
||||
updateUnits() {
|
||||
if (this.unitUpdateLoading || this.updateLoading) return
|
||||
|
||||
Reference in New Issue
Block a user