Commit c5d9f242 authored by hongguangwu's avatar hongguangwu

MVP1.7.17-离职待办-优化代码

parent b2d5b985
...@@ -200,7 +200,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -200,7 +200,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} }
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) { if (user == null || Common.isEmpty(user.getId())) {
user = this.getNewYifuUser(); user = this.getNewYifuUser(tEmployeeContractInfo.getLeaveName());
} }
if (user == null || Common.isEmpty(user.getId())) { if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN); return R.failed(CommonConstants.PLEASE_LOG_IN);
...@@ -508,6 +508,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -508,6 +508,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
initType(tEmployeeContractInfo); initType(tEmployeeContractInfo);
if (Common.isEmpty(tEmployeeContractInfo.getId())) { if (Common.isEmpty(tEmployeeContractInfo.getId())) {
if (Common.isEmpty(tEmployeeContractInfo.getApplyNo())) {
String code = this.getCode(true);
tEmployeeContractInfo.setApplyNo(code);
}
// 针对编码再做一次重复性校验 // 针对编码再做一次重复性校验
String isCur = baseMapper.getContractByApplyNo(tEmployeeContractInfo.getApplyNo()); String isCur = baseMapper.getContractByApplyNo(tEmployeeContractInfo.getApplyNo());
if (Common.isNotNull(isCur)) { if (Common.isNotNull(isCur)) {
...@@ -2521,12 +2525,17 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -2521,12 +2525,17 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} }
} }
private YifuUser getNewYifuUser() { private YifuUser getNewYifuUser(String leaveName) {
if (Common.isEmpty(leaveName)) {
leaveName = "自动化派单";
} else {
leaveName = "自动化派单-" + leaveName;
}
Set<String> dbAuthsSet = new HashSet<>(); Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0])); .createAuthorityList(dbAuthsSet.toArray(new String[0]));
return new YifuUser("6", 1L, "", "自动化派单", return new YifuUser("6", 1L, "", leaveName,
"自动化派单", "0", SecurityConstants.BCRYPT + "123456", leaveName, "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true, "12345678911", true, true, true,
true, true,
"1", authorities, "1", "1", authorities, "1",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment