fix:流水返回对象统一

This commit is contained in:
wangff
2025-11-24 16:27:19 +08:00
parent 9bc035fffd
commit 93417c4a4f
9 changed files with 17 additions and 19 deletions

View File

@@ -17,7 +17,7 @@ import java.util.List;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class BillPageDTO {
private List<BillDTO> pageData;
private List<TradeRecordDTO> pageData;
private WalletBasicPageInfo page;

View File

@@ -1,5 +1,6 @@
package com.cool.store.dto.wallet;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -11,6 +12,7 @@ import java.io.Serializable;
* @Version 1.0
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class TradeRecordDTO implements Serializable {
@ApiModelProperty(value = "业务系统付款单号(如 CRM 单号)", required = true)

View File

@@ -1,5 +1,6 @@
package com.cool.store.vo.wallet;
import com.cool.store.dto.wallet.TradeRecordDTO;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
@@ -23,7 +24,7 @@ import java.util.Objects;
@NoArgsConstructor
public class AccountBillPageVO {
@ApiModelProperty("分页数据")
PageInfo<AccountBillListVO> data;
PageInfo<TradeRecordDTO> data;
@ApiModelProperty("收入")
private BigDecimal getAmount;
@@ -31,7 +32,7 @@ public class AccountBillPageVO {
@ApiModelProperty("支出")
private BigDecimal useAmount;
public AccountBillPageVO(PageInfo<AccountBillListVO> data, Long getAmount, Long useAmount) {
public AccountBillPageVO(PageInfo<TradeRecordDTO> data, Long getAmount, Long useAmount) {
this.data = data;
BigDecimal denominator = new BigDecimal(100);
this.getAmount = new BigDecimal(Objects.nonNull(getAmount) ? getAmount : 0).divide(denominator, 2, RoundingMode.HALF_UP);

View File

@@ -134,8 +134,8 @@ public class WalletApiService {
* @param request
* @return
*/
public BillDetailDTO getBillDetail(BillDetailRequest request){
return walletHttpClientRest.postWithSign(walletBaseUrl+"/open/crm/trans/v1/billDetail", request, BillDetailDTO.class);
public TradeRecordDTO getBillDetail(BillDetailRequest request){
return walletHttpClientRest.postWithSign(walletBaseUrl+"/open/crm/trans/v1/billDetail", request, TradeRecordDTO.class);
}
/**

View File

@@ -107,7 +107,7 @@ public interface WalletService {
* @param request 交易详情查询Request
* @return 交易详情VO
*/
BillDetailDTO getBillDetail(BillDetailRequest request);
TradeRecordDTO getBillDetail(BillDetailRequest request);
/**
* 密码维护

View File

@@ -166,7 +166,7 @@ public class WalletServiceImpl implements WalletService {
result.setPageSize(page.getPageSize());
result.setPages(page.getCount());
result.setTotal(page.getTotal());
result.setList(CollectionUtils.isNotEmpty(list) ? BeanUtil.toList(list, clazz) : Collections.emptyList());
result.setList(CollectionUtils.isNotEmpty(list) ? (list.get(0).getClass().equals(clazz) ? (List<R>) list : BeanUtil.toList(list, clazz)) : Collections.emptyList());
return result;
}
@@ -359,12 +359,12 @@ public class WalletServiceImpl implements WalletService {
.pageSize(request.getPageSize())
.build();
BillPageDTO billPage = walletApiService.getBillPage(billPageRequest);
PageInfo<AccountBillListVO> data = toPageInfo(billPage.getPageData(), AccountBillListVO.class, billPage.getPage());
PageInfo<TradeRecordDTO> data = toPageInfo(billPage.getPageData(), TradeRecordDTO.class, billPage.getPage());
return new AccountBillPageVO(data, billPage.getGetAmount(), billPage.getUseAmount());
}
@Override
public BillDetailDTO getBillDetail(BillDetailRequest request) {
public TradeRecordDTO getBillDetail(BillDetailRequest request) {
return walletApiService.getBillDetail(request);
}

View File

@@ -8,7 +8,6 @@ import com.cool.store.dto.huoma.*;
import com.cool.store.dto.wallet.*;
import com.cool.store.entity.*;
import com.cool.store.enums.DownSystemTypeEnum;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.MessageEnum;
import com.cool.store.enums.SMSMsgEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
@@ -40,8 +39,6 @@ import com.cool.store.service.wallet.WalletApiService;
import com.cool.store.service.wechat.WechatTemplateService;
import com.cool.store.service.xinfa.XinFaBusinessService;
import com.cool.store.utils.RsaSignUtil;
import com.cool.store.utils.easyExcel.StoreImageExcelExporter;
import com.cool.store.utils.poi.ExcelUtil;
import com.cool.store.utils.poi.StringUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
@@ -52,10 +49,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.*;
@@ -757,8 +752,8 @@ public class PCTestController {
@ApiOperation(" 获取账单详情")
@PostMapping("/getBillDetail")
public ResponseResult<BillDetailDTO> getBillDetail(@RequestBody BillDetailRequest request) {
BillDetailDTO billDetail = walletApiService.getBillDetail(request);
public ResponseResult<TradeRecordDTO> getBillDetail(@RequestBody BillDetailRequest request) {
TradeRecordDTO billDetail = walletApiService.getBillDetail(request);
return ResponseResult.success(billDetail);
}

View File

@@ -64,7 +64,7 @@ public class WalletController {
@ApiOperation("交易流水详情")
@GetMapping("/billDetail")
public ResponseResult<BillDetailDTO> getBillDetail(BillDetailRequest request) {
public ResponseResult<TradeRecordDTO> getBillDetail(BillDetailRequest request) {
return ResponseResult.success(walletService.getBillDetail(request));
}
}

View File

@@ -1,7 +1,7 @@
package com.cool.store.controller.webc;
import com.cool.store.dto.wallet.BillDetailDTO;
import com.cool.store.dto.wallet.OpenBasicInfoDTO;
import com.cool.store.dto.wallet.TradeRecordDTO;
import com.cool.store.request.wallet.*;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.wallet.WalletService;
@@ -77,7 +77,7 @@ public class MiniWalletController {
@ApiOperation("交易流水详情")
@GetMapping("/billDetail")
public ResponseResult<BillDetailDTO> getBillDetail(BillDetailRequest request) {
public ResponseResult<TradeRecordDTO> getBillDetail(BillDetailRequest request) {
return ResponseResult.success(walletService.getBillDetail(request));
}