xiangpei
2025-02-23 c276317fa2e695e65efadbbb3204d14986ded733
business/src/main/java/com/ycl/service/impl/ProjectInvestmentInfoServiceImpl.java
@@ -1,5 +1,6 @@
package com.ycl.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ycl.common.utils.SecurityUtils;
import com.ycl.domain.entity.ProjectInvestmentInfo;
@@ -44,6 +45,7 @@
        entity.setUpdateBy(userId);
        baseMapper.insert(entity);
        //避免新增一个后重复新增返回id给前端判断
        return Result.ok("添加成功").data(entity.getId());
    }
@@ -106,8 +108,13 @@
     */
    @Override
    public Result detail(Integer id) {
        ProjectInvestmentInfoVO vo = baseMapper.getById(id);
        Assert.notNull(vo, "记录不存在");
        QueryWrapper<ProjectInvestmentInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("project_id",id);
        ProjectInvestmentInfo entity = baseMapper.selectOne(queryWrapper);
        ProjectInvestmentInfoVO vo = new ProjectInvestmentInfoVO();
        if(entity!=null) {
            vo = ProjectInvestmentInfoVO.getVoByEntity(entity, null);
        }
        return Result.ok().data(vo);
    }