fuliqi
2024-11-28 a1fc7e3e337393954a95b5f85c1a3f59d61208c4
business/src/main/java/com/ycl/service/impl/ProjectInvestmentInfoServiceImpl.java
@@ -1,6 +1,7 @@
package com.ycl.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ycl.common.utils.SecurityUtils;
import com.ycl.domain.entity.ProjectInvestmentInfo;
import com.ycl.mapper.ProjectInvestmentInfoMapper;
import com.ycl.service.ProjectInvestmentInfoService;
@@ -38,8 +39,12 @@
    @Override
    public Result add(ProjectInvestmentInfoForm form) {
        ProjectInvestmentInfo entity = ProjectInvestmentInfoForm.getEntityByForm(form, null);
        Long userId = SecurityUtils.getUserId();
        entity.setCreateBy(userId);
        entity.setUpdateBy(userId);
        baseMapper.insert(entity);
        return Result.ok("添加成功");
        return Result.ok("添加成功").data(entity.getId());
    }
    /**
@@ -54,6 +59,8 @@
        // 为空抛IllegalArgumentException,做全局异常处理
        Assert.notNull(entity, "记录不存在");
        BeanUtils.copyProperties(form, entity);
        Long userId = SecurityUtils.getUserId();
        entity.setUpdateBy(userId);
        baseMapper.updateById(entity);
        return Result.ok("修改成功");
    }