Commit cef3bdb0 by yinyong

ebay-sku数据拆分比例

parent 829e8310
......@@ -70,5 +70,7 @@ public class DcBaseEbaySkuMappingDto {
private BigDecimal unitPrice;
private Integer skuCount;
}
\ No newline at end of file
package com.bailuntec.domain.entity;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class DcBaseEbaySkuRatio {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_ebay_sku_ratio.id
*
* @mbg.generated
*/
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_ebay_sku_ratio.item_id
*
* @mbg.generated
*/
private String itemId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_ebay_sku_ratio.sku_code
*
* @mbg.generated
*/
private String skuCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_ebay_sku_ratio.sku_count
*
* @mbg.generated
*/
private Integer skuCount;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_ebay_sku_ratio.sku_ratio
*
* @mbg.generated
*/
private BigDecimal skuRatio;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_ebay_sku_ratio.sku_price
*
* @mbg.generated
*/
private BigDecimal skuPrice;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", itemId=").append(itemId);
sb.append(", skuCode=").append(skuCode);
sb.append(", skuCount=").append(skuCount);
sb.append(", skuRatio=").append(skuRatio);
sb.append(", skuPrice=").append(skuPrice);
sb.append("]");
return sb.toString();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
*/
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
DcBaseEbaySkuRatio other = (DcBaseEbaySkuRatio) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId()))
&& (this.getSkuCode() == null ? other.getSkuCode() == null : this.getSkuCode().equals(other.getSkuCode()))
&& (this.getSkuCount() == null ? other.getSkuCount() == null : this.getSkuCount().equals(other.getSkuCount()))
&& (this.getSkuRatio() == null ? other.getSkuRatio() == null : this.getSkuRatio().equals(other.getSkuRatio()))
&& (this.getSkuPrice() == null ? other.getSkuPrice() == null : this.getSkuPrice().equals(other.getSkuPrice()));
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode());
result = prime * result + ((getSkuCode() == null) ? 0 : getSkuCode().hashCode());
result = prime * result + ((getSkuCount() == null) ? 0 : getSkuCount().hashCode());
result = prime * result + ((getSkuRatio() == null) ? 0 : getSkuRatio().hashCode());
result = prime * result + ((getSkuPrice() == null) ? 0 : getSkuPrice().hashCode());
return result;
}
}
\ No newline at end of file
package com.bailuntec.mapper;
import com.bailuntec.domain.entity.DcBaseEbaySkuRatio;
import com.bailuntec.domain.example.DcBaseEbaySkuRatioExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface DcBaseEbaySkuRatioMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
*/
long countByExample(DcBaseEbaySkuRatioExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
*/
int deleteByExample(DcBaseEbaySkuRatioExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
*/
int insert(DcBaseEbaySkuRatio record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
*/
int insertSelective(DcBaseEbaySkuRatio record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DcBaseEbaySkuRatio selectOneByExample(DcBaseEbaySkuRatioExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
*/
List<DcBaseEbaySkuRatio> selectByExample(DcBaseEbaySkuRatioExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
*/
DcBaseEbaySkuRatio selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") DcBaseEbaySkuRatio record, @Param("example") DcBaseEbaySkuRatioExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
*/
int updateByExample(@Param("record") DcBaseEbaySkuRatio record, @Param("example") DcBaseEbaySkuRatioExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(DcBaseEbaySkuRatio record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
*/
int updateByPrimaryKey(DcBaseEbaySkuRatio record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsert(DcBaseEbaySkuRatio record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_ratio
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsertSelective(DcBaseEbaySkuRatio record);
}
\ No newline at end of file
......@@ -1025,7 +1025,7 @@
</resultMap>
<select id="selectSkuMapping" resultType="com.bailuntec.domain.dto.DcBaseEbaySkuMappingDto">
select dc0.*, dc1.unit_price from dc_base_ebay_sku_mapping dc0 left join dc_base_sku dc1 on dc0.sku_code = dc1.bailun_sku where dc0.item_id = #{itemId}
select dc0.*, dc1.unit_price, count(1) as skuCount from dc_base_ebay_sku_mapping dc0 left join dc_base_sku dc1 on dc0.sku_code = dc1.bailun_sku where dc0.item_id = #{itemId} group by dc0.sku_code
</select>
<resultMap id="BaseResultMap2" type="com.bailuntec.domain.dto.DcBaseFinanceEbayItemDto">
......@@ -1071,7 +1071,7 @@
where bj_date &gt;= #{startTime} and bj_date &lt; #{endTime} group by item_id) b
</select>
<select id="selectEbay" resultMap="BaseResultMap2">
<select id="selectEbay" resultMap="BaseResultMap1">
select * from dc_base_finance_ebay
where bj_date &gt;= #{startTime} and bj_date &lt; #{endTime}
group by item_id
......
......@@ -3,6 +3,7 @@ package com.bailuntec;
import com.alibaba.druid.pool.DruidDataSource;
import com.bailuntec.job.CalculateAmazonItemJob;
import com.bailuntec.job.CalculateEbayItemJob;
import com.bailuntec.job.CalculateEbaySkuRatioJob;
import com.bailuntec.job.EbayItemSyncJob;
import com.bailuntec.utils.PropertiesUtil;
import com.dangdang.ddframe.job.config.JobCoreConfiguration;
......@@ -29,6 +30,7 @@ public class Application {
new JobScheduler(createRegistryCenter(), createJobConfiguration()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration1()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration2()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration3()).init();
}
private static CoordinatorRegistryCenter createRegistryCenter() {
......@@ -58,6 +60,13 @@ public class Application {
return simpleJobRootConfig;
}
private static LiteJobConfiguration createJobConfiguration3() {
JobCoreConfiguration simpleCoreConfig = JobCoreConfiguration.newBuilder(propertiesUtil.getPropertyAsString("JOB_EBAY_RATIO_NAME"), propertiesUtil.getPropertyAsString("JOB_EBAY_RATIO_CRON"), propertiesUtil.getPropertyAsInt("SHARDING_TOTAL_COUNT")).build();
SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(simpleCoreConfig, CalculateEbaySkuRatioJob.class.getCanonicalName());
LiteJobConfiguration simpleJobRootConfig = LiteJobConfiguration.newBuilder(simpleJobConfig).build();
return simpleJobRootConfig;
}
private static JobEventConfiguration createJobEventConfiguration() {
JobEventConfiguration jobEventRdbConfig = new JobEventRdbConfiguration(setUpEventTraceDataSource());
return jobEventRdbConfig;
......
......@@ -15,4 +15,6 @@ JOB_AMAZON_NAME=mid-calculate-amazon-item
JOB_AMAZON_CRON=0 0 7 * * ? *
JOB_EBAY_SKU_NAME=base-ebay-sku-sync
JOB_EBAY_SKU_CRON=0 0 12 * * ? *
JOB_EBAY_RATIO_NAME=base-ebay-sku-ratio
JOB_EBAY_RATIO_CRON=0/1 * * * * ? *
SHARDING_TOTAL_COUNT=1
\ No newline at end of file
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