|
|
@@ -1,6 +1,7 @@
|
|
|
package com.sckw.payment.service.wallet;
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
@@ -66,10 +67,12 @@ public class KwpBizWalletService {
|
|
|
* 分页查询钱包明细
|
|
|
*/
|
|
|
public PageDataResult<KwpBizWalletPageResponse> pageBizWalletList(KwpBizWalletQueryRequest request) {
|
|
|
+ log.info("分页查询钱包明细,入参:{}", JSONObject.toJSONString(request));
|
|
|
int systemType = LoginUserHolder.getSystemType();
|
|
|
|
|
|
//非管理端,返回空分页结果
|
|
|
if (systemType != SystemTypeEnum.COMPANY.getCode()) {
|
|
|
+ log.info("当前登录企业非管理端:{}", SystemTypeEnum.COMPANY.getCode());
|
|
|
return PageDataResult.empty(request.getPage(), request.getPageSize());
|
|
|
}
|
|
|
|
|
|
@@ -96,7 +99,9 @@ public class KwpBizWalletService {
|
|
|
List<KwpBizWalletPageResponse> walletPageList = pageList.size() >= request.getPage() ?
|
|
|
pageList.get(request.getPage() - 1) : Collections.emptyList();
|
|
|
|
|
|
- return PageDataResult.success(request.getPage(), request.getPageSize(), (long) walletPageList.size(), walletPageList);
|
|
|
+ PageDataResult<KwpBizWalletPageResponse> walletPageResponse = PageDataResult.success(request.getPage(), request.getPageSize(), (long) walletPageList.size(), walletPageList);
|
|
|
+ log.info("分页查询钱包明细成功,结果:{}", JSONObject.toJSONString(walletPageResponse));
|
|
|
+ return walletPageResponse;
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -120,10 +125,13 @@ public class KwpBizWalletService {
|
|
|
|
|
|
List<KwpBizWallet> bizWalletList = kwpBizWalletRepository.list(queryWrapper);
|
|
|
if (bizWalletList == null || CollectionUtils.isEmpty(bizWalletList)) {
|
|
|
+ log.info("当前供应企业无子级企业,entId:{}", entTypeResDto.getEntId());
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
|
|
|
- return getAndConvertWallet(entIds, bizWalletList);
|
|
|
+ List<KwpBizWalletPageResponse> supWalletList = getAndConvertWallet(entIds, bizWalletList);
|
|
|
+ log.info("供应企业钱包信息结果:{}", JSONObject.toJSONString(supWalletList));
|
|
|
+ return supWalletList;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -138,13 +146,16 @@ public class KwpBizWalletService {
|
|
|
.in(KwpBizWallet::getProEntId, entId);
|
|
|
List<KwpBizWallet> bizWalletList = kwpBizWalletRepository.list(queryWrapper);
|
|
|
if (bizWalletList == null || bizWalletList.isEmpty()) {
|
|
|
+ log.info("当前采购企业无钱包数据,entId:{}", entId);
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
|
|
|
//查询钱包所关联的供应商企业id
|
|
|
List<Long> entIds = bizWalletList.stream().map(KwpBizWallet::getSupEntId).collect(Collectors.toList());
|
|
|
|
|
|
- return getAndConvertWallet(entIds, bizWalletList);
|
|
|
+ List<KwpBizWalletPageResponse> proWallet = getAndConvertWallet(entIds, bizWalletList);
|
|
|
+ log.info("采购企业钱包信息结果:{}", JSONObject.toJSONString(proWallet));
|
|
|
+ return proWallet;
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -265,6 +276,7 @@ public class KwpBizWalletService {
|
|
|
* 新增钱包
|
|
|
*/
|
|
|
public void addWallet(KwpBizWalletSaveRequest request) {
|
|
|
+ log.info("新增钱包,入参:{}", JSONObject.toJSONString(request));
|
|
|
//校验
|
|
|
checkAddWallet(request);
|
|
|
|
|
|
@@ -277,6 +289,7 @@ public class KwpBizWalletService {
|
|
|
String entName = queryEntById(request.getProEntId());
|
|
|
kwpBizWallet.setName(entName + StringConstant.HYPHEN + OFFLINE_WALLET);
|
|
|
kwpBizWalletRepository.save(kwpBizWallet);
|
|
|
+ log.info("新增钱包成功!");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -318,6 +331,7 @@ public class KwpBizWalletService {
|
|
|
* 钱包状态更新
|
|
|
*/
|
|
|
public void updateWallet(Long id) {
|
|
|
+ log.info("更新钱包状态,入参:{}", id);
|
|
|
if (id == null) {
|
|
|
throw new RuntimeException("钱包id不能为空!");
|
|
|
}
|
|
|
@@ -331,6 +345,7 @@ public class KwpBizWalletService {
|
|
|
wallet.setState(0);
|
|
|
}
|
|
|
kwpBizWalletRepository.updateById(wallet);
|
|
|
+ log.info("更新钱包成功!");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -338,6 +353,7 @@ public class KwpBizWalletService {
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void updateWalletAmount(KwpBizWalletPrepayRequest request) {
|
|
|
+ log.info("人工录入明细,入参:{}", JSONObject.toJSONString(request));
|
|
|
KwpBizWallet wallet = kwpBizWalletRepository.getById(request.getWalletId());
|
|
|
if (wallet == null) {
|
|
|
throw new RuntimeException("钱包id:" + request.getWalletId() + ", 钱包信息不存在!");
|
|
|
@@ -363,13 +379,15 @@ public class KwpBizWalletService {
|
|
|
walletOperation.setVoucherUrl(request.getVoucherUrl());
|
|
|
walletOperation.setRemark(request.getRemark());
|
|
|
kwpBizWalletPrepayRepository.save(walletOperation);
|
|
|
+ log.info("人工录入明细成功!");
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 钱包冻账明细
|
|
|
+ * 分页查询钱包冻账明细
|
|
|
*/
|
|
|
public PageDataResult<KwpBizWalletPrepayPageResponse> walletPrepayDetail(KwpBizWalletPrepayQueryRequest request) {
|
|
|
+ log.info("分页查询钱包冻账明细,入参:{}", JSONObject.toJSONString(request));
|
|
|
Page<KwpBizWalletPrepay> page = new Page<>(request.getPage(), request.getPageSize());
|
|
|
LambdaQueryWrapper<KwpBizWalletPrepay> queryWrapper = Wrappers.<KwpBizWalletPrepay>lambdaQuery()
|
|
|
.eq(request.getType() != null, KwpBizWalletPrepay::getType, request.getType())
|
|
|
@@ -381,6 +399,7 @@ public class KwpBizWalletService {
|
|
|
Page<KwpBizWalletPrepay> walletPrepayPage = kwpBizWalletPrepayRepository.page(page, queryWrapper);
|
|
|
//若为null,返回空分页结果
|
|
|
if (walletPrepayPage == null || CollectionUtils.isEmpty(walletPrepayPage.getRecords())) {
|
|
|
+ log.info("分页查询钱包冻账明细无数据");
|
|
|
return PageDataResult.empty(request.getPage(), request.getPageSize());
|
|
|
}
|
|
|
|
|
|
@@ -403,16 +422,21 @@ public class KwpBizWalletService {
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
walletPrepayPageList.sort(Comparator.comparing(KwpBizWalletPrepayPageResponse::getCreateTime));
|
|
|
- return PageDataResult.success(request.getPage(), request.getPageSize(), (long) walletPrepayPageList.size(), walletPrepayPageList);
|
|
|
+ PageDataResult<KwpBizWalletPrepayPageResponse> walletPrepayPageResponse = PageDataResult
|
|
|
+ .success(request.getPage(), request.getPageSize(), (long) walletPrepayPageList.size(), walletPrepayPageList);
|
|
|
+ log.info("分页查询钱包冻账明细成功,结果:{}", JSONObject.toJSONString(walletPrepayPageResponse));
|
|
|
+ return walletPrepayPageResponse;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 钱包冻账明细导出
|
|
|
*/
|
|
|
public List<KwpBizWalletPrepayExcelVO> queryExportWalletPrepay(KwpBizWalletPrepayQueryRequest request) {
|
|
|
+ log.info("钱包冻账明细导出,入参:{}", JSONObject.toJSONString(request));
|
|
|
//查询导出数据
|
|
|
PageDataResult<KwpBizWalletPrepayPageResponse> walletPrepayPageResult = walletPrepayDetail(request);
|
|
|
- return walletPrepayPageResult.getList().stream().map(vo -> {
|
|
|
+ List<KwpBizWalletPrepayExcelVO> walletPrepayExcelVO = walletPrepayPageResult.getList().stream().map(vo -> {
|
|
|
KwpBizWalletPrepayExcelVO excelVO = KwpBizWalletPrepayExcelVO.toPageResp(vo);
|
|
|
//变动类型
|
|
|
String descByCode = PrepayTypEnum.getDescByCode(vo.getType());
|
|
|
@@ -420,7 +444,8 @@ public class KwpBizWalletService {
|
|
|
|
|
|
return excelVO;
|
|
|
}).collect(Collectors.toList());
|
|
|
-
|
|
|
+ log.info("钱包冻账明细导出成功,结果:{}", JSONObject.toJSONString(walletPrepayPageResult));
|
|
|
+ return walletPrepayExcelVO;
|
|
|
}
|
|
|
|
|
|
|