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
4304a011
Commit
4304a011
authored
Nov 15, 2019
by
yinyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
周转销量大于过去7天 50%权重 14天50%权重取7、14平均销量加配置增量百分比
parent
1b9affdf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
246 additions
and
3 deletions
+246
-3
DcAutoUprushConfig.java
.../java/com/bailuntec/domain/entity/DcAutoUprushConfig.java
+94
-0
DcAutoUprushConfigExample.java
...m/bailuntec/domain/example/DcAutoUprushConfigExample.java
+0
-0
DcAutoSalesMapper.java
...src/main/java/com/bailuntec/mapper/DcAutoSalesMapper.java
+8
-1
DcAutoSalesMapper.xml
.../src/main/java/com/bailuntec/mapper/DcAutoSalesMapper.xml
+0
-0
DcAutoUprushConfigMapper.java
...n/java/com/bailuntec/mapper/DcAutoUprushConfigMapper.java
+125
-0
DcAutoUprushConfigMapper.xml
...in/java/com/bailuntec/mapper/DcAutoUprushConfigMapper.xml
+0
-0
AutoTurnoverJob.java
...over/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
+19
-2
No files found.
data-common/src/main/java/com/bailuntec/domain/entity/DcAutoUprushConfig.java
0 → 100644
View file @
4304a011
package
com
.
bailuntec
.
domain
.
entity
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
public
class
DcAutoUprushConfig
{
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_auto_uprush_config.id
*
* @mbg.generated
*/
private
Integer
id
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_auto_uprush_config.warehouse_code
*
* @mbg.generated
*/
private
String
warehouseCode
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_auto_uprush_config.percentage
*
* @mbg.generated
*/
private
BigDecimal
percentage
;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
*/
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getClass
().
getSimpleName
());
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", warehouseCode="
).
append
(
warehouseCode
);
sb
.
append
(
", percentage="
).
append
(
percentage
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
*/
@Override
public
boolean
equals
(
Object
that
)
{
if
(
this
==
that
)
{
return
true
;
}
if
(
that
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
that
.
getClass
())
{
return
false
;
}
DcAutoUprushConfig
other
=
(
DcAutoUprushConfig
)
that
;
return
(
this
.
getId
()
==
null
?
other
.
getId
()
==
null
:
this
.
getId
().
equals
(
other
.
getId
()))
&&
(
this
.
getWarehouseCode
()
==
null
?
other
.
getWarehouseCode
()
==
null
:
this
.
getWarehouseCode
().
equals
(
other
.
getWarehouseCode
()))
&&
(
this
.
getPercentage
()
==
null
?
other
.
getPercentage
()
==
null
:
this
.
getPercentage
().
equals
(
other
.
getPercentage
()));
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
*/
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
result
=
prime
*
result
+
((
getId
()
==
null
)
?
0
:
getId
().
hashCode
());
result
=
prime
*
result
+
((
getWarehouseCode
()
==
null
)
?
0
:
getWarehouseCode
().
hashCode
());
result
=
prime
*
result
+
((
getPercentage
()
==
null
)
?
0
:
getPercentage
().
hashCode
());
return
result
;
}
}
\ No newline at end of file
data-common/src/main/java/com/bailuntec/domain/example/DcAutoUprushConfigExample.java
0 → 100644
View file @
4304a011
This diff is collapsed.
Click to expand it.
data-common/src/main/java/com/bailuntec/mapper/DcAutoSalesMapper.java
View file @
4304a011
...
@@ -7,7 +7,9 @@ import com.bailuntec.domain.entity.DcAutoTurnover;
...
@@ -7,7 +7,9 @@ import com.bailuntec.domain.entity.DcAutoTurnover;
import
com.bailuntec.domain.example.DcAutoSalesExample
;
import
com.bailuntec.domain.example.DcAutoSalesExample
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
public
interface
DcAutoSalesMapper
{
public
interface
DcAutoSalesMapper
{
/**
/**
...
@@ -125,7 +127,11 @@ public interface DcAutoSalesMapper {
...
@@ -125,7 +127,11 @@ public interface DcAutoSalesMapper {
*/
*/
int
upsertSelective
(
DcAutoSales
record
);
int
upsertSelective
(
DcAutoSales
record
);
SalesVolumeDTO
getSalesVolumeDTO
(
@Param
(
"queryTime"
)
String
queryTime
,
@Param
(
"bailunSku"
)
String
bailunSku
,
@Param
(
"warehouseCode"
)
String
warehouseCode
);
Map
<
String
,
BigDecimal
>
getSalesAvg
(
@Param
(
"queryTime"
)
String
queryTime
,
@Param
(
"bailunSku"
)
String
bailunSku
,
@Param
(
"warehouseCode"
)
String
warehouseCode
);
SalesVolumeDTO
getSalesVolumeDTONoCompare
(
@Param
(
"queryTime"
)
String
queryTime
,
@Param
(
"bailunSku"
)
String
bailunSku
,
@Param
(
"warehouseCode"
)
String
warehouseCode
);
SalesVolumeDTO
getSalesVolumeDTO
(
@Param
(
"queryTime"
)
String
queryTime
,
@Param
(
"bailunSku"
)
String
bailunSku
,
@Param
(
"warehouseCode"
)
String
warehouseCode
,
@Param
(
"compareSales"
)
BigDecimal
compareSales
);
SalesVolumeAvgDTO
getPlatformHistorySales
(
@Param
(
"bailunSku"
)
String
bailunSku
,
@Param
(
"warehouseCode"
)
String
warehouseCode
,
@Param
(
"platform"
)
String
platform
);
SalesVolumeAvgDTO
getPlatformHistorySales
(
@Param
(
"bailunSku"
)
String
bailunSku
,
@Param
(
"warehouseCode"
)
String
warehouseCode
,
@Param
(
"platform"
)
String
platform
);
}
}
\ No newline at end of file
data-common/src/main/java/com/bailuntec/mapper/DcAutoSalesMapper.xml
View file @
4304a011
This diff is collapsed.
Click to expand it.
data-common/src/main/java/com/bailuntec/mapper/DcAutoUprushConfigMapper.java
0 → 100644
View file @
4304a011
package
com
.
bailuntec
.
mapper
;
import
com.bailuntec.domain.entity.DcAutoUprushConfig
;
import
com.bailuntec.domain.example.DcAutoUprushConfigExample
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
DcAutoUprushConfigMapper
{
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
*/
long
countByExample
(
DcAutoUprushConfigExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
*/
int
deleteByExample
(
DcAutoUprushConfigExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
*/
int
deleteByPrimaryKey
(
Integer
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
*/
int
insert
(
DcAutoUprushConfig
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
*/
int
insertSelective
(
DcAutoUprushConfig
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DcAutoUprushConfig
selectOneByExample
(
DcAutoUprushConfigExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
*/
List
<
DcAutoUprushConfig
>
selectByExample
(
DcAutoUprushConfigExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
*/
DcAutoUprushConfig
selectByPrimaryKey
(
Integer
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
*/
int
updateByExampleSelective
(
@Param
(
"record"
)
DcAutoUprushConfig
record
,
@Param
(
"example"
)
DcAutoUprushConfigExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
*/
int
updateByExample
(
@Param
(
"record"
)
DcAutoUprushConfig
record
,
@Param
(
"example"
)
DcAutoUprushConfigExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
*/
int
updateByPrimaryKeySelective
(
DcAutoUprushConfig
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
*/
int
updateByPrimaryKey
(
DcAutoUprushConfig
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int
upsert
(
DcAutoUprushConfig
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_uprush_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int
upsertSelective
(
DcAutoUprushConfig
record
);
}
\ No newline at end of file
data-common/src/main/java/com/bailuntec/mapper/DcAutoUprushConfigMapper.xml
0 → 100644
View file @
4304a011
This diff is collapsed.
Click to expand it.
data-show/show-auto-turnover/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
View file @
4304a011
...
@@ -145,8 +145,25 @@ public class AutoTurnoverJob extends PointJob {
...
@@ -145,8 +145,25 @@ public class AutoTurnoverJob extends PointJob {
String
warehouseCode
=
dcBaseStock
.
getWarehouseCode
();
String
warehouseCode
=
dcBaseStock
.
getWarehouseCode
();
DcAutoSales
dcAutoSales
=
null
;
DcAutoSales
dcAutoSales
=
null
;
try
{
try
{
DcAutoSalesMapper
autoSalesMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcAutoSalesMapper
.
class
);
BigDecimal
incrementalRatio
=
BigDecimal
.
ONE
;
SalesVolumeDTO
salesVolumeDTO
=
autoSalesMapper
.
getSalesVolumeDTO
(
queryTime
,
bailunSku
,
warehouseCode
);
BigDecimal
compareSales
=
BigDecimal
.
ZERO
;
DcAutoSalesMapper
autoSalesMapper
=
null
;
SalesVolumeDTO
salesVolumeDTO
=
null
;
autoSalesMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcAutoSalesMapper
.
class
);
Map
<
String
,
BigDecimal
>
map
=
autoSalesMapper
.
getSalesAvg
(
queryTime
,
bailunSku
,
warehouseCode
);
DcAutoUprushConfigMapper
dcAutoUprushConfigMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcAutoUprushConfigMapper
.
class
);
DcAutoUprushConfig
dcAutoUprushConfig
=
dcAutoUprushConfigMapper
.
selectOneByExample
(
DcAutoUprushConfigExample
.
newAndCreateCriteria
().
andWarehouseCodeEqualTo
(
warehouseCode
).
example
());
if
(
dcAutoUprushConfig
!=
null
&&
map
!=
null
)
{
incrementalRatio
=
incrementalRatio
.
add
(
dcAutoUprushConfig
.
getPercentage
());
compareSales
=
(
map
.
get
(
"seven_sales"
).
add
(
map
.
get
(
"fourteen_sales"
))).
divide
(
BigDecimal
.
valueOf
(
2
),
RoundingMode
.
HALF_EVEN
).
multiply
(
incrementalRatio
);
}
autoSalesMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcAutoSalesMapper
.
class
);
if
(
compareSales
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
{
salesVolumeDTO
=
autoSalesMapper
.
getSalesVolumeDTONoCompare
(
queryTime
,
bailunSku
,
warehouseCode
);
}
else
{
salesVolumeDTO
=
autoSalesMapper
.
getSalesVolumeDTO
(
queryTime
,
bailunSku
,
warehouseCode
,
compareSales
);
}
if
(
StringUtils
.
isEmpty
(
salesVolumeDTO
.
getHistorySales
().
trim
()))
{
if
(
StringUtils
.
isEmpty
(
salesVolumeDTO
.
getHistorySales
().
trim
()))
{
DcAutoSalesMapper
dcAutoSalesMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcAutoSalesMapper
.
class
);
DcAutoSalesMapper
dcAutoSalesMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcAutoSalesMapper
.
class
);
dcAutoSales
=
new
DcAutoSales
(
bailunSku
,
warehouseCode
);
dcAutoSales
=
new
DcAutoSales
(
bailunSku
,
warehouseCode
);
...
...
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