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
9fbdbc13
Commit
9fbdbc13
authored
Jun 27, 2023
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
需求 #15246
parent
e82e0950
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
5 deletions
+44
-5
OrderServiceImpl.java
...ava/com/egolm/shop/api/service/impl/OrderServiceImpl.java
+44
-5
No files found.
src/main/java/com/egolm/shop/api/service/impl/OrderServiceImpl.java
View file @
9fbdbc13
...
...
@@ -201,8 +201,21 @@ public class OrderServiceImpl implements OrderService {
if
(
orderList
.
size
()
>
0
)
{
List
<
String
>
orderIds
=
orderList
.
stream
().
map
(
o
->
(
String
)
o
.
get
(
"sSalesOrderID"
))
.
collect
(
Collectors
.
toList
());
String
sql2
=
"select sod.*,PromoSalePrice=CONVERT(NUMERIC(12,2),case when sod.nSaleQty = 0 then 0 else ROUND((sod.nSaleAmount)/sod.nSaleQty,2) end),OriginaSaleAmount=sod.nSaleAmount+sod.nDisAmount,ISGift = sod.nTag&1,agp.sURL "
+
" from tSalesOrderDtl sod left join V_GetminAgentGoodsPic agp on agp.nAgentID = sod.nAgentID and agp.nGoodsID = sod.nGoodsID and agp.sPicTypeID = 1 "
//需求 #15246
String
sql2
=
"select sod.sSalesOrderID, sod.nIdx, sod.sAgentContractNO, sod.nAgentID, "
+
" sod.sWarehouseNO, sod.sBarcode, sod.nGoodsID, sod.sGoodsDesc, "
+
" nSaleQty = case when sod.nOrderRate > 1 then sod.nPackQty else sod.nSaleQty end, "
+
" nSalePrice = case when sod.nOrderRate > 1 then sod.nSaleAmount / sod.nPackQty else sod.nSalePrice end, sod.nSaleAmount, "
+
" sod.nDisAmount, sod.sMemo, sod.dUpdate, sod.nTag, "
+
" sod.dLastUpdateTime, sod.sPromoActionTypeID, sod.sPromoActionType, "
+
" sod.sPromoPaperNO, sod.nExpressFee, "
+
" nOldSaleQty = case when sod.nOrderRate > 1 then sod.nOldSaleQty / sod.nOrderRate else sod.nOldSaleQty end, "
+
" nOldSalePrice = case when sod.nOrderRate > 1 then sod.nOldSalePrice * sod.nOrderRate else sod.nOldSalePrice end, "
+
" sod.sSaleUnit, sod.nPackQty, sod.nOrderRate,"
+
" PromoSalePrice=CONVERT(NUMERIC(12,2),case when sod.nSaleQty = 0 then 0 else ROUND((sod.nSaleAmount)/sod.nSaleQty,2) end),"
+
" OriginaSaleAmount=sod.nSaleAmount+sod.nDisAmount,"
+
" ISGift = sod.nTag&1, agp.sURL"
+
" from tSalesOrderDtl sod left join V_GetminAgentGoodsPic agp on agp.nAgentID = sod.nAgentID and agp.nGoodsID = sod.nGoodsID and agp.sPicTypeID = 1 "
+
" where sod.sSalesOrderID in ("
+
StringUtil
.
join
(
"', '"
,
"'"
,
"'"
,
orderIds
)
+
")"
;
List
<
Map
<
String
,
Object
>>
orderDtlList
=
jdbcTemplate
.
queryForList
(
sql2
);
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
dtlML
=
Util
.
listToML
(
orderDtlList
,
"sSalesOrderID"
);
...
...
@@ -211,8 +224,34 @@ public class OrderServiceImpl implements OrderService {
List
<
Map
<
String
,
Object
>>
dtlList
=
dtlML
.
get
(
sSalesOrderID
);
orderMap
.
put
(
"list"
,
dtlList
);
}
String
sql3
=
"select * from tSalesOrderSub where sSalesOrderID in ("
+
StringUtil
.
join
(
"', '"
,
"'"
,
"'"
,
orderIds
)
+
")"
;
//需求 #15246
String
sql3
=
"select sosd.sSubOrderID, sosd.nIdx, sosd.sSalesOrderID, sosd.sAgentContractNO, "
+
" sosd.nAgentID, sosd.sWarehouseNO, sosd.sBarcode, sosd.nGoodsID, sosd.sGoodsDesc, "
+
" nSaleQty = case when sosd.nOrderRate > 1 then sosd.nPackQty else sosd.nSaleQty end, "
+
" nSalePrice = case when sosd.nOrderRate > 1 then sosd.nSaleAmount/sosd.nPackQty else sosd.nSalePrice end, "
+
" sosd.nSaleAmount, "
+
" sosd.nDisAmount, "
+
" nSendQty = case when sosd.nOrderRate > 1 then sosd.nSendQty / sosd.nOrderRate else sosd.nSendQty end, "
+
" sosd.nSendAmount, "
+
" nReceiveQty = case when sosd.nOrderRate > 1 then sosd.nReceiveQty / sosd.nOrderRate else sosd.nReceiveQty end, "
+
" sosd.nReceiveAmount, "
+
" sosd.sMemo, sosd.dUpdate, sosd.nTag, sosd.dLastUpdateTime, "
+
" sosd.sPromoActionTypeID, sosd.sPromoActionType, sosd.sOldSubOrderID, "
+
" sosd.nAvgStockPrice, sosd.nReturnQty, sosd.sReturnTypeID, "
+
" sosd.sReturnType, sosd.sRetunReson, sosd.nCaseUnits, sosd.sUnit, "
+
" sosd.sChangeUser, sosd.dChangeDate, sosd.dProduceDate, sosd.nTaxRate, "
+
" sosd.nExpressFee, sosd.sPromoPaperNO, "
+
" nOldSaleQty = case when sosd.nOrderRate > 1 then sosd.nOldSaleQty / sosd.nOrderRate else sosd.nOldSaleQty end, "
+
" nOldSalePrice = case when sosd.nOrderRate > 1 then sosd.nOldSalePrice*sosd.nOrderRate else sosd.nOldSalePrice end, "
+
" sosd.nOldLockedQty, sosd.sSaleUnit, "
+
" sosd.nPackQty, sosd.nOrderRate, "
+
" PromoSalePrice=CONVERT(NUMERIC(12,2),case when sosd.nSaleQty = 0 then 0 else ROUND((sosd.nSaleAmount)/sosd.nSaleQty,2) end),"
+
" OriginaSaleAmount=sosd.nSaleAmount+sosd.nDisAmount,"
+
" ISGift = sosd.nTag&1,"
+
" agp.sURL "
+
"from tSalesOrderSubDtl sosd left join V_GetminAgentGoodsPic agp on agp.nAgentID = sosd.nAgentID and agp.nGoodsID = sosd.nGoodsID and agp.sPicTypeID = 1"
+
"where sosd.sSubOrderID in ("
+
StringUtil
.
join
(
"', '"
,
"'"
,
"'"
,
orderIds
)
+
")"
;
List
<
Map
<
String
,
Object
>>
subList
=
jdbcTemplate
.
queryForList
(
sql3
);
if
(
subList
.
size
()
>
0
)
{
List
<
String
>
subIds
=
subList
.
stream
().
map
(
o
->
(
String
)
o
.
get
(
"sSubOrderID"
))
...
...
@@ -384,7 +423,7 @@ public class OrderServiceImpl implements OrderService {
" sosd.sChangeUser, sosd.dChangeDate, sosd.dProduceDate, sosd.nTaxRate, "
+
" sosd.nExpressFee, sosd.sPromoPaperNO, "
+
" nOldSaleQty = case when sosd.nOrderRate > 1 then sosd.nOldSaleQty / sosd.nOrderRate else sosd.nOldSaleQty end, "
+
" nOldSalePrice = case when sosd.nOrderRate > 1 then sosd.nOldSalePrice*sosd.nOrderRate else sosd.nOldSalePrice end,
"
+
" nOldSalePrice = case when sosd.nOrderRate > 1 then sosd.nOldSalePrice*sosd.nOrderRate else sosd.nOldSalePrice end,"
+
" sosd.nOldLockedQty, sosd.sSaleUnit, "
+
" sosd.nPackQty, sosd.nOrderRate, "
+
" PromoSalePrice=CONVERT(NUMERIC(12,2),case when sosd.nSaleQty = 0 then 0 else ROUND((sosd.nSaleAmount)/sosd.nSaleQty,2) end),"
+
...
...
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