Commit 631bee6a by guojuxing

初始化项目新增

parent 43f2fb4a
......@@ -19,7 +19,10 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @author guojx
......@@ -259,7 +262,19 @@ public class EnterpriseInitApiServiceImpl implements EnterpriseInitApiService{
@Override
public ServiceResponse<Void> initEnterpriseData(List<Integer> enterpriseIdList) {
if (CollectionUtils.isNotEmpty(enterpriseIdList)) {
enterpriseIdList.forEach(e -> enterpriseInitService.initEnterpriseConfigInfo(e));
enterpriseIdList.forEach(e -> {
List<TabEnterpriseInit> list = enterpriseInitService.listByParentId(null, e);
Set<String> hasConfig = new HashSet<>();
if (CollectionUtils.isNotEmpty(list)) {
hasConfig = list.stream().filter(con -> con.getIsInitConfig() == 1).map(con -> con.getConfigCode()).collect(Collectors.toSet());
}
enterpriseInitService.initEnterpriseConfigInfo(e);
//已经配置过的数据需要还原
if (CollectionUtils.isNotEmpty(hasConfig)) {
hasConfig.stream().forEach( temp -> enterpriseInitService.initByCode(temp, e));
}
});
}
return ServiceResponse.success();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment