专病路径
This commit is contained in:
parent
1d26f3c421
commit
2ecb3e50fa
@ -195,7 +195,7 @@ public class Constants {
|
|||||||
public static final String TASK_STATUS_CODE = "TSC";
|
public static final String TASK_STATUS_CODE = "TSC";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务状态编码
|
* 机构代码编码
|
||||||
*/
|
*/
|
||||||
public static final String AGENCY_CODE = "AYC";
|
public static final String AGENCY_CODE = "AYC";
|
||||||
|
|
||||||
|
|||||||
@ -27,10 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@ -183,7 +180,13 @@ public class AgencyServiceImpl implements IAgencyService {
|
|||||||
agency.setValue(agency.getId().toString());
|
agency.setValue(agency.getId().toString());
|
||||||
}
|
}
|
||||||
List<AgencyVO> agenciesTree = buildDeptTree(agencies);
|
List<AgencyVO> agenciesTree = buildDeptTree(agencies);
|
||||||
return agenciesTree.stream().map(AgencyTreeVO::new).collect(Collectors.toList());
|
//排序
|
||||||
|
List<AgencyVO> sortedAgenciesTree = agenciesTree.stream().sorted(Comparator.comparing(AgencyVO::getAgencySort)).collect(Collectors.toList());
|
||||||
|
for (AgencyVO agencyVO : sortedAgenciesTree) {
|
||||||
|
List<AgencyVO> collect = agencyVO.getChildren().stream().sorted(Comparator.comparing(AgencyVO::getAgencySort)).collect(Collectors.toList());
|
||||||
|
agencyVO.setChildren(collect);
|
||||||
|
}
|
||||||
|
return sortedAgenciesTree.stream().map(AgencyTreeVO::new).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
package com.xinelu.manage.service.agencycategory.impl;
|
package com.xinelu.manage.service.agencycategory.impl;
|
||||||
|
|
||||||
|
import com.xinelu.common.constant.Constants;
|
||||||
import com.xinelu.common.utils.SecurityUtils;
|
import com.xinelu.common.utils.SecurityUtils;
|
||||||
import com.xinelu.common.utils.StringUtils;
|
import com.xinelu.common.utils.StringUtils;
|
||||||
|
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||||
import com.xinelu.manage.domain.agencycategory.AgencyCategory;
|
import com.xinelu.manage.domain.agencycategory.AgencyCategory;
|
||||||
import com.xinelu.manage.mapper.agencycategory.AgencyCategoryMapper;
|
import com.xinelu.manage.mapper.agencycategory.AgencyCategoryMapper;
|
||||||
import com.xinelu.manage.service.agencycategory.IAgencyCategoryService;
|
import com.xinelu.manage.service.agencycategory.IAgencyCategoryService;
|
||||||
@ -28,6 +30,8 @@ import java.util.stream.Collectors;
|
|||||||
public class AgencyCategoryServiceImpl implements IAgencyCategoryService {
|
public class AgencyCategoryServiceImpl implements IAgencyCategoryService {
|
||||||
@Resource
|
@Resource
|
||||||
private AgencyCategoryMapper agencyCategoryMapper;
|
private AgencyCategoryMapper agencyCategoryMapper;
|
||||||
|
@Resource
|
||||||
|
private GenerateSystemCodeUtil generateSystemCodeUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询机构类别
|
* 查询机构类别
|
||||||
@ -65,6 +69,7 @@ public class AgencyCategoryServiceImpl implements IAgencyCategoryService {
|
|||||||
}
|
}
|
||||||
agencyCategory.setCreateTime(LocalDateTime.now());
|
agencyCategory.setCreateTime(LocalDateTime.now());
|
||||||
agencyCategory.setCreateBy(SecurityUtils.getUsername());
|
agencyCategory.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
agencyCategory.setCategoryCode(Constants.CATEGORY_CODE + generateSystemCodeUtil.generateSystemCode(Constants.CATEGORY_CODE));
|
||||||
return agencyCategoryMapper.insertAgencyCategory(agencyCategory);
|
return agencyCategoryMapper.insertAgencyCategory(agencyCategory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user