|
@@ -364,6 +364,7 @@ public class ExportServiceImpl implements ExportService {
|
|
|
long i = 1;
|
|
|
|
|
|
Map<String,BigDecimal> serviceChargeMap = new HashMap<String, BigDecimal>();
|
|
|
+ Map<String,Integer> orderCountMap = new HashMap<String, Integer>();
|
|
|
|
|
|
for (StudentPaymentOrderExportDto row : studentPaymentOrderExportDtos) {
|
|
|
if (row.getActualAmount() == null) {
|
|
@@ -382,7 +383,15 @@ public class ExportServiceImpl implements ExportService {
|
|
|
BigDecimal currentFee = BigDecimal.ZERO;
|
|
|
BigDecimal totalFee = BigDecimal.ZERO;
|
|
|
if (row.getPaymentChannel() != null && row.getPaymentChannel().equals("ADAPAY")) {
|
|
|
- //FeeFlagNumDto countFeeFlagNum = studentPaymentRouteOrderDao.getCountFeeFlagNum(row.getOrderNo());
|
|
|
+ FeeFlagNumDto countFeeFlagNum = studentPaymentRouteOrderDao.getCountFeeFlagNum(row.getOrderNo());
|
|
|
+
|
|
|
+ Integer times = orderCountMap.get(row.getOrderNo());
|
|
|
+ if (times == null) {
|
|
|
+ times = 1;
|
|
|
+ } else {
|
|
|
+ ++times;
|
|
|
+ }
|
|
|
+ orderCountMap.put(row.getOrderNo(), times);
|
|
|
|
|
|
transferFee = serviceChargeMap.get(row.getOrderNo());
|
|
|
if(transferFee == null){
|
|
@@ -391,7 +400,7 @@ public class ExportServiceImpl implements ExportService {
|
|
|
|
|
|
currentFee = row.getRouteAmount().multiply(new BigDecimal("0.28")).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
|
|
|
totalFee = row.getActualAmount().multiply(new BigDecimal("0.28")).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
|
|
|
- if(totalFee.subtract(transferFee.add(currentFee)).doubleValue() < 0){
|
|
|
+ if(totalFee.subtract(transferFee.add(currentFee)).doubleValue() < 0 || times == countFeeFlagNum.getTotalNum()){
|
|
|
currentFee = totalFee.subtract(transferFee);
|
|
|
serviceChargeMap.put(row.getOrderNo(), totalFee);
|
|
|
}else{
|