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
302aefe3
Commit
302aefe3
authored
Sep 04, 2019
by
yinyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
半成品订单以sku维度同步
parent
4236061d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
28 deletions
+97
-28
SemiOrderResultInfo.java
...n/java/com/bailuntec/domain/pojo/SemiOrderResultInfo.java
+3
-1
SemiOrderSyncJob.java
...der/src/main/java/com/bailuntec/job/SemiOrderSyncJob.java
+8
-23
const.properties
.../base-sync-semi-order/src/main/resources/const.properties
+2
-2
DcSemiOrder.java
...rc/main/java/com/bailuntec/domain/entity/DcSemiOrder.java
+84
-2
DcSemiOrderExample.java
...java/com/bailuntec/domain/example/DcSemiOrderExample.java
+0
-0
DcSemiOrderMapper.xml
.../src/main/java/com/bailuntec/mapper/DcSemiOrderMapper.xml
+0
-0
No files found.
data-base/base-sync-semi-order/src/main/java/com/bailuntec/domain/pojo/SemiOrderResultInfo.java
View file @
302aefe3
...
@@ -4,10 +4,12 @@ import com.bailuntec.domain.entity.DcBaseFinancePaypal;
...
@@ -4,10 +4,12 @@ import com.bailuntec.domain.entity.DcBaseFinancePaypal;
import
com.bailuntec.domain.entity.DcSemiOrder
;
import
com.bailuntec.domain.entity.DcSemiOrder
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.List
;
@Data
@Data
public
class
SemiOrderResultInfo
{
public
class
SemiOrderResultInfo
{
private
Boolean
success
;
private
Boolean
success
;
private
ResultData
<
DcSemiOrder
>
data
;
private
List
<
DcSemiOrder
>
data
;
}
}
data-base/base-sync-semi-order/src/main/java/com/bailuntec/job/SemiOrderSyncJob.java
View file @
302aefe3
...
@@ -23,6 +23,7 @@ import java.io.IOException;
...
@@ -23,6 +23,7 @@ import java.io.IOException;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
@Slf4j
@Slf4j
public
class
SemiOrderSyncJob
extends
PointJob
{
public
class
SemiOrderSyncJob
extends
PointJob
{
...
@@ -57,18 +58,14 @@ public class SemiOrderSyncJob extends PointJob {
...
@@ -57,18 +58,14 @@ public class SemiOrderSyncJob extends PointJob {
if
(
StringUtils
.
isNoneBlank
(
palResultStr
))
{
if
(
StringUtils
.
isNoneBlank
(
palResultStr
))
{
SemiOrderResultInfo
palResultRoot
=
JSON
.
parseObject
(
palResultStr
,
SemiOrderResultInfo
.
class
);
SemiOrderResultInfo
palResultRoot
=
JSON
.
parseObject
(
palResultStr
,
SemiOrderResultInfo
.
class
);
if
(
palResultRoot
!=
null
&&
palResultRoot
.
getSuccess
().
booleanValue
())
{
if
(
palResultRoot
!=
null
&&
palResultRoot
.
getSuccess
().
booleanValue
())
{
ResultData
<
DcSemiOrder
>
resultData
=
palResultRoot
.
getData
();
List
<
DcSemiOrder
>
resultData
=
palResultRoot
.
getData
();
if
(
jobPointLog
.
getPageIndex
().
equals
(
0
))
{
if
(
resultData
!=
null
&&
resultData
.
size
()
>
0
)
{
jobPointLog
.
setPageIndex
(
resultData
.
getTotalPages
()
+
1
);
for
(
DcSemiOrder
semiOrder
:
resultData
)
{
}
if
(
resultData
.
getItems
()
!=
null
&&
resultData
.
getItems
().
size
()
>
0
)
{
for
(
DcSemiOrder
semiOrder
:
resultData
.
getItems
())
{
semiOrder
.
setId
(
null
);
DcSemiOrderMapper
mapper
=
SessionUtil
.
getSession
().
getMapper
(
DcSemiOrderMapper
.
class
);
DcSemiOrderMapper
mapper
=
SessionUtil
.
getSession
().
getMapper
(
DcSemiOrderMapper
.
class
);
mapper
.
upsertSelective
(
semiOrder
);
mapper
.
upsertSelective
(
semiOrder
);
}
}
}
else
{
break
;
}
}
}
else
{
}
else
{
throw
new
RuntimeException
(
"调用流水接口同步百伦流水失败, 响应200, 请求参数"
+
map
.
toString
());
throw
new
RuntimeException
(
"调用流水接口同步百伦流水失败, 响应200, 请求参数"
+
map
.
toString
());
...
@@ -76,22 +73,10 @@ public class SemiOrderSyncJob extends PointJob {
...
@@ -76,22 +73,10 @@ public class SemiOrderSyncJob extends PointJob {
}
else
{
}
else
{
throw
new
RuntimeException
(
"调用流水接口同步百伦流水失败, 响应为null, 请求参数"
+
map
.
toString
());
throw
new
RuntimeException
(
"调用流水接口同步百伦流水失败, 响应为null, 请求参数"
+
map
.
toString
());
}
}
if
(
jobPointLog
.
getPageIndex
()
%
10
==
0
)
{
jobPointLog
.
setPageIndex
(
jobPointLog
.
getPageIndex
()
+
1
);
try
{
}
while
(
true
);
JobPointLogMapper
mapper
=
SessionUtil
.
getSession
().
getMapper
(
JobPointLogMapper
.
class
);
mapper
.
upsertSelective
(
jobPointLog
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"Mybatis操作DB插入任务记录失败"
,
e
);
}
finally
{
SessionUtil
.
closeSession
();
}
}
jobPointLog
.
setPageIndex
(
jobPointLog
.
getPageIndex
()
-
1
);
}
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-semi-order/src/main/resources/const.properties
View file @
302aefe3
SEMI_ORDER_URL
=
http://api.mjplan.bailuntec.com/api/applyorderlist
SEMI_ORDER_URL
=
http://mjzz.bailuntec.com/api/ApiOrderApply
\ No newline at end of file
data-common/src/main/java/com/bailuntec/domain/entity/DcSemiOrder.java
View file @
302aefe3
package
com
.
bailuntec
.
domain
.
entity
;
package
com
.
bailuntec
.
domain
.
entity
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
lombok.Data
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -209,11 +208,73 @@ public class DcSemiOrder {
...
@@ -209,11 +208,73 @@ public class DcSemiOrder {
/**
/**
*
*
* This field was generated by MyBatis Generator.
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_order.warehouse_id
*
* @mbg.generated
*/
private
Integer
warehouseId
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_order.last_update_date
*
* @mbg.generated
*/
private
LocalDateTime
lastUpdateDate
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_order.sku_quantity
*
* @mbg.generated
*/
private
BigDecimal
skuQuantity
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_order.sku_unit_cost
*
* @mbg.generated
*/
private
BigDecimal
skuUnitCost
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_order.sku_unit_price
*
* @mbg.generated
*/
private
BigDecimal
skuUnitPrice
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_order.sku
*
* @mbg.generated
*/
private
String
sku
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_order.warehouse_name
*
* @mbg.generated
*/
private
String
warehouseName
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_order.semi_order_id
* This field corresponds to the database column dc_semi_order.semi_order_id
*
*
* @mbg.generated
* @mbg.generated
*/
*/
@JSONField
(
name
=
"ID"
)
private
Integer
semiOrderId
;
private
Integer
semiOrderId
;
/**
/**
...
@@ -250,6 +311,13 @@ public class DcSemiOrder {
...
@@ -250,6 +311,13 @@ public class DcSemiOrder {
sb
.
append
(
", originalQuantity="
).
append
(
originalQuantity
);
sb
.
append
(
", originalQuantity="
).
append
(
originalQuantity
);
sb
.
append
(
", toalCostRecord="
).
append
(
toalCostRecord
);
sb
.
append
(
", toalCostRecord="
).
append
(
toalCostRecord
);
sb
.
append
(
", toalPriceRecord="
).
append
(
toalPriceRecord
);
sb
.
append
(
", toalPriceRecord="
).
append
(
toalPriceRecord
);
sb
.
append
(
", warehouseId="
).
append
(
warehouseId
);
sb
.
append
(
", lastUpdateDate="
).
append
(
lastUpdateDate
);
sb
.
append
(
", skuQuantity="
).
append
(
skuQuantity
);
sb
.
append
(
", skuUnitCost="
).
append
(
skuUnitCost
);
sb
.
append
(
", skuUnitPrice="
).
append
(
skuUnitPrice
);
sb
.
append
(
", sku="
).
append
(
sku
);
sb
.
append
(
", warehouseName="
).
append
(
warehouseName
);
sb
.
append
(
", semiOrderId="
).
append
(
semiOrderId
);
sb
.
append
(
", semiOrderId="
).
append
(
semiOrderId
);
sb
.
append
(
"]"
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
return
sb
.
toString
();
...
@@ -295,6 +363,13 @@ public class DcSemiOrder {
...
@@ -295,6 +363,13 @@ public class DcSemiOrder {
&&
(
this
.
getOriginalQuantity
()
==
null
?
other
.
getOriginalQuantity
()
==
null
:
this
.
getOriginalQuantity
().
equals
(
other
.
getOriginalQuantity
()))
&&
(
this
.
getOriginalQuantity
()
==
null
?
other
.
getOriginalQuantity
()
==
null
:
this
.
getOriginalQuantity
().
equals
(
other
.
getOriginalQuantity
()))
&&
(
this
.
getToalCostRecord
()
==
null
?
other
.
getToalCostRecord
()
==
null
:
this
.
getToalCostRecord
().
equals
(
other
.
getToalCostRecord
()))
&&
(
this
.
getToalCostRecord
()
==
null
?
other
.
getToalCostRecord
()
==
null
:
this
.
getToalCostRecord
().
equals
(
other
.
getToalCostRecord
()))
&&
(
this
.
getToalPriceRecord
()
==
null
?
other
.
getToalPriceRecord
()
==
null
:
this
.
getToalPriceRecord
().
equals
(
other
.
getToalPriceRecord
()))
&&
(
this
.
getToalPriceRecord
()
==
null
?
other
.
getToalPriceRecord
()
==
null
:
this
.
getToalPriceRecord
().
equals
(
other
.
getToalPriceRecord
()))
&&
(
this
.
getWarehouseId
()
==
null
?
other
.
getWarehouseId
()
==
null
:
this
.
getWarehouseId
().
equals
(
other
.
getWarehouseId
()))
&&
(
this
.
getLastUpdateDate
()
==
null
?
other
.
getLastUpdateDate
()
==
null
:
this
.
getLastUpdateDate
().
equals
(
other
.
getLastUpdateDate
()))
&&
(
this
.
getSkuQuantity
()
==
null
?
other
.
getSkuQuantity
()
==
null
:
this
.
getSkuQuantity
().
equals
(
other
.
getSkuQuantity
()))
&&
(
this
.
getSkuUnitCost
()
==
null
?
other
.
getSkuUnitCost
()
==
null
:
this
.
getSkuUnitCost
().
equals
(
other
.
getSkuUnitCost
()))
&&
(
this
.
getSkuUnitPrice
()
==
null
?
other
.
getSkuUnitPrice
()
==
null
:
this
.
getSkuUnitPrice
().
equals
(
other
.
getSkuUnitPrice
()))
&&
(
this
.
getSku
()
==
null
?
other
.
getSku
()
==
null
:
this
.
getSku
().
equals
(
other
.
getSku
()))
&&
(
this
.
getWarehouseName
()
==
null
?
other
.
getWarehouseName
()
==
null
:
this
.
getWarehouseName
().
equals
(
other
.
getWarehouseName
()))
&&
(
this
.
getSemiOrderId
()
==
null
?
other
.
getSemiOrderId
()
==
null
:
this
.
getSemiOrderId
().
equals
(
other
.
getSemiOrderId
()));
&&
(
this
.
getSemiOrderId
()
==
null
?
other
.
getSemiOrderId
()
==
null
:
this
.
getSemiOrderId
().
equals
(
other
.
getSemiOrderId
()));
}
}
...
@@ -330,6 +405,13 @@ public class DcSemiOrder {
...
@@ -330,6 +405,13 @@ public class DcSemiOrder {
result
=
prime
*
result
+
((
getOriginalQuantity
()
==
null
)
?
0
:
getOriginalQuantity
().
hashCode
());
result
=
prime
*
result
+
((
getOriginalQuantity
()
==
null
)
?
0
:
getOriginalQuantity
().
hashCode
());
result
=
prime
*
result
+
((
getToalCostRecord
()
==
null
)
?
0
:
getToalCostRecord
().
hashCode
());
result
=
prime
*
result
+
((
getToalCostRecord
()
==
null
)
?
0
:
getToalCostRecord
().
hashCode
());
result
=
prime
*
result
+
((
getToalPriceRecord
()
==
null
)
?
0
:
getToalPriceRecord
().
hashCode
());
result
=
prime
*
result
+
((
getToalPriceRecord
()
==
null
)
?
0
:
getToalPriceRecord
().
hashCode
());
result
=
prime
*
result
+
((
getWarehouseId
()
==
null
)
?
0
:
getWarehouseId
().
hashCode
());
result
=
prime
*
result
+
((
getLastUpdateDate
()
==
null
)
?
0
:
getLastUpdateDate
().
hashCode
());
result
=
prime
*
result
+
((
getSkuQuantity
()
==
null
)
?
0
:
getSkuQuantity
().
hashCode
());
result
=
prime
*
result
+
((
getSkuUnitCost
()
==
null
)
?
0
:
getSkuUnitCost
().
hashCode
());
result
=
prime
*
result
+
((
getSkuUnitPrice
()
==
null
)
?
0
:
getSkuUnitPrice
().
hashCode
());
result
=
prime
*
result
+
((
getSku
()
==
null
)
?
0
:
getSku
().
hashCode
());
result
=
prime
*
result
+
((
getWarehouseName
()
==
null
)
?
0
:
getWarehouseName
().
hashCode
());
result
=
prime
*
result
+
((
getSemiOrderId
()
==
null
)
?
0
:
getSemiOrderId
().
hashCode
());
result
=
prime
*
result
+
((
getSemiOrderId
()
==
null
)
?
0
:
getSemiOrderId
().
hashCode
());
return
result
;
return
result
;
}
}
...
...
data-common/src/main/java/com/bailuntec/domain/example/DcSemiOrderExample.java
View file @
302aefe3
This diff is collapsed.
Click to expand it.
data-common/src/main/java/com/bailuntec/mapper/DcSemiOrderMapper.xml
View file @
302aefe3
This diff is collapsed.
Click to expand it.
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