Commit c4164d70 authored by huyuchen's avatar huyuchen

Merge remote-tracking branch 'origin/MVP1.4' into MVP1.4

parents c2fdeb3c d6e864bb
......@@ -1548,15 +1548,25 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
employee = tEmployeeInfoMapper.selectById(employeeInfo.getEmpId());
initEmpBusinessInfo(employeeInfo, employee, businessVo, tBusinessEmployeeExtendInfo);
}
// 获取合同数据
// 获取合同数据(去除作废,终止)
List<TEmployeeContractInfo> contractInfoList = contractInfoMapper.selectList(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard,employeeInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getIsObsolete,CommonConstants.ZERO_STRING)
.ne(TEmployeeContractInfo::getSituation, EmployeeConstants.SITUATION_SIX)
.ne(TEmployeeContractInfo::getSituation, EmployeeConstants.SITUATION_SEVEN)
.eq(TEmployeeContractInfo::getSettleDomain, settleDomain)
.orderByDesc(TEmployeeContractInfo::getContractStart));
// 获取合同数据(全部2023-1-16 11:32:12 倩倩要求:B端人员里要看到作废中止的合同(原话:显示没有问题))
List<TEmployeeContractInfo> allContractInfoList = contractInfoMapper.selectList(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard,employeeInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getIsObsolete,CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getSettleDomain, settleDomain)
.orderByDesc(TEmployeeContractInfo::getContractStart));
// 处理详情对应的合同信息
if (Common.isNotNull(contractInfoList)){
initEmpBusinessContractInfo(businessDetailVo, contractInfoList);
initEmpBusinessContractInfo(businessDetailVo, contractInfoList, allContractInfoList);
}
// 获取最高学历
List<TEmpEducation> educations = empEducationMapper.selectList(Wrappers.<TEmpEducation>query().lambda()
......@@ -1606,14 +1616,15 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return R.ok(businessVo);
}
private void initEmpBusinessContractInfo(EmployeeBusinessDetailVo businessDetailVo, List<TEmployeeContractInfo> contractInfoList) {
private void initEmpBusinessContractInfo(EmployeeBusinessDetailVo businessDetailVo
, List<TEmployeeContractInfo> contractInfoList, List<TEmployeeContractInfo> allContractInfoList) {
businessDetailVo.setSituationCount(contractInfoList.size());
if (businessDetailVo.getSituationCount() > CommonConstants.ONE_INT){
businessDetailVo.setSituation(EmpBusinessConstants.empContractSituationRenew);
}else {
businessDetailVo.setSituation(EmpBusinessConstants.empContractSituationNew);
}
businessDetailVo.setContractInfoList(contractInfoList);
businessDetailVo.setContractInfoList(allContractInfoList);
TEmployeeContractInfo contractInfo = contractInfoList.get(CommonConstants.ZERO_INT);
if (null != contractInfo.getContractEnd()){
businessDetailVo.setContractEndDate(DateUtil.formatDate(contractInfo.getContractEnd()));
......
......@@ -14,6 +14,9 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -652,4 +655,9 @@ public class Common {
}
return errorMessageList;
}
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
Set<Object> seen = ConcurrentHashMap.newKeySet();
return t -> seen.add(keyExtractor.apply(t));
}
}
......@@ -22,6 +22,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.ehcache.impl.internal.util.ServiceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
......@@ -235,19 +236,21 @@ public class BusinessUserController {
Set<SysMenu> all = new HashSet<>();
SecurityUtils.getRolesByClient(ClientNameConstants.CLIENT_B)
.forEach(roleId -> all.addAll(sysMenuService.findMenuByRoleId(roleId)));
List<MenuTreeForVue> menuTreeList;
if (Common.isNotNull(type)) {
menuTreeList = all.stream()
.filter(menuVo -> type.equals(menuVo.getType()))
.map(MenuTreeForVue::new)
.sorted(Comparator.comparingInt(MenuTreeForVue::getSort))
.collect(Collectors.toList());
} else {
menuTreeList = all.stream()
.map(MenuTreeForVue::new)
.sorted(Comparator.comparingInt(MenuTreeForVue::getSort))
.collect(Collectors.toList());
}
List<MenuTreeForVue> menuTreeList = null;
if (Common.isNotNull(all)){
if (Common.isNotNull(type)) {
menuTreeList = all.stream().filter(Common.distinctByKey(SysMenu::getMenuId))
.filter(menuVo -> type.equals(menuVo.getType()))
.map(MenuTreeForVue::new)
.sorted(Comparator.comparingInt(MenuTreeForVue::getSort))
.collect(Collectors.toList());
} else {
menuTreeList = all.stream().filter(Common.distinctByKey(SysMenu::getMenuId))
.map(MenuTreeForVue::new)
.sorted(Comparator.comparingInt(MenuTreeForVue::getSort))
.collect(Collectors.toList());
}
}
return new R<>(TreeUtil.bulid(menuTreeList, -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