Commit 8fe52778 by huluobin

update

parent b6e7af01
...@@ -107,8 +107,8 @@ public class EbayFinanceAdSyncJobTest { ...@@ -107,8 +107,8 @@ public class EbayFinanceAdSyncJobTest {
public void testThreadPool2() { public void testThreadPool2() {
EbayFinanceAdSyncJob ebayFinanceAdSyncJob = new EbayFinanceAdSyncJob(); EbayFinanceAdSyncJob ebayFinanceAdSyncJob = new EbayFinanceAdSyncJob();
LocalDateTime start = LocalDateTime.of(2020, 12, 14, 0, 0); LocalDateTime start = LocalDateTime.of(2020, 12, 17, 0, 0);
LocalDateTime end = LocalDateTime.of(2020, 12, 14, 0, 0); LocalDateTime end = LocalDateTime.of(2020, 12, 20, 0, 0);
List<LocalDateTime> localDateTimeList = Stream.iterate(start, List<LocalDateTime> localDateTimeList = Stream.iterate(start,
localDateTime -> localDateTime.plusDays(1)) localDateTime -> localDateTime.plusDays(1))
......
...@@ -32,6 +32,7 @@ public class Application { ...@@ -32,6 +32,7 @@ public class Application {
new JobScheduler(createRegistryCenter(), createJobConfiguration1()).init(); new JobScheduler(createRegistryCenter(), createJobConfiguration1()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration2()).init(); new JobScheduler(createRegistryCenter(), createJobConfiguration2()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration4()).init(); new JobScheduler(createRegistryCenter(), createJobConfiguration4()).init();
new JobScheduler(createRegistryCenter(), createJobConfigurationX()).init();
} }
private static CoordinatorRegistryCenter createRegistryCenter() { private static CoordinatorRegistryCenter createRegistryCenter() {
...@@ -61,6 +62,13 @@ public class Application { ...@@ -61,6 +62,13 @@ public class Application {
return simpleJobRootConfig; return simpleJobRootConfig;
} }
private static LiteJobConfiguration createJobConfigurationX() {
JobCoreConfiguration simpleCoreConfig = JobCoreConfiguration.newBuilder(propertiesUtil.getPropertyAsString("JOB_MAPPING_NAME-X"), propertiesUtil.getPropertyAsString("JOB_MAPPING_CRON"), propertiesUtil.getPropertyAsInt("SHARDING_TOTAL_COUNT")).build();
SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(simpleCoreConfig, SkuMappingSyncJob.class.getCanonicalName());
LiteJobConfiguration simpleJobRootConfig = LiteJobConfiguration.newBuilder(simpleJobConfig).build();
return simpleJobRootConfig;
}
private static LiteJobConfiguration createJobConfiguration4() { private static LiteJobConfiguration createJobConfiguration4() {
JobCoreConfiguration simpleCoreConfig = JobCoreConfiguration.newBuilder(propertiesUtil.getPropertyAsString("JOB_CATEGORY_NAME"), propertiesUtil.getPropertyAsString("JOB_CATEGORY_CRON"), propertiesUtil.getPropertyAsInt("SHARDING_TOTAL_COUNT")).build(); JobCoreConfiguration simpleCoreConfig = JobCoreConfiguration.newBuilder(propertiesUtil.getPropertyAsString("JOB_CATEGORY_NAME"), propertiesUtil.getPropertyAsString("JOB_CATEGORY_CRON"), propertiesUtil.getPropertyAsInt("SHARDING_TOTAL_COUNT")).build();
SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(simpleCoreConfig, BailunCategoryJob.class.getCanonicalName()); SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(simpleCoreConfig, BailunCategoryJob.class.getCanonicalName());
......
...@@ -65,6 +65,9 @@ public class SkuMappingSyncJob extends PointJob { ...@@ -65,6 +65,9 @@ public class SkuMappingSyncJob extends PointJob {
skuMappingInfoList.forEach(dcBaseSkuMapping -> { skuMappingInfoList.forEach(dcBaseSkuMapping -> {
dcBaseSkuMapping.setGmtModified(LocalDateTime.now()); dcBaseSkuMapping.setGmtModified(LocalDateTime.now());
DcBaseSkuMappingMapper dcBaseSkuMappingMapper = SessionUtil.getSession().getMapper(DcBaseSkuMappingMapper.class); DcBaseSkuMappingMapper dcBaseSkuMappingMapper = SessionUtil.getSession().getMapper(DcBaseSkuMappingMapper.class);
String shortSiteEn = dcBaseSkuMappingMapper.selectShortSiteEn(dcBaseSkuMapping.getSite());
dcBaseSkuMapping.setSite(shortSiteEn);
dcBaseSkuMappingMapper.upsertSelective(dcBaseSkuMapping); dcBaseSkuMappingMapper.upsertSelective(dcBaseSkuMapping);
}); });
if (jobPointLog.getPageIndex().equals(0) && skuMappingResponse.getTotalPage() != null) { if (jobPointLog.getPageIndex().equals(0) && skuMappingResponse.getTotalPage() != null) {
...@@ -77,6 +80,7 @@ public class SkuMappingSyncJob extends PointJob { ...@@ -77,6 +80,7 @@ public class SkuMappingSyncJob extends PointJob {
jobPointLog.setPageIndex(jobPointLog.getPageIndex() - 1); jobPointLog.setPageIndex(jobPointLog.getPageIndex() - 1);
} while (jobPointLog.getPageIndex() > 0); } while (jobPointLog.getPageIndex() > 0);
jobPointLog.setPageIndex(0); jobPointLog.setPageIndex(0);
jobPointLog.setStartTime(jobPointLog.getEndTime()); jobPointLog.setStartTime(jobPointLog.getEndTime());
jobPointLog.setEndTime(jobPointLog.getStartTime().plusDays(jobPointLog.getIntervalTime().longValue()).isAfter(LocalDateTime.now()) ? LocalDateTime.now() : jobPointLog.getStartTime().plusDays(jobPointLog.getIntervalTime().longValue())); jobPointLog.setEndTime(jobPointLog.getStartTime().plusDays(jobPointLog.getIntervalTime().longValue()).isAfter(LocalDateTime.now()) ? LocalDateTime.now() : jobPointLog.getStartTime().plusDays(jobPointLog.getIntervalTime().longValue()));
......
...@@ -21,6 +21,10 @@ JOB_SIMPLE_CATEGORY_CRON=0 0 23 * * ? * ...@@ -21,6 +21,10 @@ JOB_SIMPLE_CATEGORY_CRON=0 0 23 * * ? *
JOB_MAPPING_NAME=base-sync-sku-mapping JOB_MAPPING_NAME=base-sync-sku-mapping
JOB_MAPPING_CRON=0/10 * * * * ? * JOB_MAPPING_CRON=0/10 * * * * ? *
JOB_MAPPING_NAME-X=base-sync-sku-mapping-x
JOB_CATEGORY_NAME=base-sync-category JOB_CATEGORY_NAME=base-sync-category
JOB_CATEGORY_CRON=0 12 * * * ? * JOB_CATEGORY_CRON=0 12 * * * ? *
SHARDING_TOTAL_COUNT=1 SHARDING_TOTAL_COUNT=1
https://bbs.sgamer.com/thread-14124960-1-1.html
...@@ -3740,6 +3740,7 @@ ...@@ -3740,6 +3740,7 @@
and has_buyer_remark = 0 and has_buyer_remark = 0
and has_platsku_remark = 0 and has_platsku_remark = 0
and has_innersale = 0 and has_innersale = 0
and bailun_order_status !='Canceled'
and !(paid_time &gt;= '2020-11-23 00:00:00' and paid_time &lt;= '2020-12-06 00:00:00' and and !(paid_time &gt;= '2020-11-23 00:00:00' and paid_time &lt;= '2020-12-06 00:00:00' and
platform_type = 'FBA') platform_type = 'FBA')
and platform_order_type != '手工单' and platform_order_type != '手工单'
......
...@@ -121,4 +121,6 @@ public interface DcBaseSkuMappingMapper { ...@@ -121,4 +121,6 @@ public interface DcBaseSkuMappingMapper {
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
int upsertSelective(DcBaseSkuMapping record); int upsertSelective(DcBaseSkuMapping record);
}
\ No newline at end of file String selectShortSiteEn(String site);
}
...@@ -682,7 +682,6 @@ public class AutoTurnoverJob extends PointJob { ...@@ -682,7 +682,6 @@ public class AutoTurnoverJob extends PointJob {
} }
if (hasMonitorFluctuation) { if (hasMonitorFluctuation) {
// if (realInventory > forecastSalesList.get(0).add(totalSafeInventory).doubleValue()) {
DcAutoForecastFluctuation dcAutoForecastFluctuationActual = null; DcAutoForecastFluctuation dcAutoForecastFluctuationActual = null;
BigDecimal forecastPurchaseAdvise = forecastPurchaseAdvisedList.get(0); BigDecimal forecastPurchaseAdvise = forecastPurchaseAdvisedList.get(0);
...@@ -783,9 +782,7 @@ public class AutoTurnoverJob extends PointJob { ...@@ -783,9 +782,7 @@ public class AutoTurnoverJob extends PointJob {
if (i < 14) { if (i < 14) {
avgForecastFourteendaySales = avgForecastFourteendaySales.add(forecastSalesList.get(i)); avgForecastFourteendaySales = avgForecastFourteendaySales.add(forecastSalesList.get(i));
} }
if (i < turnoverDays) { avgForecastTurnoverDaySales = avgForecastTurnoverDaySales.add(forecastSalesList.get(i));
avgForecastTurnoverDaySales = avgForecastTurnoverDaySales.add(forecastSalesList.get(i));
}
//如果初始采购建议 <= 0, 那就也不用备货., stockUpDays - 1的原因是我们已经算了一天的预测销量了. //如果初始采购建议 <= 0, 那就也不用备货., stockUpDays - 1的原因是我们已经算了一天的预测销量了.
if (i < stockUpDays - 1 && forecastPurchaseAdvisedList.get(0).compareTo(BigDecimal.ZERO) == 1) { if (i < stockUpDays - 1 && forecastPurchaseAdvisedList.get(0).compareTo(BigDecimal.ZERO) == 1) {
stockUpSales = stockUpSales.add(forecastSalesList.get(i + 1 + turnoverDays)); stockUpSales = stockUpSales.add(forecastSalesList.get(i + 1 + turnoverDays));
...@@ -1386,8 +1383,8 @@ public class AutoTurnoverJob extends PointJob { ...@@ -1386,8 +1383,8 @@ public class AutoTurnoverJob extends PointJob {
int interval = Period.between(recordTime, localDate).getDays(); int interval = Period.between(recordTime, localDate).getDays();
int index = Math.max(interval, 0); int index = Math.max(interval, 0);
forecastInboundRelationList.set(index, dcBaseTransExpectarrivaltimes.stream().map(dcBaseTransExpectarrivaltime -> Constant.TRANSFER_SIGN + dcBaseTransExpectarrivaltime.getTransferOrderId() + "_" + dcBaseTransExpectarrivaltime.getCount()).collect(Collectors.joining("*"))); forecastInboundRelationList.set(index, forecastInboundRelationList.get(index) + dcBaseTransExpectarrivaltimes.stream().map(dcBaseTransExpectarrivaltime -> Constant.TRANSFER_SIGN + dcBaseTransExpectarrivaltime.getTransferOrderId() + "_" + dcBaseTransExpectarrivaltime.getCount()).collect(Collectors.joining("*")));
forecastTransferInboundList.set(index, dcBaseTransExpectarrivaltimes.stream().mapToInt(DcBaseTransExpectarrivaltime::getCount).sum()); forecastTransferInboundList.set(index, forecastTransferInboundList.get(index) + dcBaseTransExpectarrivaltimes.stream().mapToInt(DcBaseTransExpectarrivaltime::getCount).sum());
forecastInboundList.set(index, forecastPurchaseInboundList.get(index) + forecastTransferInboundList.get(index)); forecastInboundList.set(index, forecastPurchaseInboundList.get(index) + forecastTransferInboundList.get(index));
}); });
...@@ -1881,10 +1878,15 @@ public class AutoTurnoverJob extends PointJob { ...@@ -1881,10 +1878,15 @@ public class AutoTurnoverJob extends PointJob {
int x = Math.max(fbaTransferIndex - n, 0); int x = Math.max(fbaTransferIndex - n, 0);
BigDecimal multiSales = BigDecimal.valueOf(Math.min(1, Math.max(1 - n * 0.3, 0) + x * 0.1)); BigDecimal multiSales = BigDecimal.valueOf(Math.min(1, Math.max(1 - n * 0.3, 0) + x * 0.1));
if (x >= 1 && salesDetailItemList.get(j) != null && salesDetailItemList.get(j).getSalesDayConfig() != null) { if (x >= 1) {
forecastSalesList.set(j, forecastSalesItem.multiply(multiSales)); forecastSalesList.set(j, forecastSalesItem.multiply(multiSales));
} }
if (salesDetailItemList.get(j) != null && salesDetailItemList.get(j).getSalesDayConfig() != null) {
forecastSalesList.set(j, salesDetailItemList.get(j).getSalesDayConfig());
}
} }
} finally { } finally {
SessionUtil.closeSession(); SessionUtil.closeSession();
} }
...@@ -1999,6 +2001,7 @@ public class AutoTurnoverJob extends PointJob { ...@@ -1999,6 +2001,7 @@ public class AutoTurnoverJob extends PointJob {
totalSales = totalSales.add(forecastSalesList.get(j)); totalSales = totalSales.add(forecastSalesList.get(j));
} }
return inventoryAvailableDays; return inventoryAvailableDays;
} }
......
...@@ -242,7 +242,6 @@ public class AutoTurnoverTest { ...@@ -242,7 +242,6 @@ public class AutoTurnoverTest {
//949406801 GZBLWH //949406801 GZBLWH
@Test @Test
public void testXX() { public void testXX() {
DcBaseStockMapper dcBaseStockMapper = SessionUtil.getSession().getMapper(DcBaseStockMapper.class);
SalesDayConfigMapper salesDayConfigMapper = SessionUtil.getSession().getMapper(SalesDayConfigMapper.class); SalesDayConfigMapper salesDayConfigMapper = SessionUtil.getSession().getMapper(SalesDayConfigMapper.class);
AutoTurnoverJob autoTurnoverJob = new AutoTurnoverJob(); AutoTurnoverJob autoTurnoverJob = new AutoTurnoverJob();
...@@ -269,7 +268,7 @@ public class AutoTurnoverTest { ...@@ -269,7 +268,7 @@ public class AutoTurnoverTest {
public void testXX2() { public void testXX2() {
DcBaseStock dcBaseStock = SessionUtil.getSession().getMapper(DcBaseStockMapper.class) DcBaseStock dcBaseStock = SessionUtil.getSession().getMapper(DcBaseStockMapper.class)
.selectOneByExample(DcBaseStockExample.newAndCreateCriteria() .selectOneByExample(DcBaseStockExample.newAndCreateCriteria()
.andBailunSkuEqualTo("947077901") .andBailunSkuEqualTo("949282602")
.andWarehouseCodeEqualTo("GZBLWH") .andWarehouseCodeEqualTo("GZBLWH")
.example()); .example());
......
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