package com.ruoyi.cs.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.common.enums.ServiceResponseEnum;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.securityContext.CsOrderMemberUserSecurityContext;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.cs.domain.CsAchievementInfo;
import com.ruoyi.cs.domain.CsAchievementInfoDetails;
import com.ruoyi.cs.domain.dto.*;
import com.ruoyi.cs.domain.vo.*;
import com.ruoyi.cs.mapper.CsAchievementInfoDetailsMapper;
import com.ruoyi.cs.service.ICsAchievementInfoDetailsService;
import com.ruoyi.cs.service.ICsAchievementInfoService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;

import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;

/**
 * 科研成果-成果详情信息Service业务层处理
 *
 * @author ruoyi
 * @date 2024-05-08
 */
@Service
public class CsAchievementInfoDetailsServiceImpl implements ICsAchievementInfoDetailsService
{
    @Resource
    private CsAchievementInfoDetailsMapper csAchievementInfoDetailsMapper;

    @Resource
    private ICsAchievementInfoDetailsService achievementInfoDetailsService;

    @Resource
    private ICsAchievementInfoService achievementInfoService;

    /**
     * 查询科研成果-成果详情信息
     *
     * @param infoDetailsId 科研成果-成果详情信息主键
     * @return 科研成果-成果详情信息
     */
    @Override
    public CsAchievementInfoDetails selectCsAchievementInfoDetailsByInfoDetailsId(String infoDetailsId)
    {
        return csAchievementInfoDetailsMapper.selectCsAchievementInfoDetailsByInfoDetailsId(infoDetailsId);
    }

    /**
     * 查询科研成果-成果详情信息
     *
     * @param infoDetailsId 科研成果-成果详情信息主键
     * @return 科研成果-成果详情信息
     */
    @Override
    public CsOrderApplyVO selectManageCsAchievementInfoDetailsByInfoDetailsId(String infoDetailsId) {
        CsAchievementInfoDetails achievementInfoDetails = csAchievementInfoDetailsMapper.selectCsAchievementInfoDetailsByInfoDetailsId(infoDetailsId);
        CsOrderApplyVO applyDetail = BeanUtil.toBean(achievementInfoDetails,CsOrderApplyVO.class);

        if(ObjectUtils.isEmpty(achievementInfoDetails)){
            throw new ServiceException(ServiceResponseEnum.Achievement_Info_Details_NOT_FIND);
        }

        String applyId = achievementInfoDetails.getResId();

        CsAchievementInfo csAchievementInfo = achievementInfoService.selectCsAchievementInfoByResId(applyId);
        if (csAchievementInfo != null) {
            applyDetail.setApplicationArea(csAchievementInfo.getApplicationArea());
            applyDetail.setPlatformSoftware(csAchievementInfo.getPlatformSoftware());
            applyDetail.setSoftwareName(csAchievementInfo.getSoftwareName());
            applyDetail.setIsPublicize(csAchievementInfo.getIsPublicize());
        }

        if ("0".equals(achievementInfoDetails.getAchievementType())) {
            // 查询当前申请的科研成果-论文成果
            List<CsAchievementPaperDetailsVO> paperDetailsVOList = new ArrayList<>();
            CsAchievementPaperDetailsVO now = BeanUtil.toBean(achievementInfoDetails,CsAchievementPaperDetailsVO.class);
            paperDetailsVOList.add(now);
            applyDetail.setPaperAchievementList(paperDetailsVOList);
        }
        if ("1".equals(achievementInfoDetails.getAchievementType())) {
            // 查询当前申请的科研成果-专利成果
            List<CsAchievementPatentDetailsVO> patentDetailsVOList = new ArrayList<>();
            CsAchievementPatentDetailsVO now = BeanUtil.toBean(achievementInfoDetails,CsAchievementPatentDetailsVO.class);
            patentDetailsVOList.add(now);
            applyDetail.setPatentAchievementList(patentDetailsVOList);
        }
        if ("2".equals(achievementInfoDetails.getAchievementType())) {
            // 查询当前申请的科研成果-奖项成果
            List<CsAchievementPrizeDetailsVO> prizeDetailsVOList = new ArrayList<>();
            CsAchievementPrizeDetailsVO now = BeanUtil.toBean(achievementInfoDetails,CsAchievementPrizeDetailsVO.class);
            prizeDetailsVOList.add(now);
            applyDetail.setPrizeAchievementList(prizeDetailsVOList);
        }
        if ("3".equals(achievementInfoDetails.getAchievementType())) {
            // 查询当前申请的科研成果-其他成果
            List<CsAchievementOtherDetailsVO> otherDetailsVOList = new ArrayList<>();
            CsAchievementOtherDetailsVO now = BeanUtil.toBean(achievementInfoDetails,CsAchievementOtherDetailsVO.class);
            otherDetailsVOList.add(now);
            applyDetail.setOtherAchievementList(otherDetailsVOList);
        }
        if ("4".equals(achievementInfoDetails.getAchievementType())) {
            // 查询当前申请的科研成果-预约成果
            List<CsAchievementReservationDetailsVO> reservationDetailsVOList = new ArrayList<>();
            CsAchievementReservationDetailsVO now = BeanUtil.toBean(achievementInfoDetails,CsAchievementReservationDetailsVO.class);
            reservationDetailsVOList.add(now);
            applyDetail.setReservationAchievementList(reservationDetailsVOList);
        }

        return applyDetail;
    }

    /**
     * 查询科研成果-成果详情信息列表
     *
     * @param csAchievementInfoDetails 科研成果-成果详情信息
     * @return 科研成果-成果详情信息
     */
    @Override
    public List<CsAchievementInfoDetails> selectCsAchievementInfoDetailsList(CsAchievementInfoDetails csAchievementInfoDetails)
    {
        return csAchievementInfoDetailsMapper.selectCsAchievementInfoDetailsListByGb(csAchievementInfoDetails);
    }

    /**
     * 新增科研成果-成果详情信息
     *
     * @param csAchievementInfoDetails 科研成果-成果详情信息
     * @return 结果
     */
    @Override
    public int insertCsAchievementInfoDetails(CsAchievementInfoDetails csAchievementInfoDetails)
    {
        csAchievementInfoDetails.setCreateAt(DateUtils.getNowDate());
        csAchievementInfoDetails.setDelFlag("0");
        return csAchievementInfoDetailsMapper.insertCsAchievementInfoDetails(csAchievementInfoDetails);
    }

    /**
     * 修改科研成果-成果详情信息
     *
     * @param csAchievementInfoDetails 科研成果-成果详情信息
     * @return 结果
     */
    @Override
    public int updateCsAchievementInfoDetails(CsAchievementInfoDetails csAchievementInfoDetails)
    {
        csAchievementInfoDetails.setUpdateAt(DateUtils.getNowDate());
        return csAchievementInfoDetailsMapper.updateCsAchievementInfoDetails(csAchievementInfoDetails);
    }

    /**
     * 修改科研成果-成果详情信息
     *
     * @param orderDTO 科研成果-成果详情信息
     * @return 结果
     */
    @Override
    public int updateManageCsAchievementInfoDetails(CsOrderApplyEditDTO orderDTO) {
        CsAchievementInfoDetails infoDetails = csAchievementInfoDetailsMapper.selectCsAchievementInfoDetailsByInfoDetailsId(orderDTO.getInfoDetailsId());

        // 构造工单申请基础信息
        String applyId = infoDetails.getResId();
        Date nowDate = DateUtils.getNowDate();
        String nowDateString = DateUtils.getTime();

        // CsResourceOrderApply addApply = BeanUtil.toBean(orderDTO, CsResourceOrderApply.class);
        // CsAchievementInfo achievementInfo = BeanUtil.toBean(orderDTO, CsAchievementInfo.class);


        // 新增
        List<CsAchievementPaperDetailsDTO> insertPaperList = new ArrayList<>();
        List<CsAchievementPatentDetailsDTO> insertPatentList = new ArrayList<>();
        List<CsAchievementPrizeDetailsDTO> insertPrizeList = new ArrayList<>();
        List<CsAchievementOtherDetailsDTO> insertOtherList = new ArrayList<>();
        List<CsAchievementReservationDetailsDTO> insertReservationList = new ArrayList<>();
        // 修改
        List<CsAchievementInfoDetails> updateList = new ArrayList<>();

        if ("0".equals(infoDetails.getAchievementType())) {
            // 批量修改科研成果-论文成果
            List<CsAchievementPaperDetailsDTO> paperAchievementList = orderDTO.getPaperAchievementList();
            if(!CollectionUtils.isEmpty(paperAchievementList)) {
                for (CsAchievementPaperDetailsDTO paperDetailsDTO : paperAchievementList) {
                    if ("".equals(paperDetailsDTO.getInfoDetailsId())) {
                        insertPaperList.add(paperDetailsDTO);
                    } else {
                        CsAchievementInfoDetails achievementInfoDetails = BeanUtil.toBean(paperDetailsDTO, CsAchievementInfoDetails.class);
                        if ("1".equals(achievementInfoDetails.getDelFlag())) {
                            achievementInfoDetails.setStatus("3");
                        }
                        achievementInfoDetails.setUpdateAt(nowDate);
                        updateList.add(achievementInfoDetails);
                    }
                }
                if (insertPaperList.size() > 0) {
                    achievementInfoService.batchInsertPaperAchievementList(insertPaperList, applyId, nowDate);
                }
            } else {
                achievementInfoDetailsService.bachDeleteCsAchievementInfoDetailsByResId(applyId, "0");
            }
        }
        if ("1".equals(infoDetails.getAchievementType())) {
            // 批量修改科研成果-专利成果
            List<CsAchievementPatentDetailsDTO> patentAchievementList = orderDTO.getPatentAchievementList();
            if(!CollectionUtils.isEmpty(patentAchievementList)) {
                for (CsAchievementPatentDetailsDTO patentDetailsDTO : patentAchievementList) {
                    if ("".equals(patentDetailsDTO.getInfoDetailsId())) {
                        insertPatentList.add(patentDetailsDTO);
                    } else {
                        CsAchievementInfoDetails achievementInfoDetails = BeanUtil.toBean(patentDetailsDTO, CsAchievementInfoDetails.class);
                        if ("1".equals(achievementInfoDetails.getDelFlag())) {
                            achievementInfoDetails.setStatus("3");
                        }
                        achievementInfoDetails.setUpdateAt(nowDate);
                        updateList.add(achievementInfoDetails);
                    }
                }
                if (insertPatentList.size() > 0) {
                    achievementInfoService.batchInsertPatentAchievementList(insertPatentList, applyId, nowDate);
                }
            } else {
                achievementInfoDetailsService.bachDeleteCsAchievementInfoDetailsByResId(applyId, "1");
            }
        }
        if ("2".equals(infoDetails.getAchievementType())) {
            // 批量修改科研成果-奖项成果
            List<CsAchievementPrizeDetailsDTO> prizeAchievementList = orderDTO.getPrizeAchievementList();
            if(!CollectionUtils.isEmpty(prizeAchievementList)) {
                for (CsAchievementPrizeDetailsDTO prizeDetailsDTO : prizeAchievementList) {
                    if ("".equals(prizeDetailsDTO.getInfoDetailsId())) {
                        insertPrizeList.add(prizeDetailsDTO);
                    } else {
                        CsAchievementInfoDetails achievementInfoDetails = BeanUtil.toBean(prizeDetailsDTO, CsAchievementInfoDetails.class);
                        if ("1".equals(achievementInfoDetails.getDelFlag())) {
                            achievementInfoDetails.setStatus("3");
                        }
                        achievementInfoDetails.setUpdateAt(nowDate);
                        updateList.add(achievementInfoDetails);
                    }
                }
                if (insertPrizeList.size() > 0) {
                    achievementInfoService.batchInsertPrizeAchievementList(insertPrizeList, applyId, nowDate);
                }
            } else {
                achievementInfoDetailsService.bachDeleteCsAchievementInfoDetailsByResId(applyId, "2");
            }
        }
        if ("3".equals(infoDetails.getAchievementType())) {
            // 批量修改科研成果-其他成果
            List<CsAchievementOtherDetailsDTO> otherAchievementList = orderDTO.getOtherAchievementList();
            if(!CollectionUtils.isEmpty(otherAchievementList)) {
                for (CsAchievementOtherDetailsDTO otherDetailsDTO : otherAchievementList) {
                    if ("".equals(otherDetailsDTO.getInfoDetailsId())) {
                        insertOtherList.add(otherDetailsDTO);
                    } else {
                        CsAchievementInfoDetails achievementInfoDetails = BeanUtil.toBean(otherDetailsDTO, CsAchievementInfoDetails.class);
                        if ("1".equals(achievementInfoDetails.getDelFlag())) {
                            achievementInfoDetails.setStatus("3");
                        }
                        achievementInfoDetails.setUpdateAt(nowDate);
                        updateList.add(achievementInfoDetails);
                    }
                }
                if (insertOtherList.size() > 0) {
                    achievementInfoService.batchInsertOtherAchievementList(insertOtherList, applyId, nowDate);
                }
            } else {
                achievementInfoDetailsService.bachDeleteCsAchievementInfoDetailsByResId(applyId, "3");
            }
        }
        if ("4".equals(infoDetails.getAchievementType())) {
            // 批量修改科研成果-预约成果
            List<CsAchievementReservationDetailsDTO> reservationAchievementList = orderDTO.getReservationAchievementList();
            if(!CollectionUtils.isEmpty(reservationAchievementList)) {
                for (CsAchievementReservationDetailsDTO reservationDetailsDTO : reservationAchievementList) {
                    if ("".equals(reservationDetailsDTO.getInfoDetailsId())) {
                        insertReservationList.add(reservationDetailsDTO);
                    } else {
                        CsAchievementInfoDetails achievementInfoDetails = BeanUtil.toBean(reservationDetailsDTO, CsAchievementInfoDetails.class);
                        if ("1".equals(achievementInfoDetails.getDelFlag())) {
                            achievementInfoDetails.setStatus("3");
                        }
                        achievementInfoDetails.setUpdateAt(nowDate);
                        updateList.add(achievementInfoDetails);
                    }
                }
                if (insertReservationList.size() > 0) {
                    achievementInfoService.batchInsertReservationAchievementList(insertReservationList, applyId, nowDate);
                }
            } else {
                achievementInfoDetailsService.bachDeleteCsAchievementInfoDetailsByResId(applyId, "4");
            }
        }

        if (updateList.size() > 0) {
            // 批量修改科研成果-成果
            achievementInfoService.batchUpdateAchievementDetailsList(updateList);
        }

        // 修改科研成果信息
        // achievementInfo.setResId(applyId);
        // achievementInfoService.updateCsAchievementInfoByResId(achievementInfo);
        return 1;
    }

