|
@@ -12,9 +12,10 @@ import com.sckw.payment.dao.KwpSettlementLogisticsMapper;
|
|
|
import com.sckw.payment.model.KwpSettlementLogistics;
|
|
import com.sckw.payment.model.KwpSettlementLogistics;
|
|
|
import com.sckw.payment.model.constant.LogisticsUnitType;
|
|
import com.sckw.payment.model.constant.LogisticsUnitType;
|
|
|
import com.sckw.payment.model.constant.SettlementEnum;
|
|
import com.sckw.payment.model.constant.SettlementEnum;
|
|
|
-import com.sckw.payment.model.dto.LedgerUnitDto;
|
|
|
|
|
-import com.sckw.payment.model.dto.MoneyType;
|
|
|
|
|
-import com.sckw.payment.model.dto.SettlementLogisticsDto;
|
|
|
|
|
|
|
+import com.sckw.payment.model.constant.SettlementOrderTypeEnum;
|
|
|
|
|
+import com.sckw.payment.model.constant.TradingEnum;
|
|
|
|
|
+import com.sckw.payment.model.dto.*;
|
|
|
|
|
+import com.sckw.payment.model.vo.SettlementVo;
|
|
|
import com.sckw.payment.model.vo.req.SettlementReq;
|
|
import com.sckw.payment.model.vo.req.SettlementReq;
|
|
|
import com.sckw.payment.model.vo.res.SettlementLogisticsStatusCountVo;
|
|
import com.sckw.payment.model.vo.res.SettlementLogisticsStatusCountVo;
|
|
|
import com.sckw.payment.model.vo.res.SettlementLogisticsSumVo;
|
|
import com.sckw.payment.model.vo.res.SettlementLogisticsSumVo;
|
|
@@ -23,6 +24,7 @@ import com.sckw.payment.utils.PageMoreRes;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
|
|
|
+import jakarta.annotation.Resource;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -45,7 +47,10 @@ public class KwpSettlementLogisticsService {
|
|
|
private RemoteSystemService remoteSystemService;
|
|
private RemoteSystemService remoteSystemService;
|
|
|
private final KwpSettlementLogisticsMapper settlementLogisticsMapper;
|
|
private final KwpSettlementLogisticsMapper settlementLogisticsMapper;
|
|
|
private final KwpLedgerLogisticsUnitService logisticsUnitService;
|
|
private final KwpLedgerLogisticsUnitService logisticsUnitService;
|
|
|
-
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private KwpSettlementWalletService kwpSettlementWalletService;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private KwpSettlementOfflineService kwpSettlementOfflineService;
|
|
|
|
|
|
|
|
public void save(KwpSettlementLogistics settlementLogistics) {
|
|
public void save(KwpSettlementLogistics settlementLogistics) {
|
|
|
settlementLogisticsMapper.insert(settlementLogistics);
|
|
settlementLogisticsMapper.insert(settlementLogistics);
|
|
@@ -98,7 +103,38 @@ public class KwpSettlementLogisticsService {
|
|
|
settlementReq.setUnitTypeTwo(LogisticsUnitType.SHIPPER);
|
|
settlementReq.setUnitTypeTwo(LogisticsUnitType.SHIPPER);
|
|
|
return pageSelect(settlementReq);
|
|
return pageSelect(settlementReq);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询贸易结算详情
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param id 结算单id
|
|
|
|
|
+ * @param unitType 企业类型
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public SettlementDetailDto<SettlementLogisticsDto, SettlementVo> queryDetail(Long id, Integer unitType) {
|
|
|
|
|
+ SettlementLogisticsDto settlementLogisticsDto = settlementLogisticsMapper.selectDetail(id, unitType);
|
|
|
|
|
+ if (Objects.isNull(settlementLogisticsDto)) {
|
|
|
|
|
+ throw new BusinessException("结算单不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ Map<String, SysDictResDto> dictResDtoMap = remoteSystemService.queryDictMapByType(DictTypeEnum.TRADE_TYPE.getType());
|
|
|
|
|
+ String trading = settlementLogisticsDto.getTrading();
|
|
|
|
|
+ SysDictResDto sysDictResDto = dictResDtoMap.get(trading);
|
|
|
|
|
+ if (Objects.nonNull(sysDictResDto)) {
|
|
|
|
|
+ settlementLogisticsDto.setTradingLabel(sysDictResDto.getLabel());
|
|
|
|
|
+ }
|
|
|
|
|
+ settlementLogisticsDto.setPercentage(settlementLogisticsDto.changePercentage(settlementLogisticsDto.getActualPrice(), settlementLogisticsDto.getTotalPrice()));
|
|
|
|
|
+ settlementLogisticsDto.setStatusLabel(SettlementEnum.getStatusDesc(settlementLogisticsDto.getStatus()));
|
|
|
|
|
+ Integer payType = TradingEnum.getPrefix(trading);
|
|
|
|
|
+ List<SettlementVo> settlementVoList = new ArrayList<>();
|
|
|
|
|
+ if (Objects.nonNull(payType)) {
|
|
|
|
|
+ if(payType==TradingEnum.OFFLINE_PAY.getStatus()){
|
|
|
|
|
+ settlementVoList = kwpSettlementOfflineService.queryList(id, SettlementOrderTypeEnum.LOGISTICS.getStatus(), payType);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ settlementVoList = kwpSettlementWalletService.queryList(id, SettlementOrderTypeEnum.LOGISTICS.getStatus(), payType);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ List<SettlementVo> settlementWallet = kwpSettlementWalletService.queryList(id, SettlementOrderTypeEnum.LOGISTICS.getStatus(), TradingEnum.getPrefix(trading));
|
|
|
|
|
+ return new SettlementDetailDto<>(settlementLogisticsDto, settlementVoList);
|
|
|
|
|
+ }
|
|
|
/**
|
|
/**
|
|
|
* 运费收款-物流订单详情
|
|
* 运费收款-物流订单详情
|
|
|
*
|
|
*
|