package com.ruoyi.cwgl.service.impl;
|
|
import java.util.List;
|
|
import com.ruoyi.common.utils.DateUtils;
|
import javax.annotation.Resource;
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.cwgl.domain.AgingLog;
|
import com.ruoyi.cwgl.mapper.AgingLogMapper;
|
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.PaymentFeedbackMapper;
|
import com.ruoyi.cwgl.domain.PaymentFeedback;
|
import com.ruoyi.cwgl.service.IPaymentFeedbackService;
|
import com.ruoyi.common.core.text.Convert;
|
|
/**
|
* 回款进度反馈Service业务层处理
|
*
|
* @author ruoyi
|
* @date 2026-03-20
|
*/
|
@Service
|
@Transactional(rollbackFor = Exception.class)
|
public class PaymentFeedbackServiceImpl extends BaseService<PaymentFeedbackMapper, PaymentFeedback> implements IPaymentFeedbackService
|
{
|
protected final Logger logger = LoggerFactory.getLogger(getClass());
|
@Resource
|
private PaymentFeedbackMapper paymentFeedbackMapper;
|
@Resource
|
private AgingLogMapper agingLogMapper;
|
|
|
/**
|
* 查询回款进度反馈
|
*
|
* @param id 回款进度反馈ID
|
* @return 回款进度反馈
|
*/
|
@DataSource(DataSourceType.SLAVE)
|
@Override
|
public PaymentFeedback selectPaymentFeedbackById(Integer id)
|
{
|
return paymentFeedbackMapper.selectPaymentFeedbackById(id);
|
}
|
|
/**
|
* 查询回款进度反馈 记录数
|
*
|
* @param paymentFeedback 回款进度反馈
|
* @return 回款进度反馈集合
|
*/
|
@DataSource(DataSourceType.SLAVE)
|
@Override
|
public int selectPaymentFeedbackCount(PaymentFeedback paymentFeedback)
|
{
|
return paymentFeedbackMapper.selectPaymentFeedbackCount(paymentFeedback);
|
}
|
|
/**
|
* 查询回款进度反馈列表
|
*
|
* @param paymentFeedback 回款进度反馈
|
* @return 回款进度反馈
|
*/
|
@DataSource(DataSourceType.SLAVE)
|
@Override
|
public List<PaymentFeedback> selectPaymentFeedbackList(PaymentFeedback paymentFeedback)
|
{
|
return paymentFeedbackMapper.selectPaymentFeedbackList(paymentFeedback);
|
}
|
|
/**
|
* 查询回款进度反馈列表 异步 导出
|
*
|
* @param paymentFeedback 回款进度反馈
|
* @param exportKey 导出功能的唯一标识
|
* @return 回款进度反馈集合
|
*/
|
@DataSource(DataSourceType.SLAVE)
|
@Async
|
@Override
|
public void export(PaymentFeedback paymentFeedback,String exportKey) {
|
|
super.export(PaymentFeedback.class,exportKey,"paymentFeedbackData",(pageNum)->{
|
PageUtils.startPage(pageNum, Constants.EXPORT_PATE_SIZE);
|
return selectPaymentFeedbackList(paymentFeedback);
|
});
|
}
|
|
|
/**
|
* 新增回款进度反馈
|
*
|
* @param paymentFeedback 回款进度反馈
|
* @return 结果
|
*/
|
@Override
|
public int insertPaymentFeedback(PaymentFeedback paymentFeedback)
|
{
|
paymentFeedback.setCreateTime(DateUtils.getNowDate());
|
int i = paymentFeedbackMapper.insertPaymentFeedback(paymentFeedback);
|
// 记录操作日志
|
if (i > 0) {
|
AgingLog log = new AgingLog();
|
log.setHeadId(paymentFeedback.getHeadId());
|
log.setCreateBy(SecurityUtils.getUsername());
|
log.setCreateTime(DateUtils.getNowDate());
|
log.setOperation("提交回款进度反馈");
|
agingLogMapper.insertAgingLog(log);
|
}
|
return i;
|
}
|
|
/**
|
* 新增回款进度反馈[批量]
|
*
|
* @param paymentFeedbacks 回款进度反馈
|
* @return 结果
|
*/
|
@Override
|
public int insertPaymentFeedbackBatch(List<PaymentFeedback> paymentFeedbacks)
|
{
|
int rows = paymentFeedbackMapper.insertPaymentFeedbackBatch(paymentFeedbacks);
|
return rows;
|
}
|
|
/**
|
* 修改回款进度反馈
|
*
|
* @param paymentFeedback 回款进度反馈
|
* @return 结果
|
*/
|
@Override
|
public int updatePaymentFeedback(PaymentFeedback paymentFeedback)
|
{
|
return paymentFeedbackMapper.updatePaymentFeedback(paymentFeedback);
|
}
|
|
/**
|
* 修改回款进度反馈[批量]
|
*
|
* @param paymentFeedbacks 回款进度反馈
|
* @return 结果
|
*/
|
@Override
|
public int updatePaymentFeedbackBatch(List<PaymentFeedback> paymentFeedbacks){
|
return paymentFeedbackMapper.updatePaymentFeedbackBatch(paymentFeedbacks);
|
}
|
|
/**
|
* 删除回款进度反馈对象
|
*
|
* @param ids 需要删除的数据ID
|
* @return 结果
|
*/
|
@Override
|
public int deletePaymentFeedbackByIds(String ids)
|
{
|
return deletePaymentFeedbackByIds(Convert.toIntArray(ids));
|
}
|
|
/**
|
* 删除回款进度反馈对象
|
*
|
*
|
* @param ids 需要删除的数据ID
|
* @return 结果
|
*/
|
@Override
|
public int deletePaymentFeedbackByIds(Integer[] ids)
|
{
|
return paymentFeedbackMapper.deletePaymentFeedbackByIds(ids);
|
}
|
|
/**
|
* 删除回款进度反馈信息
|
*
|
* @param id 回款进度反馈ID
|
* @return 结果
|
*/
|
@Override
|
public int deletePaymentFeedbackById(Integer id)
|
{
|
return paymentFeedbackMapper.deletePaymentFeedbackById(id);
|
}
|
}
|