This commit is contained in:
Paidax
2025-03-27 15:38:56 +08:00
parent 7410b3a181
commit 50aa04192a
47 changed files with 4438 additions and 686 deletions
@@ -39,23 +39,6 @@ public interface SourceData {
// Assert.isTrue(jsonResult.getBoolean("success"), jsonResult.getString("data"));
}
/**
* 不进系统人员类型
*/
List<String> NOT_ENTERING_PERSON_TYPE = List.of("退休人员", "兼职教师", "非全日用工(项目临聘)", "服务外包和其他人员",
"教学编制2", "教学教师(附属医院)", "教学编制", "离休人员", "临时人员", "非全日制工", "博士后(在职)");
/**
* 不进系统在职状态
* 01 退休
* 05 调出
* 06 辞职
* 07 离职
* @see io.v.nutz.zhgh.data.constant.HMCFieldCode#USER_STATE_CODE
*/
List<String> NOT_ENTERING_USER_STATE = List.of("01", "05", "06", "07");
List<String> NOT_ENTERING_USER_LOGIN_NAME = List.of("2020000410", "2008000010");
/**
* 接口中的数据跟SourceUser的对应关系
* <p>
@@ -83,6 +66,7 @@ public interface SourceData {
put("ZYJSZWDJ", new String[]{"professionalTechnicalLevel"}); // 专业技术等级
put("JZGLBM", new String[]{"userCategory"}); // 教职工类别
put("GWLBM", new String[]{"jobCategory"}); // 岗位类别
put("LXRQ", new String[]{"schoolTime"}); // 岗位类别
}};
/**
@@ -119,11 +103,6 @@ public interface SourceData {
// checkSuccess(map);
List<NutMap> data = map.getAsList("data", NutMap.class);
for (NutMap row : data) {
if (NOT_ENTERING_PERSON_TYPE.contains(row.getString("RYFLMC"))
|| NOT_ENTERING_USER_LOGIN_NAME.contains(row.getString("GH"))
|| NOT_ENTERING_USER_STATE.contains(row.getString("DQZTM"))) {
continue;
}
Map entity = new HashMap(500);
row.forEach((k, v) -> {
@@ -4,23 +4,18 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HtmlUtil;
import io.v.nutz.base.utils.ManyAddOrRenewUtil;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.sys.models.Sys_dict;
import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.services.SysDictService;
import io.v.nutz.sys.services.SysUserRoleService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
import io.v.nutz.zhgh.data.constant.SourceData;
import io.v.nutz.zhgh.data.constant.UserChangeType;
import io.v.nutz.zhgh.data.model.UserHistory;
import io.v.nutz.zhgh.data.model.UserSource;
import io.v.nutz.zhgh.data.service.HistoryUserService;
import io.v.nutz.zhgh.data.service.SourceUserService;
import io.v.nutz.zhgh.data.vo.SourceUserCommonVo;
import io.v.nutz.zhgh.staffmanage.member.UserMode;
import io.v.nutz.base.service.AsyncService;
import io.v.nutz.base.service.impl.ViServiceImpl;
@@ -51,14 +46,12 @@ import org.nutz.lang.random.R;
import org.nutz.lang.util.NutMap;
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
import org.springframework.beans.BeanUtils;
import org.springframework.util.StringUtils;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@@ -72,6 +65,18 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
super(dao);
}
/**
* 不进系统人员类型
*/
private final List<String> NOT_ENTERING_PERSON_TYPE = List.of("退休人员", "兼职教师", "非全日用工(项目临聘)", "服务外包和其他人员",
"教学编制2", "教学教师(附属医院)", "教学编制", "离休人员", "临时人员", "非全日制工", "博士后(在职)");
/**
* 不进系统在职状态
* @see io.v.nutz.zhgh.data.constant.HMCFieldCode#USER_STATE_CODE
*/
private final List<String> NOT_ENTERING_USER_STATE = List.of("退休", "调出", "辞职", "离职");
private final List<String> NOT_ENTERING_USER_LOGIN_NAME = List.of("2020000410", "2008000010");
@Inject
private AsyncService asyncService;
@@ -179,6 +184,10 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
source.setWelfareMember(null);
Sys_user user = userMap.get(source.getLoginname().toLowerCase());
boolean isNotEnterUser = NOT_ENTERING_PERSON_TYPE.contains(source.getPersonType())
|| NOT_ENTERING_USER_LOGIN_NAME.contains(source.getLoginname())
|| NOT_ENTERING_USER_STATE.contains(source.getUserState());
if (isAuto) {
checkMemberOrWelfareMember(changeConfig, source, user, addMemberUserIds, deleteMemberUserIds,
addWelfareMemberUserIds, deleteWelfareMemberUserIds);
@@ -220,18 +229,24 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
if (Lang.isEmpty(history)) {
continue;
}
histories.add(history);
if (history.getChangeTypes().contains(MemberChangeType.NEW.getType())) {
if (user != null) {
histories.add(history);
}
if (!isNotEnterUser && history.getChangeTypes().contains(MemberChangeType.NEW.getType())) {
needInitUserList.add(u);
histories.add(history);
}
} else {
SourceChangeMiddleTable table = createSourceChangeMiddleTable(source, user, dictMap, allowChangeFieldNames);
if (Lang.isEmpty(table)) {
continue;
}
middleTables.add(table);
if (table.getChangeTypes().contains(MemberChangeType.NEW.getType())) {
if (user != null) {
middleTables.add(table);
}
if (!isNotEnterUser && table.getChangeTypes().contains(MemberChangeType.NEW.getType())) {
needInitUserList.add(u);
middleTables.add(table);
}
}
}