|
|
@@ -21,6 +21,7 @@ import com.sckw.payment.model.*;
|
|
|
import com.sckw.payment.model.constant.LedgerEnum;
|
|
|
import com.sckw.payment.model.constant.SettlementEnum;
|
|
|
import com.sckw.payment.model.constant.TradeUnitType;
|
|
|
+import com.sckw.payment.model.constant.TradingEnum;
|
|
|
import com.sckw.payment.model.dto.*;
|
|
|
import com.sckw.payment.model.vo.req.*;
|
|
|
import com.sckw.payment.model.vo.res.LedgerCountSumVo;
|
|
|
@@ -148,9 +149,9 @@ public class KwpLedgerTradeService extends AbsLedger {
|
|
|
tradeReq.setUnitTypeTwo(TradeUnitType.SELL);
|
|
|
List<Integer> status = new ArrayList<>();
|
|
|
|
|
|
- LedgerCountSumVo ledgerCountSumVo = tradeMapper.countSum(tradeReq, status);
|
|
|
- LedgerCountSumVo ledgerCountSumVo2 = tradeMapper.countSumMoney(tradeReq, status);
|
|
|
- return new LedgerCountSumVo(ledgerCountSumVo2.getTotalPrice(), ledgerCountSumVo.getLedgerCount());
|
|
|
+ Long aLong = tradeMapper.countSum(tradeReq, status);
|
|
|
+ BigDecimal bigDecimal = tradeMapper.countSumMoney(tradeReq, status);
|
|
|
+ return new LedgerCountSumVo(bigDecimal, aLong);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -183,9 +184,9 @@ public class KwpLedgerTradeService extends AbsLedger {
|
|
|
add(LedgerEnum.SAVE.getStatus());
|
|
|
add(LedgerEnum.REVOCATION.getStatus());
|
|
|
}};
|
|
|
- LedgerCountSumVo ledgerCountSumVo = tradeMapper.countSum(tradeReq, status);
|
|
|
- LedgerCountSumVo ledgerCountSumVo2 = tradeMapper.countSumMoney(tradeReq, status);
|
|
|
- return new LedgerCountSumVo(ledgerCountSumVo2.getTotalPrice(), ledgerCountSumVo.getLedgerCount());
|
|
|
+ Long aLong = tradeMapper.countSum(tradeReq, status);
|
|
|
+ BigDecimal bigDecimal = tradeMapper.countSumMoney(tradeReq, status);
|
|
|
+ return new LedgerCountSumVo(bigDecimal, aLong);
|
|
|
}
|
|
|
|
|
|
private void removeDraft(Long id) {
|
|
|
@@ -253,17 +254,22 @@ public class KwpLedgerTradeService extends AbsLedger {
|
|
|
tradeOrderService.check(ids);
|
|
|
List<OrderDetailRes> resList = new ArrayList<>();
|
|
|
Map<Long, String> map = new HashMap<>();
|
|
|
-
|
|
|
+ String trading = tradeSendReq.getTrading();
|
|
|
for (Long id : ids) {
|
|
|
OrderDetailRes orderDetailById = tradeOrderInfoService.getOrderDetailById(id);
|
|
|
if (Objects.isNull(orderDetailById)) {
|
|
|
throw new BusinessException("订单未找到");
|
|
|
}
|
|
|
- KwpTradeFreeze byTOrderId = kwpTradeFreezeService.getByTOrderId(id);
|
|
|
- if (Objects.isNull(byTOrderId)) {
|
|
|
- throw new BusinessException("未找到关联的冻结单");
|
|
|
+ //1x 预付款 2x 货到付款 3x 线下付款
|
|
|
+ Integer prefix = TradingEnum.getPrefix(trading);
|
|
|
+ //仅预付款需要校验冻结单号
|
|
|
+ if (Objects.nonNull(prefix) && prefix == TradingEnum.PRE_PAY.getStatus() ) {
|
|
|
+ KwpTradeFreeze byTOrderId = kwpTradeFreezeService.getByTOrderId(id);
|
|
|
+ if(Objects.isNull(byTOrderId)){
|
|
|
+ throw new BusinessException("未找到关联的冻结单");
|
|
|
+ }
|
|
|
+ map.put(id, byTOrderId.getOrderNo());
|
|
|
}
|
|
|
- map.put(id, byTOrderId.getOrderNo());
|
|
|
resList.add(orderDetailById);
|
|
|
}
|
|
|
for (Long id : ids) {
|