    /**
     * 批量删除科研成果-成果详情信息
     *
     * @param infoDetailsIds 需要删除的科研成果-成果详情信息主键
     * @return 结果
     */
    @Override
    public int deleteCsAchievementInfoDetailsByInfoDetailsIds(String[] infoDetailsIds)
    {
        return csAchievementInfoDetailsMapper.deleteCsAchievementInfoDetailsByInfoDetailsIds(infoDetailsIds);
    }

    /**
     * 删除科研成果-成果详情信息信息
     *
     * @param infoDetailsId 科研成果-成果详情信息主键
     * @return 结果
     */
    @Override
    public int deleteCsAchievementInfoDetailsByInfoDetailsId(String infoDetailsId)
    {
        return csAchievementInfoDetailsMapper.deleteCsAchievementInfoDetailsByInfoDetailsId(infoDetailsId);
    }

    /**
     * 查询论文成果列表
     *
     * @param applyId
     * @return
     */
    @Override
    public List<CsAchievementPaperDetailsVO> selectPaperAchievementList(String applyId) {
        CsAchievementInfoDetails csAchievementInfoDetails = new CsAchievementInfoDetails();
        csAchievementInfoDetails.setResId(applyId);
        csAchievementInfoDetails.setAchievementType("0");
        csAchievementInfoDetails.setDelFlag("0");
        List<CsAchievementInfoDetails> list = csAchievementInfoDetailsMapper.selectCsAchievementInfoDetailsList(csAchievementInfoDetails);
        List<CsAchievementPaperDetailsVO> paperDetailsList = list.stream()
                .map( paperDetails ->{
                    CsAchievementPaperDetailsVO paperDetailsVO = new CsAchievementPaperDetailsVO();
                    paperDetailsVO = BeanUtil.toBean(paperDetails, CsAchievementPaperDetailsVO.class);
                    return paperDetailsVO;
                })
                .collect(Collectors.toList());
        return paperDetailsList;
    }

