|
|
|
@ -1,11 +1,15 @@
|
|
|
|
|
package com.op.quality.service.impl;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
|
|
import com.op.common.core.utils.DateUtils;
|
|
|
|
|
import com.op.common.core.utils.SpringUtils;
|
|
|
|
|
import com.op.common.core.utils.uuid.IdUtils;
|
|
|
|
|
import com.op.common.security.utils.SecurityUtils;
|
|
|
|
|
import com.op.quality.domain.vo.TreeSelect;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import com.op.quality.mapper.QcProjectTypeMapper;
|
|
|
|
@ -106,4 +110,23 @@ public class QcProjectTypeServiceImpl implements IQcProjectTypeService {
|
|
|
|
|
public int deleteQcProjectTypeById(String id) {
|
|
|
|
|
return qcProjectTypeMapper.deleteQcProjectTypeById(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<TreeSelect> selectProjectTypeTree(QcProjectType qcProjectType) {
|
|
|
|
|
List<QcProjectType> qcProjectTypeList = SpringUtils.getAopProxy(this).selectQcProjectTypeList(qcProjectType);
|
|
|
|
|
return buildProjectTreeSelect(qcProjectTypeList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<TreeSelect> buildProjectTreeSelect(List<QcProjectType> qcProjectTypeList) {
|
|
|
|
|
// 根节点
|
|
|
|
|
QcProjectType rootTree = new QcProjectType();
|
|
|
|
|
rootTree.setProjectTypeCode("projectType0");
|
|
|
|
|
rootTree.setProjectTypeName("检验方案");
|
|
|
|
|
// 设置二级节点
|
|
|
|
|
rootTree.setChildren(qcProjectTypeList);
|
|
|
|
|
// 因为只有二层,直接构造树
|
|
|
|
|
List<QcProjectType> projectTypeTree = new ArrayList<>();
|
|
|
|
|
projectTypeTree.add(rootTree);
|
|
|
|
|
return projectTypeTree.stream().map(TreeSelect::new).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|