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
7345390f
Commit
7345390f
authored
Apr 18, 2019
by
wutong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步WMS库存新添加多个字段
parent
28f61875
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
233 additions
and
93 deletions
+233
-93
WmsStockItem.java
...src/main/java/com/bailuntec/domain/pojo/WmsStockItem.java
+13
-0
WmsStockJob.java
...tock-wms/src/main/java/com/bailuntec/job/WmsStockJob.java
+5
-4
DcBaseStockMapper.java
...src/main/java/com/bailuntec/mapper/DcBaseStockMapper.java
+0
-3
DcBaseStockMapper.xml
.../src/main/java/com/bailuntec/mapper/DcBaseStockMapper.xml
+42
-85
DcBaseStock.java
...rc/main/java/com/bailuntec/domain/entity/DcBaseStock.java
+14
-1
DcBaseStockExample.java
...java/com/bailuntec/domain/example/DcBaseStockExample.java
+159
-0
No files found.
data-base/base-sync-stock-wms/src/main/java/com/bailuntec/domain/pojo/WmsStockItem.java
View file @
7345390f
...
@@ -15,12 +15,25 @@ public class WmsStockItem {
...
@@ -15,12 +15,25 @@ public class WmsStockItem {
private
String
skuTitle
;
private
String
skuTitle
;
@JSONField
(
name
=
"warehouseCode"
)
@JSONField
(
name
=
"warehouseCode"
)
private
String
warehouseCode
;
private
String
warehouseCode
;
//待上架库存
@JSONField
(
name
=
"pendingStock"
)
@JSONField
(
name
=
"pendingStock"
)
private
Integer
waitPutaway
;
private
Integer
waitPutaway
;
//占用库存
@JSONField
(
name
=
"reserveStock"
)
@JSONField
(
name
=
"reserveStock"
)
private
Integer
occupyStock
;
private
Integer
occupyStock
;
//可用库存
@JSONField
(
name
=
"availabelStock"
)
@JSONField
(
name
=
"availabelStock"
)
private
Integer
usableStock
;
private
Integer
usableStock
;
//在途库存
@JSONField
(
name
=
"inboundStock"
)
private
Integer
quantityTransit
;
//不可用库存
@JSONField
(
name
=
"unSellStock"
)
private
Integer
quantityFreeze
;
//已发货库存
@JSONField
(
name
=
"shippedStock"
)
private
Integer
shippedStock
;
@JSONField
(
name
=
"lastModificationTime"
)
@JSONField
(
name
=
"lastModificationTime"
)
private
LocalDateTime
updateTime
;
private
LocalDateTime
updateTime
;
}
}
data-base/base-sync-stock-wms/src/main/java/com/bailuntec/job/WmsStockJob.java
View file @
7345390f
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.bailuntec.domain.entity.DcBaseStock
;
import
com.bailuntec.domain.entity.DcBaseStock
;
import
com.bailuntec.domain.entity.JobPointLog
;
import
com.bailuntec.domain.entity.JobPointLog
;
import
com.bailuntec.domain.example.DcBaseStockExample
;
import
com.bailuntec.domain.pojo.*
;
import
com.bailuntec.domain.pojo.*
;
import
com.bailuntec.mapper.DcBaseStockMapper
;
import
com.bailuntec.mapper.DcBaseStockMapper
;
import
com.bailuntec.mapper.DcBaseWarehouseMapper
;
import
com.bailuntec.mapper.DcBaseWarehouseMapper
;
...
@@ -81,11 +82,12 @@ public class WmsStockJob extends PointJob {
...
@@ -81,11 +82,12 @@ public class WmsStockJob extends PointJob {
e
.
printStackTrace
();
e
.
printStackTrace
();
throw
new
RuntimeException
(
"WMS库存BeanUtils.copyProperties失败"
);
throw
new
RuntimeException
(
"WMS库存BeanUtils.copyProperties失败"
);
}
}
mapper
.
upsertSelective
(
dcBaseStock
);
int
i
=
mapper
.
updateByExampleSelective
(
dcBaseStock
,
DcBaseStockExample
.
newAndCreateCriteria
().
andBailunSkuEqualTo
(
dcBaseStock
.
getBailunSku
()).
andWarehouseCodeEqualTo
(
dcBaseStock
.
getWarehouseCode
()).
example
());
SessionUtil
.
getSession
().
commit
();
if
(
i
==
0
)
{
mapper
.
insertSelective
(
dcBaseStock
);
}
});
});
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"MYBATIS操作DB失败"
,
e
);
throw
new
RuntimeException
(
"MYBATIS操作DB失败"
,
e
);
}
finally
{
}
finally
{
SessionUtil
.
closeSession
();
SessionUtil
.
closeSession
();
...
@@ -99,7 +101,6 @@ public class WmsStockJob extends PointJob {
...
@@ -99,7 +101,6 @@ public class WmsStockJob extends PointJob {
}
}
jobPointLog
.
setPageIndex
(
jobPointLog
.
getPageIndex
()
+
1
);
jobPointLog
.
setPageIndex
(
jobPointLog
.
getPageIndex
()
+
1
);
}
while
(
jobPointLog
.
getPageIndex
()
<=
totalPage
);
}
while
(
jobPointLog
.
getPageIndex
()
<=
totalPage
);
if
(
jobPointLog
.
getPageIndex
()
>
totalPage
)
jobPointLog
.
setPageIndex
(
1
);
jobPointLog
.
setStartTime
(
now
);
jobPointLog
.
setStartTime
(
now
);
jobPointLog
.
setEndTime
(
LocalDateTime
.
now
());
jobPointLog
.
setEndTime
(
LocalDateTime
.
now
());
}
}
...
...
data-base/base-sync-stock-wms/src/main/java/com/bailuntec/mapper/DcBaseStockMapper.java
View file @
7345390f
...
@@ -121,6 +121,4 @@ public interface DcBaseStockMapper {
...
@@ -121,6 +121,4 @@ public interface DcBaseStockMapper {
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
*/
int
upsertSelective
(
DcBaseStock
record
);
int
upsertSelective
(
DcBaseStock
record
);
void
insertDailyStock
();
}
}
\ No newline at end of file
data-base/base-sync-stock-wms/src/main/java/com/bailuntec/mapper/DcBaseStockMapper.xml
View file @
7345390f
This diff is collapsed.
Click to expand it.
data-common/src/main/java/com/bailuntec/domain/entity/DcBaseStock.java
View file @
7345390f
...
@@ -295,6 +295,15 @@ public class DcBaseStock {
...
@@ -295,6 +295,15 @@ public class DcBaseStock {
private
LocalDateTime
updateTime
;
private
LocalDateTime
updateTime
;
/**
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_stock.shipped_stock
*
* @mbg.generated
*/
private
Integer
shippedStock
;
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_stock
* This method corresponds to the database table dc_base_stock
*
*
...
@@ -338,6 +347,7 @@ public class DcBaseStock {
...
@@ -338,6 +347,7 @@ public class DcBaseStock {
sb
.
append
(
", gmtModified="
).
append
(
gmtModified
);
sb
.
append
(
", gmtModified="
).
append
(
gmtModified
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", shippedStock="
).
append
(
shippedStock
);
sb
.
append
(
"]"
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
return
sb
.
toString
();
}
}
...
@@ -391,7 +401,8 @@ public class DcBaseStock {
...
@@ -391,7 +401,8 @@ public class DcBaseStock {
&&
(
this
.
getGmtCreate
()
==
null
?
other
.
getGmtCreate
()
==
null
:
this
.
getGmtCreate
().
equals
(
other
.
getGmtCreate
()))
&&
(
this
.
getGmtCreate
()
==
null
?
other
.
getGmtCreate
()
==
null
:
this
.
getGmtCreate
().
equals
(
other
.
getGmtCreate
()))
&&
(
this
.
getGmtModified
()
==
null
?
other
.
getGmtModified
()
==
null
:
this
.
getGmtModified
().
equals
(
other
.
getGmtModified
()))
&&
(
this
.
getGmtModified
()
==
null
?
other
.
getGmtModified
()
==
null
:
this
.
getGmtModified
().
equals
(
other
.
getGmtModified
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()));
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()))
&&
(
this
.
getShippedStock
()
==
null
?
other
.
getShippedStock
()
==
null
:
this
.
getShippedStock
().
equals
(
other
.
getShippedStock
()));
}
}
/**
/**
...
@@ -436,6 +447,7 @@ public class DcBaseStock {
...
@@ -436,6 +447,7 @@ public class DcBaseStock {
result
=
prime
*
result
+
((
getGmtModified
()
==
null
)
?
0
:
getGmtModified
().
hashCode
());
result
=
prime
*
result
+
((
getGmtModified
()
==
null
)
?
0
:
getGmtModified
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getShippedStock
()
==
null
)
?
0
:
getShippedStock
().
hashCode
());
return
result
;
return
result
;
}
}
}
}
\ No newline at end of file
data-common/src/main/java/com/bailuntec/domain/example/DcBaseStockExample.java
View file @
7345390f
...
@@ -218,6 +218,36 @@ public class DcBaseStockExample {
...
@@ -218,6 +218,36 @@ public class DcBaseStockExample {
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
*/
public
DcBaseStockExample
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_base_stock
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
DcBaseStockExample
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_base_stock
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
void
setOffset
(
Integer
offset
)
{
public
void
setOffset
(
Integer
offset
)
{
this
.
offset
=
offset
;
this
.
offset
=
offset
;
}
}
...
@@ -2289,6 +2319,66 @@ public class DcBaseStockExample {
...
@@ -2289,6 +2319,66 @@ public class DcBaseStockExample {
addCriterion
(
"update_time not between"
,
value1
,
value2
,
"updateTime"
);
addCriterion
(
"update_time not between"
,
value1
,
value2
,
"updateTime"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andShippedStockIsNull
()
{
addCriterion
(
"shipped_stock is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andShippedStockIsNotNull
()
{
addCriterion
(
"shipped_stock is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andShippedStockEqualTo
(
Integer
value
)
{
addCriterion
(
"shipped_stock ="
,
value
,
"shippedStock"
);
return
(
Criteria
)
this
;
}
public
Criteria
andShippedStockNotEqualTo
(
Integer
value
)
{
addCriterion
(
"shipped_stock <>"
,
value
,
"shippedStock"
);
return
(
Criteria
)
this
;
}
public
Criteria
andShippedStockGreaterThan
(
Integer
value
)
{
addCriterion
(
"shipped_stock >"
,
value
,
"shippedStock"
);
return
(
Criteria
)
this
;
}
public
Criteria
andShippedStockGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"shipped_stock >="
,
value
,
"shippedStock"
);
return
(
Criteria
)
this
;
}
public
Criteria
andShippedStockLessThan
(
Integer
value
)
{
addCriterion
(
"shipped_stock <"
,
value
,
"shippedStock"
);
return
(
Criteria
)
this
;
}
public
Criteria
andShippedStockLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"shipped_stock <="
,
value
,
"shippedStock"
);
return
(
Criteria
)
this
;
}
public
Criteria
andShippedStockIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"shipped_stock in"
,
values
,
"shippedStock"
);
return
(
Criteria
)
this
;
}
public
Criteria
andShippedStockNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"shipped_stock not in"
,
values
,
"shippedStock"
);
return
(
Criteria
)
this
;
}
public
Criteria
andShippedStockBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"shipped_stock between"
,
value1
,
value2
,
"shippedStock"
);
return
(
Criteria
)
this
;
}
public
Criteria
andShippedStockNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"shipped_stock not between"
,
value1
,
value2
,
"shippedStock"
);
return
(
Criteria
)
this
;
}
}
}
/**
/**
...
@@ -2337,6 +2427,7 @@ public class DcBaseStockExample {
...
@@ -2337,6 +2427,7 @@ public class DcBaseStockExample {
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
*/
@Deprecated
public
Criteria
andIf
(
boolean
ifAdd
,
ICriteriaAdd
add
)
{
public
Criteria
andIf
(
boolean
ifAdd
,
ICriteriaAdd
add
)
{
if
(
ifAdd
)
{
if
(
ifAdd
)
{
add
.
add
(
this
);
add
.
add
(
this
);
...
@@ -2345,12 +2436,43 @@ public class DcBaseStockExample {
...
@@ -2345,12 +2436,43 @@ public class DcBaseStockExample {
}
}
/**
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_stock
*
* @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_base_stock
*
* @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 was generated by MyBatis Generator.
* This interface corresponds to the database table dc_base_stock
* This interface corresponds to the database table dc_base_stock
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
*/
@Deprecated
public
interface
ICriteriaAdd
{
public
interface
ICriteriaAdd
{
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
...
@@ -2454,4 +2576,40 @@ public class DcBaseStockExample {
...
@@ -2454,4 +2576,40 @@ public class DcBaseStockExample {
this
(
condition
,
value
,
secondValue
,
null
);
this
(
condition
,
value
,
secondValue
,
null
);
}
}
}
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table dc_base_stock
*
* @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_base_stock
*
* @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_base_stock
*
* @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_base_stock
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
void
example
(
DcBaseStockExample
example
);
}
}
}
\ No newline at end of file
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