package com.ruoyi.cwgl.service.impl; import java.util.List; import com.ruoyi.common.utils.DateUtils; import javax.annotation.Resource; import org.springframework.transaction.annotation.Transactional; import org.springframework.stereotype.Service; import org.springframework.scheduling.annotation.Async; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.annotation.DataSource; import com.ruoyi.common.enums.DataSourceType; import com.ruoyi.common.core.service.BaseService; import com.ruoyi.cwgl.mapper.PayableBillManagementLogMapper; import com.ruoyi.cwgl.domain.PayableBillManagementLog; import com.ruoyi.cwgl.service.IPayableBillManagementLogService; import com.ruoyi.common.core.text.Convert; /** * 应付账单管理日志Service业务层处理 * * @author ruoyi * @date 2025-12-23 */ @Service @Transactional(rollbackFor = Exception.class) public class PayableBillManagementLogServiceImpl extends BaseService implements IPayableBillManagementLogService { protected final Logger logger = LoggerFactory.getLogger(getClass()); @Resource private PayableBillManagementLogMapper payableBillManagementLogMapper; /** * 查询应付账单管理日志 * * @param id 应付账单管理日志ID * @return 应付账单管理日志 */ @DataSource(DataSourceType.SLAVE) @Override public PayableBillManagementLog selectPayableBillManagementLogById(Integer id) { return payableBillManagementLogMapper.selectPayableBillManagementLogById(id); } /** * 查询应付账单管理日志 记录数 * * @param payableBillManagementLog 应付账单管理日志 * @return 应付账单管理日志集合 */ @DataSource(DataSourceType.SLAVE) @Override public int selectPayableBillManagementLogCount(PayableBillManagementLog payableBillManagementLog) { return payableBillManagementLogMapper.selectPayableBillManagementLogCount(payableBillManagementLog); } /** * 查询应付账单管理日志列表 * * @param payableBillManagementLog 应付账单管理日志 * @return 应付账单管理日志 */ @DataSource(DataSourceType.SLAVE) @Override public List selectPayableBillManagementLogList(PayableBillManagementLog payableBillManagementLog) { return payableBillManagementLogMapper.selectPayableBillManagementLogList(payableBillManagementLog); } /** * 查询应付账单管理日志列表 异步 导出 * * @param payableBillManagementLog 应付账单管理日志 * @param exportKey 导出功能的唯一标识 * @return 应付账单管理日志集合 */ @DataSource(DataSourceType.SLAVE) @Async @Override public void export(PayableBillManagementLog payableBillManagementLog,String exportKey) { super.export(PayableBillManagementLog.class,exportKey,"payableBillManagementLogData",(pageNum)->{ PageUtils.startPage(pageNum, Constants.EXPORT_PATE_SIZE); return selectPayableBillManagementLogList(payableBillManagementLog); }); } /** * 新增应付账单管理日志 * * @param payableBillManagementLog 应付账单管理日志 * @return 结果 */ @Override public int insertPayableBillManagementLog(PayableBillManagementLog payableBillManagementLog) { payableBillManagementLog.setCreateTime(DateUtils.getNowDate()); return payableBillManagementLogMapper.insertPayableBillManagementLog(payableBillManagementLog); } /** * 新增应付账单管理日志[批量] * * @param payableBillManagementLogs 应付账单管理日志 * @return 结果 */ @Override public int insertPayableBillManagementLogBatch(List payableBillManagementLogs) { int rows = payableBillManagementLogMapper.insertPayableBillManagementLogBatch(payableBillManagementLogs); return rows; } /** * 修改应付账单管理日志 * * @param payableBillManagementLog 应付账单管理日志 * @return 结果 */ @Override public int updatePayableBillManagementLog(PayableBillManagementLog payableBillManagementLog) { return payableBillManagementLogMapper.updatePayableBillManagementLog(payableBillManagementLog); } /** * 修改应付账单管理日志[批量] * * @param payableBillManagementLogs 应付账单管理日志 * @return 结果 */ @Override public int updatePayableBillManagementLogBatch(List payableBillManagementLogs){ return payableBillManagementLogMapper.updatePayableBillManagementLogBatch(payableBillManagementLogs); } /** * 删除应付账单管理日志对象 * * @param ids 需要删除的数据ID * @return 结果 */ @Override public int deletePayableBillManagementLogByIds(String ids) { return deletePayableBillManagementLogByIds(Convert.toIntArray(ids)); } /** * 删除应付账单管理日志对象 * * * @param ids 需要删除的数据ID * @return 结果 */ @Override public int deletePayableBillManagementLogByIds(Integer[] ids) { return payableBillManagementLogMapper.deletePayableBillManagementLogByIds(ids); } /** * 删除应付账单管理日志信息 * * @param id 应付账单管理日志ID * @return 结果 */ @Override public int deletePayableBillManagementLogById(Integer id) { return payableBillManagementLogMapper.deletePayableBillManagementLogById(id); } }