|
@@ -3,6 +3,7 @@ package org.jeecg.modules.archives.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.apache.commons.lang.ArrayUtils;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.jeecg.common.dto.archives.BsInfo;
|
|
|
import org.jeecg.common.dto.archives.DeInfo;
|
|
|
import org.jeecg.common.dto.archives.DeInfoRespDTO;
|
|
@@ -92,11 +93,13 @@ public class ProjectManageArchivesServiceImpl extends ServiceImpl<ProjectManageA
|
|
|
QueryWrapper<ProjectManageArchivesAndBusiness> queryWrapper = new QueryWrapper();
|
|
|
queryWrapper.eq("del_flag","0");
|
|
|
queryWrapper.eq("pro_archives_id",projectManageArchives.getId());
|
|
|
+ queryWrapper.orderByAsc("create_time");
|
|
|
List<ProjectManageArchivesAndBusiness> businessList = projectManageArchivesAndBusinessService.list(queryWrapper);
|
|
|
|
|
|
QueryWrapper<ProjectManageBusinessOther> otherQueryWrapper = new QueryWrapper();
|
|
|
otherQueryWrapper.eq("del_flag","0");
|
|
|
otherQueryWrapper.eq("pro_archives_id",projectManageArchives.getId());
|
|
|
+ otherQueryWrapper.orderByAsc("create_time");
|
|
|
List<ProjectManageBusinessOther> otherList = projectManageBusinessOtherService.list(otherQueryWrapper);
|
|
|
Map<Integer, List<ProjectManageBusinessOther>> otherMap = otherList.stream().collect(Collectors.groupingBy(ProjectManageBusinessOther :: getPlanType));
|
|
|
|
|
@@ -133,6 +136,7 @@ public class ProjectManageArchivesServiceImpl extends ServiceImpl<ProjectManageA
|
|
|
* @desc 将里程碑计划数据转成树状结构
|
|
|
*/
|
|
|
private List<ProBusinessOtherListRespDTO> getPlanList(List<ProjectManageBusinessOther> otherList) {
|
|
|
+ otherList.sort((x, y) -> Integer.compare(x.getSort(), y.getSort()));
|
|
|
List<ProBusinessOtherListRespDTO> resp = Lists.newArrayList();
|
|
|
|
|
|
Map<String, List<ProjectManageBusinessOther>> postMap = otherList.stream().collect(Collectors.groupingBy(ProjectManageBusinessOther :: getParentId));
|
|
@@ -158,7 +162,7 @@ public class ProjectManageArchivesServiceImpl extends ServiceImpl<ProjectManageA
|
|
|
* @desc 获取执行人列表
|
|
|
*/
|
|
|
private List<String> getExecutorList(ProjectManageBusinessOther other) {
|
|
|
- return Arrays.asList(other.getExecutorId().split("、"));
|
|
|
+ return StringUtils.isNotBlank(other.getExecutorId()) ? Arrays.asList(other.getExecutorId().split("、")) : null;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -186,6 +190,7 @@ public class ProjectManageArchivesServiceImpl extends ServiceImpl<ProjectManageA
|
|
|
* @desc 获取里程碑数据
|
|
|
*/
|
|
|
private List<ProArchivesAndBusinessAddReqDTO> getBsInfoData(List<ProjectManageArchivesAndBusiness> businessList, int planType) {
|
|
|
+ businessList.sort((x, y) -> Integer.compare(x.getSort(), y.getSort()));
|
|
|
List<ProArchivesAndBusinessAddReqDTO> reqDTOS = Lists.newArrayList();
|
|
|
for(ProjectManageArchivesAndBusiness business : businessList){
|
|
|
int currentPlanType = business.getPlanType();
|
|
@@ -333,8 +338,11 @@ public class ProjectManageArchivesServiceImpl extends ServiceImpl<ProjectManageA
|
|
|
*/
|
|
|
private void saveMileData(List<ProArchivesAndBusinessAddReqDTO> mileList, ProArchivesAddReqDTO reqDTO) {
|
|
|
List<ProjectManageArchivesAndBusiness> list = Lists.newArrayList();
|
|
|
+ int sort = 1;
|
|
|
for(ProArchivesAndBusinessAddReqDTO mile : mileList) {
|
|
|
- list.add(new ProjectManageArchivesAndBusiness(mile, reqDTO.getId(), reqDTO.getPkOrg()));
|
|
|
+ ProjectManageArchivesAndBusiness business = new ProjectManageArchivesAndBusiness(mile, reqDTO.getId(), reqDTO.getPkOrg());
|
|
|
+ business.setSort(sort++);
|
|
|
+ list.add(business);
|
|
|
}
|
|
|
projectManageArchivesAndBusinessService.saveBatch(list);
|
|
|
}
|
|
@@ -344,8 +352,11 @@ public class ProjectManageArchivesServiceImpl extends ServiceImpl<ProjectManageA
|
|
|
*/
|
|
|
private void saveMolePlanData(List<ProBusinessOtherAddReqDTO> planList, ProArchivesAddReqDTO reqDTO, Integer planType) {
|
|
|
List<ProjectManageBusinessOther> list = Lists.newArrayList();
|
|
|
+ int sort = 1;
|
|
|
for(ProBusinessOtherAddReqDTO plan : planList) {
|
|
|
- list.add(new ProjectManageBusinessOther(plan, reqDTO.getId(), planType, reqDTO.getPkOrg()));
|
|
|
+ ProjectManageBusinessOther other = new ProjectManageBusinessOther(plan, reqDTO.getId(), planType, reqDTO.getPkOrg());
|
|
|
+ other.setSort(sort++);
|
|
|
+ list.add(other);
|
|
|
}
|
|
|
projectManageBusinessOtherService.saveBatch(list);
|
|
|
}
|