package com.ruoyi.gysl.service.impl;

import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.docking.entity.SmartDeclaration;
import com.ruoyi.gysl.entity.request.ZwIdPageReq;
import com.ruoyi.gysl.entity.response.YdxxtjResponse;
import com.ruoyi.gysl.entity.stats.AllProjectResponse;
import com.ruoyi.gysl.entity.stats.RibbonResponse;
import com.ruoyi.gysl.mapper.ZwStatsMapper;
import com.ruoyi.gysl.service.ZwStatsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 政务统计服务实现类
 *
 * @author makejava
 * @since 2025-02-24 09:25:55
 */
@Service("ZwStatsService")
public class ZwStatsServiceImpl implements ZwStatsService {

    @Resource
    private ZwStatsMapper zwStatsMapper;


    @Resource
    private RedisCache redisCache;

    /**
     * 项目情况
     */
    @Override
    public AllProjectResponse allProject(String years) {
        return zwStatsMapper.allProject(years);
    }

    /**
     * 功能区
     */
    @Override
    public List<RibbonResponse> ribbon(String years) {
        return zwStatsMapper.ribbon(years);
    }

    /**
     * 投资主体
     */
    @Override
    public List<RibbonResponse> investors(String years) {
        return zwStatsMapper.investors(years);
    }

    /**
     * 消息通知
     */
    @Override
    public List<SmartDeclaration> zwNotice(Long userId) {
        return zwStatsMapper.zwNotice(userId);
    }

    /**
     * 政务消息通知数量
     */
    @Override
    public int zwNoticeCount(Long userId) {
        return zwStatsMapper.zwNoticeCount(userId);
    }

    /**
     * 产业导向细分产业分析
     */
    @Override
    public List<RibbonResponse> xfcyfx() {
        return zwStatsMapper.xfcyfx();
    }

    /**
     * 产业导向目录分析
     */
    @Override
    public List<RibbonResponse> mlfx() {
        return zwStatsMapper.mlfx();
    }

    /**
     * 产业数据分析
     */
    @Override
    public List<RibbonResponse> slfx() {
        List<RibbonResponse> a1 = new ArrayList<>();
        RibbonResponse r1 = new RibbonResponse();
        r1.setCount(zwStatsMapper.allXfcyfx());
        r1.setSsgnq("细分产业分析");
        RibbonResponse r2 = new RibbonResponse();
        r2.setCount(zwStatsMapper.allMlfx());
        r2.setSsgnq("目录分析");
        a1.add(r1);
        a1.add(r2);
        return a1;
    }

    /**
     * 储备项目统计分析
     */
    @Override
    public List<RibbonResponse> cbxmtj() {
        return zwStatsMapper.cbxmtj();
    }


}
