liding
2 天以前 befc0e5606ab7c913dda0346152a4150d0ee5f79
basic-server/src/main/java/com/ruoyi/basic/service/impl/CoalInfoServiceImpl.java
@@ -9,9 +9,12 @@
import com.ruoyi.basic.entity.CoalInfo;
import com.ruoyi.basic.mapper.CoalInfoMapper;
import com.ruoyi.basic.service.CoalInfoService;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.Objects;
@@ -32,6 +35,9 @@
    @Override
    public IPage<CoalInfo> selectCoalInfoList(Page page, CoalInfoDto coalInfoDto) {
        LambdaQueryWrapper<CoalInfo> queryWrapper = new LambdaQueryWrapper<>();
        if (StringUtils.hasText(coalInfoDto.getCoal())) {
            queryWrapper.like(CoalInfo::getCoal,coalInfoDto.getCoal());
        }
        queryWrapper.orderByDesc(CoalInfo::getCreateTime);
        return coalInfoMapper.selectPage(page, queryWrapper);
    }
@@ -40,6 +46,8 @@
    public int addOrEditCoalInfo(CoalInfoDto coalInfoDto) {
        CoalInfo coalInfo = new CoalInfo();
        BeanUtils.copyProperties(coalInfoDto, coalInfo);
        coalInfo.setMaintainerId(SecurityUtils.getUserId());
        coalInfo.setMaintenanceDate(DateUtils.getNowDate());
        if (Objects.isNull(coalInfo.getId())) {
            return coalInfoMapper.insert(coalInfo);
        } else {