liding
2 天以前 733b9e6837365d2817d7e8a0005b2c167c18f77e
basic-server/src/main/java/com/ruoyi/basic/service/impl/CoalInfoServiceImpl.java
@@ -9,13 +9,14 @@
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.time.LocalDate;
import java.util.List;
import java.util.Objects;
/**
@@ -36,7 +37,7 @@
    public IPage<CoalInfo> selectCoalInfoList(Page page, CoalInfoDto coalInfoDto) {
        LambdaQueryWrapper<CoalInfo> queryWrapper = new LambdaQueryWrapper<>();
        if (StringUtils.hasText(coalInfoDto.getSearchAll())) {
            queryWrapper.like(CoalInfo::getCoal,coalInfoDto.getSearchAll());
            queryWrapper.like(CoalInfo::getCoal, coalInfoDto.getSearchAll());
        }
        queryWrapper.orderByDesc(CoalInfo::getCreateTime);
        return coalInfoMapper.selectPage(page, queryWrapper);
@@ -47,7 +48,7 @@
        CoalInfo coalInfo = new CoalInfo();
        BeanUtils.copyProperties(coalInfoDto, coalInfo);
        coalInfo.setMaintainerId(SecurityUtils.getUserId());
        coalInfo.setMaintenanceDate(DateUtils.getNowDate());
        coalInfo.setMaintenanceDate(LocalDate.now());
        if (Objects.isNull(coalInfoDto.getId())) {
            return coalInfoMapper.insert(coalInfo);
        } else {
@@ -70,4 +71,9 @@
        // 执行批量逻辑删除
        return coalInfoMapper.update(null, updateWrapper);
    }
    @Override
    public List<CoalInfo> coalInfoList() {
        return coalInfoMapper.selectList(null);
    }
}