    /**
     * 查询专利成果列表
     *
     * @param applyId
     * @return
     */
    @Override
    public List<CsAchievementPatentDetailsVO> selectPatentAchievementList(String applyId) {
        CsAchievementInfoDetails csAchievementInfoDetails = new CsAchievementInfoDetails();
        csAchievementInfoDetails.setResId(applyId);
        csAchievementInfoDetails.setAchievementType("1");
        csAchievementInfoDetails.setDelFlag("0");
        List<CsAchievementInfoDetails> list = csAchievementInfoDetailsMapper.selectCsAchievementInfoDetailsList(csAchievementInfoDetails);
        List<CsAchievementPatentDetailsVO> patentDetailsList = list.stream()
                .map( patentDetails ->{
                    CsAchievementPatentDetailsVO patentDetailsVO = new CsAchievementPatentDetailsVO();
                    patentDetailsVO = BeanUtil.toBean(patentDetails, CsAchievementPatentDetailsVO.class);
                    return patentDetailsVO;
                })
                .collect(Collectors.toList());
        return patentDetailsList;
    }

    /**
     * 查询奖项成果列表
     *
     * @param applyId
     * @return
     */
    @Override
    public List<CsAchievementPrizeDetailsVO> selectPrizeAchievementList(String applyId) {
        CsAchievementInfoDetails csAchievementInfoDetails = new CsAchievementInfoDetails();
        csAchievementInfoDetails.setResId(applyId);
        csAchievementInfoDetails.setAchievementType("2");
        csAchievementInfoDetails.setDelFlag("0");
        List<CsAchievementInfoDetails> list = csAchievementInfoDetailsMapper.selectCsAchievementInfoDetailsList(csAchievementInfoDetails);
        List<CsAchievementPrizeDetailsVO> prizeDetailsList = list.stream()
                .map( prizeDetails ->{
                    CsAchievementPrizeDetailsVO prizeDetailsVO = new CsAchievementPrizeDetailsVO();
                    prizeDetailsVO = BeanUtil.toBean(prizeDetails, CsAchievementPrizeDetailsVO.class);
                    return prizeDetailsVO;
                })
                .collect(Collectors.toList());
        return prizeDetailsList;
    }

    /**
     * 查询其他成果列表
     *
     * @param applyId
     * @return
     */
    @Override
    public List<CsAchievementOtherDetailsVO> selectOtherAchievementList(String applyId) {
        CsAchievementInfoDetails csAchievementInfoDetails = new CsAchievementInfoDetails();
        csAchievementInfoDetails.setResId(applyId);
        csAchievementInfoDetails.setAchievementType("3");
        csAchievementInfoDetails.setDelFlag("0");
        List<CsAchievementInfoDetails> list = csAchievementInfoDetailsMapper.selectCsAchievementInfoDetailsList(csAchievementInfoDetails);
        List<CsAchievementOtherDetailsVO> otherDetailsList = list.stream()
                .map( otherDetails ->{
                    CsAchievementOtherDetailsVO otherDetailsVO = new CsAchievementOtherDetailsVO();
                    otherDetailsVO = BeanUtil.toBean(otherDetails, CsAchievementOtherDetailsVO.class);
                    return otherDetailsVO;
                })
                .collect(Collectors.toList());
        return otherDetailsList;
    }

    /**
     * 查询预约成果列表
     *
     * @param applyId
     * @return
     */
    @Override
    public List<CsAchievementReservationDetailsVO> selectReservationAchievementList(String applyId) {
        CsAchievementInfoDetails csAchievementInfoDetails = new CsAchievementInfoDetails();
        csAchievementInfoDetails.setResId(applyId);
        csAchievementInfoDetails.setAchievementType("4");
        csAchievementInfoDetails.setDelFlag("0");
        List<CsAchievementInfoDetails> list = csAchievementInfoDetailsMapper.selectCsAchievementInfoDetailsList(csAchievementInfoDetails);
        List<CsAchievementReservationDetailsVO> reservationDetailsList = list.stream()
                .map( reservationDetails ->{
                    CsAchievementReservationDetailsVO reservationDetailsVO = new CsAchievementReservationDetailsVO();
                    reservationDetailsVO = BeanUtil.toBean(reservationDetails, CsAchievementReservationDetailsVO.class);
                    return reservationDetailsVO;
                })
                .collect(Collectors.toList());
        return reservationDetailsList;
    }

