Commit 9c4b48f8 by huluobin

ebay的平台费直接改为读取oms的

parent d6e81269
...@@ -84,8 +84,8 @@ public class EbayFinanceAdSyncJobTest { ...@@ -84,8 +84,8 @@ public class EbayFinanceAdSyncJobTest {
public void testThreadPool() { public void testThreadPool() {
EbayFinanceAdSyncJob ebayFinanceAdSyncJob = new EbayFinanceAdSyncJob(); EbayFinanceAdSyncJob ebayFinanceAdSyncJob = new EbayFinanceAdSyncJob();
LocalDateTime start = LocalDateTime.of(2020, 11, 18, 0, 0); LocalDateTime start = LocalDateTime.of(2020, 12, 1, 0, 0);
LocalDateTime end = LocalDateTime.of(2020, 12, 2, 0, 0); LocalDateTime end = LocalDateTime.of(2020, 12, 12, 0, 0);
List<LocalDateTime> localDateTimeList = Stream.iterate(start, List<LocalDateTime> localDateTimeList = Stream.iterate(start,
localDateTime -> localDateTime.plusDays(1)) localDateTime -> localDateTime.plusDays(1))
......
...@@ -254,10 +254,13 @@ public class OrderSyncJob extends PointJob { ...@@ -254,10 +254,13 @@ public class OrderSyncJob extends PointJob {
checkFbaFee(dcBaseOmsSku, dcBaseOmsOrder); checkFbaFee(dcBaseOmsSku, dcBaseOmsOrder);
} }
if ((dcBaseOmsOrder.getCostPlatformFee().compareTo(BigDecimal.ZERO) == 0) && (initTotalCost.compareTo(BigDecimal.valueOf(0)) == 1) && (amountSales.compareTo(BigDecimal.ZERO) == 1)) { //ebay的平台费直接改为读取oms的
DcBaseOmsSkuMapper dcBaseOmsSkuMapper = SessionUtil.getSession().getMapper(DcBaseOmsSkuMapper.class); if ((dcBaseOmsOrder.getCostPlatformFee().compareTo(BigDecimal.ZERO) == 0) &&
BigDecimal costPlatformFee = dcBaseOmsSkuMapper.selectCostPlatformFee(dcBaseOmsSku.getBailunSku(), dcBaseOmsSku.getPlatformType(), dcBaseOmsSku.getWebsite()); (initTotalCost.compareTo(BigDecimal.valueOf(0)) == 1) &&
totalCostPlatformFee = totalCostPlatformFee.add(costPlatformFee == null ? BigDecimal.ZERO : costPlatformFee); (amountSales.compareTo(BigDecimal.ZERO) == 1)) {
// DcBaseOmsSkuMapper dcBaseOmsSkuMapper = SessionUtil.getSession().getMapper(DcBaseOmsSkuMapper.class);
// BigDecimal costPlatformFee = dcBaseOmsSkuMapper.selectCostPlatformFee(dcBaseOmsSku.getBailunSku(), dcBaseOmsSku.getPlatformType(), dcBaseOmsSku.getWebsite(),dcBaseOmsSku.getOriginOrderId());
// totalCostPlatformFee = totalCostPlatformFee.add(costPlatformFee == null ? BigDecimal.ZERO : costPlatformFee);
hasCostPlatformFee = false; hasCostPlatformFee = false;
} }
......
...@@ -256,7 +256,7 @@ public class OrderSyncTask extends PointJob { ...@@ -256,7 +256,7 @@ public class OrderSyncTask extends PointJob {
if ((dcBaseOmsOrder.getCostPlatformFee().compareTo(BigDecimal.ZERO) == 0) && (initTotalCost.compareTo(BigDecimal.valueOf(0)) == 1) && (amountSales.compareTo(BigDecimal.ZERO) == 1)) { if ((dcBaseOmsOrder.getCostPlatformFee().compareTo(BigDecimal.ZERO) == 0) && (initTotalCost.compareTo(BigDecimal.valueOf(0)) == 1) && (amountSales.compareTo(BigDecimal.ZERO) == 1)) {
DcBaseOmsSkuMapper dcBaseOmsSkuMapper = SessionUtil.getSession().getMapper(DcBaseOmsSkuMapper.class); DcBaseOmsSkuMapper dcBaseOmsSkuMapper = SessionUtil.getSession().getMapper(DcBaseOmsSkuMapper.class);
BigDecimal costPlatformFee = dcBaseOmsSkuMapper.selectCostPlatformFee(dcBaseOmsSku.getBailunSku(), dcBaseOmsSku.getPlatformType(), dcBaseOmsSku.getWebsite()); BigDecimal costPlatformFee = dcBaseOmsSkuMapper.selectCostPlatformFee(dcBaseOmsSku.getBailunSku(), dcBaseOmsSku.getPlatformType(), dcBaseOmsSku.getWebsite(),dcBaseOmsSku.getOriginOrderId());
totalCostPlatformFee = totalCostPlatformFee.add(costPlatformFee == null ? BigDecimal.ZERO : costPlatformFee); totalCostPlatformFee = totalCostPlatformFee.add(costPlatformFee == null ? BigDecimal.ZERO : costPlatformFee);
hasCostPlatformFee = false; hasCostPlatformFee = false;
} }
......
...@@ -26,7 +26,7 @@ public class OmsOrderTest { ...@@ -26,7 +26,7 @@ public class OmsOrderTest {
// map.put("BailunLastUpdateTimeFrom", "2019-04-11 11:45:33"); // map.put("BailunLastUpdateTimeFrom", "2019-04-11 11:45:33");
// map.put("BailunLastUpdateTimeTo", "2019-04-11 16:17:03"); // map.put("BailunLastUpdateTimeTo", "2019-04-11 16:17:03");
//OriginOrderNo=112-7750508-3145827 //OriginOrderNo=112-7750508-3145827
map.put("OriginOrderNo", "353296395593-1198797722022"); map.put("OriginOrderNo", "353300877748-1202307414022");
//353295108454-1198385057022 //353295108454-1198385057022
// map.put("OriginOrderNo", "353295108454-1198385057022"); // map.put("OriginOrderNo", "353295108454-1198385057022");
Request request = new Request.Builder() Request request = new Request.Builder()
......
...@@ -132,7 +132,11 @@ public interface DcBaseOmsSkuMapper { ...@@ -132,7 +132,11 @@ public interface DcBaseOmsSkuMapper {
BigDecimal selectFBAFee(@Param("bailunSku") String bailunSku, @Param("webSite") String webSite, @Param("paidTime") LocalDateTime paidTime); BigDecimal selectFBAFee(@Param("bailunSku") String bailunSku, @Param("webSite") String webSite, @Param("paidTime") LocalDateTime paidTime);
BigDecimal selectCostPlatformFee(@Param("bailunSku") String bailunSku, @Param("platformType") String platformType, @Param("webSite") String webSite); @Deprecated
BigDecimal selectCostPlatformFee(@Param("bailunSku") String bailunSku,
@Param("platformType") String platformType,
@Param("webSite") String webSite,
@Param("originOrderId") String originOrderId);
DcBaseOmsSku selectOneByCreateTime(@Param("bailunSku") String bailunSku); DcBaseOmsSku selectOneByCreateTime(@Param("bailunSku") String bailunSku);
......
...@@ -3714,6 +3714,7 @@ ...@@ -3714,6 +3714,7 @@
AND bailun_sku = #{bailunSku} AND bailun_sku = #{bailunSku}
AND website = #{webSite} AND website = #{webSite}
AND cost_platform_fee &gt; 0 AND cost_platform_fee &gt; 0
and origin_order_id !=#{originOrderId}
order by order_update_time desc order by order_update_time desc
limit 1 limit 1
</select> </select>
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<configuration> <configuration>
<!--<properties resource="db-tj.properties"/>--> <!--<properties resource="db-tj.properties"/>-->
<properties resource="db-dev.properties"/> <!-- <properties resource="db-dev.properties"/>-->
<!-- <properties resource="db-prod.properties"/>--> <properties resource="db-prod.properties"/>
<settings> <settings>
<setting name="mapUnderscoreToCamelCase" value="true"/> <setting name="mapUnderscoreToCamelCase" value="true"/>
</settings> </settings>
......
...@@ -7,16 +7,11 @@ import com.bailuntec.job.ReplaceLogisticJob; ...@@ -7,16 +7,11 @@ import com.bailuntec.job.ReplaceLogisticJob;
import com.bailuntec.utils.PropertiesUtil; import com.bailuntec.utils.PropertiesUtil;
import com.dangdang.ddframe.job.config.JobCoreConfiguration; import com.dangdang.ddframe.job.config.JobCoreConfiguration;
import com.dangdang.ddframe.job.config.simple.SimpleJobConfiguration; import com.dangdang.ddframe.job.config.simple.SimpleJobConfiguration;
import com.dangdang.ddframe.job.event.JobEventConfiguration;
import com.dangdang.ddframe.job.event.rdb.JobEventRdbConfiguration;
import com.dangdang.ddframe.job.lite.api.JobScheduler; import com.dangdang.ddframe.job.lite.api.JobScheduler;
import com.dangdang.ddframe.job.lite.config.LiteJobConfiguration; import com.dangdang.ddframe.job.lite.config.LiteJobConfiguration;
import com.dangdang.ddframe.job.lite.lifecycle.api.JobAPIFactory;
import com.dangdang.ddframe.job.lite.lifecycle.api.JobOperateAPI;
import com.dangdang.ddframe.job.reg.base.CoordinatorRegistryCenter; import com.dangdang.ddframe.job.reg.base.CoordinatorRegistryCenter;
import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperConfiguration; import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperConfiguration;
import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter; import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter;
import com.google.common.base.Optional;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
...@@ -36,24 +31,19 @@ public class Application { ...@@ -36,24 +31,19 @@ public class Application {
log.info("starting app..."); log.info("starting app...");
// //
new JobScheduler(createRegistryCenter(), new JobScheduler(createRegistryCenter(),
createJobConfigurationNormal(), createJobConfigurationNormal()).init();
createJobEventConfiguration()).init();
new JobScheduler(createRegistryCenter(), new JobScheduler(createRegistryCenter(),
createJobConfigurationIncrement(), createJobConfigurationIncrement()).init();
createJobEventConfiguration()).init();
new JobScheduler(createRegistryCenter(), new JobScheduler(createRegistryCenter(),
createReplaceLogistic(), createReplaceLogistic()).init();
createJobEventConfiguration()).init();
new JobScheduler(createRegistryCenter(), new JobScheduler(createRegistryCenter(),
createQueueConsumer(), createQueueConsumer()).init();
createJobEventConfiguration()).init();
new JobScheduler(createRegistryCenter(), new JobScheduler(createRegistryCenter(),
createJobConfigurationNeNormal(), createJobConfigurationNeNormal()).init();
createJobEventConfiguration()).init();
} }
...@@ -122,10 +112,10 @@ public class Application { ...@@ -122,10 +112,10 @@ public class Application {
return LiteJobConfiguration.newBuilder(simpleJobConfig).build(); return LiteJobConfiguration.newBuilder(simpleJobConfig).build();
} }
//
private static JobEventConfiguration createJobEventConfiguration() { // private static JobEventConfiguration createJobEventConfiguration() {
return new JobEventRdbConfiguration(setUpEventTraceDataSource()); // return new JobEventRdbConfiguration(setUpEventTraceDataSource());
} // }
private static DataSource setUpEventTraceDataSource() { private static DataSource setUpEventTraceDataSource() {
DruidDataSource result = new DruidDataSource(); DruidDataSource result = new DruidDataSource();
......
...@@ -10,9 +10,9 @@ EVENT_RDB_STORAGE_PASSWORD=#7kfnymAM$Y9-Ntf ...@@ -10,9 +10,9 @@ EVENT_RDB_STORAGE_PASSWORD=#7kfnymAM$Y9-Ntf
ZOOKEEPER_SERVER=172.31.255.120:2181 ZOOKEEPER_SERVER=172.31.255.120:2181
NAME_SPACE=data-center NAME_SPACE=data-center
JOB_NAME=show-auto-turnover28 JOB_NAME=show-auto-turnover29
JOB_CRON=0 0 3 * * ? #JOB_CRON=0 0 3 * * ?
#JOB_CRON=0 0 10 * * ? JOB_CRON=0 35 11 * * ?
SHARDING_TOTAL_COUNT=8 SHARDING_TOTAL_COUNT=8
......
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