Commit 49e0ea3f by huluobin

update

parent 2bbf6387
......@@ -2,7 +2,6 @@ package com.bailuntec;
import com.alibaba.druid.pool.DruidDataSource;
import com.bailuntec.job.*;
import com.bailuntec.listener.SkuMSSyncJobListener;
import com.bailuntec.utils.PropertiesUtil;
import com.dangdang.ddframe.job.config.JobCoreConfiguration;
import com.dangdang.ddframe.job.config.simple.SimpleJobConfiguration;
......@@ -24,7 +23,10 @@ public class Application {
private static final String EVENT_RDB_STORAGE_URL = propertiesUtil.getPropertyAsString("EVENT_RDB_STORAGE_URL");
private static final String EVENT_RDB_STORAGE_USERNAME = propertiesUtil.getPropertyAsString("EVENT_RDB_STORAGE_USERNAME");
private static final String EVENT_RDB_STORAGE_PASSWORD = propertiesUtil.getPropertyAsString("EVENT_RDB_STORAGE_PASSWORD");
public static void main(String[] args) {
System.setProperty("java.util.concurrent.ForkJoinPool.common.parallelism", "20");
new JobScheduler(createRegistryCenter(), createJobConfiguration()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration3()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration1()).init();
......@@ -44,6 +46,7 @@ public class Application {
LiteJobConfiguration simpleJobRootConfig = LiteJobConfiguration.newBuilder(simpleJobConfig).build();
return simpleJobRootConfig;
}
private static LiteJobConfiguration createJobConfiguration1() {
JobCoreConfiguration simpleCoreConfig = JobCoreConfiguration.newBuilder(propertiesUtil.getPropertyAsString("JOB_SIMPLE_CATEGORY_NAME"), propertiesUtil.getPropertyAsString("JOB_SIMPLE_CATEGORY_CRON"), propertiesUtil.getPropertyAsInt("SHARDING_TOTAL_COUNT")).build();
SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(simpleCoreConfig, SkuSimpleCategoryJob.class.getCanonicalName());
......
......@@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.bailuntec.domain.constant.CommonConstant;
import com.bailuntec.domain.entity.DcBaseSkuMapping;
import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.domain.pojo.*;
import com.bailuntec.domain.pojo.SkuMappingResponse;
import com.bailuntec.mapper.DcBaseSkuMappingMapper;
import com.bailuntec.mapper.JobPointLogMapper;
import com.bailuntec.support.PointJob;
......@@ -60,16 +60,16 @@ public class SkuMappingSyncJob extends PointJob {
SkuMappingResponse skuMappingResponse = JSONObject.parseObject(resultStr, SkuMappingResponse.class);
JobPointLogMapper pointLogMapper = SessionUtil.getSession().getMapper(JobPointLogMapper.class);
pointLogMapper.upsertSelective(jobPointLog);
if (skuMappingResponse.getData()!= null && skuMappingResponse.getData().size() > 0) {
if (skuMappingResponse.getData() != null && skuMappingResponse.getData().size() > 0) {
List<DcBaseSkuMapping> skuMappingInfoList = skuMappingResponse.getData();
for(DcBaseSkuMapping dcBaseSkuMapping : skuMappingInfoList) {
skuMappingInfoList.parallelStream().forEach(dcBaseSkuMapping -> {
dcBaseSkuMapping.setGmtModified(LocalDateTime.now());
DcBaseSkuMappingMapper dcBaseSkuMappingMapper = SessionUtil.getSession().getMapper(DcBaseSkuMappingMapper.class);
dcBaseSkuMappingMapper.upsertSelective(dcBaseSkuMapping);
});
if (jobPointLog.getPageIndex().equals(0) && skuMappingResponse.getTotalPage() != null) {
jobPointLog.setPageIndex(skuMappingResponse.getTotalPage() + 1);
}
if (jobPointLog.getPageIndex().equals(0) && skuMappingResponse.getTotalPage() != null) {
jobPointLog.setPageIndex(skuMappingResponse.getTotalPage() + 1);
}
}
} else {
throw new RuntimeException("调用SKUMS系统接口返回null");
......
......@@ -623,14 +623,22 @@
</select>
<select id="getListByPageEbay" 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 company_id = 1 and account_name not like '%test%'
<if test="platformId != null">
and platform_id=#{platformId}
</if>
order by id) t1
LEFT JOIN job_account_log t2 on t1.account_id = t2.account_id order by t1.id
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 company_id = 1 and account_name not like '%test%'and platform_id= #{platformId} order by id) t1
LEFT JOIN job_account_log t2 on t1.account_id = t2.account_id
order by t1.id
</select>
<select id="getListByPageAmazon" 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