    /**
     * 查询用户科研成果-成果详情信息列表
     *
     * @return 科研成果-成果详情信息集合
     */
    @Override
    public List<CsAchievementInfoDetailsUserVo> selectUserCsAchievementInfoDetailsList() {
        return csAchievementInfoDetailsMapper.selectUserCsAchievementInfoDetailsList(CsOrderMemberUserSecurityContext.getMemberUserId());
        // return csAchievementInfoDetailsMapper.selectUserCsAchievementInfoDetailsList("ad86230aaf7f4104ba7b6c9abdb39f8f");
    }

    /**
     * 批量删除科研成果-成果详情信息
     *
     * @param resId 相关资源ID
     * @param achievementType 成果类型：0-论文成果，1-专利成果，2-专项成果，3-其他成果，4-预约成果，5-资源使用情况调研表
     * @return 结果
     */
    @Override
    public int bachDeleteCsAchievementInfoDetailsByResId(String resId, String achievementType) {
        return csAchievementInfoDetailsMapper.bachDeleteCsAchievementInfoDetailsByResId(resId, achievementType);
    }

    /**
     * 查询管理端科研成果相关统计
     *
     * @param beginAt 开始时间
     * @param endAt 结束时间
     * @return 科研成果数量集合
     */
    @Override
    public Map<String, Object> selectAchievementInfoDetailsStatistics(String beginAt, String endAt) {
        return csAchievementInfoDetailsMapper.selectAchievementInfoDetailsStatistics(beginAt, endAt);
    }

    /**
     * 获取用户成果信息数量
     *
     * @param memberUserId 用户ID
     * @return 科研成果数量集合
     */
    @Override
    public CsAchievementNumVo getUserAchievementNum(String memberUserId) {
        List<Map<String, Object>> userAchievementNumMap = csAchievementInfoDetailsMapper.getUserAchievementNum(memberUserId);

        Map<String, Object> map = new HashMap<>();
        map.put("classId", "-1");
        map.put("className", "成果数量");
        map.put("remarks", "-1");
        int achievementNum = 0;
        if (!userAchievementNumMap.isEmpty()) {
            for (Map<String, Object> stringObjectMap : userAchievementNumMap) {
                achievementNum += Integer.parseInt(stringObjectMap.get("achievementNum").toString());
            }
        }
        map.put("achievementNum", achievementNum+"");

        userAchievementNumMap.add(map);

        CsAchievementNumVo csAchievementNumVo = new CsAchievementNumVo();
        for (Map<String, Object> stringObjectMap : userAchievementNumMap) {
            if (stringObjectMap.get("remarks").toString().equals("0")) {
                csAchievementNumVo.setPaperAchievementName(stringObjectMap.get("className").toString());
                csAchievementNumVo.setPaperAchievementNum(stringObjectMap.get("achievementNum").toString());
            } else if (stringObjectMap.get("remarks").toString().equals("1")) {
                csAchievementNumVo.setPatentAchievementName(stringObjectMap.get("className").toString());
                csAchievementNumVo.setPatentAchievementNum(stringObjectMap.get("achievementNum").toString());
            } else if (stringObjectMap.get("remarks").toString().equals("2")) {
                csAchievementNumVo.setPrizeAchievementName(stringObjectMap.get("className").toString());
                csAchievementNumVo.setPrizeAchievementNum(stringObjectMap.get("achievementNum").toString());
            } else if (stringObjectMap.get("remarks").toString().equals("3")) {
                csAchievementNumVo.setOtherAchievementName(stringObjectMap.get("className").toString());
                csAchievementNumVo.setOtherAchievementNum(stringObjectMap.get("achievementNum").toString());
            } else if (stringObjectMap.get("remarks").toString().equals("4")) {
                csAchievementNumVo.setReservationAchievementName(stringObjectMap.get("className").toString());
                csAchievementNumVo.setReservationAchievementNum(stringObjectMap.get("achievementNum").toString());
            } else if (stringObjectMap.get("remarks").toString().equals("5")) {
                csAchievementNumVo.setResourcesAchievementName(stringObjectMap.get("className").toString());
                csAchievementNumVo.setResourcesAchievementNum(stringObjectMap.get("achievementNum").toString());
            } else {
                csAchievementNumVo.setAchievementName(stringObjectMap.get("className").toString());
                csAchievementNumVo.setAchievementNum(stringObjectMap.get("achievementNum").toString());
            }
        }

        return csAchievementNumVo;
    }
}
