Commit bbc6f50e by yinyong

自动周转--复制最近一个月oms订单数据

parent 14ef06f4
......@@ -26,6 +26,7 @@ public class Application {
private static final String EVENT_RDB_STORAGE_PASSWORD = propertiesUtil.getPropertyAsString("EVENT_RDB_STORAGE_PASSWORD");
public static void main(String[] args) {
new JobScheduler(createRegistryCenter(), createJobConfiguration(),createJobEventConfiguration(), new OrderSyncJobListener()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration1(),createJobEventConfiguration(), new OrderSyncJobListener()).init();
}
private static CoordinatorRegistryCenter createRegistryCenter() {
......@@ -41,6 +42,13 @@ public class Application {
return simpleJobRootConfig;
}
private static LiteJobConfiguration createJobConfiguration1() {
JobCoreConfiguration simpleCoreConfig = JobCoreConfiguration.newBuilder(propertiesUtil.getPropertyAsString("JOB_NAME30"), propertiesUtil.getPropertyAsString("JOB_CRON30"), propertiesUtil.getPropertyAsInt("SHARDING_TOTAL_COUNT")).build();
SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(simpleCoreConfig, OrderSyncJob.class.getCanonicalName());
LiteJobConfiguration simpleJobRootConfig = LiteJobConfiguration.newBuilder(simpleJobConfig).build();
return simpleJobRootConfig;
}
private static JobEventConfiguration createJobEventConfiguration() {
JobEventConfiguration jobEventRdbConfig = new JobEventRdbConfiguration(setUpEventTraceDataSource());
return jobEventRdbConfig;
......
......@@ -43,9 +43,11 @@ public class OrderSyncJob extends PointJob {
//临时处理速卖通数据
map.put("pageCount", jobPointLog.getPageSize().toString());
//时间回退一点, 避免服务器时间不一致而漏单
map.put("TimeFrom", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getStartTime().minusMinutes(3)));
/*map.put("TimeFrom", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getStartTime().minusMinutes(3)));
map.put("TimeTo", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getEndTime()));
map.put("DateType", "purchaseTime");
map.put("DateType", "purchaseTime");*/
map.put("BailunLastUpdateTimeFrom", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getStartTime().minusMinutes(3)));
map.put("BailunLastUpdateTimeTo", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getEndTime()));
do {
map.put("pageIndex", jobPointLog.getPageIndex().equals(0) ? "1" : jobPointLog.getPageIndex().toString());
Response response = null;
......
package com.bailuntec.job;
import com.alibaba.fastjson.JSON;
import com.bailuntec.domain.constant.CommonConstant;
import com.bailuntec.domain.constant.Constant;
import com.bailuntec.domain.entity.*;
import com.bailuntec.domain.enumerate.OrderExceptionStatus;
import com.bailuntec.domain.enumerate.OrderExceptionType;
import com.bailuntec.domain.enumerate.PlatformType;
import com.bailuntec.domain.example.*;
import com.bailuntec.domain.pojo.*;
import com.bailuntec.mapper.*;
import com.bailuntec.support.CallBailunSystem;
import com.bailuntec.support.PointJob;
import com.bailuntec.utils.ExceptionUtil;
import com.bailuntec.utils.OkHttpUtil;
import com.bailuntec.utils.PropertiesUtil;
import com.bailuntec.utils.SessionUtil;
import com.dangdang.ddframe.job.api.ShardingContext;
import lombok.extern.slf4j.Slf4j;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@Slf4j
public class OrderSyncJob30 extends PointJob {
private OkHttpClient okHttpClient = OkHttpUtil.getInstance();
private PropertiesUtil propertiesUtil = PropertiesUtil.getInstance("const");
@Override
public void executeJob(ShardingContext shardingContext, JobPointLog jobPointLog) {
String queryTime = DateTimeFormatter.ofPattern(CommonConstant.DATE_FORMAT).format(LocalDate.now());
DcBaseOmsSku30Mapper dcBaseOmsSku30Mapper = SessionUtil.getSession().getMapper(DcBaseOmsSku30Mapper.class);
dcBaseOmsSku30Mapper.upsertByOmsSku(queryTime);
}
}
......@@ -12,4 +12,7 @@ NAME_SPACE=data-center
JOB_NAME=base-sync-oms-order-coroutine
#JOB_NAME=base-sync-oms-order
JOB_CRON=0/1 * * * * ? *
JOB_NAME30=base-sync-oms-sku30
#JOB_NAME=base-sync-oms-order
JOB_CRON30=0 0 22,23,00 * * ? *
SHARDING_TOTAL_COUNT=1
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
package com.bailuntec.mapper;
import com.bailuntec.domain.entity.DcBaseOmsSku30;
import com.bailuntec.domain.example.DcBaseOmsSku30Example;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface DcBaseOmsSku30Mapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_sku_30
*
* @mbg.generated
*/
long countByExample(DcBaseOmsSku30Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_sku_30
*
* @mbg.generated
*/
int deleteByExample(DcBaseOmsSku30Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_sku_30
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_sku_30
*
* @mbg.generated
*/
int insert(DcBaseOmsSku30 record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_sku_30
*
* @mbg.generated
*/
int insertSelective(DcBaseOmsSku30 record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_sku_30
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DcBaseOmsSku30 selectOneByExample(DcBaseOmsSku30Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_sku_30
*
* @mbg.generated
*/
List<DcBaseOmsSku30> selectByExample(DcBaseOmsSku30Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_sku_30
*
* @mbg.generated
*/
DcBaseOmsSku30 selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_sku_30
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") DcBaseOmsSku30 record, @Param("example") DcBaseOmsSku30Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_sku_30
*
* @mbg.generated
*/
int updateByExample(@Param("record") DcBaseOmsSku30 record, @Param("example") DcBaseOmsSku30Example example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_sku_30
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(DcBaseOmsSku30 record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_sku_30
*
* @mbg.generated
*/
int updateByPrimaryKey(DcBaseOmsSku30 record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_sku_30
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsert(DcBaseOmsSku30 record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_sku_30
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsertSelective(DcBaseOmsSku30 record);
int upsertByOmsSku(@Param("queryTime")String queryTime);
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
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