Commit 8b29e6e4 authored by 刘文强's avatar 刘文强

Merge branch 'dev-0611' into 'master'

feat: 上汽大众只推送小红书平台

See merge request !82
parents dca0fd55 b78dbca0
...@@ -5,6 +5,7 @@ import com.afanticar.afantiopenapi.model.dto.CommonPageInfoDTO; ...@@ -5,6 +5,7 @@ import com.afanticar.afantiopenapi.model.dto.CommonPageInfoDTO;
import com.afanticar.afantiopenapi.model.dto.DataReportRequestDTO; import com.afanticar.afantiopenapi.model.dto.DataReportRequestDTO;
import com.afanticar.afantiopenapi.model.dto.ReportDataInfoDTO; import com.afanticar.afantiopenapi.model.dto.ReportDataInfoDTO;
import com.afanticar.afantiopenapi.service.DataReportService; import com.afanticar.afantiopenapi.service.DataReportService;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -36,6 +37,7 @@ public class DataReportController extends BaseController { ...@@ -36,6 +37,7 @@ public class DataReportController extends BaseController {
@ApiOperation("获取报表数据") @ApiOperation("获取报表数据")
public BaseResponse<CommonPageInfoDTO<ReportDataInfoDTO>> report(HttpServletRequest request, @RequestBody @Valid DataReportRequestDTO requestBody) { public BaseResponse<CommonPageInfoDTO<ReportDataInfoDTO>> report(HttpServletRequest request, @RequestBody @Valid DataReportRequestDTO requestBody) {
String clientId = (String) request.getAttribute("clientId"); String clientId = (String) request.getAttribute("clientId");
log.info("请求数据报表入参,client_id:{}, 请求参数:{}", clientId, JSONObject.toJSONString(requestBody));
return BaseController.success(dataReportService.report(clientId, requestBody)); return BaseController.success(dataReportService.report(clientId, requestBody));
} }
} }
...@@ -30,6 +30,7 @@ import java.net.URISyntaxException; ...@@ -30,6 +30,7 @@ import java.net.URISyntaxException;
import java.net.URL; import java.net.URL;
import java.time.Instant; import java.time.Instant;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
...@@ -59,6 +60,17 @@ public class DataReportService { ...@@ -59,6 +60,17 @@ public class DataReportService {
@Value("${spring.rocket-mq.secretKey}") @Value("${spring.rocket-mq.secretKey}")
private String ossAccessSecret; private String ossAccessSecret;
/**
* 上汽大众-主体id
*/
@Value("${prinicipalId.sqdz:869753009302654976}")
private String principalIdSqdz;
/**
* 上汽大众-主体id
*/
@Value("${platform.sqdz:xiaohongshu}")
private String platformSqdz;
private OSS oss; private OSS oss;
@PostConstruct @PostConstruct
...@@ -78,6 +90,10 @@ public class DataReportService { ...@@ -78,6 +90,10 @@ public class DataReportService {
OpenApiClientPrincipalRelationEntity openApiClientPrincipalRelationEntity = openApiClientPrincipalEntityList.get(0); OpenApiClientPrincipalRelationEntity openApiClientPrincipalRelationEntity = openApiClientPrincipalEntityList.get(0);
String principalId = openApiClientPrincipalRelationEntity.getPrincipalId(); String principalId = openApiClientPrincipalRelationEntity.getPrincipalId();
requestBody.setPrincipalId(principalId); requestBody.setPrincipalId(principalId);
// 上汽大众只推送小红书平台
if (Objects.equals(principalIdSqdz, principalId)) {
requestBody.setPlatformList(Collections.singletonList(platformSqdz));
}
Page<DwsAfantiAdbDataOssRecordEntity> page = dwsAfantiAdbDataOssRecordMapper.page(new Page<>(requestBody.getPage(), requestBody.getSize()), requestBody); Page<DwsAfantiAdbDataOssRecordEntity> page = dwsAfantiAdbDataOssRecordMapper.page(new Page<>(requestBody.getPage(), requestBody.getSize()), requestBody);
return convertToCommonPageInfo(page); return convertToCommonPageInfo(page);
} }
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
<select id="page" resultType="com.afanticar.afantiopenapi.model.entity.DwsAfantiAdbDataOssRecordEntity"> <select id="page" resultType="com.afanticar.afantiopenapi.model.entity.DwsAfantiAdbDataOssRecordEntity">
select * from dws_afanti_adb_data_oss_record where select * from dws_afanti_adb_data_oss_record where
statistics_day between #{param.startTime} and #{param.endTime} statistics_day between #{param.startTime} and #{param.endTime}
and platform in <foreach collection="param.platformList" open="(" close=")" separator="," item="item"> and platform in
#{item} <foreach collection="param.platformList" open="(" close=")" separator="," item="item">
</foreach> #{item}
and data_type in <foreach collection="param.dataTypeList" open="(" close=")" separator="," item="item"> </foreach>
#{item} and data_type in
</foreach> <foreach collection="param.dataTypeList" open="(" close=")" separator="," item="item">
#{item}
</foreach>
and principal_id = #{param.principalId} and principal_id = #{param.principalId}
</select> </select>
......
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