Commit da0af94b by huluobin

update

parent 49e0ea3f
...@@ -220,7 +220,6 @@ public class SyncCostFirstFinishJob extends PointJob { ...@@ -220,7 +220,6 @@ public class SyncCostFirstFinishJob extends PointJob {
} }
//注意这里的规则 : 如果sku需要动态更新 根据调拨单sku更新sku平均头程费用 //注意这里的规则 : 如果sku需要动态更新 根据调拨单sku更新sku平均头程费用
//rule : case 当前sku库存不为0 :新的平均头程费 = (旧的平均头程费用 * max((当前sku库存数量 - 调拨单sku数量),0) + 调拨单sku加权平均头程费用)/ (当前sku库存数量 + 调拨单sku数量) //rule : case 当前sku库存不为0 :新的平均头程费 = (旧的平均头程费用 * max((当前sku库存数量 - 调拨单sku数量),0) + 调拨单sku加权平均头程费用)/ (当前sku库存数量 + 调拨单sku数量)
//rule : case 当前sku库存为0 :新的平均头程费 = 调拨单sku加权平均头程费 //rule : case 当前sku库存为0 :新的平均头程费 = 调拨单sku加权平均头程费
......
...@@ -17,7 +17,7 @@ JOB_CRON=0/1 * * * * ? * ...@@ -17,7 +17,7 @@ JOB_CRON=0/1 * * * * ? *
JOB_NAME30=base-sync-oms-skus30 JOB_NAME30=base-sync-oms-skus30
#JOB_NAME=base-sync-oms-order #JOB_NAME=base-sync-oms-order
JOB_CRON30=0 0 22,23,00 * * ? * JOB_CRON30=0 0 02,22,23,00,13 * * ? *
JOB_COROUTINE_NAME=base-sync-oms-order-task3 JOB_COROUTINE_NAME=base-sync-oms-order-task3
JOB_COROUTINE_CRON=0/1 * * * * ? JOB_COROUTINE_CRON=0/1 * * * * ?
......
...@@ -4,5 +4,5 @@ ADD base-sync-sku-1.0-SNAPSHOT.jar app.jar ...@@ -4,5 +4,5 @@ ADD base-sync-sku-1.0-SNAPSHOT.jar app.jar
RUN echo "Asia/Shanghai" > /etc/timezone RUN echo "Asia/Shanghai" > /etc/timezone
ENTRYPOINT ["java","-Xms130m","-Xmx260m","-jar","/app.jar"] ENTRYPOINT ["java","-Xms130m","-Xmx1000m","-jar","/app.jar"]
EXPOSE 8080 EXPOSE 8080
...@@ -25,7 +25,7 @@ public class Application { ...@@ -25,7 +25,7 @@ public class Application {
private static final String EVENT_RDB_STORAGE_PASSWORD = propertiesUtil.getPropertyAsString("EVENT_RDB_STORAGE_PASSWORD"); private static final String EVENT_RDB_STORAGE_PASSWORD = propertiesUtil.getPropertyAsString("EVENT_RDB_STORAGE_PASSWORD");
public static void main(String[] args) { public static void main(String[] args) {
System.setProperty("java.util.concurrent.ForkJoinPool.common.parallelism", "20"); // System.setProperty("java.util.concurrent.ForkJoinPool.common.parallelism", "20");
new JobScheduler(createRegistryCenter(), createJobConfiguration()).init(); new JobScheduler(createRegistryCenter(), createJobConfiguration()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration3()).init(); new JobScheduler(createRegistryCenter(), createJobConfiguration3()).init();
......
...@@ -62,7 +62,7 @@ public class SkuMappingSyncJob extends PointJob { ...@@ -62,7 +62,7 @@ public class SkuMappingSyncJob extends PointJob {
pointLogMapper.upsertSelective(jobPointLog); pointLogMapper.upsertSelective(jobPointLog);
if (skuMappingResponse.getData() != null && skuMappingResponse.getData().size() > 0) { if (skuMappingResponse.getData() != null && skuMappingResponse.getData().size() > 0) {
List<DcBaseSkuMapping> skuMappingInfoList = skuMappingResponse.getData(); List<DcBaseSkuMapping> skuMappingInfoList = skuMappingResponse.getData();
skuMappingInfoList.parallelStream().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);
dcBaseSkuMappingMapper.upsertSelective(dcBaseSkuMapping); dcBaseSkuMappingMapper.upsertSelective(dcBaseSkuMapping);
......
...@@ -11,7 +11,6 @@ import org.apache.ibatis.session.TransactionIsolationLevel; ...@@ -11,7 +11,6 @@ import org.apache.ibatis.session.TransactionIsolationLevel;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Slf4j @Slf4j
...@@ -25,29 +24,30 @@ public class CalculateOutStockJob implements SimpleJob { ...@@ -25,29 +24,30 @@ public class CalculateOutStockJob implements SimpleJob {
try { try {
DcMidTransitMapper mapper = sqlSession.getMapper(DcMidTransitMapper.class); DcMidTransitMapper mapper = sqlSession.getMapper(DcMidTransitMapper.class);
List<OutStockQuantity> listQuantityOutStock = mapper.selectQuantityOutStock(); List<OutStockQuantity> listQuantityOutStock = mapper.selectQuantityOutStock();
if(listQuantityOutStock != null) { if (listQuantityOutStock != null) {
mapper.calculateOutStock(listQuantityOutStock, localDateTime); mapper.calculateOutStock(listQuantityOutStock, localDateTime);
} }
sqlSession.commit(); sqlSession.commit();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("计算缺货数失败",e); throw new RuntimeException("计算缺货数失败", e);
} finally { } finally {
if (sqlSession != null) { if (sqlSession != null) {
sqlSession.close(); sqlSession.close();
} }
} }
SqlSession sqlSessionUpdate = SessionUtil.getFactory().openSession(TransactionIsolationLevel.READ_UNCOMMITTED); SqlSession sqlSessionUpdate = SessionUtil.getFactory().openSession(TransactionIsolationLevel.READ_UNCOMMITTED);
try { try {
DcMidTransitMapper mapper = sqlSessionUpdate.getMapper(DcMidTransitMapper.class); DcMidTransitMapper mapper = sqlSessionUpdate.getMapper(DcMidTransitMapper.class);
// LocalDateTime localDateTime = mapper.selectMaxOutStockModified(); // LocalDateTime localDateTime = mapper.selectMaxOutStockModified();
mapper.updateOldOutStockToZero(df.format(localDateTime)); mapper.updateOldOutStockToZero(df.format(localDateTime));
sqlSessionUpdate.commit(); sqlSessionUpdate.commit();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("更新缺货数失败",e); throw new RuntimeException("更新缺货数失败", e);
} finally { } finally {
if(sqlSessionUpdate !=null) { if (sqlSessionUpdate != null) {
sqlSessionUpdate.close(); sqlSessionUpdate.close();
} }
} }
......
...@@ -856,7 +856,17 @@ public class AutoTurnoverJob extends PointJob { ...@@ -856,7 +856,17 @@ public class AutoTurnoverJob extends PointJob {
} }
} }
private boolean actualForecastFluctuations(DcAutoTurnoverWithBLOBs dcAutoTurnover, LocalDate recordTime, List<BigDecimal> forecastSalesList, Integer realInventory, BigDecimal totalSafeInventory, Integer outStock, DcAutoConfigSkuWarehouse dcAutoConfigSkuWarehouse, BigDecimal avgHistoryFourteendaySales, BigDecimal avgHistoryThreedaySales, List<DcAutoForecastFluctuation> forecastFluctuationList) { private boolean actualForecastFluctuations(DcAutoTurnoverWithBLOBs dcAutoTurnover,
LocalDate recordTime,
List<BigDecimal> forecastSalesList,
Integer realInventory,
BigDecimal totalSafeInventory,
Integer outStock,
DcAutoConfigSkuWarehouse dcAutoConfigSkuWarehouse,
BigDecimal avgHistoryFourteendaySales,
BigDecimal avgHistoryThreedaySales,
List<DcAutoForecastFluctuation> forecastFluctuationList) {
boolean hasMonitorFluctuation = false;//默认是停止了监控波动功能的 boolean hasMonitorFluctuation = false;//默认是停止了监控波动功能的
/* /*
* 这个if判断单纯是为了判断实际冗余,然后存一个表给别人用 * 这个if判断单纯是为了判断实际冗余,然后存一个表给别人用
......
...@@ -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-turnover4 JOB_NAME=show-auto-turnover6
#JOB_CRON=0 0 3 * * ? #JOB_CRON=0 0 3 * * ?
JOB_CRON=0 50 9 * * ? JOB_CRON=0 50 8 * * ?
SHARDING_TOTAL_COUNT=8 SHARDING_TOTAL_COUNT=8
......
...@@ -137,8 +137,8 @@ public class AutoTurnoverTest { ...@@ -137,8 +137,8 @@ public class AutoTurnoverTest {
public void testXX() { public void testXX() {
DcBaseStock dcBaseStock = SessionUtil.getSession().getMapper(DcBaseStockMapper.class) DcBaseStock dcBaseStock = SessionUtil.getSession().getMapper(DcBaseStockMapper.class)
.selectOneByExample(DcBaseStockExample.newAndCreateCriteria() .selectOneByExample(DcBaseStockExample.newAndCreateCriteria()
.andBailunSkuEqualTo("949406801") .andBailunSkuEqualTo("949943201")
.andWarehouseCodeEqualTo("GZBLWH") // .andWarehouseCodeEqualTo("GB4PXBL")
.example()); .example());
try { try {
......
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