Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
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
曲欣亮
shop
Commits
fe7fb930
Commit
fe7fb930
authored
Apr 24, 2023
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改购物车查询
parent
cbb45ef6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
4 deletions
+57
-4
CartQueryServiceImpl.java
...com/egolm/shop/api/service/impl/CartQueryServiceImpl.java
+55
-2
CartServiceImpl.java
...java/com/egolm/shop/api/service/impl/CartServiceImpl.java
+2
-2
No files found.
src/main/java/com/egolm/shop/api/service/impl/CartQueryServiceImpl.java
View file @
fe7fb930
...
...
@@ -87,7 +87,6 @@ public class CartQueryServiceImpl implements CartQueryService {
}
}
List
<
Map
<
String
,
Object
>>
wmsList
=
getWmsList
(
datas
,
shopNo
);
Util
.
replaceKey
(
datas
,
":"
,
false
,
"sShopNO:shopNo"
,
"sAgentContractNO:contractNo"
,
"nGoodsID:goodsId"
,
"sGoodsDesc:goodsName"
,
"nSaleQty:saleQty"
,
"sPromoPaperNO:promoNo"
,
"sPromoActionTypeID:promoTypeId"
,
"nMinSaleQty:minOrderQty"
,
"sUnit:priceUnit"
,
...
...
@@ -125,7 +124,60 @@ public class CartQueryServiceImpl implements CartQueryService {
rjx
.
set
(
"promoData"
,
Util
.
listToMM
(
promos
,
"promoNo"
));
rjx
.
set
(
"isOrnament"
,
isOrnament
);
rjx
.
set
(
"isInvalid"
,
isInvalid
);
this
.
processPayAmount
(
rjx
);
//this.processPayAmount(rjx);
List
<
Map
<
String
,
Object
>>
orderSumPayList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
wmsSumPayList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
try
{
String
sql
=
"exec up_B2BGetSumCart '"
+
shopNo
+
"',1 "
;
//计算汇总
orderSumPayList
=
jdbcTemplate
.
executeMutil
(
sql
).
getDatas
().
get
(
0
);
//按订单汇总的
wmsSumPayList
=
jdbcTemplate
.
executeMutil
(
sql
).
getDatas
().
get
(
1
);
//按仓库汇总
if
(
orderSumPayList
!=
null
&&
orderSumPayList
.
size
()>
0
)
{
Map
<
String
,
Object
>
orderSumPayMap
=
orderSumPayList
.
get
(
0
);
String
Status
=
orderSumPayMap
.
get
(
"Status"
)+
""
;
if
(
Status
.
equals
(
"0"
))
{
rjx
.
set
(
"totalAmount"
,
orderSumPayMap
.
get
(
"TotalAmount"
));
rjx
.
set
(
"payAmount"
,
orderSumPayMap
.
get
(
"PayAmount"
));
rjx
.
set
(
"payPoint"
,
orderSumPayMap
.
containsKey
(
"PayPoint"
)?
orderSumPayMap
.
get
(
"PayPoint"
):
0
);
rjx
.
set
(
"totalSaleQty"
,
orderSumPayMap
.
get
(
"TotalSaleQty"
));
rjx
.
set
(
"totalCount"
,
orderSumPayMap
.
get
(
"TotalCount"
));
rjx
.
set
(
"totalSaleAmount"
,
orderSumPayMap
.
get
(
"TotalSaleAmount"
));
rjx
.
set
(
"totalDisAmount"
,
orderSumPayMap
.
get
(
"TotalDisAmount"
));
}
else
{
String
ErrorMsg
=
orderSumPayMap
.
get
(
"ErrorMsg"
)+
""
;
Rjx
errRjx
=
Rjx
.
json
().
set
(
"IsValid"
,
false
).
set
(
"errormsg"
,
ErrorMsg
);
return
errRjx
;
}
}
List
<
Map
<
String
,
Object
>>
rjxWmsList
=
(
List
<
Map
<
String
,
Object
>>)
rjx
.
get
(
"wmsList"
);
if
(
wmsSumPayList
!=
null
&&
rjxWmsList
!=
null
&&
wmsSumPayList
.
size
()
>
0
&&
rjxWmsList
.
size
()
>
0
)
{
for
(
Map
<
String
,
Object
>
wmsMap
:
wmsSumPayList
)
{
String
freightamount
=
wmsMap
.
get
(
"TotalSaleQty"
)+
""
;
String
discountAmount
=
wmsMap
.
get
(
"TotalDisAmount"
)+
""
;
String
totalAmount
=
wmsMap
.
get
(
"PayAmount"
)+
""
;
String
minOrderAmt
=
wmsMap
.
get
(
"MinOrderAmount"
)+
""
;
String
WarehouseNO
=
wmsMap
.
get
(
"WarehouseNO"
)+
""
;
for
(
Map
<
String
,
Object
>
rjxWmsMap
:
rjxWmsList
)
{
String
warehouseNo
=
rjxWmsMap
.
get
(
"warehouseNo"
)+
""
;
if
(
WarehouseNO
.
equals
(
warehouseNo
))
{
rjxWmsMap
.
put
(
"totalAmount"
,
totalAmount
);
rjxWmsMap
.
put
(
"freightAmount"
,
freightamount
);
rjxWmsMap
.
put
(
"minOrderAmt"
,
minOrderAmt
);
rjxWmsMap
.
put
(
"discountAmount"
,
discountAmount
);
break
;
}
}
}
rjx
.
set
(
"wmsList"
,
rjxWmsList
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
rjx
;
}
...
...
@@ -208,6 +260,7 @@ public class CartQueryServiceImpl implements CartQueryService {
private
void
processPayAmount
(
Rjx
rjx
)
{
BigDecimal
nNeedPayAmount
=
BigDecimal
.
ZERO
;
BigDecimal
nNeedPayPoint
=
BigDecimal
.
ZERO
;
BigDecimal
nTotalAmount
=
BigDecimal
.
ZERO
;
...
...
src/main/java/com/egolm/shop/api/service/impl/CartServiceImpl.java
View file @
fe7fb930
...
...
@@ -194,8 +194,8 @@ public class CartServiceImpl implements CartService {
String
shopNO
=
params
.
get
(
"shopNO"
)+
""
;
String
terminal
=
params
.
get
(
"terminal"
)+
""
;
Map
<
String
,
Object
>
queryMap
=
cartRedisService
.
query
(
orgNo
,
shopNO
,
terminal
);
Map
<
String
,
Object
>
countMap
=
this
.
count
(
orgNo
,
shopNO
);
queryMap
.
putAll
(
countMap
);
/*
Map<String, Object> countMap = this.count(orgNo, shopNO);
queryMap.putAll(countMap);
*/
return
Rjx
.
jsonOk
().
setData
(
queryMap
).
toJson
();
}
...
...
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