更新
This commit is contained in:
parent
e6c6f8c406
commit
e897418fa2
|
@ -0,0 +1,15 @@
|
|||
package com.ruoyi.ss.bonusRefund.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.ss.bonus.domain.Bonus;
|
||||
import com.ruoyi.ss.bonusRefund.domain.BonusRefund;
|
||||
|
||||
public interface BonusRefundConverter {
|
||||
|
||||
/**
|
||||
* 转换为退款记录
|
||||
*/
|
||||
List<BonusRefund> toPo(List<Bonus> bonusList);
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.ruoyi.ss.bonusRefund.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||
import com.ruoyi.ss.bonus.domain.Bonus;
|
||||
import com.ruoyi.ss.bonusRefund.domain.BonusRefund;
|
||||
import com.ruoyi.ss.bonusRefund.service.BonusRefundConverter;
|
||||
|
||||
@Service
|
||||
public class BonusRefundConverterImpl implements BonusRefundConverter {
|
||||
|
||||
@Override
|
||||
public List<BonusRefund> toPo(List<Bonus> refundList) {
|
||||
if (CollectionUtils.isEmptyElement(refundList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<BonusRefund> result = new ArrayList<>();
|
||||
for (Bonus refund : refundList) {
|
||||
BonusRefund po = new BonusRefund();
|
||||
po.setBonusId(refund.getId());
|
||||
po.setRefundAmount(refund.getRefundAmount());
|
||||
result.add(po);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user