Commit 4c7450fd authored by alex yao's avatar alex yao

fix: 【【POE】分享应用时数据统计更改】 --bug=1009877

parent 950f26ad
...@@ -39,8 +39,9 @@ public interface DataAnalyzeReportService { ...@@ -39,8 +39,9 @@ public interface DataAnalyzeReportService {
* *
* @param agentId 应用ID * @param agentId 应用ID
* @param channel 渠道 * @param channel 渠道
* @param userId 用户ID * @param userId 使用者
* @param deducted 积分扣减者
* @param pointDeductionNum 积分扣除数量-单位分 * @param pointDeductionNum 积分扣除数量-单位分
*/ */
boolean dataReport(String agentId, DataAnalyzeChannelEnum channel, Long userId, Long pointDeductionNum); boolean dataReport(String agentId, DataAnalyzeChannelEnum channel, Long userId, Long deducted, Long pointDeductionNum);
} }
...@@ -62,10 +62,10 @@ public class DataAnalyzeReportServiceImpl implements DataAnalyzeReportService { ...@@ -62,10 +62,10 @@ public class DataAnalyzeReportServiceImpl implements DataAnalyzeReportService {
} }
@Override @Override
public boolean dataReport(String agentId, DataAnalyzeChannelEnum channel, Long userId, Long pointDeductionNum) { public boolean dataReport(String agentId, DataAnalyzeChannelEnum channel, Long userId, Long deducted, Long pointDeductionNum) {
BigDecimal points = new BigDecimal(pointDeductionNum).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP); BigDecimal points = new BigDecimal(pointDeductionNum).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
this.dataReportByDialogue(userId, DataAnalyzeTypeEnum.AGENT, agentId, channel); this.dataReportByDialogue(userId, DataAnalyzeTypeEnum.AGENT, agentId, channel);
this.dataReportByPoint(userId, points, DataAnalyzeTypeEnum.AGENT, agentId, channel); this.dataReportByPoint(deducted, points, DataAnalyzeTypeEnum.AGENT, agentId, channel);
return true; return true;
} }
} }
...@@ -4,7 +4,8 @@ select * from (select ...@@ -4,7 +4,8 @@ select * from (select
count(bdapr.relation_id) as usage_count, count(bdapr.relation_id) as usage_count,
sum(bdapr.point_num) as total_points, sum(bdapr.point_num) as total_points,
max(bdapr.datetime) as last_usage_time, max(bdapr.datetime) as last_usage_time,
(case when bdapr.channel = 'preview' or bdapr.channel = 'multi_preview' then "N" else "Y" end) as publish_status (case when baai.agent_publish_status = "publish" then "Y" else "N" end) as publish_status
-- (case when bdapr.channel = 'preview' or bdapr.channel = 'multi_preview' then "N" else "Y" end) as publish_status
from from
biz_data_analyze_point_record bdapr biz_data_analyze_point_record bdapr
left join biz_agent_application_info baai on baai.agent_id = bdapr.relation_id left join biz_agent_application_info baai on baai.agent_id = bdapr.relation_id
......
...@@ -193,7 +193,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService { ...@@ -193,7 +193,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
if (StringUtils.isBlank(channel)) { if (StringUtils.isBlank(channel)) {
channel = DataAnalyzeChannelEnum.link_share.getChannel(); channel = DataAnalyzeChannelEnum.link_share.getChannel();
} }
dataAnalyzeReportService.dataReport(agentId, DataAnalyzeChannelEnum.valueOf(channel), deducted, pointDeductionNum); dataAnalyzeReportService.dataReport(agentId, DataAnalyzeChannelEnum.valueOf(channel), userBaseEntity.getUserId(), deducted, deducted.equals(userBaseEntity.getUserId()) ? pointDeductionNum : 0L);
} catch (Exception e) { } catch (Exception e) {
memberEquityService.rollbackPoint(reduceSn); memberEquityService.rollbackPoint(reduceSn);
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());
......
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