组织架构树排序、人员卡片BUG修复
This commit is contained in:
parent
5e950415ff
commit
7d1fc84fad
|
|
@ -27,10 +27,21 @@ public class UserCard {
|
|||
private String email;
|
||||
private String phone;
|
||||
private String belongTo;
|
||||
private String accountType;
|
||||
private String status;
|
||||
|
||||
public String getBelongTo() {
|
||||
return StringUtils.isBlank(belongTo) ? "主账号" : "次账号";
|
||||
public String getAccountType() {
|
||||
if (StringUtils.isBlank(accountType)) {
|
||||
return "";
|
||||
}
|
||||
switch (accountType) {
|
||||
case "0":
|
||||
return "主账号";
|
||||
case "1":
|
||||
return "次账号";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
|
|
@ -43,7 +54,7 @@ public class UserCard {
|
|||
public String getImage() {
|
||||
weaver.hrm.User user = new weaver.hrm.User();
|
||||
user.setLanguage(LanguageService.getDefaultLang());
|
||||
if(StringUtils.isNotBlank(image)&& image.contains("/")){
|
||||
if (StringUtils.isNotBlank(image) && image.contains("/")) {
|
||||
return image;
|
||||
}
|
||||
return FieldDefinedValueUtil.getFieldValue(user, ExtendInfoPO.builder().controlType(6).browserType("1").build(), image);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<result column="sex" property="sex"/>
|
||||
<result column="email" property="email"/>
|
||||
<result column="mobile" property="phone"/>
|
||||
<result column="belong_to" property="belongTo"/>
|
||||
<result column="account_type" property="accountType"/>
|
||||
<result column="status" property="status"/>
|
||||
</resultMap>
|
||||
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
sex,
|
||||
email,
|
||||
mobile,
|
||||
belong_to,
|
||||
account_type,
|
||||
status
|
||||
from jcl_org_hrmresource
|
||||
where id = #{id}
|
||||
|
|
|
|||
|
|
@ -225,6 +225,11 @@ public class OrganizationSyncEc {
|
|||
String oldName = oldJobPO.getJobName();
|
||||
|
||||
String newName = Util.null2String(params.get("job_name"));
|
||||
if(newName.equals(oldName)){
|
||||
this.resultMap = new HashMap<>();
|
||||
this.resultMap.put("sign", "1");
|
||||
return;
|
||||
}
|
||||
RecordInfo oldHrmJobTitle = getSystemDataMapper().getHrmJobTitleByName(oldName);
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
|
|
|||
|
|
@ -30,17 +30,35 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
public class OrgImportUtil {
|
||||
|
||||
/**
|
||||
* 插入导入日志信息
|
||||
*
|
||||
* @param importType
|
||||
* @param operateType
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
public static Long saveImportLog(String importType, String operateType, User user) {
|
||||
JclImportHistoryPO historyPO = JclImportHistoryPO.builder().operator((long) user.getUID()).operateTime(DateUtil.getFullDate()).clientAddress(user.getLoginip()).importType(importType).sourceFrom("excel").operateType(operateType).status("importing").build();
|
||||
MapperProxyFactory.getProxy(JclImportHistoryMapper.class).insertHistory(historyPO);
|
||||
return historyPO.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入导入日志详细信息
|
||||
*
|
||||
* @param historyDetailPO
|
||||
*/
|
||||
public static void saveImportDetailLog(JclImportHistoryDetailPO historyDetailPO) {
|
||||
String detailMsg = "导入第" + historyDetailPO.getRowNums() + "行数据," + historyDetailPO.getRelatedName() + historyDetailPO.getOperateDetail();
|
||||
String relatedName = "";
|
||||
if (StringUtils.isNotBlank(historyDetailPO.getRelatedName())) {
|
||||
relatedName = "[" + historyDetailPO.getRelatedName() + "]";
|
||||
}
|
||||
String detailMsg = "导入第" + historyDetailPO.getRowNums() + "行数据," + relatedName + historyDetailPO.getOperateDetail();
|
||||
historyDetailPO.setOperateDetail(detailMsg);
|
||||
MapperProxyFactory.getProxy(JclImportHistoryDetailMapper.class).insertHistoryDetail(historyDetailPO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换存入数据库的值
|
||||
*/
|
||||
|
|
@ -97,6 +115,12 @@ public class OrgImportUtil {
|
|||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取表格中的内容
|
||||
*
|
||||
* @param cell
|
||||
* @return
|
||||
*/
|
||||
public static String getCellValue(XSSFCell cell) {
|
||||
String cellValue = "";
|
||||
if (cell == null)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class SearchTreeUtil {
|
|||
// 排序,设置是否为叶子节点
|
||||
List<TreeNode> collect = treeList.stream().peek(item ->
|
||||
item.setIsParent(CollectionUtils.isNotEmpty(item.getSubs()))
|
||||
).sorted(Comparator.comparing(SearchTree::getOrderNum)).collect(Collectors.toList());
|
||||
).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(collect)) {
|
||||
treeDatas.addAll(collect);
|
||||
}
|
||||
|
|
@ -87,14 +87,16 @@ public class SearchTreeUtil {
|
|||
* @return
|
||||
*/
|
||||
public static List<SearchTree> builderTreeMode(List<SearchTree> treeList) {
|
||||
List<SearchTree> sortedList = treeList.stream().sorted(Comparator.comparing(SearchTree::getOrderNum)).collect(Collectors.toList());
|
||||
Map<String, List<TreeNode>> collects = sortedList.stream().collect(Collectors.groupingBy(TreeNode::getPid));
|
||||
Map<String, List<SearchTree>> collects = treeList.stream().collect(Collectors.groupingBy(TreeNode::getPid));
|
||||
Set<String> leafIds = new HashSet<>();
|
||||
List<SearchTree> collect = sortedList.stream().peek(e -> {
|
||||
e.setSubs(collects.get(e.getId()));
|
||||
leafIds.add(e.getId());
|
||||
if (CollectionUtils.isNotEmpty(e.getSubs())) {
|
||||
e.setIsParent(true);
|
||||
List<SearchTree> collect = treeList.stream().peek(e -> {
|
||||
if (null != collects && CollectionUtils.isNotEmpty(collects.get(e.getId()))) {
|
||||
List<TreeNode> nodes = collects.get(e.getId()).stream().sorted(Comparator.comparing(item -> null == item.getOrderNum() ? 0 : item.getOrderNum())).collect(Collectors.toList());
|
||||
e.setSubs(nodes);
|
||||
leafIds.add(e.getId());
|
||||
if (CollectionUtils.isNotEmpty(e.getSubs())) {
|
||||
e.setIsParent(true);
|
||||
}
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
return collect.stream().filter(item -> !leafIds.contains(item.getPid())).collect(Collectors.toList());
|
||||
|
|
@ -113,13 +115,14 @@ public class SearchTreeUtil {
|
|||
boolean isAdd = !childMap.isEmpty();
|
||||
Set<String> leafIds = new HashSet<>();
|
||||
List<SearchTree> collect = treeList.stream().peek(e -> {
|
||||
Set<TreeNode> treeNodes = new HashSet<>();
|
||||
Set<TreeNode> treeNodes = new LinkedHashSet<>();
|
||||
List<TreeNode> nodes = parentMap.get(e.getId());
|
||||
if (CollectionUtils.isNotEmpty(nodes)) {
|
||||
treeNodes.addAll(nodes);
|
||||
}
|
||||
if (isAdd && CollectionUtils.isNotEmpty(childMap.get(e.getId()))) {
|
||||
treeNodes.addAll(childMap.get(e.getId()));
|
||||
List<SearchTree> searchTrees = childMap.get(e.getId()).stream().sorted(Comparator.comparing(SearchTree::getOrderNum)).collect(Collectors.toList());
|
||||
treeNodes.addAll(searchTrees);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(e.getSubs())) {
|
||||
treeNodes.addAll(e.getSubs());
|
||||
|
|
|
|||
Loading…
Reference in New Issue