fix:流水返回对象统一
This commit is contained in:
@@ -17,7 +17,7 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class BillPageDTO {
|
public class BillPageDTO {
|
||||||
private List<BillDTO> pageData;
|
private List<TradeRecordDTO> pageData;
|
||||||
|
|
||||||
private WalletBasicPageInfo page;
|
private WalletBasicPageInfo page;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.dto.wallet;
|
package com.cool.store.dto.wallet;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -11,6 +12,7 @@ import java.io.Serializable;
|
|||||||
* @Version 1.0
|
* @Version 1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class TradeRecordDTO implements Serializable {
|
public class TradeRecordDTO implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(value = "业务系统付款单号(如 CRM 单号)", required = true)
|
@ApiModelProperty(value = "业务系统付款单号(如 CRM 单号)", required = true)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.vo.wallet;
|
package com.cool.store.vo.wallet;
|
||||||
|
|
||||||
|
import com.cool.store.dto.wallet.TradeRecordDTO;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -23,7 +24,7 @@ import java.util.Objects;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class AccountBillPageVO {
|
public class AccountBillPageVO {
|
||||||
@ApiModelProperty("分页数据")
|
@ApiModelProperty("分页数据")
|
||||||
PageInfo<AccountBillListVO> data;
|
PageInfo<TradeRecordDTO> data;
|
||||||
|
|
||||||
@ApiModelProperty("收入")
|
@ApiModelProperty("收入")
|
||||||
private BigDecimal getAmount;
|
private BigDecimal getAmount;
|
||||||
@@ -31,7 +32,7 @@ public class AccountBillPageVO {
|
|||||||
@ApiModelProperty("支出")
|
@ApiModelProperty("支出")
|
||||||
private BigDecimal useAmount;
|
private BigDecimal useAmount;
|
||||||
|
|
||||||
public AccountBillPageVO(PageInfo<AccountBillListVO> data, Long getAmount, Long useAmount) {
|
public AccountBillPageVO(PageInfo<TradeRecordDTO> data, Long getAmount, Long useAmount) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
BigDecimal denominator = new BigDecimal(100);
|
BigDecimal denominator = new BigDecimal(100);
|
||||||
this.getAmount = new BigDecimal(Objects.nonNull(getAmount) ? getAmount : 0).divide(denominator, 2, RoundingMode.HALF_UP);
|
this.getAmount = new BigDecimal(Objects.nonNull(getAmount) ? getAmount : 0).divide(denominator, 2, RoundingMode.HALF_UP);
|
||||||
|
|||||||
@@ -134,8 +134,8 @@ public class WalletApiService {
|
|||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public BillDetailDTO getBillDetail(BillDetailRequest request){
|
public TradeRecordDTO getBillDetail(BillDetailRequest request){
|
||||||
return walletHttpClientRest.postWithSign(walletBaseUrl+"/open/crm/trans/v1/billDetail", request, BillDetailDTO.class);
|
return walletHttpClientRest.postWithSign(walletBaseUrl+"/open/crm/trans/v1/billDetail", request, TradeRecordDTO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public interface WalletService {
|
|||||||
* @param request 交易详情查询Request
|
* @param request 交易详情查询Request
|
||||||
* @return 交易详情VO
|
* @return 交易详情VO
|
||||||
*/
|
*/
|
||||||
BillDetailDTO getBillDetail(BillDetailRequest request);
|
TradeRecordDTO getBillDetail(BillDetailRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码维护
|
* 密码维护
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ public class WalletServiceImpl implements WalletService {
|
|||||||
result.setPageSize(page.getPageSize());
|
result.setPageSize(page.getPageSize());
|
||||||
result.setPages(page.getCount());
|
result.setPages(page.getCount());
|
||||||
result.setTotal(page.getTotal());
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,12 +359,12 @@ public class WalletServiceImpl implements WalletService {
|
|||||||
.pageSize(request.getPageSize())
|
.pageSize(request.getPageSize())
|
||||||
.build();
|
.build();
|
||||||
BillPageDTO billPage = walletApiService.getBillPage(billPageRequest);
|
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());
|
return new AccountBillPageVO(data, billPage.getGetAmount(), billPage.getUseAmount());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BillDetailDTO getBillDetail(BillDetailRequest request) {
|
public TradeRecordDTO getBillDetail(BillDetailRequest request) {
|
||||||
return walletApiService.getBillDetail(request);
|
return walletApiService.getBillDetail(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import com.cool.store.dto.huoma.*;
|
|||||||
import com.cool.store.dto.wallet.*;
|
import com.cool.store.dto.wallet.*;
|
||||||
import com.cool.store.entity.*;
|
import com.cool.store.entity.*;
|
||||||
import com.cool.store.enums.DownSystemTypeEnum;
|
import com.cool.store.enums.DownSystemTypeEnum;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
|
||||||
import com.cool.store.enums.MessageEnum;
|
import com.cool.store.enums.MessageEnum;
|
||||||
import com.cool.store.enums.SMSMsgEnum;
|
import com.cool.store.enums.SMSMsgEnum;
|
||||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
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.wechat.WechatTemplateService;
|
||||||
import com.cool.store.service.xinfa.XinFaBusinessService;
|
import com.cool.store.service.xinfa.XinFaBusinessService;
|
||||||
import com.cool.store.utils.RsaSignUtil;
|
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.cool.store.utils.poi.StringUtils;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
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.beans.factory.annotation.Value;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@@ -757,8 +752,8 @@ public class PCTestController {
|
|||||||
|
|
||||||
@ApiOperation(" 获取账单详情")
|
@ApiOperation(" 获取账单详情")
|
||||||
@PostMapping("/getBillDetail")
|
@PostMapping("/getBillDetail")
|
||||||
public ResponseResult<BillDetailDTO> getBillDetail(@RequestBody BillDetailRequest request) {
|
public ResponseResult<TradeRecordDTO> getBillDetail(@RequestBody BillDetailRequest request) {
|
||||||
BillDetailDTO billDetail = walletApiService.getBillDetail(request);
|
TradeRecordDTO billDetail = walletApiService.getBillDetail(request);
|
||||||
return ResponseResult.success(billDetail);
|
return ResponseResult.success(billDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class WalletController {
|
|||||||
|
|
||||||
@ApiOperation("交易流水详情")
|
@ApiOperation("交易流水详情")
|
||||||
@GetMapping("/billDetail")
|
@GetMapping("/billDetail")
|
||||||
public ResponseResult<BillDetailDTO> getBillDetail(BillDetailRequest request) {
|
public ResponseResult<TradeRecordDTO> getBillDetail(BillDetailRequest request) {
|
||||||
return ResponseResult.success(walletService.getBillDetail(request));
|
return ResponseResult.success(walletService.getBillDetail(request));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.cool.store.controller.webc;
|
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.OpenBasicInfoDTO;
|
||||||
|
import com.cool.store.dto.wallet.TradeRecordDTO;
|
||||||
import com.cool.store.request.wallet.*;
|
import com.cool.store.request.wallet.*;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.wallet.WalletService;
|
import com.cool.store.service.wallet.WalletService;
|
||||||
@@ -77,7 +77,7 @@ public class MiniWalletController {
|
|||||||
|
|
||||||
@ApiOperation("交易流水详情")
|
@ApiOperation("交易流水详情")
|
||||||
@GetMapping("/billDetail")
|
@GetMapping("/billDetail")
|
||||||
public ResponseResult<BillDetailDTO> getBillDetail(BillDetailRequest request) {
|
public ResponseResult<TradeRecordDTO> getBillDetail(BillDetailRequest request) {
|
||||||
return ResponseResult.success(walletService.getBillDetail(request));
|
return ResponseResult.success(walletService.getBillDetail(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user