Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
dc-java
Commits
f1400bf8
Commit
f1400bf8
authored
Oct 27, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
bee1e435
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
28 deletions
+14
-28
DailyFeeJob.java
...ance-fee/src/main/java/com/bailuntec/job/DailyFeeJob.java
+1
-1
FeeJob.java
...c-finance-fee/src/main/java/com/bailuntec/job/FeeJob.java
+8
-10
MainTest.java
data-base/base-sync-finance-fee/src/test/java/MainTest.java
+1
-0
pom.xml
data-common/pom.xml
+0
-13
DcAutoSalesForecastStageConfigMapper.xml
...bailuntec/mapper/DcAutoSalesForecastStageConfigMapper.xml
+2
-0
AutoTurnoverServiceImpl.java
...a/com/bailuntec/service/impl/AutoTurnoverServiceImpl.java
+1
-3
AutoTurnoverJobTest.java
.../src/test/java/com/bailuntec/job/AutoTurnoverJobTest.java
+1
-1
No files found.
data-base/base-sync-finance-fee/src/main/java/com/bailuntec/job/DailyFeeJob.java
View file @
f1400bf8
...
@@ -13,7 +13,7 @@ public class DailyFeeJob extends PointJob {
...
@@ -13,7 +13,7 @@ public class DailyFeeJob extends PointJob {
@Override
@Override
public
void
executeJob
(
ShardingContext
shardingContext
,
JobPointLog
jobPointLog
)
{
public
void
executeJob
(
ShardingContext
shardingContext
,
JobPointLog
jobPointLog
)
{
DcBaseFinanceFeeMapper
dcBaseFinanceFeeMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseFinanceFeeMapper
.
class
);
DcBaseFinanceFeeMapper
dcBaseFinanceFeeMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseFinanceFeeMapper
.
class
);
LocalDate
time
=
LocalDate
.
of
(
2020
,
9
,
29
);
LocalDate
time
=
LocalDate
.
of
(
2020
,
10
,
21
);
try
{
try
{
dcBaseFinanceFeeMapper
.
deleteDailyFee
(
time
.
minusDays
(
1L
));
dcBaseFinanceFeeMapper
.
deleteDailyFee
(
time
.
minusDays
(
1L
));
dcBaseFinanceFeeMapper
.
insertDailyFee
(
time
.
minusDays
(
1L
));
dcBaseFinanceFeeMapper
.
insertDailyFee
(
time
.
minusDays
(
1L
));
...
...
data-base/base-sync-finance-fee/src/main/java/com/bailuntec/job/FeeJob.java
View file @
f1400bf8
package
com
.
bailuntec
.
job
;
package
com
.
bailuntec
.
job
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.bailuntec.domain.CostDto
;
import
com.bailuntec.domain.CostInfo
;
import
com.bailuntec.domain.CostInfo
;
import
com.bailuntec.domain.constant.CommonConstant
;
import
com.bailuntec.domain.constant.CommonConstant
;
import
com.bailuntec.domain.entity.DcBaseFinanceFee
;
import
com.bailuntec.domain.entity.DcBaseFinanceFee
;
...
@@ -19,7 +18,6 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -19,7 +18,6 @@ import lombok.extern.slf4j.Slf4j;
import
okhttp3.OkHttpClient
;
import
okhttp3.OkHttpClient
;
import
okhttp3.Request
;
import
okhttp3.Request
;
import
okhttp3.Response
;
import
okhttp3.Response
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -66,18 +64,18 @@ public class FeeJob extends PointJob {
...
@@ -66,18 +64,18 @@ public class FeeJob extends PointJob {
}
}
if
(
costInfo
!=
null
&&
costInfo
.
getData
().
getList
().
size
()
>
0
)
{
if
(
costInfo
!=
null
&&
costInfo
.
getData
().
getList
().
size
()
>
0
)
{
List
<
DcBaseFinanceFee
>
costDtoList
=
costInfo
.
getData
().
getList
();
List
<
DcBaseFinanceFee
>
costDtoList
=
costInfo
.
getData
().
getList
();
for
(
DcBaseFinanceFee
dcBaseFinanceFee
:
costDtoList
)
{
for
(
DcBaseFinanceFee
dcBaseFinanceFee
:
costDtoList
)
{
try
{
try
{
DcBaseFinanceFeeMapper
dcBaseFinanceFeeMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseFinanceFeeMapper
.
class
);
DcBaseFinanceFeeMapper
dcBaseFinanceFeeMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseFinanceFeeMapper
.
class
);
dcBaseFinanceFee
.
setBjModified
(
LocalDateTime
.
now
());
dcBaseFinanceFee
.
setBjModified
(
LocalDateTime
.
now
());
int
result
=
dcBaseFinanceFeeMapper
.
updateByExampleSelective
(
dcBaseFinanceFee
,
DcBaseFinanceFeeExample
.
newAndCreateCriteria
().
andCostNoEqualTo
(
dcBaseFinanceFee
.
getCostNo
()).
example
());
int
result
=
dcBaseFinanceFeeMapper
.
updateByExampleSelective
(
dcBaseFinanceFee
,
DcBaseFinanceFeeExample
.
newAndCreateCriteria
().
andCostNoEqualTo
(
dcBaseFinanceFee
.
getCostNo
()).
example
());
if
(
result
==
0
)
{
if
(
result
==
0
)
{
dcBaseFinanceFee
.
setBjModified
(
null
);
dcBaseFinanceFee
.
setBjModified
(
null
);
dcBaseFinanceFeeMapper
.
insertSelective
(
dcBaseFinanceFee
);
dcBaseFinanceFeeMapper
.
insertSelective
(
dcBaseFinanceFee
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"BeanUtils.copyProperties失败"
);
throw
new
RuntimeException
(
"BeanUtils.copyProperties失败"
);
}
finally
{
}
finally
{
SessionUtil
.
closeSession
();
SessionUtil
.
closeSession
();
}
}
}
}
...
@@ -97,9 +95,9 @@ public class FeeJob extends PointJob {
...
@@ -97,9 +95,9 @@ public class FeeJob extends PointJob {
}
}
jobPointLog
.
setPageIndex
(
jobPointLog
.
getPageIndex
()
-
1
);
jobPointLog
.
setPageIndex
(
jobPointLog
.
getPageIndex
()
-
1
);
}
while
(
0
<
jobPointLog
.
getPageIndex
());
}
while
(
0
<
jobPointLog
.
getPageIndex
());
jobPointLog
.
setPageIndex
(
0
);
jobPointLog
.
setPageIndex
(
0
);
jobPointLog
.
setStartTime
(
jobPointLog
.
getEndTime
());
jobPointLog
.
setStartTime
(
jobPointLog
.
getEndTime
());
jobPointLog
.
setEndTime
(
jobPointLog
.
getEndTime
().
plusDays
(
jobPointLog
.
getIntervalTime
()).
isAfter
(
LocalDateTime
.
now
())
?
LocalDateTime
.
now
()
:
jobPointLog
.
getEndTime
().
plusDays
(
jobPointLog
.
getIntervalTime
()));
jobPointLog
.
setEndTime
(
jobPointLog
.
getEndTime
().
plusDays
(
jobPointLog
.
getIntervalTime
()).
isAfter
(
LocalDateTime
.
now
())
?
LocalDateTime
.
now
()
:
jobPointLog
.
getEndTime
().
plusDays
(
jobPointLog
.
getIntervalTime
()));
}
}
}
}
data-base/base-sync-finance-fee/src/test/java/MainTest.java
View file @
f1400bf8
...
@@ -6,6 +6,7 @@ import org.junit.jupiter.api.Test;
...
@@ -6,6 +6,7 @@ import org.junit.jupiter.api.Test;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
public
class
MainTest
{
public
class
MainTest
{
@Test
@Test
public
void
test
()
{
public
void
test
()
{
ManageCostJob
syncManagerCostJob
=
new
ManageCostJob
();
ManageCostJob
syncManagerCostJob
=
new
ManageCostJob
();
...
...
data-common/pom.xml
View file @
f1400bf8
...
@@ -73,18 +73,6 @@
...
@@ -73,18 +73,6 @@
<artifactId>
commons-beanutils
</artifactId>
<artifactId>
commons-beanutils
</artifactId>
</dependency>
</dependency>
<!-- <!– https://mvnrepository.com/artifact/org.slf4j/slf4j-api –>-->
<!-- <dependency>-->
<!-- <groupId>org.slf4j</groupId>-->
<!-- <artifactId>slf4j-api</artifactId>-->
<!-- </dependency>-->
<!-- <!– https://mvnrepository.com/artifact/ch.qos.logback/logback-classic –>-->
<!-- <dependency>-->
<!-- <groupId>ch.qos.logback</groupId>-->
<!-- <artifactId>logback-classic</artifactId>-->
<!-- </dependency>-->
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<groupId>
com.alibaba
</groupId>
...
@@ -94,7 +82,6 @@
...
@@ -94,7 +82,6 @@
<dependency>
<dependency>
<groupId>
org.junit.jupiter
</groupId>
<groupId>
org.junit.jupiter
</groupId>
<artifactId>
junit-jupiter-api
</artifactId>
<artifactId>
junit-jupiter-api
</artifactId>
<scope>
test
</scope>
</dependency>
</dependency>
<!-- 自动生成接口文档 -->
<!-- 自动生成接口文档 -->
...
...
data-common/src/main/java/com/bailuntec/mapper/DcAutoSalesForecastStageConfigMapper.xml
View file @
f1400bf8
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
and (t6.hq_type = t5.warehouse_type or length(trim(t5.warehouse_type)) = 0)
and (t6.hq_type = t5.warehouse_type or length(trim(t5.warehouse_type)) = 0)
and (t2.product_type = t5.category or length(trim(t5.category)) = 0)
and (t2.product_type = t5.category or length(trim(t5.category)) = 0)
and (t6.area_id = t5.warehouse_area_id or length(trim(t5.warehouse_area_id)) = 0)
and (t6.area_id = t5.warehouse_area_id or length(trim(t5.warehouse_area_id)) = 0)
# and t5.is_delete = 0
LEFT JOIN dc_auto_sales_forecast_stage_config t7 on t7.config_id = t5.id
LEFT JOIN dc_auto_sales_forecast_stage_config t7 on t7.config_id = t5.id
and (IF(t5.screen_type = 1,
and (IF(t5.screen_type = 1,
t8.first_inbound_date
<
= t7.duration_upper_limit or
t8.first_inbound_date
<
= t7.duration_upper_limit or
...
@@ -57,6 +58,7 @@
...
@@ -57,6 +58,7 @@
and (t6.hq_type = t5.warehouse_type or length(trim(t5.warehouse_type)) = 0)
and (t6.hq_type = t5.warehouse_type or length(trim(t5.warehouse_type)) = 0)
and (t2.product_type = t5.category or length(trim(t5.category)) = 0)
and (t2.product_type = t5.category or length(trim(t5.category)) = 0)
and (t6.area_id = t5.warehouse_area_id or length(trim(t5.warehouse_area_id)) = 0)
and (t6.area_id = t5.warehouse_area_id or length(trim(t5.warehouse_area_id)) = 0)
and t5.is_delete = 0
and t5.id = 4
and t5.id = 4
LEFT JOIN dc_auto_sales_forecast_stage_config t7 on t7.config_id = t5.id
LEFT JOIN dc_auto_sales_forecast_stage_config t7 on t7.config_id = t5.id
and (IF(t5.screen_type = 1,
and (IF(t5.screen_type = 1,
...
...
data-show/show-auto-turnover/src/main/java/com/bailuntec/service/impl/AutoTurnoverServiceImpl.java
View file @
f1400bf8
...
@@ -5,7 +5,6 @@ import com.bailuntec.domain.entity.DcAutoTurnover;
...
@@ -5,7 +5,6 @@ import com.bailuntec.domain.entity.DcAutoTurnover;
import
com.bailuntec.mapper.DcAutoSalesForecastStageConfigMapper
;
import
com.bailuntec.mapper.DcAutoSalesForecastStageConfigMapper
;
import
com.bailuntec.mapper.DcBaseOmsSkuMapper
;
import
com.bailuntec.mapper.DcBaseOmsSkuMapper
;
import
com.bailuntec.service.AutoTurnoverService
;
import
com.bailuntec.service.AutoTurnoverService
;
import
com.bailuntec.utils.ReadSessionUtil
;
import
com.bailuntec.utils.SessionUtil
;
import
com.bailuntec.utils.SessionUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.ibatis.session.SqlSession
;
import
org.apache.ibatis.session.SqlSession
;
...
@@ -30,7 +29,7 @@ public class AutoTurnoverServiceImpl implements AutoTurnoverService {
...
@@ -30,7 +29,7 @@ public class AutoTurnoverServiceImpl implements AutoTurnoverService {
@Override
@Override
public
List
<
BigDecimal
>
getAutoTurnoverSaleDetails
(
DcAutoTurnover
dcAutoTurnover
,
int
turnoverDays
,
int
autoForecastDay
)
{
public
List
<
BigDecimal
>
getAutoTurnoverSaleDetails
(
DcAutoTurnover
dcAutoTurnover
,
int
turnoverDays
,
int
autoForecastDay
)
{
SqlSession
session
=
Read
SessionUtil
.
getFactory
().
openSession
(
true
);
SqlSession
session
=
SessionUtil
.
getFactory
().
openSession
(
true
);
// SqlSession readOnlySession = ReadSessionUtil.getFactory().openSession(true);
// SqlSession readOnlySession = ReadSessionUtil.getFactory().openSession(true);
try
{
try
{
Queue
<
BigDecimal
>
forecastSalesDetails
=
new
LinkedList
<>();
Queue
<
BigDecimal
>
forecastSalesDetails
=
new
LinkedList
<>();
...
@@ -43,7 +42,6 @@ public class AutoTurnoverServiceImpl implements AutoTurnoverService {
...
@@ -43,7 +42,6 @@ public class AutoTurnoverServiceImpl implements AutoTurnoverService {
//命中的预测规则
//命中的预测规则
DcAutoSalesForecastStageConfig
dcAutoSalesForecastStageConfig
=
dcAutoSalesForecastStageConfigMapper
.
selectMatchStage
(
dcAutoTurnover
.
getBailunSku
(),
dcAutoTurnover
.
getWarehouseCode
());
DcAutoSalesForecastStageConfig
dcAutoSalesForecastStageConfig
=
dcAutoSalesForecastStageConfigMapper
.
selectMatchStage
(
dcAutoTurnover
.
getBailunSku
(),
dcAutoTurnover
.
getWarehouseCode
());
//周转天数
//周转天数
/*
/*
* 每个时间段的销量预测是dcAutoSalesForecastStageConfig对应时间段的三个参数对应的过去时间段的销量的加权平均*/
* 每个时间段的销量预测是dcAutoSalesForecastStageConfig对应时间段的三个参数对应的过去时间段的销量的加权平均*/
...
...
data-show/show-auto-turnover/src/test/java/com/bailuntec/job/AutoTurnoverJobTest.java
View file @
f1400bf8
...
@@ -325,7 +325,7 @@ public class AutoTurnoverJobTest {
...
@@ -325,7 +325,7 @@ public class AutoTurnoverJobTest {
DcBaseStockMapper
dcBaseStockMapper
=
sqlSession
.
getMapper
(
DcBaseStockMapper
.
class
);
DcBaseStockMapper
dcBaseStockMapper
=
sqlSession
.
getMapper
(
DcBaseStockMapper
.
class
);
DcBaseStock
dcBaseStock
=
dcBaseStockMapper
.
selectOneByExample
(
DcBaseStockExample
.
newAndCreateCriteria
()
DcBaseStock
dcBaseStock
=
dcBaseStockMapper
.
selectOneByExample
(
DcBaseStockExample
.
newAndCreateCriteria
()
.
andBailunSkuEqualTo
(
"94
8259717
"
)
.
andBailunSkuEqualTo
(
"94
9299201
"
)
.
andWarehouseCodeEqualTo
(
"GZBLWH"
)
.
andWarehouseCodeEqualTo
(
"GZBLWH"
)
.
example
());
.
example
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment