|
|
@@ -41,6 +41,7 @@ import com.zhongshu.card.server.core.util.CommonUtil;
|
|
|
import io.micrometer.common.util.StringUtils;
|
|
|
import lombok.SneakyThrows;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.junit.Ignore;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StopWatch;
|
|
|
@@ -49,6 +50,7 @@ import java.math.BigDecimal;
|
|
|
import java.math.MathContext;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Slf4j
|
|
|
@Service
|
|
|
@@ -375,13 +377,19 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
shareOrder.setShareOrderNo(shareOrderNo);
|
|
|
shareOrderDao.save(shareOrder);
|
|
|
return satInfo;
|
|
|
- }).toList();
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
|
|
if (satInfos.size()>1){
|
|
|
- SatInfo satInfo = satInfos.get(0);
|
|
|
- BigDecimal upSatAmt = new BigDecimal(satInfo.getSatAmt()).add(new BigDecimal("1"));
|
|
|
- satInfo.setSatAmt(upSatAmt.toBigInteger().toString());
|
|
|
- satInfos.set(0, satInfo);
|
|
|
+ BigDecimal bigDecimal = BigDecimal.ZERO;
|
|
|
+ for (SatInfo sat: satInfos) {
|
|
|
+ bigDecimal = bigDecimal.add(new BigDecimal(sat.getSatAmt()));
|
|
|
+ }
|
|
|
+ if (bigDecimal.compareTo(total) != 0){
|
|
|
+ SatInfo satInfo = satInfos.get(0);
|
|
|
+ BigDecimal upSatAmt = new BigDecimal(satInfo.getSatAmt()).add(new BigDecimal("1"));
|
|
|
+ satInfo.setSatAmt(upSatAmt.toBigInteger().toString());
|
|
|
+ satInfos.set(0, satInfo);
|
|
|
+ }
|
|
|
}
|
|
|
return satInfos;
|
|
|
}
|