Commit 0ae5bbf4 by 宋祥

Merge branch 'mymaster' into 'master'

C1001319苏总演示前提的几点小优化

See merge request rays/pcloud-book!59
parents 818c4aed 33f1c7d2
......@@ -585,6 +585,16 @@ public class BookGroupBizImpl implements BookGroupBiz {
Map<Long, ProductDto> productDtoMap = productConsr.getProBasesByIds(productIds);
List<AppPriceCacheDTO> appPriceCacheDTOS = new ArrayList<>();
for (Long appId : appIds) {
if (appDtoMap.get(appId) != null) {
AppPriceCacheDTO appPriceCacheDTO = new AppPriceCacheDTO();
appPriceCacheDTO.setAppTypeEnum(AppTypeEnum.APP_TYPE_MAP.get(appDtoMap.get(appId).getTypeCode()));
appPriceCacheDTO.setAppId(appId);
appPriceCacheDTOS.add(appPriceCacheDTO);
}
}
Map<Long, BigDecimal> appPriceMap = ResponseHandleUtil.parseMapResponse(appPriceCacheService.getCaches(appPriceCacheDTOS), Long.class, BigDecimal.class);
//结算接口
Map<Long, BigDecimal> productIncomeMap = settlementConsr.getAdviserIncomeByCondition(productIds, "PRODUCT", partyId, qrcodeId, bookGroupId);
Map<Long, BigDecimal> appIncomeMap = settlementConsr.getAdviserIncomeByCondition(appIds, "APP", partyId, qrcodeId, bookGroupId);
......@@ -633,6 +643,14 @@ public class BookGroupBizImpl implements BookGroupBiz {
if (productTypeDto != null) {
appStatisticsDTO.setTypeName(productTypeDto.getTypeName());
}
List<SpecificationDto> specificationDtos = productDto.getSpecification();
if (!ListUtils.isEmpty(specificationDtos)) {
SpecificationDto specificationDto = specificationDtos.get(0);
if (specificationDto != null) {
appStatisticsDTO.setDealPrice(specificationDto.getDealPrice());
appStatisticsDTO.setRetailPrice(specificationDto.getAdvisePrice());
}
}
}
}
if ("APP".equalsIgnoreCase(type)) {
......@@ -653,6 +671,12 @@ public class BookGroupBizImpl implements BookGroupBiz {
appStatisticsDTO.setServeName(appDto.getTitle());
appStatisticsDTO.setImage(appDto.getSquareImg());
}
if (appPriceMap != null) {
if (appPriceMap.get(id) != null) {
appStatisticsDTO.setRetailPrice(appPriceMap.get(id).doubleValue());
appStatisticsDTO.setDealPrice(0D);
}
}
}
if (buyCount == null || buyCount == 0 || clickCount == null || clickCount == 0) {
appStatisticsDTO.setBuyRate(0D);
......
......@@ -48,6 +48,12 @@ public class AppStatisticsDTO implements Serializable {
@ApiModelProperty("收益总额")
private Double incomeAmount;
@ApiModelProperty("销售价")
private Double retailPrice;
@ApiModelProperty("协议价")
private Double dealPrice;
public Long getServeId() {
return serveId;
......@@ -137,6 +143,22 @@ public class AppStatisticsDTO implements Serializable {
this.incomeAmount = incomeAmount;
}
public Double getRetailPrice() {
return retailPrice;
}
public void setRetailPrice(Double retailPrice) {
this.retailPrice = retailPrice;
}
public Double getDealPrice() {
return dealPrice;
}
public void setDealPrice(Double dealPrice) {
this.dealPrice = dealPrice;
}
@Override
public String toString() {
return "AppStatisticsDTO{" +
......@@ -151,6 +173,8 @@ public class AppStatisticsDTO implements Serializable {
", buyRate=" + buyRate +
", saleAmount=" + saleAmount +
", incomeAmount=" + incomeAmount +
", retailPrice=" + retailPrice +
", dealPrice=" + dealPrice +
'}';
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment