| | |
| | | package com.gkhy.exam.system.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class StandardizedTemplateServiceImpl extends ServiceImpl<StandardizedTemplateMapper, StandardizedTemplate> implements StandardizedTemplateService { |
| | |
| | | |
| | | @Autowired |
| | | private CustomerService customerService; |
| | | |
| | | @Autowired |
| | | private ProductServiceMapper productServiceMapper; |
| | | @Override |
| | | public CommonPage selectStandardizedTemplateList(StandardizedTemplate standardizedTemplate) { |
| | | boolean admin = SecurityUtils.adminUser(); |
| | |
| | | map.put("sysFunctionalDistributions", sysFunctionalDistributions); |
| | | //程序文件 |
| | | map.put("companyIndustryTemplates", companyIndustryTemplates); |
| | | //产品和服务实现过程 |
| | | |
| | | LambdaQueryWrapper<ProductService> lambdaQueryWrapper = Wrappers.<ProductService>lambdaQuery() |
| | | .eq(ProductService::getCompanyId, companyId) |
| | | .eq(ProductService::getDelFlag, 0); |
| | | List<ProductService> productServices = productServiceMapper.selectList(lambdaQueryWrapper); |
| | | if (ObjectUtil.isNotEmpty(productServices)){ |
| | | List<String> fileUrls = productServices.stream().map(ProductService::getFileUrl).collect(Collectors.toList()); |
| | | List< String> fileUrlsData = fileUrls.stream().map(fileUrl -> { |
| | | List<String> collect = Arrays.stream(fileUrl.split(",")).collect(Collectors.toList()); |
| | | return collect; |
| | | }).flatMap(Collection::stream).collect(Collectors.toList()); |
| | | // for (String fileUrl : fileUrls) { |
| | | // List<String> collect = Arrays.stream(fileUrl.split(",")).collect(Collectors.toList()); |
| | | // } |
| | | map.put("productServiceDatas", fileUrlsData); |
| | | }else { |
| | | map.put("productServiceDatas", new ArrayList<>()); |
| | | } |
| | | return CommonResult.success(map); |
| | | } |
| | | } |