记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
2f4b79c8
Commit
2f4b79c8
authored
Jan 06, 2023
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 支出多店铺 erp
parent
730ff243
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
156 additions
and
173 deletions
+156
-173
IGoblinErpService.java
...m/liquidnet/service/goblin/service/IGoblinErpService.java
+2
-2
ErpWdtClient.java
...n/java/com/liquidnet/service/erp/config/ErpWdtClient.java
+3
-9
application-dev.yml
liquidnet-bus-config/liquidnet-config/application-dev.yml
+0
-15
application-test.yml
liquidnet-bus-config/liquidnet-config/application-test.yml
+0
-15
WdtController.java
...iquidnet/service/goblin/controller/erp/WdtController.java
+8
-5
WdtServiceImpl.java
...idnet/service/goblin/service/impl/erp/WdtServiceImpl.java
+110
-93
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+9
-9
GoblinNftOrderServiceImpl.java
...service/order/service/impl/GoblinNftOrderServiceImpl.java
+1
-1
GoblinOrderServiceImpl.java
...et/service/order/service/impl/GoblinOrderServiceImpl.java
+1
-1
MixOrderServiceImpl.java
...idnet/service/order/service/impl/MixOrderServiceImpl.java
+2
-2
GoblinOrderUtils.java
...a/com/liquidnet/service/order/utils/GoblinOrderUtils.java
+10
-17
GoblinRedisUtils.java
...a/com/liquidnet/service/order/utils/GoblinRedisUtils.java
+10
-4
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/IGoblinErpService.java
View file @
2f4b79c8
...
@@ -4,12 +4,12 @@ import com.liquidnet.service.base.ResponseDto;
...
@@ -4,12 +4,12 @@ import com.liquidnet.service.base.ResponseDto;
public
interface
IGoblinErpService
{
public
interface
IGoblinErpService
{
ResponseDto
<
Boolean
>
initErpStock
(
String
spuId
,
int
min
);
ResponseDto
<
Boolean
>
initErpStock
(
String
spuId
,
int
min
,
String
storeId
);
ResponseDto
<
Boolean
>
pushTrade
(
String
orderId
);
ResponseDto
<
Boolean
>
pushTrade
(
String
orderId
);
ResponseDto
<
Boolean
>
syncErpLogistic
();
ResponseDto
<
Boolean
>
syncErpLogistic
();
ResponseDto
<
Boolean
>
checkGoodsNo
(
String
specNo
,
String
goodsNo
);
ResponseDto
<
Boolean
>
checkGoodsNo
(
String
specNo
,
String
goodsNo
,
String
storeId
);
}
}
liquidnet-bus-common/liquident-common-erp/src/main/java/com/liquidnet/service/erp/config/ErpWdtClient.java
View file @
2f4b79c8
...
@@ -16,12 +16,6 @@ import java.util.*;
...
@@ -16,12 +16,6 @@ import java.util.*;
@Slf4j
@Slf4j
public
class
ErpWdtClient
{
public
class
ErpWdtClient
{
@Value
(
"${liquidnet.erp.wdt.api.appKey}"
)
private
String
appkey
;
@Value
(
"${liquidnet.erp.wdt.api.sid}"
)
private
String
sid
;
@Value
(
"${liquidnet.erp.wdt.api.appsecret}"
)
private
String
appSecret
;
@Value
(
"${liquidnet.erp.wdt.url}"
)
@Value
(
"${liquidnet.erp.wdt.url}"
)
private
String
baseUrl
;
private
String
baseUrl
;
...
@@ -67,12 +61,12 @@ public class ErpWdtClient {
...
@@ -67,12 +61,12 @@ public class ErpWdtClient {
return
length
;
return
length
;
}
}
public
String
execute
(
String
url
,
Map
<
String
,
String
>
param
)
{
public
String
execute
(
String
url
,
Map
<
String
,
String
>
param
,
String
appKey
,
String
sid
,
String
appSecret
)
{
MultiValueMap
<
String
,
String
>
header
=
CollectionUtil
.
linkedMultiValueMapStringString
();
MultiValueMap
<
String
,
String
>
header
=
CollectionUtil
.
linkedMultiValueMapStringString
();
header
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
header
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
MultiValueMap
<
String
,
String
>
params
=
CollectionUtil
.
linkedMultiValueMapStringString
();
MultiValueMap
<
String
,
String
>
params
=
CollectionUtil
.
linkedMultiValueMapStringString
();
param
.
put
(
"appkey"
,
this
.
appk
ey
);
param
.
put
(
"appkey"
,
appK
ey
);
param
.
put
(
"sid"
,
this
.
sid
);
param
.
put
(
"sid"
,
sid
);
param
.
put
(
"timestamp"
,
Long
.
toString
(
System
.
currentTimeMillis
()
/
1000
));
param
.
put
(
"timestamp"
,
Long
.
toString
(
System
.
currentTimeMillis
()
/
1000
));
param
.
put
(
"sign"
,
getErpSign
(
param
,
appSecret
));
param
.
put
(
"sign"
,
getErpSign
(
param
,
appSecret
));
params
.
setAll
(
param
);
params
.
setAll
(
param
);
...
...
liquidnet-bus-config/liquidnet-config/application-dev.yml
View file @
2f4b79c8
...
@@ -245,20 +245,5 @@ liquidnet:
...
@@ -245,20 +245,5 @@ liquidnet:
erp
:
erp
:
wdt
:
wdt
:
url
:
https://sandbox.wangdian.cn/openapi2/
url
:
https://sandbox.wangdian.cn/openapi2/
api
:
sid
:
apidevnew2
appKey
:
mdtk2-test
appsecret
:
09335107b
client
:
sid
:
apidevnew2
appKey
:
mdtk2-test
appsecret
:
292c3b92
store
:
shop_no
:
mdtk2-test
warehouse_no
:
mdtk2-test
platform_id
:
127
contentSize
:
50
redisSize
:
1
#application-dev-end
#application-dev-end
\ No newline at end of file
liquidnet-bus-config/liquidnet-config/application-test.yml
View file @
2f4b79c8
...
@@ -245,19 +245,4 @@ liquidnet:
...
@@ -245,19 +245,4 @@ liquidnet:
erp
:
erp
:
wdt
:
wdt
:
url
:
https://sandbox.wangdian.cn/openapi2/
url
:
https://sandbox.wangdian.cn/openapi2/
api
:
sid
:
apidevnew2
appKey
:
mdtk2-test
appsecret
:
09335107b
client
:
sid
:
apidevnew2
appKey
:
mdtk2-test
appsecret
:
292c3b92
store
:
shop_no
:
mdtk2-test
warehouse_no
:
mdtk2-test
platform_id
:
127
contentSize
:
50
redisSize
:
1
#application-test-end
#application-test-end
\ No newline at end of file
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/erp/WdtController.java
View file @
2f4b79c8
...
@@ -23,13 +23,15 @@ public class WdtController {
...
@@ -23,13 +23,15 @@ public class WdtController {
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"spuId"
,
value
=
"spuId"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"spuId"
,
value
=
"spuId"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"Integer"
,
name
=
"min"
,
value
=
"间隔时间"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"Integer"
,
name
=
"min"
,
value
=
"间隔时间"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"storeId"
,
value
=
"店铺id"
),
})
})
public
ResponseDto
<
Boolean
>
initErpStock
(
@RequestParam
(
value
=
"spuId"
,
required
=
false
)
String
spuId
,
public
ResponseDto
<
Boolean
>
initErpStock
(
@RequestParam
(
value
=
"spuId"
,
required
=
false
)
String
spuId
,
@RequestParam
(
value
=
"min"
,
required
=
false
)
Integer
min
)
{
@RequestParam
(
value
=
"min"
,
required
=
false
)
Integer
min
,
@RequestParam
(
value
=
"storeId"
,
required
=
false
)
String
storeId
)
{
if
(
min
==
null
||
min
<=
0
)
{
if
(
min
==
null
||
min
<=
0
)
{
min
=
5
;
min
=
5
;
}
}
return
goblinErpService
.
initErpStock
(
spuId
,
min
);
return
goblinErpService
.
initErpStock
(
spuId
,
min
,
storeId
);
}
}
...
@@ -55,12 +57,13 @@ public class WdtController {
...
@@ -55,12 +57,13 @@ public class WdtController {
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"spec_no"
,
value
=
"商家编码"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"spec_no"
,
value
=
"商家编码"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"goods_no"
,
value
=
"货品编号"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"goods_no"
,
value
=
"货品编号"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"store_id"
,
value
=
"店铺id"
),
})
})
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
public
ResponseDto
<
Boolean
>
checkGoodsNo
(
@RequestParam
(
value
=
"spec_no"
)
String
spec_no
,
public
ResponseDto
<
Boolean
>
checkGoodsNo
(
@RequestParam
(
value
=
"spec_no"
)
String
spec_no
,
@RequestParam
(
value
=
"goods_no"
)
String
goods_no
)
{
@RequestParam
(
value
=
"goods_no"
)
String
goods_no
,
return
goblinErpService
.
checkGoodsNo
(
spec_no
,
goods_no
);
@RequestParam
(
value
=
"store_id"
)
String
store_id
)
{
return
goblinErpService
.
checkGoodsNo
(
spec_no
,
goods_no
,
store_id
);
}
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/erp/WdtServiceImpl.java
View file @
2f4b79c8
...
@@ -61,15 +61,9 @@ public class WdtServiceImpl implements IGoblinErpService {
...
@@ -61,15 +61,9 @@ public class WdtServiceImpl implements IGoblinErpService {
IGoblinStoreOrderService
goblinStoreOrderService
;
IGoblinStoreOrderService
goblinStoreOrderService
;
@Autowired
@Autowired
QueueUtils
queueUtils
;
QueueUtils
queueUtils
;
@Value
(
"${liquidnet.erp.wdt.redisSize}"
)
private
int
redisSize
;
@Value
(
"${liquidnet.erp.wdt.store.shop_no}"
)
private
String
shopNo
;
@Value
(
"${liquidnet.erp.wdt.contentSize}"
)
private
int
contentSize
;
@Override
@Override
public
ResponseDto
<
Boolean
>
initErpStock
(
String
spuId
,
int
min
)
{
public
ResponseDto
<
Boolean
>
initErpStock
(
String
spuId
,
int
min
,
String
storeId
)
{
try
{
try
{
Date
nowTime
=
DateUtil
.
now
();
Date
nowTime
=
DateUtil
.
now
();
String
json
;
String
json
;
...
@@ -88,7 +82,11 @@ public class WdtServiceImpl implements IGoblinErpService {
...
@@ -88,7 +82,11 @@ public class WdtServiceImpl implements IGoblinErpService {
param
.
put
(
"warehouse_no"
,
skuInfoVo
.
getErpWarehouseNo
());
param
.
put
(
"warehouse_no"
,
skuInfoVo
.
getErpWarehouseNo
());
param
.
put
(
"spec_no"
,
skuInfoVo
.
getSkuErpCode
());
param
.
put
(
"spec_no"
,
skuInfoVo
.
getSkuErpCode
());
param
.
remove
(
"sign"
);
param
.
remove
(
"sign"
);
json
=
erpWdtClient
.
execute
(
ErpEnum
.
WdtAPI
.
STOCK_QUERY
.
getUri
(),
param
);
GoblinStoreErpConfigVo
storeErpConfigVo
=
goblinRedisUtils
.
getStoreErpConfigVoByStoreId
(
storeId
);
if
(
storeErpConfigVo
==
null
||
storeErpConfigVo
.
getShopNo
().
equals
(
""
))
{
return
ResponseDto
.
failure
(
"参数错误"
);
}
json
=
erpWdtClient
.
execute
(
ErpEnum
.
WdtAPI
.
STOCK_QUERY
.
getUri
(),
param
,
storeErpConfigVo
.
getAppKey
(),
storeErpConfigVo
.
getSid
(),
storeErpConfigVo
.
getAppSecret
());
ArrayList
<
SyncStockVo
>
list
=
baseStock
(
json
);
ArrayList
<
SyncStockVo
>
list
=
baseStock
(
json
);
String
error
=
syncStockError
(
list
,
json
,
spuId
);
String
error
=
syncStockError
(
list
,
json
,
spuId
);
if
(!
""
.
equals
(
error
))
{
if
(!
""
.
equals
(
error
))
{
...
@@ -98,22 +96,30 @@ public class WdtServiceImpl implements IGoblinErpService {
...
@@ -98,22 +96,30 @@ public class WdtServiceImpl implements IGoblinErpService {
}
}
}
}
}
else
{
}
else
{
int
pageSize
=
40
;
//
int pageSize = 40;
int
allCount
=
(
int
)
mongoTemplate
.
count
(
Query
.
query
(
Criteria
.
where
(
"erpHosting"
).
is
(
1
)
List
<
GoblinGoodsSkuInfoVo
>
goblinGoodsSkuInfoVos
=
mongoTemplate
.
find
(
Query
.
query
(
Criteria
.
where
(
"erpHosting"
).
is
(
1
)
// .and("skuType").is("0")
// .and("skuType").is("0")
),
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
//总条数
),
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
//总条数
int
pageCount
=
(
allCount
/
pageSize
)
+
1
;
// param.put("page_size", pageSize + "");
param
.
put
(
"page_size"
,
pageSize
+
""
);
for
(
GoblinGoodsSkuInfoVo
data
:
goblinGoodsSkuInfoVos
)
{
// param.put("warehouse_no", "mdtk2-test");
param
.
put
(
"warehouse_no"
,
data
.
getErpWarehouseNo
());
// param.put("spec_no", "md111-1");
param
.
put
(
"spec_no"
,
data
.
getSkuErpCode
());
for
(
int
i
=
0
;
i
<
pageCount
;
i
++)
{
param
.
remove
(
"sign"
);
param
.
put
(
"page_no"
,
i
+
""
);
// for (int i = 0; i < pageCount; i++) {
json
=
erpWdtClient
.
execute
(
ErpEnum
.
WdtAPI
.
STOCK_QUERY
.
getUri
(),
param
);
// param.put("page_no", i + "");
GoblinStoreErpConfigVo
storeErpConfigVo
=
goblinRedisUtils
.
getStoreErpConfigVoByStoreId
(
data
.
getStoreId
());
if
(
storeErpConfigVo
==
null
){
log
.
error
(
"storeId:{},查询失败"
,
data
.
getStoreId
());
continue
;
}
json
=
erpWdtClient
.
execute
(
ErpEnum
.
WdtAPI
.
STOCK_QUERY
.
getUri
(),
param
,
storeErpConfigVo
.
getAppKey
(),
storeErpConfigVo
.
getSid
(),
storeErpConfigVo
.
getAppSecret
());
ArrayList
<
SyncStockVo
>
list
=
baseStock
(
json
);
ArrayList
<
SyncStockVo
>
list
=
baseStock
(
json
);
syncStock
(
list
);
syncStock
(
list
);
// }
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用接口失败 spuId:{},min:{}"
,
spuId
,
min
);
log
.
error
(
"调用接口失败 spuId:{},min:{}"
,
spuId
,
min
);
return
ResponseDto
.
failure
();
return
ResponseDto
.
failure
();
}
}
...
@@ -192,46 +198,45 @@ public class WdtServiceImpl implements IGoblinErpService {
...
@@ -192,46 +198,45 @@ public class WdtServiceImpl implements IGoblinErpService {
public
ResponseDto
<
Boolean
>
pushTrade
(
String
singleId
)
{
public
ResponseDto
<
Boolean
>
pushTrade
(
String
singleId
)
{
List
<
TradeListParam
>
listOrder
=
ErpObjectUtil
.
tradeListParam
();
List
<
TradeListParam
>
listOrder
=
ErpObjectUtil
.
tradeListParam
();
List
<
List
<
String
>>
orderIdList
=
CollectionUtil
.
arrayListListString
();
List
<
List
<
String
>>
orderIdList
=
CollectionUtil
.
arrayListListString
();
// 获取 订单id 数据
List
<
String
>
shopNoList
=
goblinRedisUtils
.
getStoreErpShopNoList
();
if
(
""
.
equals
(
singleId
)
||
null
==
singleId
)
{
for
(
String
shopNo
:
shopNoList
)
{
// for (int i = 0; i < redisSize; i++) {
// 获取 订单id 数据
// List<String> list = goblinRedisUtils.getRange(i);
if
(
""
.
equals
(
singleId
)
||
null
==
singleId
)
{
// orderIdList.add(list);
List
<
String
>
list
=
CollectionUtil
.
arrayListString
();
// //todo 删除redis key
for
(
int
i
=
0
;
i
<
50
;
i
++)
{
// }
String
orderId
=
goblinRedisUtils
.
erpLeftPop
(
shopNo
);
if
(
orderId
!=
null
)
{
List
<
String
>
list
=
CollectionUtil
.
arrayListString
();
list
.
add
(
orderId
);
for
(
int
i
=
0
;
i
<
contentSize
;
i
++)
{
}
String
orderId
=
goblinRedisUtils
.
erpLeftPop
(
0
);
if
(
orderId
!=
null
)
{
list
.
add
(
orderId
);
}
}
orderIdList
.
add
(
list
);
}
else
{
List
<
String
>
a
=
CollectionUtil
.
arrayListString
();
a
.
add
(
singleId
);
orderIdList
.
add
(
a
);
}
}
orderIdList
.
add
(
list
);
}
else
{
List
<
String
>
a
=
CollectionUtil
.
arrayListString
();
a
.
add
(
singleId
);
orderIdList
.
add
(
a
);
}
//同步订单
//同步订单
for
(
List
<
String
>
b
:
orderIdList
)
{
for
(
List
<
String
>
b
:
orderIdList
)
{
for
(
String
orderId
:
b
)
{
GoblinStoreErpConfigVo
shopVo
=
getStoreErpConfigVo
(
shopNo
);
goblinOrderData
(
orderId
,
listOrder
);
nftOrderData
(
orderId
,
listOrder
);
}
//执行同步订单
Map
<
String
,
String
>
param
=
CollectionUtil
.
linkMapStringString
();
param
.
put
(
"shop_no"
,
shopNo
);
param
.
put
(
"trade_list"
,
JSON
.
toJSONString
(
listOrder
));
String
json
=
erpWdtClient
.
execute
(
ErpEnum
.
WdtAPI
.
TRADE_PUSH
.
getUri
(),
param
);
TradePushVo
data
=
JsonUtils
.
fromJson
(
json
,
TradePushVo
.
class
);
int
newCount
=
data
.
getNew_count
();
if
(
listOrder
.
size
()
<
newCount
)
{
for
(
String
orderId
:
b
)
{
for
(
String
orderId
:
b
)
{
goblinRedisUtils
.
erpAddPush
(
1
,
orderId
);
goblinOrderData
(
orderId
,
listOrder
);
nftOrderData
(
orderId
,
listOrder
);
}
//执行同步订单
Map
<
String
,
String
>
param
=
CollectionUtil
.
linkMapStringString
();
param
.
put
(
"shop_no"
,
shopNo
);
param
.
put
(
"trade_list"
,
JSON
.
toJSONString
(
listOrder
));
GoblinStoreErpConfigVo
storeErpConfigVo
=
goblinRedisUtils
.
getStoreErpConfigVoByStoreId
(
shopVo
.
getStoreId
());
String
json
=
erpWdtClient
.
execute
(
ErpEnum
.
WdtAPI
.
TRADE_PUSH
.
getUri
(),
param
,
storeErpConfigVo
.
getAppKey
(),
storeErpConfigVo
.
getSid
(),
storeErpConfigVo
.
getAppSecret
());
TradePushVo
data
=
JsonUtils
.
fromJson
(
json
,
TradePushVo
.
class
);
int
newCount
=
data
.
getNew_count
();
if
(
listOrder
.
size
()
>
newCount
)
{
for
(
String
orderId
:
b
)
{
goblinRedisUtils
.
erpAddErrorPush
(
shopNo
,
orderId
);
}
log
.
error
(
"同步 erp 失败 "
);
}
}
log
.
error
(
"同步 erp 失败 "
);
}
}
}
}
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
...
@@ -372,59 +377,66 @@ public class WdtServiceImpl implements IGoblinErpService {
...
@@ -372,59 +377,66 @@ public class WdtServiceImpl implements IGoblinErpService {
@Override
@Override
public
ResponseDto
<
Boolean
>
syncErpLogistic
()
{
public
ResponseDto
<
Boolean
>
syncErpLogistic
()
{
Map
<
String
,
String
>
paramSync
=
CollectionUtil
.
linkMapStringString
();
List
<
String
>
shopNoList
=
goblinRedisUtils
.
getStoreErpShopNoList
();
paramSync
.
put
(
"shop_no"
,
shopNo
);
for
(
String
shopNo
:
shopNoList
)
{
paramSync
.
put
(
"limit"
,
"100"
);
GoblinStoreErpConfigVo
shopVo
=
getStoreErpConfigVo
(
shopNo
);
String
jsonSyc
=
erpWdtClient
.
execute
(
ErpEnum
.
WdtAPI
.
LOGISTICS_SYNC_QUERY
.
getUri
(),
paramSync
);
LogisticSyncBaseVo
dataSyc
=
JsonUtils
.
fromJson
(
jsonSyc
,
LogisticSyncBaseVo
.
class
);
Map
<
String
,
String
>
paramSync
=
CollectionUtil
.
linkMapStringString
();
//处理平台发货
paramSync
.
put
(
"shop_no"
,
shopNo
);
List
<
LogisticsSyncVo
>
logisticsSyncVos
=
dataSyc
.
getTrades
();
paramSync
.
put
(
"limit"
,
"100"
);
List
<
LogisticsListParam
>
listParams
=
ObjectUtil
.
logisticsListParam
();
String
jsonSyc
=
erpWdtClient
.
execute
(
ErpEnum
.
WdtAPI
.
LOGISTICS_SYNC_QUERY
.
getUri
(),
paramSync
,
shopVo
.
getAppKey
(),
shopVo
.
getSid
(),
shopVo
.
getAppSecret
());
for
(
LogisticsSyncVo
vo
:
logisticsSyncVos
)
{
LogisticSyncBaseVo
dataSyc
=
JsonUtils
.
fromJson
(
jsonSyc
,
LogisticSyncBaseVo
.
class
);
String
orderCode
=
vo
.
getTid
();
//处理平台发货
String
mailNo
=
vo
.
getLogistics_no
();
List
<
LogisticsSyncVo
>
logisticsSyncVos
=
dataSyc
.
getTrades
();
int
recId
=
vo
.
getRec_id
();
List
<
LogisticsListParam
>
listParams
=
ObjectUtil
.
logisticsListParam
();
String
code
;
for
(
LogisticsSyncVo
vo
:
logisticsSyncVos
)
{
try
{
String
orderCode
=
vo
.
getTid
();
ResponseDto
<
Boolean
>
response
=
goblinStoreOrderService
.
express
(
""
,
null
,
mailNo
,
"ERP"
,
orderCode
);
String
mailNo
=
vo
.
getLogistics_no
();
code
=
response
.
getCode
();
int
recId
=
vo
.
getRec_id
();
}
catch
(
Exception
e
)
{
String
code
;
e
.
printStackTrace
();
try
{
code
=
"1"
;
ResponseDto
<
Boolean
>
response
=
goblinStoreOrderService
.
express
(
""
,
null
,
mailNo
,
"ERP"
,
orderCode
);
}
code
=
response
.
getCode
();
LogisticsListParam
ack
=
LogisticsListParam
.
getNew
();
}
catch
(
Exception
e
)
{
ack
.
setRec_id
(
recId
);
e
.
printStackTrace
();
if
(
"0"
.
equals
(
code
))
{
code
=
"1"
;
ack
.
setStatus
(
0
);
}
ack
.
setMessage
(
"正在现场物流同步成功"
);
LogisticsListParam
ack
=
LogisticsListParam
.
getNew
();
}
else
{
ack
.
setRec_id
(
recId
);
ack
.
setStatus
(
1
);
if
(
"0"
.
equals
(
code
))
{
ack
.
setMessage
(
"正在现场物流同步失败"
);
ack
.
setStatus
(
0
);
ack
.
setMessage
(
"正在现场物流同步成功"
);
}
else
{
ack
.
setStatus
(
1
);
ack
.
setMessage
(
"正在现场物流同步失败"
);
}
listParams
.
add
(
ack
);
}
}
listParams
.
add
(
ack
);
}
//确认物流同步 ACK
//确认物流同步 ACK
if
(
listParams
.
size
()
>
0
)
{
if
(
listParams
.
size
()
>
0
)
{
Map
<
String
,
String
>
paramAck
=
CollectionUtil
.
linkMapStringString
();
Map
<
String
,
String
>
paramAck
=
CollectionUtil
.
linkMapStringString
();
paramAck
.
put
(
"shop_no"
,
shopNo
);
paramAck
.
put
(
"shop_no"
,
shopNo
);
paramAck
.
put
(
"limit"
,
"100"
);
paramAck
.
put
(
"limit"
,
"100"
);
paramAck
.
put
(
"logistics_list"
,
JSON
.
toJSONString
(
listParams
));
paramAck
.
put
(
"logistics_list"
,
JSON
.
toJSONString
(
listParams
));
String
jsonAck
=
erpWdtClient
.
execute
(
ErpEnum
.
WdtAPI
.
LOGISTICS_SYNC_ACK
.
getUri
(),
paramAck
);
String
jsonAck
=
erpWdtClient
.
execute
(
ErpEnum
.
WdtAPI
.
LOGISTICS_SYNC_ACK
.
getUri
(),
paramAck
,
shopVo
.
getAppKey
(),
shopVo
.
getSid
(),
shopVo
.
getAppSecret
());
LogisticSyncAckBaseVo
dataAck
=
JsonUtils
.
fromJson
(
jsonAck
,
LogisticSyncAckBaseVo
.
class
);
LogisticSyncAckBaseVo
dataAck
=
JsonUtils
.
fromJson
(
jsonAck
,
LogisticSyncAckBaseVo
.
class
);
}
}
}
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
}
}
@Override
@Override
public
ResponseDto
<
Boolean
>
checkGoodsNo
(
String
spec_no
,
String
goods_no
)
{
public
ResponseDto
<
Boolean
>
checkGoodsNo
(
String
spec_no
,
String
goods_no
,
String
storeId
)
{
// Date nowTime = DateUtil.now();
// Date nowTime = DateUtil.now();
Map
<
String
,
String
>
paramAck
=
CollectionUtil
.
linkMapStringString
();
Map
<
String
,
String
>
paramAck
=
CollectionUtil
.
linkMapStringString
();
// paramAck.put("start_time", DateUtil.format(DateUtil.addMin(nowTime, -5), DateUtil.Formatter.yyyyMMddHHmmss));
// paramAck.put("start_time", DateUtil.format(DateUtil.addMin(nowTime, -5), DateUtil.Formatter.yyyyMMddHHmmss));
// paramAck.put("end_time", DateUtil.format(nowTime, DateUtil.Formatter.yyyyMMddHHmmss));
// paramAck.put("end_time", DateUtil.format(nowTime, DateUtil.Formatter.yyyyMMddHHmmss));
paramAck
.
put
(
"spec_no"
,
spec_no
);
paramAck
.
put
(
"spec_no"
,
spec_no
);
paramAck
.
put
(
"goods_no"
,
goods_no
);
paramAck
.
put
(
"goods_no"
,
goods_no
);
String
json
=
erpWdtClient
.
execute
(
ErpEnum
.
WdtAPI
.
GOODS_QUERY
.
getUri
(),
paramAck
);
GoblinStoreErpConfigVo
storeErpConfigVo
=
goblinRedisUtils
.
getStoreErpConfigVoByStoreId
(
storeId
);
String
json
=
erpWdtClient
.
execute
(
ErpEnum
.
WdtAPI
.
GOODS_QUERY
.
getUri
(),
paramAck
,
storeErpConfigVo
.
getAppKey
(),
storeErpConfigVo
.
getSid
(),
storeErpConfigVo
.
getAppSecret
());
log
.
error
(
"json = "
+
json
);
log
.
error
(
"json = "
+
json
);
CheckGoodsBaseVo
checkGoodsBaseVo
=
JsonUtils
.
fromJson
(
json
,
CheckGoodsBaseVo
.
class
);
CheckGoodsBaseVo
checkGoodsBaseVo
=
JsonUtils
.
fromJson
(
json
,
CheckGoodsBaseVo
.
class
);
log
.
error
(
"checkGoodsBaseVo = "
+
checkGoodsBaseVo
);
log
.
error
(
"checkGoodsBaseVo = "
+
checkGoodsBaseVo
);
...
@@ -434,4 +446,9 @@ public class WdtServiceImpl implements IGoblinErpService {
...
@@ -434,4 +446,9 @@ public class WdtServiceImpl implements IGoblinErpService {
return
ResponseDto
.
success
(
true
);
return
ResponseDto
.
success
(
true
);
}
}
}
}
public
GoblinStoreErpConfigVo
getStoreErpConfigVo
(
String
shopNo
)
{
Query
query
=
Query
.
query
(
Criteria
.
where
(
"shopNo"
).
is
(
shopNo
));
return
mongoTemplate
.
findOne
(
query
,
GoblinStoreErpConfigVo
.
class
,
GoblinStoreErpConfigVo
.
class
.
getSimpleName
());
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
2f4b79c8
...
@@ -2901,26 +2901,26 @@ public class GoblinRedisUtils {
...
@@ -2901,26 +2901,26 @@ public class GoblinRedisUtils {
String
rdk
=
GoblinRedisConst
.
ERP_GOBLIN_GOODS_LIST
.
concat
(
index
+
""
);
String
rdk
=
GoblinRedisConst
.
ERP_GOBLIN_GOODS_LIST
.
concat
(
index
+
""
);
List
<
Object
>
list
=
redisUtil
.
getRange
(
rdk
);
List
<
Object
>
list
=
redisUtil
.
getRange
(
rdk
);
List
<
String
>
data
=
CollectionUtil
.
arrayListString
();
List
<
String
>
data
=
CollectionUtil
.
arrayListString
();
for
(
Object
str
:
list
)
{
for
(
Object
str
:
list
)
{
data
.
add
((
String
)
str
);
data
.
add
((
String
)
str
);
}
}
return
data
;
return
data
;
}
}
public
String
erpLeftPop
(
int
index
)
{
public
String
erpLeftPop
(
String
shopNo
)
{
String
rdk
=
GoblinRedisConst
.
ERP_GOBLIN_GOODS_LIST
.
concat
(
index
+
""
);
String
rdk
=
GoblinRedisConst
.
ERP_GOBLIN_GOODS_LIST
.
concat
(
shopNo
);
Object
obj
=
redisUtil
.
leftPop
(
rdk
);
Object
obj
=
redisUtil
.
leftPop
(
rdk
);
if
(
obj
==
null
)
{
if
(
obj
==
null
)
{
return
null
;
return
null
;
}
else
{
}
else
{
return
(
String
)
obj
;
return
(
String
)
obj
;
}
}
}
}
//添加erp订单
//添加erp订单
public
int
erpAdd
Push
(
int
index
,
String
orderId
)
{
public
int
erpAdd
ErrorPush
(
String
shopNo
,
String
orderId
)
{
String
rdk
=
GoblinRedisConst
.
ERP_GOBLIN_GOODS_LIST
.
concat
(
index
+
""
);
String
rdk
=
GoblinRedisConst
.
ERP_GOBLIN_GOODS_LIST
.
concat
(
"error:"
+
shopNo
);
return
(
int
)
redisUtil
.
rightPush
(
rdk
,
orderId
);
return
(
int
)
redisUtil
.
rightPush
(
rdk
,
orderId
);
}
}
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/GoblinNftOrderServiceImpl.java
View file @
2f4b79c8
...
@@ -748,7 +748,7 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
...
@@ -748,7 +748,7 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
String
uid
=
orderVo
.
getUserId
();
String
uid
=
orderVo
.
getUserId
();
Integer
orderStatusOld
=
orderVo
.
getStatus
();
Integer
orderStatusOld
=
orderVo
.
getStatus
();
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
goblinOrderUtils
.
addErpPush
(
orderVo
.
getOrderId
(),
orderVo
.
getErpHosting
());
goblinOrderUtils
.
addErpPush
(
orderVo
.
getOrderId
(),
orderVo
.
getErpHosting
()
,
orderVo
.
getStoreId
()
);
// 更新订单信息
// 更新订单信息
if
(
StringUtil
.
isEmpty
(
syncOrderParam
.
getPaymentType
()))
{
if
(
StringUtil
.
isEmpty
(
syncOrderParam
.
getPaymentType
()))
{
orderVo
.
setPaymentType
(
""
);
orderVo
.
setPaymentType
(
""
);
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/GoblinOrderServiceImpl.java
View file @
2f4b79c8
...
@@ -831,7 +831,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
...
@@ -831,7 +831,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
log
.
error
(
"订单号为 {} 的订单正在退款 或者已退款"
,
syncOrderParam
.
getOrderCode
());
log
.
error
(
"订单号为 {} 的订单正在退款 或者已退款"
,
syncOrderParam
.
getOrderCode
());
}
else
if
(
syncOrderParam
.
getStatus
().
equals
(
1
)
&&
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_0
.
getValue
())
{
}
else
if
(
syncOrderParam
.
getStatus
().
equals
(
1
)
&&
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_0
.
getValue
())
{
log
.
error
(
"订单号为 {} 的订单正常流程"
,
syncOrderParam
.
getOrderCode
());
log
.
error
(
"订单号为 {} 的订单正常流程"
,
syncOrderParam
.
getOrderCode
());
orderUtils
.
addErpPush
(
orderVo
.
getOrderId
(),
orderVo
.
getErpHosting
());
orderUtils
.
addErpPush
(
orderVo
.
getOrderId
(),
orderVo
.
getErpHosting
()
,
orderVo
.
getStoreId
()
);
storeOrder
.
setPaymentType
(
syncOrderParam
.
getPaymentType
());
storeOrder
.
setPaymentType
(
syncOrderParam
.
getPaymentType
());
storeOrder
.
setPaymentId
(
syncOrderParam
.
getPaymentId
());
storeOrder
.
setPaymentId
(
syncOrderParam
.
getPaymentId
());
storeOrder
.
setPayCode
(
syncOrderParam
.
getCode
());
storeOrder
.
setPayCode
(
syncOrderParam
.
getCode
());
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/MixOrderServiceImpl.java
View file @
2f4b79c8
...
@@ -640,7 +640,7 @@ public class MixOrderServiceImpl implements IMixOrderService {
...
@@ -640,7 +640,7 @@ public class MixOrderServiceImpl implements IMixOrderService {
log
.
error
(
"Mix订单Id为 {} 的订单正在退款 或者已退款"
,
orderId
);
log
.
error
(
"Mix订单Id为 {} 的订单正在退款 或者已退款"
,
orderId
);
}
else
if
(
status
==
1
)
{
}
else
if
(
status
==
1
)
{
log
.
error
(
"Mix订单Id {} 的订单正常流程"
,
orderId
);
log
.
error
(
"Mix订单Id {} 的订单正常流程"
,
orderId
);
orderUtils
.
addErpPush
(
orderVo
.
getOrderId
(),
orderVo
.
getErpHosting
());
orderUtils
.
addErpPush
(
orderVo
.
getOrderId
(),
orderVo
.
getErpHosting
()
,
orderVo
.
getStoreId
()
);
storeOrder
.
setPaymentType
(
paymentType
);
storeOrder
.
setPaymentType
(
paymentType
);
storeOrder
.
setPaymentId
(
paymentId
);
storeOrder
.
setPaymentId
(
paymentId
);
storeOrder
.
setPayCode
(
code
);
storeOrder
.
setPayCode
(
code
);
...
@@ -736,7 +736,7 @@ public class MixOrderServiceImpl implements IMixOrderService {
...
@@ -736,7 +736,7 @@ public class MixOrderServiceImpl implements IMixOrderService {
String
uid
=
orderVo
.
getUserId
();
String
uid
=
orderVo
.
getUserId
();
Integer
orderStatusOld
=
orderVo
.
getStatus
();
Integer
orderStatusOld
=
orderVo
.
getStatus
();
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
orderUtils
.
addErpPush
(
orderVo
.
getOrderId
(),
orderVo
.
getErpHosting
());
orderUtils
.
addErpPush
(
orderVo
.
getOrderId
(),
orderVo
.
getErpHosting
()
,
orderVo
.
getStoreId
()
);
// 更新订单信息
// 更新订单信息
if
(
StringUtil
.
isEmpty
(
paymentType
))
{
if
(
StringUtil
.
isEmpty
(
paymentType
))
{
orderVo
.
setPaymentType
(
""
);
orderVo
.
setPaymentType
(
""
);
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinOrderUtils.java
View file @
2f4b79c8
...
@@ -39,10 +39,6 @@ public class GoblinOrderUtils {
...
@@ -39,10 +39,6 @@ public class GoblinOrderUtils {
private
String
candyUrl
;
private
String
candyUrl
;
@Value
(
"${liquidnet.service.order.url-pay.goblinRefundUrl}"
)
@Value
(
"${liquidnet.service.order.url-pay.goblinRefundUrl}"
)
private
String
synUrl
;
private
String
synUrl
;
@Value
(
"${liquidnet.erp.wdt.contentSize}"
)
private
int
contentSize
;
@Value
(
"${liquidnet.erp.wdt.redisSize}"
)
private
int
redisSize
;
@Autowired
@Autowired
private
IDragonOrderRefundsService
dragonOrderRefundsService
;
private
IDragonOrderRefundsService
dragonOrderRefundsService
;
...
@@ -256,8 +252,8 @@ public class GoblinOrderUtils {
...
@@ -256,8 +252,8 @@ public class GoblinOrderUtils {
GoblinUseResultVo
returnVo
=
GoblinUseResultVo
.
getNew
();
GoblinUseResultVo
returnVo
=
GoblinUseResultVo
.
getNew
();
List
<
CouponOutLineVo
>
couponList
=
redisUtils
.
getOutLineCoupon
();
List
<
CouponOutLineVo
>
couponList
=
redisUtils
.
getOutLineCoupon
();
boolean
isOutLine
=
false
;
boolean
isOutLine
=
false
;
for
(
CouponOutLineVo
data:
couponList
)
{
for
(
CouponOutLineVo
data
:
couponList
)
{
if
(
data
.
getStoreCouponId
().
equals
(
ucouponId
))
{
if
(
data
.
getStoreCouponId
().
equals
(
ucouponId
))
{
isOutLine
=
true
;
isOutLine
=
true
;
BigDecimal
tempPrice
=
totalPrice
.
subtract
(
totalPrice
.
multiply
(
BigDecimal
.
valueOf
(
data
.
getDiscount
())).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_DOWN
));
BigDecimal
tempPrice
=
totalPrice
.
subtract
(
totalPrice
.
multiply
(
BigDecimal
.
valueOf
(
data
.
getDiscount
())).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_DOWN
));
returnVo
.
setSpuIds
(
CollectionUtil
.
linkedListString
());
returnVo
.
setSpuIds
(
CollectionUtil
.
linkedListString
());
...
@@ -265,7 +261,7 @@ public class GoblinOrderUtils {
...
@@ -265,7 +261,7 @@ public class GoblinOrderUtils {
returnVo
.
setCouType
(
data
.
getCouType
());
returnVo
.
setCouType
(
data
.
getCouType
());
}
}
}
}
if
(
isOutLine
)
{
if
(
isOutLine
)
{
return
returnVo
;
return
returnVo
;
}
}
try
{
try
{
...
@@ -571,18 +567,15 @@ public class GoblinOrderUtils {
...
@@ -571,18 +567,15 @@ public class GoblinOrderUtils {
}
}
public
void
addErpPush
(
String
orderId
,
int
erpHosting
)
{
public
void
addErpPush
(
String
orderId
,
int
erpHosting
,
String
storeId
)
{
if
(
erpHosting
==
0
)
{
if
(
erpHosting
==
0
)
{
}
else
{
}
else
{
redisUtils
.
erpAddPush
(
0
,
orderId
);
GoblinStoreErpConfigVo
vo
=
redisUtils
.
getStoreErpConfigVoByStoreId
(
storeId
);
// for (int i = 0; i < redisSize; i++) {
if
(
vo
==
null
||
vo
.
getShopNo
().
equals
(
""
))
{
// boolean isFull = redisUtils.erpAddPush(i, orderId) > contentSize;
// if (isFull) {
}
else
{
// redisUtils.erpPopPush(i);
redisUtils
.
erpAddPush
(
vo
.
getShopNo
(),
orderId
);
// } else {
}
// break;
// }
// }
}
}
}
}
}
}
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinRedisUtils.java
View file @
2f4b79c8
...
@@ -746,14 +746,20 @@ public class GoblinRedisUtils {
...
@@ -746,14 +746,20 @@ public class GoblinRedisUtils {
//添加erp订单
//添加erp订单
public
int
erpAddPush
(
int
index
,
String
orderId
)
{
public
int
erpAddPush
(
String
shopNo
,
String
orderId
)
{
String
rdk
=
GoblinRedisConst
.
ERP_GOBLIN_GOODS_LIST
.
concat
(
index
+
""
);
String
rdk
=
GoblinRedisConst
.
ERP_GOBLIN_GOODS_LIST
.
concat
(
shopNo
);
return
(
int
)
redisUtil
.
rightPush
(
rdk
,
orderId
);
return
(
int
)
redisUtil
.
rightPush
(
rdk
,
orderId
);
}
}
//移除erp订单
//移除erp订单
public
String
erpPopPush
(
int
index
)
{
public
String
erpPopPush
(
String
shopNo
)
{
String
rdk
=
GoblinRedisConst
.
ERP_GOBLIN_GOODS_LIST
.
concat
(
index
+
""
);
String
rdk
=
GoblinRedisConst
.
ERP_GOBLIN_GOODS_LIST
.
concat
(
shopNo
);
return
(
String
)
redisUtil
.
rightPop
(
rdk
);
return
(
String
)
redisUtil
.
rightPop
(
rdk
);
}
}
public
GoblinStoreErpConfigVo
getStoreErpConfigVoByStoreId
(
String
storeId
)
{
String
rk
=
GoblinRedisConst
.
BASIC_STORE_ERP_CONF
.
concat
(
storeId
);
GoblinStoreErpConfigVo
vo
=
(
GoblinStoreErpConfigVo
)
redisUtil
.
get
(
rk
);
return
vo
;
}
}
}
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