Commit 9a12d2af by daixing

fix 收益不准确

parent 3f929a1c
......@@ -8,6 +8,8 @@ import java.util.Map;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.settlementcenter.record.dto.GetGroupClassifyIncomeDTO;
import com.pcloud.settlementcenter.record.dto.GetGroupQrcodeIncomeDTO;
import com.pcloud.settlementcenter.record.dto.GroupRescourceIncomeParamDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -133,10 +135,10 @@ public class BookConsr {
}
@ParamLog(value = "批量获取社群码分类的收益", isBefore = false, isAfterReturn = false)
public Map<Long,BigDecimal> getClassifyIncome(List<Long> classifyIds) throws BizException {
public Map<Long,BigDecimal> getClassifyIncome(GetGroupClassifyIncomeDTO getGroupClassifyIncomeDTO) throws BizException {
Map<Long,BigDecimal> classifyIncome = new HashMap<>();
try {
ResponseEntity<ResponseDto<Map<Long,BigDecimal>>> responseEntityP = bookService.getGroupClassifyIncome(classifyIds);
ResponseEntity<ResponseDto<Map<Long,BigDecimal>>> responseEntityP = bookService.getGroupClassifyIncome(getGroupClassifyIncomeDTO);
classifyIncome = ResponseHandleUtil.parseMap(responseEntityP, Long.class, BigDecimal.class);
} catch (Exception e) {
LOGGER.error("批量获取社群码分类的收益.[getClassifyIncome]:" + e.getMessage(), e);
......@@ -145,10 +147,10 @@ public class BookConsr {
}
@ParamLog(value = "批量获取社群码分类下的微信群收益", isBefore = false, isAfterReturn = false)
public Map<Long,BigDecimal> getQrcodeIncome(List<Long> qrcodeIds) throws BizException {
public Map<Long,BigDecimal> getQrcodeIncome(GetGroupQrcodeIncomeDTO getGroupQrcodeIncomeDTO) throws BizException {
Map<Long,BigDecimal> qrcodeIncome = new HashMap<>();
try {
ResponseEntity<ResponseDto<Map<Long,BigDecimal>>> responseEntityP = bookService.getGroupQrcodeIncome(qrcodeIds);
ResponseEntity<ResponseDto<Map<Long,BigDecimal>>> responseEntityP = bookService.getGroupQrcodeIncome(getGroupQrcodeIncomeDTO);
qrcodeIncome = ResponseHandleUtil.parseMap(responseEntityP, Long.class, BigDecimal.class);
} catch (Exception e) {
LOGGER.error("批量获取社群码分类下的微信群收益.[getQrcodeIncome]:" + e.getMessage(), e);
......
......@@ -65,6 +65,8 @@ import com.pcloud.resourcecenter.product.dto.SpecificationDto;
import com.pcloud.resourcecenter.product.dto.UpdateAppProductParamDTO;
import com.pcloud.resourcecenter.product.entity.Product;
import com.pcloud.resourcecenter.product.service.ProductService;
import com.pcloud.settlementcenter.record.dto.GetGroupClassifyIncomeDTO;
import com.pcloud.settlementcenter.record.dto.GetGroupQrcodeIncomeDTO;
import com.pcloud.settlementcenter.record.dto.GroupRescourceIncomeParamDTO;
import com.pcloud.settlementcenter.record.dto.ProductStaticUnderAppMapDTO;
import com.pcloud.settlementcenter.record.service.SettlementService;
......@@ -1121,11 +1123,11 @@ public class BookGroupBizImpl implements BookGroupBiz {
return pageBeanNew;
}
//填充数据
setInfo(recordList,bookGroupId,classifyId,wxGroupId,type);
setInfo(recordList,bookGroupId,classifyId,wxGroupId,type,adviserId);
return pageBeanNew;
}
void setInfo(List<ResourcesStatisticVO> recordList,Long bookGroupId,Long classifyId, Long qrcodeId, String type){
void setInfo(List<ResourcesStatisticVO> recordList,Long bookGroupId,Long classifyId, Long qrcodeId, String type,Long partyId){
List<Long> rescourceIds = recordList.stream().map(ResourcesStatisticVO::getRescourceId).collect(Collectors.toList());
// map.put("rescourceIds",rescourceIds);
GroupRescourceIncomeParamDTO groupRescourceIncomeParamDTO = new GroupRescourceIncomeParamDTO();
......@@ -1134,6 +1136,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
groupRescourceIncomeParamDTO.setQrcodeId(qrcodeId);
groupRescourceIncomeParamDTO.setType(type);
groupRescourceIncomeParamDTO.setRescourceIds(rescourceIds);
groupRescourceIncomeParamDTO.setRoleId(5L);
groupRescourceIncomeParamDTO.setPartyId(partyId);
Map<Long, BigDecimal> rescourceIncome = bookConsr.getRescourceIncome(groupRescourceIncomeParamDTO);
GroupIncomeSearchDto groupIncomeSearchDto = new GroupIncomeSearchDto();
groupIncomeSearchDto.setBookGroupId(bookGroupId);
......@@ -1238,7 +1242,11 @@ public class BookGroupBizImpl implements BookGroupBiz {
return new ArrayList<>();
}
List<Long> classifyIds = listClassifyVOS.stream().map(ListClassifyVO::getId).collect(Collectors.toList());
Map<Long, BigDecimal> classifyIncome = bookConsr.getClassifyIncome(classifyIds);
GetGroupClassifyIncomeDTO getGroupClassifyIncomeDTO = new GetGroupClassifyIncomeDTO();
getGroupClassifyIncomeDTO.setClassifyIds(classifyIds);
getGroupClassifyIncomeDTO.setPartyId(adviserId);
getGroupClassifyIncomeDTO.setRoleId(5L);
Map<Long, BigDecimal> classifyIncome = bookConsr.getClassifyIncome(getGroupClassifyIncomeDTO);
List<GroupStatisticVO> groupStatisticVOS = new ArrayList<>();
Map<Long, Long> mapMemberCount = wechatGroupConsr.getclassifyMemberCount(classifyIds);
listClassifyVOS.forEach(e ->{
......@@ -1275,7 +1283,11 @@ public class BookGroupBizImpl implements BookGroupBiz {
}
List<Long> qrcodeIds = qrcodeByClassify.stream().map(ClassifyQrcodeVO::getId).collect(Collectors.toList());
List<String> wxGroupIds = qrcodeByClassify.stream().map(ClassifyQrcodeVO::getWeixinGroupId).collect(Collectors.toList());
Map<Long, BigDecimal> qrcodeIncome = bookConsr.getQrcodeIncome(qrcodeIds);
GetGroupQrcodeIncomeDTO getGroupQrcodeIncomeDTO = new GetGroupQrcodeIncomeDTO();
getGroupQrcodeIncomeDTO.setRoleId(5L);
getGroupQrcodeIncomeDTO.setQrcodeIds(qrcodeIds);
getGroupQrcodeIncomeDTO.setPartyId(adviserId);
Map<Long, BigDecimal> qrcodeIncome = bookConsr.getQrcodeIncome(getGroupQrcodeIncomeDTO);
Map<String, GroupMemberStatisDTO> groupMemberStatisDTOMap = wechatGroupConsr.listGroupMemberStatisInfo(wxGroupIds);
List<WxGroupStatisticVO> wxGroupStatisticVOS = new ArrayList<>();
qrcodeByClassify.forEach(e ->{
......@@ -1312,6 +1324,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
groupRescourceIncomeParamDTO.setQrcodeId(qrcodeId);
groupRescourceIncomeParamDTO.setType(type);
groupRescourceIncomeParamDTO.setRescourceIds(rescourceIds);
groupRescourceIncomeParamDTO.setPartyId(adviserId);
groupRescourceIncomeParamDTO.setRoleId(5L);
BigDecimal rescourceTotalIncome = bookConsr.getRescourceTotalIncome(groupRescourceIncomeParamDTO);
totalRescourceDataVO.setTotalIncome(rescourceTotalIncome == null?BigDecimal.ZERO:rescourceTotalIncome);
BigDecimal totalSale = tradeConsr.getTotalSale(bookGroupId, classifyId, qrcodeId, type);
......@@ -1326,11 +1340,13 @@ public class BookGroupBizImpl implements BookGroupBiz {
List<ResourcesStatisticVO> appClickStatistics = appClickRecordDao.getClickStatistics(bookGroupId, null, null, "APP");
List<ResourcesStatisticVO> productClickStatistics = appClickRecordDao.getClickStatistics(bookGroupId, null, null, "PRODUCT");
if (!ListUtils.isEmpty(appClickStatistics)){
setInfo(appClickStatistics, bookGroupId, null, null, "APP");
setInfo(appClickStatistics, bookGroupId, null, null, "APP", adviserId);
//获取挂在应用下的商品信息
ProductStaticUnderAppMapDTO productStaticUnderAppMapDTO = new ProductStaticUnderAppMapDTO();
productStaticUnderAppMapDTO.setBookGroupId(bookGroupId);
productStaticUnderAppMapDTO.setAppIds(appClickStatistics.stream().map(ResourcesStatisticVO::getRescourceId).collect(Collectors.toList()));
productStaticUnderAppMapDTO.setPartyId(adviserId);
productStaticUnderAppMapDTO.setRoleId(5L);
Map<Long, List<com.pcloud.settlementcenter.record.dto.ResourcesStatisticVO>> productStaticUnderApp = settlementConsr.getProductStaticUnderApp(productStaticUnderAppMapDTO);
Map<Long, List<StatisticsIncomeDto>> productStaticUnderAppMap = copy(productStaticUnderApp,bookGroupId);
appClickStatistics.forEach(e ->{
......@@ -1348,7 +1364,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
}
if (!ListUtils.isEmpty(productClickStatistics)){
setInfo(productClickStatistics, bookGroupId, null, null, "PRODUCT");
setInfo(productClickStatistics, bookGroupId, null, null, "PRODUCT", adviserId);
productClickStatistics.forEach(e ->{
StatisticsIncomeDto statisticsIncomeDto = new StatisticsIncomeDto();
statisticsIncomeDto.setProductId(e.getRescourceId());
......
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