Commit 880c0219 by wutong

限制有Ad授权的账户才去执行

parent e7e78f3f
...@@ -44,7 +44,7 @@ public class AmazonAdGenerateReportIdJob extends PointJob { ...@@ -44,7 +44,7 @@ public class AmazonAdGenerateReportIdJob extends PointJob {
try { try {
JobAccountLogMapper jobAccountLogMapper = SessionUtil.getSession().getMapper(JobAccountLogMapper.class); JobAccountLogMapper jobAccountLogMapper = SessionUtil.getSession().getMapper(JobAccountLogMapper.class);
int pageSize = totalPage % shardingContext.getShardingTotalCount() == 0 ? totalPage / shardingContext.getShardingTotalCount() : totalPage / shardingContext.getShardingTotalCount() + 1; int pageSize = totalPage % shardingContext.getShardingTotalCount() == 0 ? totalPage / shardingContext.getShardingTotalCount() : totalPage / shardingContext.getShardingTotalCount() + 1;
List<JobAccountLog> listByPage = jobAccountLogMapper.getListByPage(platformId, pageSize * shardingContext.getShardingItem(), pageSize); List<JobAccountLog> listByPage = jobAccountLogMapper.getListByPageAmazon(pageSize * shardingContext.getShardingItem(), pageSize);
if (listByPage != null && listByPage.size() > 0) { if (listByPage != null && listByPage.size() > 0) {
for (JobAccountLog jobAccountLog : listByPage) { for (JobAccountLog jobAccountLog : listByPage) {
if (jobAccountLog.getId() == null) { //Id为null在任务表无记录 if (jobAccountLog.getId() == null) { //Id为null在任务表无记录
...@@ -199,7 +199,7 @@ public class AmazonAdGenerateReportIdJob extends PointJob { ...@@ -199,7 +199,7 @@ public class AmazonAdGenerateReportIdJob extends PointJob {
int i = 0; int i = 0;
try { try {
DcBaseCompanyAccountMapper accountMapper = SessionUtil.getSession().getMapper(DcBaseCompanyAccountMapper.class); DcBaseCompanyAccountMapper accountMapper = SessionUtil.getSession().getMapper(DcBaseCompanyAccountMapper.class);
i = (int)accountMapper.countByExample(DcBaseCompanyAccountExample.newAndCreateCriteria().andPlatformIdEqualTo(platformId).example()); i = (int)accountMapper.countByExample(DcBaseCompanyAccountExample.newAndCreateCriteria().andPlatformIdEqualTo(platformId).andAmazonAdAuthJsonNotEqualTo("").example());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
......
...@@ -124,4 +124,6 @@ public interface JobAccountLogMapper { ...@@ -124,4 +124,6 @@ public interface JobAccountLogMapper {
List<JobAccountLog> getListByPage(@Param("platformId") Integer platformId, @Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize); List<JobAccountLog> getListByPage(@Param("platformId") Integer platformId, @Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize);
List<JobAccountLog> getListByPageAmazon(@Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize);
} }
\ No newline at end of file
...@@ -611,7 +611,12 @@ ...@@ -611,7 +611,12 @@
<select id="getListByPage" resultType="com.bailuntec.domain.entity.JobAccountLog"> <select id="getListByPage" resultType="com.bailuntec.domain.entity.JobAccountLog">
SELECT t2.id,t1.company_id, t1.account_id, t2.job_name,t2.page_index,t2.page_size,t2.type,t2.interval_time,t2.start_time,t2.end_time, t2.task_ids FROM SELECT t2.id,t1.company_id, t1.account_id, t2.job_name,t2.page_index,t2.page_size,t2.type,t2.interval_time,t2.start_time,t2.end_time, t2.task_ids FROM
(SELECT * FROM dc_base_company_account WHERE 1=1 <if test="platformId != null">and platform_id=#{platformId} </if>) t1 LEFT JOIN job_account_log t2 on t1.account_id = t2.account_id order by id limit #{pageIndex},#{pageSize} (SELECT * FROM dc_base_company_account WHERE 1=1 <if test="platformId != null">and platform_id=#{platformId} </if>) t1 LEFT JOIN job_account_log t2 on t1.account_id = t2.account_id order by id limit #{pageIndex},#{pageSize}
</select>
<select id="getListByPageAmazon" resultType="com.bailuntec.domain.entity.JobAccountLog">
SELECT t2.id,t1.company_id, t1.account_id, t2.job_name,t2.page_index,t2.page_size,t2.type,t2.interval_time,t2.start_time,t2.end_time, t2.task_ids FROM
(SELECT * FROM dc_base_company_account WHERE 1=1 and amazon_ad_auth_json != '' <if test="platformId != null">and platform_id=#{platformId} </if>) t1 LEFT JOIN job_account_log t2 on t1.account_id = t2.account_id order by id limit #{pageIndex},#{pageSize}
</select> </select>
<!-- <select id="getListByPage" resultType="com.bailuntec.domain.entity.JobAccountLog"> <!-- <select id="getListByPage" resultType="com.bailuntec.domain.entity.JobAccountLog">
......
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