yanderong
4 天以前 7617d46abee2950b7336e3379f8c7a564939cb54
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.ruoyi.other.service.impl;
 
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.other.api.domain.TBalanceWarningRecord;
import com.ruoyi.other.mapper.TBalanceWarningRecordMapper;
import com.ruoyi.other.service.TBalanceWarningRecordService;
import org.springframework.stereotype.Service;
 
import java.time.LocalDate;
 
/**
 * <p>
 * 公司余额预警短信提醒记录 服务实现类
 * </p>
 *
 * @author mxcd
 * @since 2026-10-10
 */
@Service
public class TBalanceWarningRecordServiceImpl
        extends ServiceImpl<TBalanceWarningRecordMapper, TBalanceWarningRecord>
        implements TBalanceWarningRecordService {
 
    @Override
    public boolean isNotifiedToday(Integer companyId, Integer warnScope, String subIdentifier) {
        if (companyId == null || warnScope == null) {
            return false;
        }
        String identifier = subIdentifier == null ? "" : subIdentifier;
        return count(Wrappers.<TBalanceWarningRecord>lambdaQuery()
                .eq(TBalanceWarningRecord::getCompanyId, companyId)
                .eq(TBalanceWarningRecord::getWarnScope, warnScope)
                .eq(TBalanceWarningRecord::getSubIdentifier, identifier)
                .eq(TBalanceWarningRecord::getWarnDate, LocalDate.now())) > 0;
    }
 
}