xuhy
2024-12-11 0a1533fd30ec1a2f4624ccda4ff11f2535ea8a46
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TIndexMenuServiceImpl.java
@@ -1,17 +1,20 @@
package com.ruoyi.system.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.TIndexMenu;
import com.ruoyi.system.domain.TTitleMajor;
import com.ruoyi.system.dto.AllertTitleDto;
import com.ruoyi.system.mapper.TIndexMenuMapper;
import com.ruoyi.system.mapper.TTitleMajorMapper;
import com.ruoyi.system.service.TIndexMenuService;
import com.ruoyi.system.service.TTitleMajorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * <p>
@@ -24,9 +27,22 @@
@Service
public class TIndexMenuServiceImpl extends ServiceImpl<TIndexMenuMapper, TIndexMenu> implements TIndexMenuService {
    @Autowired
    private TTitleMajorMapper titleMajorMapper;
    @Override
    public List<AllertTitleDto> allert(List<String> cityCode) {
        return this.baseMapper.allert(cityCode);
        List<AllertTitleDto> allert = new ArrayList<>();
        for (String s : cityCode) {
            List<AllertTitleDto> allert1 = this.baseMapper.allert(Collections.singletonList(s));
            allert.addAll(allert1);
        }
        for (AllertTitleDto allertTitleDto : allert) {
            List<TTitleMajor> tTitleMajors = titleMajorMapper.selectList(Wrappers.lambdaQuery(TTitleMajor.class)
                    .eq(TTitleMajor::getTechnicalId, allertTitleDto.getId()));
            allertTitleDto.setChildren(tTitleMajors);
        }
        return allert;
    }
    @Override