|
|
@@ -1,5 +1,6 @@
|
|
|
package com.goafanti.ambSystem.service.Impl;
|
|
|
|
|
|
+import com.goafanti.ambSystem.bo.AmbAll;
|
|
|
import com.goafanti.ambSystem.bo.InputAmb;
|
|
|
import com.goafanti.ambSystem.bo.OutAmb;
|
|
|
import com.goafanti.ambSystem.service.AmbService;
|
|
|
@@ -11,10 +12,7 @@ import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
public class AmbServiceImpl extends BaseMybatisDao<AmbSystemMapper> implements AmbService {
|
|
|
@@ -55,12 +53,40 @@ public class AmbServiceImpl extends BaseMybatisDao<AmbSystemMapper> implements A
|
|
|
return (Pagination<OutAmb>) findPage("selectAmbSystemList","selectAmbSystemCount",param,in.getPageNo(),in.getPageSize());
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<?> selectAll() {
|
|
|
+ List<AmbAll> list = ambSystemMapper.getAncestorsList(null);
|
|
|
+ List<AmbAll> all=new ArrayList<>();
|
|
|
+ for (AmbAll a : list) {
|
|
|
+ if (a.getLvl()==1){
|
|
|
+ pushLvl(a,list);
|
|
|
+ all.add(a);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return all;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void pushLvl(AmbAll a , List<AmbAll> list) {
|
|
|
+ if (a.getLvl()<7){
|
|
|
+ List<AmbAll> all=new ArrayList<>();
|
|
|
+ for (AmbAll as : list) {
|
|
|
+ if (as.getLvl()>1 && as.getParentId().equals(a.getId())){
|
|
|
+ pushLvl(as,list);
|
|
|
+ all.add(as);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ a.setList(all);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private String getAncestorsNames(String ancestors) {
|
|
|
String[] split = ancestors.split(",");
|
|
|
List<String> list = Arrays.asList(split);
|
|
|
- List<AmbSystem> ancestorsList = ambSystemMapper.getAncestorsList(list);
|
|
|
+ List<AmbAll> ancestorsList = ambSystemMapper.getAncestorsList(list);
|
|
|
StringBuffer sb=new StringBuffer();
|
|
|
- for (AmbSystem ambSystem : ancestorsList) {
|
|
|
+ for (AmbAll ambSystem : ancestorsList) {
|
|
|
for (String s : list) {
|
|
|
if (!ambSystem.getId().toString().equals("1")){
|
|
|
if (ambSystem.getId().toString().equals(s)){
|