zxl
2025-03-14 23b688e436a89845e92d861adb5875e625e90d9f
business/src/main/java/com/ycl/service/impl/ProjectInvestmentFundingServiceImpl.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.ycl.common.utils.SecurityUtils;
import com.ycl.domain.entity.ProjectInvestmentFunding;
import com.ycl.domain.entity.ProjectInvestmentInfo;
@@ -46,6 +47,7 @@
        entity.setCreateBy(userId);
        entity.setUpdateBy(userId);
        baseMapper.insert(entity);
        //避免新增一个后重复新增返回id给前端判断
        return Result.ok("添加成功").data(entity.getId());
    }
@@ -108,11 +110,13 @@
     */
    @Override
    public Result detail(Integer id) {
        QueryWrapper<ProjectInvestmentFunding> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("project_id",id);
        ProjectInvestmentFunding entity = baseMapper.selectOne(queryWrapper);
        Assert.notNull(entity, "记录不存在");
        ProjectInvestmentFundingVO vo = ProjectInvestmentFundingVO.getVoByEntity(entity, null);
        ProjectInvestmentFunding entity = new LambdaQueryChainWrapper<>(baseMapper)
                .eq(ProjectInvestmentFunding::getProjectId, id)
                .one();
        ProjectInvestmentFundingVO vo =new ProjectInvestmentFundingVO();
        if(entity!=null){
            vo = ProjectInvestmentFundingVO.getVoByEntity(entity, null);
        }
        return Result.ok().data(vo);
    }