记得上下班打卡 | 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
883fd9ec
Commit
883fd9ec
authored
Dec 09, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交 nft 下单接口
parent
5544f016
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
146 additions
and
66 deletions
+146
-66
WdtServiceImpl.java
...net/service/platform/service/impl/erp/WdtServiceImpl.java
+135
-66
GoblinRedisUtils.java
...om/liquidnet/service/platform/utils/GoblinRedisUtils.java
+11
-0
No files found.
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/erp/WdtServiceImpl.java
View file @
883fd9ec
...
...
@@ -18,10 +18,7 @@ import com.liquidnet.service.erp.vo.SyncStockVo;
import
com.liquidnet.service.erp.vo.TradePushVo
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinOrderSkuVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreOrderVo
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.mapper.GoblinGoodsSkuMapper
;
import
com.liquidnet.service.goblin.service.IGoblinErpService
;
import
com.liquidnet.service.platform.utils.GoblinRedisUtils
;
...
...
@@ -39,6 +36,7 @@ import org.springframework.stereotype.Service;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
/**
...
...
@@ -191,8 +189,27 @@ public class WdtServiceImpl implements IGoblinErpService {
//同步订单
for
(
List
<
String
>
b
:
orderIdList
)
{
for
(
String
orderId
:
b
)
{
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
);
}
return
ResponseDto
.
success
();
}
//构建 商品订单数据
private
List
<
TradeListParam
>
goblinOrderData
(
String
orderId
,
List
<
TradeListParam
>
listOrder
)
{
TradeListParam
tradeListParam
=
TradeListParam
.
getNew
();
GoblinStoreOrderVo
orderVo
=
goblinRedisUtils
.
getGoblinOrder
(
orderId
);
if
(
orderVo
==
null
)
{
return
listOrder
;
}
List
<
String
>
orderSkuIds
=
orderVo
.
getOrderSkuVoIds
();
List
<
OrderListParam
>
listOrderSku
=
ErpObjectUtil
.
orderListParam
();
String
warehouseNo
=
""
;
...
...
@@ -232,6 +249,14 @@ public class WdtServiceImpl implements IGoblinErpService {
tradeListParam
.
setPay_time
(
orderVo
.
getPayTime
());
tradeListParam
.
setBuyer_nick
(
orderVo
.
getUserName
());
tradeListParam
.
setPay_id
(
orderVo
.
getPayCode
());
if
(
orderVo
.
getOrderAttrVo
().
getExpressAddress
().
equals
(
""
)){
tradeListParam
.
setReceiver_name
(
"正在映画"
);
tradeListParam
.
setReceiver_province
(
"北京市"
);
tradeListParam
.
setReceiver_city
(
"北京市"
);
tradeListParam
.
setReceiver_district
(
"朝阳区"
);
tradeListParam
.
setReceiver_address
(
"广渠路 创1985园区 3-12"
);
tradeListParam
.
setReceiver_mobile
(
"15901093014"
);
}
else
{
tradeListParam
.
setReceiver_name
(
orderVo
.
getOrderAttrVo
().
getExpressContacts
());
String
[]
address
=
orderVo
.
getOrderAttrVo
().
getExpressAddress
().
split
(
" "
);
if
(
address
.
length
>
0
)
{
...
...
@@ -245,6 +270,7 @@ public class WdtServiceImpl implements IGoblinErpService {
}
tradeListParam
.
setReceiver_address
(
orderVo
.
getOrderAttrVo
().
getExpressAddress
());
tradeListParam
.
setReceiver_mobile
(
orderVo
.
getOrderAttrVo
().
getExpressPhone
());
}
tradeListParam
.
setPost_amount
(
orderVo
.
getPriceExpress
());
tradeListParam
.
setExt_cod_fee
(
BigDecimal
.
ZERO
);
tradeListParam
.
setOther_amount
(
BigDecimal
.
ZERO
);
...
...
@@ -253,14 +279,57 @@ public class WdtServiceImpl implements IGoblinErpService {
if
(
erpHosting
==
1
)
{
listOrder
.
add
(
tradeListParam
);
}
return
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
);
//构建 nft订单数据
private
List
<
TradeListParam
>
nftOrderData
(
String
orderId
,
List
<
TradeListParam
>
listOrder
)
{
TradeListParam
tradeListParam
=
TradeListParam
.
getNew
();
GoblinNftOrderVo
orderVo
=
goblinRedisUtils
.
getNftOrder
(
orderId
);
List
<
OrderListParam
>
listOrderSku
=
ErpObjectUtil
.
orderListParam
();
//配置sku维度数据
OrderListParam
orderSkuParam
=
OrderListParam
.
getNew
();
if
(
orderVo
!=
null
&&
orderVo
.
getErpHosting
()
==
1
&&
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_2
.
getValue
())
{
GoblinGoodsSkuInfoVo
skuVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
orderVo
.
getSkuId
());
GoblinGoodsInfoVo
spuVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
orderVo
.
getSpuId
());
orderSkuParam
.
setOid
(
orderVo
.
getOrderId
().
concat
(
"a1"
));
orderSkuParam
.
setNum
(
BigDecimal
.
valueOf
(
orderVo
.
getNum
()));
orderSkuParam
.
setPrice
(
skuVo
.
getPrice
());
orderSkuParam
.
setStatus
(
ErpEnum
.
WdtStatus
.
STATUS_UN_SEND
.
WdtStatus
());
orderSkuParam
.
setRefund_status
(
0
);
orderSkuParam
.
setGoods_id
(
orderVo
.
getSpuId
());
orderSkuParam
.
setSpec_id
(
orderVo
.
getBoxSkuId
().
equals
(
""
)
?
orderVo
.
getSkuId
()
:
orderVo
.
getBoxSkuId
());
orderSkuParam
.
setGoods_no
(
orderVo
.
getSpuErpCode
());
orderSkuParam
.
setSpec_no
(
orderVo
.
getSkuErpCode
());
orderSkuParam
.
setGoods_name
(
spuVo
.
getName
());
orderSkuParam
.
setAdjust_amount
(
BigDecimal
.
ZERO
);
orderSkuParam
.
setDiscount
(
BigDecimal
.
ZERO
);
orderSkuParam
.
setShare_discount
(
skuVo
.
getPrice
().
multiply
(
BigDecimal
.
valueOf
(
orderVo
.
getNum
())).
subtract
(
orderVo
.
getPriceActual
()));
listOrderSku
.
add
(
orderSkuParam
);
//配置订单维度数据
tradeListParam
.
setOrder_list
(
listOrderSku
);
tradeListParam
.
setTid
(
orderVo
.
getOrderCode
());
tradeListParam
.
setTrade_status
(
ErpEnum
.
WdtStatus
.
STATUS_UN_SEND
.
WdtStatus
());
tradeListParam
.
setPay_status
(
2
);
tradeListParam
.
setDelivery_term
(
1
);
tradeListParam
.
setTrade_time
(
orderVo
.
getCreatedAt
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
tradeListParam
.
setPay_time
(
orderVo
.
getPayTime
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
tradeListParam
.
setBuyer_nick
(
orderVo
.
getUserName
());
tradeListParam
.
setPay_id
(
orderVo
.
getPayCode
());
tradeListParam
.
setReceiver_name
(
"正在映画"
);
tradeListParam
.
setReceiver_province
(
"北京市"
);
tradeListParam
.
setReceiver_city
(
"北京市"
);
tradeListParam
.
setReceiver_district
(
"朝阳区"
);
tradeListParam
.
setReceiver_address
(
"广渠路 创1985园区 3-12"
);
tradeListParam
.
setReceiver_mobile
(
"15901093014"
);
tradeListParam
.
setPost_amount
(
BigDecimal
.
ZERO
);
tradeListParam
.
setExt_cod_fee
(
BigDecimal
.
ZERO
);
tradeListParam
.
setOther_amount
(
BigDecimal
.
ZERO
);
tradeListParam
.
setPaid
(
orderVo
.
getPriceActual
());
tradeListParam
.
setWarehouse_no
(
orderVo
.
getErpWarehouseNo
());
listOrder
.
add
(
tradeListParam
);
}
return
ResponseDto
.
success
()
;
return
listOrder
;
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/utils/GoblinRedisUtils.java
View file @
883fd9ec
...
...
@@ -54,6 +54,17 @@ public class GoblinRedisUtils {
}
}
// 获取 nft订单详情vo
public
GoblinNftOrderVo
getNftOrder
(
String
orderId
)
{
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_NFT_ORDER_INFO
.
concat
(
orderId
);
Object
obj
=
getRedis
().
get
(
redisKey
);
if
(
obj
==
null
)
{
return
null
;
}
else
{
return
(
GoblinNftOrderVo
)
obj
;
}
}
// 获取 订单相关Skuvo
public
GoblinOrderSkuVo
getGoblinOrderSkuVo
(
String
orderSkuId
)
{
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_ORDER_SKU
.
concat
(
orderSkuId
);
...
...
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