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
1f4321ae
Commit
1f4321ae
authored
Apr 23, 2019
by
wutong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动周转实际冗余和实际缺货保存数量
parent
5a11a8ea
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
221 additions
and
21 deletions
+221
-21
DcAutoForecastFluctuation.java
...om/bailuntec/domain/entity/DcAutoForecastFluctuation.java
+14
-1
DcAutoForecastFluctuationExample.java
...ntec/domain/example/DcAutoForecastFluctuationExample.java
+159
-0
AutoTurnoverJob.java
...over/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
+3
-0
DcAutoForecastFluctuationMapper.xml
.../com/bailuntec/mapper/DcAutoForecastFluctuationMapper.xml
+43
-18
AutoTurnoverTest.java
...ow/show-auto-turnover/src/test/java/AutoTurnoverTest.java
+1
-1
init.properties
mybatis-generator/src/main/resources/init.properties
+1
-1
No files found.
data-common/src/main/java/com/bailuntec/domain/entity/DcAutoForecastFluctuation.java
View file @
1f4321ae
...
...
@@ -153,6 +153,15 @@ public class DcAutoForecastFluctuation {
private
BigDecimal
avgSalesThree
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_auto_forecast_fluctuation.quantity
*
* @mbg.generated
*/
private
Integer
quantity
;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_forecast_fluctuation
*
...
...
@@ -180,6 +189,7 @@ public class DcAutoForecastFluctuation {
sb
.
append
(
", confirmTime="
).
append
(
confirmTime
);
sb
.
append
(
", type="
).
append
(
type
);
sb
.
append
(
", avgSalesThree="
).
append
(
avgSalesThree
);
sb
.
append
(
", quantity="
).
append
(
quantity
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
...
...
@@ -217,7 +227,8 @@ public class DcAutoForecastFluctuation {
&&
(
this
.
getHasConfirm
()
==
null
?
other
.
getHasConfirm
()
==
null
:
this
.
getHasConfirm
().
equals
(
other
.
getHasConfirm
()))
&&
(
this
.
getConfirmTime
()
==
null
?
other
.
getConfirmTime
()
==
null
:
this
.
getConfirmTime
().
equals
(
other
.
getConfirmTime
()))
&&
(
this
.
getType
()
==
null
?
other
.
getType
()
==
null
:
this
.
getType
().
equals
(
other
.
getType
()))
&&
(
this
.
getAvgSalesThree
()
==
null
?
other
.
getAvgSalesThree
()
==
null
:
this
.
getAvgSalesThree
().
equals
(
other
.
getAvgSalesThree
()));
&&
(
this
.
getAvgSalesThree
()
==
null
?
other
.
getAvgSalesThree
()
==
null
:
this
.
getAvgSalesThree
().
equals
(
other
.
getAvgSalesThree
()))
&&
(
this
.
getQuantity
()
==
null
?
other
.
getQuantity
()
==
null
:
this
.
getQuantity
().
equals
(
other
.
getQuantity
()));
}
/**
...
...
@@ -246,6 +257,7 @@ public class DcAutoForecastFluctuation {
result
=
prime
*
result
+
((
getConfirmTime
()
==
null
)
?
0
:
getConfirmTime
().
hashCode
());
result
=
prime
*
result
+
((
getType
()
==
null
)
?
0
:
getType
().
hashCode
());
result
=
prime
*
result
+
((
getAvgSalesThree
()
==
null
)
?
0
:
getAvgSalesThree
().
hashCode
());
result
=
prime
*
result
+
((
getQuantity
()
==
null
)
?
0
:
getQuantity
().
hashCode
());
return
result
;
}
}
\ No newline at end of file
data-common/src/main/java/com/bailuntec/domain/example/DcAutoForecastFluctuationExample.java
View file @
1f4321ae
...
...
@@ -220,6 +220,36 @@ public class DcAutoForecastFluctuationExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
DcAutoForecastFluctuationExample
when
(
boolean
condition
,
IExampleWhen
then
)
{
if
(
condition
)
{
then
.
example
(
this
);
}
return
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_forecast_fluctuation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
DcAutoForecastFluctuationExample
when
(
boolean
condition
,
IExampleWhen
then
,
IExampleWhen
otherwise
)
{
if
(
condition
)
{
then
.
example
(
this
);
}
else
{
otherwise
.
example
(
this
);
}
return
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_forecast_fluctuation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
void
setOffset
(
Integer
offset
)
{
this
.
offset
=
offset
;
}
...
...
@@ -1351,6 +1381,66 @@ public class DcAutoForecastFluctuationExample {
addCriterion
(
"avg_sales_three not between"
,
value1
,
value2
,
"avgSalesThree"
);
return
(
Criteria
)
this
;
}
public
Criteria
andQuantityIsNull
()
{
addCriterion
(
"quantity is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andQuantityIsNotNull
()
{
addCriterion
(
"quantity is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andQuantityEqualTo
(
Integer
value
)
{
addCriterion
(
"quantity ="
,
value
,
"quantity"
);
return
(
Criteria
)
this
;
}
public
Criteria
andQuantityNotEqualTo
(
Integer
value
)
{
addCriterion
(
"quantity <>"
,
value
,
"quantity"
);
return
(
Criteria
)
this
;
}
public
Criteria
andQuantityGreaterThan
(
Integer
value
)
{
addCriterion
(
"quantity >"
,
value
,
"quantity"
);
return
(
Criteria
)
this
;
}
public
Criteria
andQuantityGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"quantity >="
,
value
,
"quantity"
);
return
(
Criteria
)
this
;
}
public
Criteria
andQuantityLessThan
(
Integer
value
)
{
addCriterion
(
"quantity <"
,
value
,
"quantity"
);
return
(
Criteria
)
this
;
}
public
Criteria
andQuantityLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"quantity <="
,
value
,
"quantity"
);
return
(
Criteria
)
this
;
}
public
Criteria
andQuantityIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"quantity in"
,
values
,
"quantity"
);
return
(
Criteria
)
this
;
}
public
Criteria
andQuantityNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"quantity not in"
,
values
,
"quantity"
);
return
(
Criteria
)
this
;
}
public
Criteria
andQuantityBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"quantity between"
,
value1
,
value2
,
"quantity"
);
return
(
Criteria
)
this
;
}
public
Criteria
andQuantityNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"quantity not between"
,
value1
,
value2
,
"quantity"
);
return
(
Criteria
)
this
;
}
}
/**
...
...
@@ -1399,6 +1489,7 @@ public class DcAutoForecastFluctuationExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
@Deprecated
public
Criteria
andIf
(
boolean
ifAdd
,
ICriteriaAdd
add
)
{
if
(
ifAdd
)
{
add
.
add
(
this
);
...
...
@@ -1407,12 +1498,43 @@ public class DcAutoForecastFluctuationExample {
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_forecast_fluctuation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
when
(
boolean
condition
,
ICriteriaWhen
then
)
{
if
(
condition
)
{
then
.
criteria
(
this
);
}
return
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_forecast_fluctuation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
when
(
boolean
condition
,
ICriteriaWhen
then
,
ICriteriaWhen
otherwise
)
{
if
(
condition
)
{
then
.
criteria
(
this
);
}
else
{
otherwise
.
criteria
(
this
);
}
return
this
;
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table dc_auto_forecast_fluctuation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
@Deprecated
public
interface
ICriteriaAdd
{
/**
* This method was generated by MyBatis Generator.
...
...
@@ -1516,4 +1638,40 @@ public class DcAutoForecastFluctuationExample {
this
(
condition
,
value
,
secondValue
,
null
);
}
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table dc_auto_forecast_fluctuation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
interface
ICriteriaWhen
{
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_forecast_fluctuation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
void
criteria
(
Criteria
criteria
);
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table dc_auto_forecast_fluctuation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
interface
IExampleWhen
{
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_auto_forecast_fluctuation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
void
example
(
DcAutoForecastFluctuationExample
example
);
}
}
\ No newline at end of file
data-show/show-auto-turnover/src/main/java/com/bailuntec/job/AutoTurnoverJob.java
View file @
1f4321ae
...
...
@@ -555,12 +555,15 @@ public class AutoTurnoverJob extends PointJob {
dcAutoForecastFluctuationActual
=
new
DcAutoForecastFluctuation
();
//实际冗余
dcAutoForecastFluctuationActual
.
setType
(
3
);
float
v
=
realInventory
-
forecastSalesList
.
get
(
0
).
add
(
totalSafeInventory
).
floatValue
();
dcAutoForecastFluctuationActual
.
setQuantity
(
Math
.
round
(
v
));
}
if
(
outStock
>
0
)
{
dcAutoForecastFluctuationActual
=
new
DcAutoForecastFluctuation
();
//实际缺货
dcAutoForecastFluctuationActual
.
setType
(
1
);
dcAutoForecastFluctuationActual
.
setQuantity
(
outStock
);
}
if
(
dcAutoForecastFluctuationActual
!=
null
)
{
dcAutoForecastFluctuationActual
.
setAvgSalesThree
(
avgHistoryThreedaySales
);
...
...
data-show/show-auto-turnover/src/main/java/com/bailuntec/mapper/DcAutoForecastFluctuationMapper.xml
View file @
1f4321ae
...
...
@@ -22,6 +22,7 @@
<result
column=
"confirm_time"
jdbcType=
"TIMESTAMP"
property=
"confirmTime"
/>
<result
column=
"type"
jdbcType=
"TINYINT"
property=
"type"
/>
<result
column=
"avg_sales_three"
jdbcType=
"DECIMAL"
property=
"avgSalesThree"
/>
<result
column=
"quantity"
jdbcType=
"INTEGER"
property=
"quantity"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<!--
...
...
@@ -96,7 +97,7 @@
-->
id, gmt_create, gmt_modified, bailun_sku, warehouse_code, warehouse_name, start_time,
end_time, bl_operator, remark, has_solve, forecast_solve_time, has_confirm, confirm_time,
type, avg_sales_three
type, avg_sales_three
, quantity
</sql>
<select
id=
"selectByExample"
parameterType=
"com.bailuntec.domain.example.DcAutoForecastFluctuationExample"
resultMap=
"BaseResultMap"
>
<!--
...
...
@@ -162,13 +163,13 @@
start_time, end_time, bl_operator,
remark, has_solve, forecast_solve_time,
has_confirm, confirm_time, type,
avg_sales_three)
values (#{id,jdbcType=INTEGER}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP},
avg_sales_three
, quantity
)
values (#{id,jdbcType=INTEGER}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP},
#{bailunSku,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, #{warehouseName,jdbcType=VARCHAR},
#{startTime,jdbcType=DATE}, #{endTime,jdbcType=DATE}, #{blOperator,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{hasSolve,jdbcType=BIT}, #{forecastSolveTime,jdbcType=TIMESTAMP},
#{hasConfirm,jdbcType=BIT}, #{confirmTime,jdbcType=TIMESTAMP}, #{type,jdbcType=TINYINT},
#{avgSalesThree,jdbcType=DECIMAL})
#{remark,jdbcType=VARCHAR}, #{hasSolve,jdbcType=BIT}, #{forecastSolveTime,jdbcType=TIMESTAMP},
#{hasConfirm,jdbcType=BIT}, #{confirmTime,jdbcType=TIMESTAMP}, #{type,jdbcType=TINYINT},
#{avgSalesThree,jdbcType=DECIMAL}
, #{quantity,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.bailuntec.domain.entity.DcAutoForecastFluctuation"
>
<!--
...
...
@@ -225,6 +226,9 @@
<if
test=
"avgSalesThree != null"
>
avg_sales_three,
</if>
<if
test=
"quantity != null"
>
quantity,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
...
...
@@ -275,6 +279,9 @@
<if
test=
"avgSalesThree != null"
>
#{avgSalesThree,jdbcType=DECIMAL},
</if>
<if
test=
"quantity != null"
>
#{quantity,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.bailuntec.domain.example.DcAutoForecastFluctuationExample"
resultType=
"java.lang.Long"
>
...
...
@@ -342,6 +349,9 @@
<if
test=
"record.avgSalesThree != null"
>
avg_sales_three = #{record.avgSalesThree,jdbcType=DECIMAL},
</if>
<if
test=
"record.quantity != null"
>
quantity = #{record.quantity,jdbcType=INTEGER},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -368,7 +378,8 @@
has_confirm = #{record.hasConfirm,jdbcType=BIT},
confirm_time = #{record.confirmTime,jdbcType=TIMESTAMP},
type = #{record.type,jdbcType=TINYINT},
avg_sales_three = #{record.avgSalesThree,jdbcType=DECIMAL}
avg_sales_three = #{record.avgSalesThree,jdbcType=DECIMAL},
quantity = #{record.quantity,jdbcType=INTEGER}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -425,6 +436,9 @@
<if
test=
"avgSalesThree != null"
>
avg_sales_three = #{avgSalesThree,jdbcType=DECIMAL},
</if>
<if
test=
"quantity != null"
>
quantity = #{quantity,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
...
...
@@ -448,7 +462,8 @@
has_confirm = #{hasConfirm,jdbcType=BIT},
confirm_time = #{confirmTime,jdbcType=TIMESTAMP},
type = #{type,jdbcType=TINYINT},
avg_sales_three = #{avgSalesThree,jdbcType=DECIMAL}
avg_sales_three = #{avgSalesThree,jdbcType=DECIMAL},
quantity = #{quantity,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<insert
id=
"upsertSelective"
parameterType=
"com.bailuntec.domain.entity.DcAutoForecastFluctuation"
>
...
...
@@ -507,6 +522,9 @@
<if
test=
"avgSalesThree != null"
>
avg_sales_three,
</if>
<if
test=
"quantity != null"
>
quantity,
</if>
</trim>
values
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -558,6 +576,9 @@
<if
test=
"avgSalesThree != null"
>
#{avgSalesThree,jdbcType=DECIMAL},
</if>
<if
test=
"quantity != null"
>
#{quantity,jdbcType=INTEGER},
</if>
</trim>
on duplicate key update
<trim
suffixOverrides=
","
>
...
...
@@ -609,6 +630,9 @@
<if
test=
"avgSalesThree != null"
>
avg_sales_three = #{avgSalesThree,jdbcType=DECIMAL},
</if>
<if
test=
"quantity != null"
>
quantity = #{quantity,jdbcType=INTEGER},
</if>
</trim>
</insert>
<insert
id=
"upsert"
parameterType=
"com.bailuntec.domain.entity.DcAutoForecastFluctuation"
>
...
...
@@ -620,18 +644,18 @@
insert into dc_auto_forecast_fluctuation
(id, gmt_create, gmt_modified, bailun_sku, warehouse_code, warehouse_name, start_time,
end_time, bl_operator, remark, has_solve, forecast_solve_time, has_confirm, confirm_time,
type, avg_sales_three)
type, avg_sales_three
, quantity
)
values
(#{id,jdbcType=INTEGER}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP},
(#{id,jdbcType=INTEGER}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP},
#{bailunSku,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, #{warehouseName,jdbcType=VARCHAR},
#{startTime,jdbcType=DATE}, #{endTime,jdbcType=DATE}, #{blOperator,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{hasSolve,jdbcType=BIT}, #{forecastSolveTime,jdbcType=TIMESTAMP},
#{hasConfirm,jdbcType=BIT}, #{confirmTime,jdbcType=TIMESTAMP}, #{type,jdbcType=TINYINT},
#{avgSalesThree,jdbcType=DECIMAL})
#{remark,jdbcType=VARCHAR}, #{hasSolve,jdbcType=BIT}, #{forecastSolveTime,jdbcType=TIMESTAMP},
#{hasConfirm,jdbcType=BIT}, #{confirmTime,jdbcType=TIMESTAMP}, #{type,jdbcType=TINYINT},
#{avgSalesThree,jdbcType=DECIMAL}
, #{quantity,jdbcType=INTEGER}
)
on duplicate key update
id = #{id,jdbcType=INTEGER},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
bailun_sku = #{bailunSku,jdbcType=VARCHAR},
warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
warehouse_name = #{warehouseName,jdbcType=VARCHAR},
...
...
@@ -640,11 +664,12 @@
bl_operator = #{blOperator,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
has_solve = #{hasSolve,jdbcType=BIT},
forecast_solve_time = #{forecastSolveTime,jdbcType=TIMESTAMP},
forecast_solve_time = #{forecastSolveTime,jdbcType=TIMESTAMP},
has_confirm = #{hasConfirm,jdbcType=BIT},
confirm_time = #{confirmTime,jdbcType=TIMESTAMP},
confirm_time = #{confirmTime,jdbcType=TIMESTAMP},
type = #{type,jdbcType=TINYINT},
avg_sales_three = #{avgSalesThree,jdbcType=DECIMAL}
avg_sales_three = #{avgSalesThree,jdbcType=DECIMAL},
quantity = #{quantity,jdbcType=INTEGER}
</insert>
<select
id=
"selectOneByExample"
parameterType=
"com.bailuntec.domain.example.DcAutoForecastFluctuationExample"
resultMap=
"BaseResultMap"
>
<!--
...
...
data-show/show-auto-turnover/src/test/java/AutoTurnoverTest.java
View file @
1f4321ae
...
...
@@ -52,7 +52,7 @@ public class AutoTurnoverTest {
// dcBaseStock = mapper.selectOneByExample(DcBaseStockExample.newAndCreateCriteria().andBailunSkuEqualTo("322572421").andWarehouseCodeEqualTo("QYBLZZ").example());
// dcBaseStock = mapper.selectOneByExample(DcBaseStockExample.newAndCreateCriteria().andBailunSkuEqualTo("232232601").andWarehouseCodeEqualTo("CHUKFBA").example());
// dcBaseStock = mapper.selectOneByExample(DcBaseStockExample.newAndCreateCriteria().andBailunSkuEqualTo("213789601").andWarehouseCodeEqualTo("GZBLWH").example());
dcBaseStock
=
mapper
.
selectOneByExample
(
DcBaseStockExample
.
newAndCreateCriteria
().
andBailunSkuEqualTo
(
"
381757501"
).
andWarehouseCodeEqualTo
(
"GZBLWH
"
).
example
());
dcBaseStock
=
mapper
.
selectOneByExample
(
DcBaseStockExample
.
newAndCreateCriteria
().
andBailunSkuEqualTo
(
"
406585310"
).
andWarehouseCodeEqualTo
(
"QYBLZZ
"
).
example
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
...
...
mybatis-generator/src/main/resources/init.properties
View file @
1f4321ae
table-name
=
dc_auto_
config_safe_inventory
table-name
=
dc_auto_
forecast_fluctuation
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