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
huluobin
dc-java
Commits
dd7dc2f8
Commit
dd7dc2f8
authored
Nov 13, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
6228d8f2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
117 additions
and
46 deletions
+117
-46
OmsOrderTest.java
...-base/base-sync-oms-order/src/test/java/OmsOrderTest.java
+1
-1
pom.xml
data-common/pom.xml
+0
-5
DcAutoTurnover.java
...main/java/com/bailuntec/domain/entity/DcAutoTurnover.java
+0
-0
DcAutoTurnoverWithBLOBs.java
.../com/bailuntec/domain/entity/DcAutoTurnoverWithBLOBs.java
+30
-0
DcAutoTurnoverExample.java
...a/com/bailuntec/domain/example/DcAutoTurnoverExample.java
+0
-0
DcAutoTurnoverMapper.java
.../main/java/com/bailuntec/mapper/DcAutoTurnoverMapper.java
+51
-9
DcAutoTurnoverMapper.xml
...c/main/java/com/bailuntec/mapper/DcAutoTurnoverMapper.xml
+0
-0
SessionUtil.java
...common/src/main/java/com/bailuntec/utils/SessionUtil.java
+7
-7
init.properties
data-common/src/main/resources/init.properties
+1
-1
mybatis-config.xml
data-common/src/main/resources/mybatis-config.xml
+1
-1
BalanceSheetService.java
...m/bailuntec/balancesheet/service/BalanceSheetService.java
+1
-5
AutoTurnoverJob.java
...over/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
+12
-12
AutoTurnoverServiceImpl.java
...a/com/bailuntec/service/impl/AutoTurnoverServiceImpl.java
+10
-0
AutoTurnoverTest.java
...ow/show-auto-turnover/src/test/java/AutoTurnoverTest.java
+1
-1
AutoTurnoverJobTest.java
.../src/test/java/com/bailuntec/job/AutoTurnoverJobTest.java
+0
-3
AutoTurnoverServiceImplTest.java
...m/bailuntec/service/impl/AutoTurnoverServiceImplTest.java
+2
-1
No files found.
data-base/base-sync-oms-order/src/test/java/OmsOrderTest.java
View file @
dd7dc2f8
...
...
@@ -26,7 +26,7 @@ public class OmsOrderTest {
// map.put("BailunLastUpdateTimeFrom", "2019-04-11 11:45:33");
// map.put("BailunLastUpdateTimeTo", "2019-04-11 16:17:03");
//OriginOrderNo=112-7750508-3145827
map
.
put
(
"OriginOrderNo"
,
"WS20200511
1851016291F39C
"
);
map
.
put
(
"OriginOrderNo"
,
"WS20200511
05223211FC52AA
"
);
Request
request
=
new
Request
.
Builder
()
.
get
()
.
url
(
OkHttpUtil
.
attachHttpGetParams
(
"http://oms.bailuntec.com/apiV2/bailunOrder/getBailunOrders"
,
map
))
...
...
data-common/pom.xml
View file @
dd7dc2f8
...
...
@@ -55,11 +55,6 @@
<artifactId>
okhttp
</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>
org.mybatis
</groupId>
<artifactId>
mybatis
</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
...
...
data-common/src/main/java/com/bailuntec/domain/entity/DcAutoTurnover.java
View file @
dd7dc2f8
This diff is collapsed.
Click to expand it.
data-common/src/main/java/com/bailuntec/domain/entity/DcAutoTurnoverWithBLOBs.java
0 → 100644
View file @
dd7dc2f8
package
com
.
bailuntec
.
domain
.
entity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ToString
(
callSuper
=
true
)
public
class
DcAutoTurnoverWithBLOBs
extends
DcAutoTurnover
{
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_auto_turnover.sales_details
*
* @mbg.generated
*/
private
String
salesDetails
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_auto_turnover.sales_details_formula
*
* @mbg.generated
*/
private
String
salesDetailsFormula
;
}
data-common/src/main/java/com/bailuntec/domain/example/DcAutoTurnoverExample.java
View file @
dd7dc2f8
This diff is collapsed.
Click to expand it.
data-common/src/main/java/com/bailuntec/mapper/DcAutoTurnoverMapper.java
View file @
dd7dc2f8
package
com
.
bailuntec
.
mapper
;
import
com.bailuntec.domain.entity.DcAutoTurnover
;
import
com.bailuntec.domain.entity.DcAutoTurnoverWithBLOBs
;
import
com.bailuntec.domain.example.DcAutoTurnoverExample
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -37,7 +38,7 @@ public interface DcAutoTurnoverMapper {
*
* @mbg.generated
*/
int
insert
(
DcAutoTurnover
record
);
int
insert
(
DcAutoTurnover
WithBLOBs
record
);
/**
* This method was generated by MyBatis Generator.
...
...
@@ -45,7 +46,7 @@ public interface DcAutoTurnoverMapper {
*
* @mbg.generated
*/
int
insertSelective
(
DcAutoTurnover
record
);
int
insertSelective
(
DcAutoTurnover
WithBLOBs
record
);
/**
* This method was generated by MyBatis Generator.
...
...
@@ -61,6 +62,23 @@ public interface DcAutoTurnoverMapper {
* This method corresponds to the database table dc_auto_turnover
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DcAutoTurnoverWithBLOBs
selectOneByExampleWithBLOBs
(
DcAutoTurnoverExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_turnover
*
* @mbg.generated
*/
List
<
DcAutoTurnoverWithBLOBs
>
selectByExampleWithBLOBs
(
DcAutoTurnoverExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_turnover
*
* @mbg.generated
*/
List
<
DcAutoTurnover
>
selectByExample
(
DcAutoTurnoverExample
example
);
...
...
@@ -70,7 +88,7 @@ public interface DcAutoTurnoverMapper {
*
* @mbg.generated
*/
DcAutoTurnover
selectByPrimaryKey
(
Integer
id
);
DcAutoTurnover
WithBLOBs
selectByPrimaryKey
(
Integer
id
);
/**
* This method was generated by MyBatis Generator.
...
...
@@ -78,7 +96,15 @@ public interface DcAutoTurnoverMapper {
*
* @mbg.generated
*/
int
updateByExampleSelective
(
@Param
(
"record"
)
DcAutoTurnover
record
,
@Param
(
"example"
)
DcAutoTurnoverExample
example
);
int
updateByExampleSelective
(
@Param
(
"record"
)
DcAutoTurnoverWithBLOBs
record
,
@Param
(
"example"
)
DcAutoTurnoverExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_turnover
*
* @mbg.generated
*/
int
updateByExampleWithBLOBs
(
@Param
(
"record"
)
DcAutoTurnoverWithBLOBs
record
,
@Param
(
"example"
)
DcAutoTurnoverExample
example
);
/**
* This method was generated by MyBatis Generator.
...
...
@@ -94,7 +120,15 @@ public interface DcAutoTurnoverMapper {
*
* @mbg.generated
*/
int
updateByPrimaryKeySelective
(
DcAutoTurnover
record
);
int
updateByPrimaryKeySelective
(
DcAutoTurnoverWithBLOBs
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_turnover
*
* @mbg.generated
*/
int
updateByPrimaryKeyWithBLOBs
(
DcAutoTurnoverWithBLOBs
record
);
/**
* This method was generated by MyBatis Generator.
...
...
@@ -120,7 +154,16 @@ public interface DcAutoTurnoverMapper {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int
upsertSelective
(
DcAutoTurnover
record
);
int
upsertSelective
(
DcAutoTurnoverWithBLOBs
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_turnover
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int
upsertWithBLOBs
(
DcAutoTurnoverWithBLOBs
record
);
void
truncateAutoInboundTable
();
...
...
@@ -135,5 +178,5 @@ public interface DcAutoTurnoverMapper {
void
truncateAutoExceptionTable
();
Integer
yesterdayStock
(
@Param
(
"bailun_sku"
)
String
bailun_sku
,
@Param
(
"warehouse_code"
)
String
warehouse_code
);
}
\ No newline at end of file
Integer
yesterdayStock
(
@Param
(
"bailun_sku"
)
String
bailun_sku
,
@Param
(
"warehouse_code"
)
String
warehouse_code
);
}
data-common/src/main/java/com/bailuntec/mapper/DcAutoTurnoverMapper.xml
View file @
dd7dc2f8
This diff is collapsed.
Click to expand it.
data-common/src/main/java/com/bailuntec/utils/SessionUtil.java
View file @
dd7dc2f8
package
com
.
bailuntec
.
utils
;
import
com.bailuntec.domain.constant.CommonConstant
;
import
com.baomidou.mybatisplus.core.MybatisSqlSessionFactoryBuilder
;
import
org.apache.ibatis.io.Resources
;
import
org.apache.ibatis.session.SqlSession
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.apache.ibatis.session.SqlSessionFactoryBuilder
;
import
java.io.Reader
;
...
...
@@ -13,7 +13,7 @@ public class SessionUtil {
private
static
final
ThreadLocal
<
SqlSession
>
threadLocal
=
new
ThreadLocal
<>();
private
static
final
ThreadLocal
<
SqlSession
>
threadLocalTransction
=
new
ThreadLocal
<>();
private
static
Reader
reader
=
null
;
private
static
SqlSessionFactoryBuilder
builder
=
null
;
private
static
Mybatis
SqlSessionFactoryBuilder
builder
=
null
;
private
static
SqlSessionFactory
factory
=
null
;
//不允许对该类进行new操作
...
...
@@ -25,7 +25,7 @@ public class SessionUtil {
//1.加载配置文件
reader
=
Resources
.
getResourceAsReader
(
CommonConstant
.
MYBATIS_CONFIG
);
//2.得到工厂的创建对象
builder
=
new
SqlSessionFactoryBuilder
();
builder
=
new
Mybatis
SqlSessionFactoryBuilder
();
//3.得到工厂对象
factory
=
builder
.
build
(
reader
);
}
catch
(
Exception
e
)
{
...
...
@@ -57,7 +57,7 @@ public class SessionUtil {
}
//关闭session
public
static
void
closeTranstionSession
()
{
public
static
void
closeTranstionSession
()
{
try
{
SqlSession
session
=
threadLocalTransction
.
get
();
if
(
session
!=
null
)
{
...
...
@@ -66,12 +66,12 @@ public class SessionUtil {
threadLocalTransction
.
set
(
null
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"MYSQL关闭Session异常"
,
e
);
throw
new
RuntimeException
(
"MYSQL关闭Session异常"
,
e
);
}
}
//关闭session
public
static
void
closeSession
()
{
public
static
void
closeSession
()
{
try
{
SqlSession
session
=
threadLocal
.
get
();
if
(
session
!=
null
)
{
...
...
@@ -80,7 +80,7 @@ public class SessionUtil {
threadLocal
.
set
(
null
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"MYSQL关闭Session异常"
,
e
);
throw
new
RuntimeException
(
"MYSQL关闭Session异常"
,
e
);
}
}
...
...
data-common/src/main/resources/init.properties
View file @
dd7dc2f8
table-name
=
dc_
client_api_log
table-name
=
dc_
auto_turnover
data-common/src/main/resources/mybatis-config.xml
View file @
dd7dc2f8
...
...
@@ -5,8 +5,8 @@
<configuration>
<!--<properties resource="db-tj.properties"/>-->
<!-- <properties resource="db-dev.properties"/>-->
<properties
resource=
"db-dev.properties"
/>
<!-- <properties resource="db-prod.properties"/>-->
<settings>
<setting
name=
"mapUnderscoreToCamelCase"
value=
"true"
/>
</settings>
...
...
data-finance/finance-balance-sheet/src/main/java/com/bailuntec/balancesheet/service/BalanceSheetService.java
View file @
dd7dc2f8
...
...
@@ -299,11 +299,7 @@ public class BalanceSheetService {
* 获取成品仓存货
*/
public
void
getInventoryBalance
(
Date
date
)
{
// 检验日期date的转人民币汇率是否存在,不存在则获取当前的汇率保存为日期date的汇率
Long
count
=
dcExchangeRateMapper
.
countLastDayExchageRate
(
date
);
if
(
count
==
0
)
{
getExchangeRate
(
date
);
}
// 货品库存
dcInventoryBalanceMapper
.
insertInventoryBalance
(
date
);
// 货品调拨在途
...
...
data-show/show-auto-turnover/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
View file @
dd7dc2f8
...
...
@@ -295,13 +295,13 @@ public class AutoTurnoverJob extends PointJob {
//记录时间
LocalDate
recordTime
=
LocalDate
.
now
();
DcAutoTurnoverMapper
dcAutoTurnoverMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcAutoTurnoverMapper
.
class
);
DcAutoTurnover
dcAutoTurnover
=
dcAutoTurnoverMapper
.
selectOneByExample
(
DcAutoTurnoverExample
.
newAndCreateCriteria
()
DcAutoTurnover
WithBLOBs
dcAutoTurnover
=
dcAutoTurnoverMapper
.
selectOneByExampleWithBLOBs
(
DcAutoTurnoverExample
.
newAndCreateCriteria
()
.
andBailunSkuEqualTo
(
bailunSku
)
.
andWarehouseCodeEqualTo
(
warehouseCode
)
.
example
());
if
(
dcAutoTurnover
==
null
)
{
dcAutoTurnover
=
new
DcAutoTurnover
();
dcAutoTurnover
=
new
DcAutoTurnover
WithBLOBs
();
}
dcAutoTurnover
.
setBailunSku
(
bailunSku
);
dcAutoTurnover
.
setWarehouseCode
(
warehouseCode
);
...
...
@@ -757,7 +757,7 @@ public class AutoTurnoverJob extends PointJob {
dcAutoTurnover
.
setQuantityPurchase
(
purchase
);
dcAutoTurnover
.
setQuantityTransfer
(
transfer
);
dcAutoTurnover
.
setQuantityOutStock
(
outStock
);
dcAutoTurnover
.
setStatus
(
forecastShortSupplyList
.
get
(
2
*
(
int
)
turnoverDays
).
intValue
()
>
0
?
1
:
0
);
dcAutoTurnover
.
setStatus
(
forecastShortSupplyList
.
get
(
2
*
turnoverDays
).
intValue
()
>
0
?
1
:
0
);
dcAutoTurnover
.
setTurnoverDays
(
turnoverDays
);
dcAutoTurnover
.
setQuantitySafeInventory
(
totalSafeInventory
);
dcAutoTurnover
.
setHqType
(
dcBaseWarehouse
.
getHqType
());
...
...
@@ -793,7 +793,7 @@ public class AutoTurnoverJob extends PointJob {
}
private
void
caculatePlatformAvgSales
(
DcAutoTurnover
dcAutoTurnover
)
{
private
void
caculatePlatformAvgSales
(
DcAutoTurnover
WithBLOBs
dcAutoTurnover
)
{
try
{
DcAutoSalesMapper
mapper
=
SessionUtil
.
getSession
().
getMapper
(
DcAutoSalesMapper
.
class
);
SalesVolumeAvgDTO
ebayAvgSales
=
mapper
.
getPlatformHistorySales
(
dcAutoTurnover
.
getBailunSku
(),
dcAutoTurnover
.
getWarehouseCode
(),
PlatformType
.
Ebay
.
value
());
...
...
@@ -856,7 +856,7 @@ public class AutoTurnoverJob extends PointJob {
}
}
private
boolean
actualForecastFluctuations
(
DcAutoTurnover
dcAutoTurnover
,
LocalDate
recordTime
,
List
<
BigDecimal
>
forecastSalesList
,
Integer
realInventory
,
BigDecimal
totalSafeInventory
,
Integer
outStock
,
DcAutoConfigSkuWarehouse
dcAutoConfigSkuWarehouse
,
BigDecimal
avgHistoryFourteendaySales
,
BigDecimal
avgHistoryThreedaySales
,
List
<
DcAutoForecastFluctuation
>
forecastFluctuationList
)
{
private
boolean
actualForecastFluctuations
(
DcAutoTurnover
WithBLOBs
dcAutoTurnover
,
LocalDate
recordTime
,
List
<
BigDecimal
>
forecastSalesList
,
Integer
realInventory
,
BigDecimal
totalSafeInventory
,
Integer
outStock
,
DcAutoConfigSkuWarehouse
dcAutoConfigSkuWarehouse
,
BigDecimal
avgHistoryFourteendaySales
,
BigDecimal
avgHistoryThreedaySales
,
List
<
DcAutoForecastFluctuation
>
forecastFluctuationList
)
{
boolean
hasMonitorFluctuation
=
false
;
//默认是停止了监控波动功能的
/*
* 这个if判断单纯是为了判断实际冗余,然后存一个表给别人用
...
...
@@ -921,7 +921,7 @@ public class AutoTurnoverJob extends PointJob {
DcAutoConfigSkuWarehouse
dcAutoConfigSkuWarehouse
,
DcBaseSku
turnoverSku
,
String
warehouseCode
,
DcAutoTurnover
dcAutoTurnover
,
DcAutoTurnover
WithBLOBs
dcAutoTurnover
,
BigDecimal
avgHistoryThreedaySales
,
List
<
DcAutoForecastFluctuation
>
forecastFluctuationList
,
List
<
BigDecimal
>
forecastShortSupplyList
,
...
...
@@ -1031,7 +1031,7 @@ public class AutoTurnoverJob extends PointJob {
}
}
private
Integer
getTurnoverDelivery
(
DcBaseSku
turnoverSku
,
DcBaseWarehouse
dcBaseWarehouse
,
DcAutoTurnover
dcAutoTurnover
,
DcAutoConfigDelivery
dcAutoConfigDelivery
,
DcAveragePurchase
dcAveragePurchase
,
DcAverageWarehouse
dcAverageWarehouse
)
{
private
Integer
getTurnoverDelivery
(
DcBaseSku
turnoverSku
,
DcBaseWarehouse
dcBaseWarehouse
,
DcAutoTurnover
WithBLOBs
dcAutoTurnover
,
DcAutoConfigDelivery
dcAutoConfigDelivery
,
DcAveragePurchase
dcAveragePurchase
,
DcAverageWarehouse
dcAverageWarehouse
)
{
/*
* 供应商交期
* 先取dc_average_purchase,如果平均交期没有
...
...
@@ -1156,7 +1156,7 @@ public class AutoTurnoverJob extends PointJob {
/**
* 预计入库
*/
private
void
ExpectedStorage
(
DcAutoConfigDelivery
dcAutoConfigDelivery
,
List
<
String
>
forecastInboundRelationList
,
Integer
purchase
,
Integer
transfer
,
LocalDate
recordTime
,
DcAutoTurnover
dcAutoTurnover
,
List
<
Integer
>
forecastPurchaseInboundList
,
List
<
Integer
>
forecastTransferInboundList
,
List
<
Integer
>
forecastInboundList
)
{
private
void
ExpectedStorage
(
DcAutoConfigDelivery
dcAutoConfigDelivery
,
List
<
String
>
forecastInboundRelationList
,
Integer
purchase
,
Integer
transfer
,
LocalDate
recordTime
,
DcAutoTurnover
WithBLOBs
dcAutoTurnover
,
List
<
Integer
>
forecastPurchaseInboundList
,
List
<
Integer
>
forecastTransferInboundList
,
List
<
Integer
>
forecastInboundList
)
{
/*
* 拿到预计到货时间在周转期内的采购单
* 采购系统的预计到货只是到货时间
...
...
@@ -1510,7 +1510,7 @@ public class AutoTurnoverJob extends PointJob {
}
private
BigDecimal
calculateSafeInventory
(
DcBaseSku
turnoverSku
,
String
bailunSku
,
String
warehouseCode
,
Integer
bailunFirstLevelCatagoryId
,
DcAutoSales
dcAutoSales
,
String
forecastSalesListJson
,
DcAutoTurnover
dcAutoTurnover
,
Map
<
String
,
BigDecimal
>
saveDaysMap
)
{
bailunFirstLevelCatagoryId
,
DcAutoSales
dcAutoSales
,
String
forecastSalesListJson
,
DcAutoTurnover
WithBLOBs
dcAutoTurnover
,
Map
<
String
,
BigDecimal
>
saveDaysMap
)
{
/*
* 先判断是否JIT 仓库是广州01 warehouse_code 且是那三个销售员 turnoversku
*
...
...
@@ -1623,7 +1623,7 @@ public class AutoTurnoverJob extends PointJob {
boolean
hasMonitorFluctuation
,
List
<
DcAutoForecastFluctuation
>
forecastFluctuationList
,
LocalDate
recordTime
,
DcAutoTurnover
dcAutoTurnover
,
DcAutoTurnover
WithBLOBs
dcAutoTurnover
,
Integer
turnoverDays
,
Integer
autoForecastDay
,
List
<
BigDecimal
>
forecastInventoryList
,
...
...
@@ -1876,7 +1876,7 @@ public class AutoTurnoverJob extends PointJob {
boolean
hasMonitorFluctuation
,
List
<
DcAutoForecastFluctuation
>
forecastFluctuationList
,
LocalDate
recordTime
,
DcAutoTurnover
dcAutoTurnover
,
DcAutoTurnover
WithBLOBs
dcAutoTurnover
,
Integer
turnoverDays
,
Integer
autoForecastDay
,
List
<
BigDecimal
>
forecastInventoryList
,
...
...
@@ -2355,7 +2355,7 @@ public class AutoTurnoverJob extends PointJob {
return
(
int
)
totalPage
;
}
public
BigDecimal
getSaveDays
(
DcAutoSales
dcAutoSales
,
DcAutoTurnover
dcAutoTurnover
,
String
bailunSku
,
String
buyerName
,
String
autoForecastDay
,
DcAutoStockUpRange
dcAutoStockUpRange
)
{
public
BigDecimal
getSaveDays
(
DcAutoSales
dcAutoSales
,
DcAutoTurnover
WithBLOBs
dcAutoTurnover
,
String
bailunSku
,
String
buyerName
,
String
autoForecastDay
,
DcAutoStockUpRange
dcAutoStockUpRange
)
{
List
<
Integer
>
historySalesList
=
JSON
.
parseObject
(
dcAutoSales
.
getHistorySalesDetails
(),
new
TypeReference
<
List
<
Integer
>>()
{
});
/*
...
...
data-show/show-auto-turnover/src/main/java/com/bailuntec/service/impl/AutoTurnoverServiceImpl.java
View file @
dd7dc2f8
package
com
.
bailuntec
.
service
.
impl
;
import
com.bailuntec.domain.entity.DcAutoSalesForecastConfig
;
import
com.bailuntec.domain.entity.DcAutoSalesForecastStageConfig
;
import
com.bailuntec.domain.entity.DcAutoTurnover
;
import
com.bailuntec.mapper.DcAutoSalesForecastConfigMapper
;
import
com.bailuntec.mapper.DcAutoSalesForecastStageConfigMapper
;
import
com.bailuntec.mapper.DcBaseOmsSkuMapper
;
import
com.bailuntec.service.AutoTurnoverService
;
...
...
@@ -39,6 +41,8 @@ public class AutoTurnoverServiceImpl implements AutoTurnoverService {
DcAutoSalesForecastStageConfigMapper
dcAutoSalesForecastStageConfigMapper
=
session
.
getMapper
(
DcAutoSalesForecastStageConfigMapper
.
class
);
DcBaseOmsSkuMapper
dcBaseOmsSkuMapper
=
session
.
getMapper
(
DcBaseOmsSkuMapper
.
class
);
DcAutoSalesForecastConfigMapper
dcAutoSalesForecastConfigMapper
=
session
.
getMapper
(
DcAutoSalesForecastConfigMapper
.
class
);
//命中的预测规则
DcAutoSalesForecastStageConfig
dcAutoSalesForecastStageConfig
=
dcAutoSalesForecastStageConfigMapper
.
selectMatchStage
(
dcAutoTurnover
.
getBailunSku
(),
dcAutoTurnover
.
getWarehouseCode
());
...
...
@@ -53,7 +57,11 @@ public class AutoTurnoverServiceImpl implements AutoTurnoverService {
if
(
dcAutoSalesForecastStageConfig
!=
null
)
{
DcAutoSalesForecastConfig
dcAutoSalesForecastConfig
=
dcAutoSalesForecastConfigMapper
.
selectById
(
dcAutoSalesForecastStageConfig
.
getConfigId
());
dcAutoTurnover
.
setDcAutoSalesForecastConfigId
(
dcAutoSalesForecastStageConfig
.
getConfigId
());
dcAutoTurnover
.
setDcAutoSalesForecastStageConfigId
(
dcAutoSalesForecastStageConfig
.
getId
());
dcAutoTurnover
.
setDcAutoSalesForecastTitle
(
dcAutoSalesForecastConfig
.
getTitle
());
log
.
info
(
"匹配到一条规则 id:{}"
,
dcAutoSalesForecastStageConfig
.
getConfigId
());
...
...
@@ -120,6 +128,8 @@ public class AutoTurnoverServiceImpl implements AutoTurnoverService {
log
.
info
(
"没有匹配销量预测规则,采用平均销量"
);
dcAutoTurnover
.
setDcAutoSalesForecastConfigId
(-
1
);
dcAutoTurnover
.
setDcAutoSalesForecastStageConfigId
(-
1
);
dcAutoTurnover
.
setDcAutoSalesForecastTitle
(
""
);
for
(
int
i
=
0
;
i
<
turnoverDays
;
i
++)
{
if
(
autoForecastDay
>=
forecastSalesDetails
.
size
())
{
...
...
data-show/show-auto-turnover/src/test/java/AutoTurnoverTest.java
View file @
dd7dc2f8
...
...
@@ -141,7 +141,7 @@ public class AutoTurnoverTest {
public
void
testXX
()
{
DcBaseStock
dcBaseStock
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseStockMapper
.
class
)
.
selectOneByExample
(
DcBaseStockExample
.
newAndCreateCriteria
()
.
andBailunSkuEqualTo
(
"
N-10ML-MX-TOP-JSP
"
)
.
andBailunSkuEqualTo
(
"
948906502
"
)
.
andWarehouseCodeEqualTo
(
"GZBLWH"
)
.
example
());
...
...
data-show/show-auto-turnover/src/test/java/com/bailuntec/job/AutoTurnoverJobTest.java
View file @
dd7dc2f8
...
...
@@ -95,8 +95,6 @@ public class AutoTurnoverJobTest {
}
@Test
public
void
syncIncrement
()
{
JobPointLog
jobPointLog
=
new
JobPointLog
();
...
...
@@ -338,6 +336,5 @@ public class AutoTurnoverJobTest {
log
.
error
(
"计算周转失败 :{}"
,
e
.
getMessage
(),
e
);
}
}
}
}
data-show/show-auto-turnover/src/test/java/com/bailuntec/service/impl/AutoTurnoverServiceImplTest.java
View file @
dd7dc2f8
package
com
.
bailuntec
.
service
.
impl
;
import
com.bailuntec.domain.entity.DcAutoTurnover
;
import
com.bailuntec.domain.entity.DcAutoTurnoverWithBLOBs
;
import
com.bailuntec.mapper.DcAutoTurnoverMapper
;
import
com.bailuntec.service.AutoTurnoverService
;
import
com.bailuntec.utils.SessionUtil
;
...
...
@@ -26,7 +27,7 @@ class AutoTurnoverServiceImplTest {
AutoTurnoverService
autoTurnoverService
=
new
AutoTurnoverServiceImpl
();
DcAutoTurnover
dcAutoTurnover
=
dcAutoTurnoverMapper
.
selectByPrimaryKey
(
58845
);
DcAutoTurnover
WithBLOBs
dcAutoTurnover
=
dcAutoTurnoverMapper
.
selectByPrimaryKey
(
58845
);
// autoTurnoverService.setAutoTurnoverSaleDetails(dcAutoTurnover,dcAutoTurnover.getTurnoverDays(),dcAutoTurnover.getTurnoverDays());
System
.
out
.
println
(
dcAutoTurnover
.
getSalesDetails
());
System
.
out
.
println
(
dcAutoTurnover
.
getSalesDetailsFormula
());
...
...
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