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
522c4640
Commit
522c4640
authored
Feb 20, 2023
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
需求 #14244
parent
9ae19d73
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
214 additions
and
2 deletions
+214
-2
OrderController.java
src/main/java/com/egolm/shop/api/OrderController.java
+23
-0
OrderService.java
src/main/java/com/egolm/shop/api/service/OrderService.java
+5
-0
OrderServiceImpl.java
...ava/com/egolm/shop/api/service/impl/OrderServiceImpl.java
+131
-2
RespObject.java
src/main/java/com/egolm/shop/bean/RespObject.java
+55
-0
No files found.
src/main/java/com/egolm/shop/api/OrderController.java
View file @
522c4640
...
...
@@ -27,6 +27,7 @@ import com.egolm.common.StringUtil;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.shop.api.service.OrderService
;
import
com.egolm.shop.bean.RespObject
;
import
com.egolm.shop.common.utils.XmlUtil
;
import
io.swagger.annotations.Api
;
...
...
@@ -106,6 +107,28 @@ public class OrderController {
return
orderService
.
queryOrderList
(
orgNo
,
shopNo
,
status
,
types
.
toArray
(
new
String
[
types
.
size
()]),
langID
,
page
);
}
@ApiOperation
(
"B2B售后退单列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNo"
,
dataType
=
"String"
,
required
=
true
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"shopNo"
,
dataType
=
"String"
,
required
=
true
,
value
=
"店铺编号"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"refundStatus"
,
dataType
=
"int"
,
required
=
true
,
value
=
"退单状态,1=申请售后、2=平台确认、3=退货/退款、4=售后完成"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"index"
,
dataType
=
"String"
,
required
=
true
,
value
=
"第几页"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"limit"
,
dataType
=
"String"
,
required
=
true
,
value
=
"每页数量"
,
defaultValue
=
"20"
),
})
@RequestMapping
(
value
=
"/getRefundOrderList"
,
method
=
RequestMethod
.
GET
)
public
RespObject
getRefundOrderList
(
String
orgNo
,
String
shopNo
,
Integer
refundStatus
,
String
langID
,
Integer
index
,
Integer
limit
)
{
Page
page
=
new
Page
();
page
.
setIndex
(
Long
.
valueOf
(
index
));
page
.
setLimit
(
Long
.
valueOf
(
limit
));
page
.
setLimitKey
(
"OrderDate desc"
);
return
orderService
.
queryRefundOrderList
(
orgNo
,
shopNo
,
refundStatus
,
langID
,
page
);
}
@ApiOperation
(
"获取主订单详情"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"salesOrderId"
,
dataType
=
"String"
,
required
=
true
),
...
...
src/main/java/com/egolm/shop/api/service/OrderService.java
View file @
522c4640
...
...
@@ -7,6 +7,7 @@ import java.util.Map;
import
com.alibaba.fastjson.JSONObject
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.shop.bean.RespObject
;
public
interface
OrderService
{
...
...
@@ -36,4 +37,8 @@ public interface OrderService {
public
List
<
Map
<
String
,
Object
>>
getDeliverSubDetail
(
String
aocOrderID
);
public
RespObject
queryRefundOrderList
(
String
orgNo
,
String
shopNo
,
Integer
refundStatus
,
String
langID
,
Page
page
);
}
src/main/java/com/egolm/shop/api/service/impl/OrderServiceImpl.java
View file @
522c4640
...
...
@@ -2,6 +2,7 @@ package com.egolm.shop.api.service.impl;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -25,6 +26,7 @@ import com.egolm.common.jdbc.dialect.Dialect;
import
com.egolm.common.jdbc.dialect.SqlServerDialect
;
import
com.egolm.common.jdbc.dialect.bean.Sql
;
import
com.egolm.shop.api.service.OrderService
;
import
com.egolm.shop.bean.RespObject
;
import
com.egolm.shop.bean.TSalesOrder
;
import
com.egolm.shop.bean.TSalesOrderDtl
;
import
com.egolm.shop.common.XException
;
...
...
@@ -896,4 +898,131 @@ public class OrderServiceImpl implements OrderService {
}*/
}
@Override
public
RespObject
queryRefundOrderList
(
String
orgNo
,
String
shopNo
,
Integer
refundStatus
,
String
langID
,
Page
page
)
{
List
<
Map
<
String
,
Object
>>
sortList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
int
saleReturnDays
=
0
;
try
{
String
dSql
=
"select SaleReturnDays = convert(int, sValue1) FROM tSystemCtrl WHERE sCode = 'SaleReturnDays' "
;
saleReturnDays
=
jdbcTemplate
.
queryForInt
(
dSql
);
}
catch
(
Exception
e
)
{
}
String
sql
=
"select "
+
" SalesOrderID = a.sSalesOrderID, "
+
" SubOrderID = a.sSubOrderID, "
+
" OrderDate = a.dOrderDate, "
+
" SalesOrderTypeID = a.sSalesOrderTypeID,"
+
" SalesOrderType = a.sSalesOrderType,"
+
" TotalSaleQty = a.nTotalSaleQty,"
+
" TotalSaleAmount = a.nTotalSaleAmount,"
+
" TotalDisAmount = a.nTotalDisAmount,"
+
" DeliveryTypeID = a.sDeliveryTypeID,"
+
" DeliveryType = a.sDeliveryType,"
+
" Contacts = a.sContacts,"
+
" Mobile = a.sMobile,"
+
" Address = a.sAddress,"
+
" ExpressFee = a.nExpressFee,"
+
" OrderStatus = a.nOrderStatus,"
+
" OrderStatusName = a.nOrderStatusName,"
+
" OrderMemo = a.sOrderMemo"
+
" from tSalesOrderSub a "
+
" where a.sShopNO = '"
+
shopNo
+
"' "
;
if
(
refundStatus
==
1
)
{
/*查询指定状态订单:1=申请售后*/
sql
+=
" and a.sSalesOrderTypeID = '0' "
+
" and a.sB2BOrderTypeID = '1' "
+
" and a.nOrderStatus&1 = 0 "
+
" and (a.nOrderStatus&16=16 or nOrderStatus&4=0) "
+
" and (datediff(dd, a.dOrderDate, getdate()) <= "
+
saleReturnDays
+
" or "
+
saleReturnDays
+
" = 0) "
+
" and exists(select 1 from tSalesOrderSubDtl where sSubOrderID = a.sSubOrderID and (nSaleQty - isnull(nReturnQty,0)) > 0) "
;
}
else
if
(
refundStatus
==
2
)
{
/*查询指定状态订单:2=平台确认*/
sql
+=
" and a.sSalesOrderTypeID = '2' "
+
" and isnull(a.sOldSubOrderID,'') <> '' "
+
" and a.nOrderStatus&4=0 "
;
}
else
if
(
refundStatus
==
3
)
{
sql
+=
" and a.sSalesOrderTypeID = '2' "
+
" and isnull(a.sOldSubOrderID,'') <> '' "
+
" and a.nOrderStatus&1=0 "
+
" and a.nOrderStatus&16=0 "
;
}
else
{
sql
+=
" and a.sSalesOrderTypeID = '2' "
+
" and isnull(a.sOldSubOrderID,'') <> '' "
+
" and a.nOrderStatus&1=0 "
+
" and a.nOrderStatus&16=16 "
;
}
List
<
Map
<
String
,
Object
>>
orderList
=
jdbcTemplate
.
limit
(
sql
,
page
);
sortList
.
addAll
(
orderList
);
sortList
.
sort
(
new
Comparator
<
Map
<
String
,
Object
>>()
{
public
int
compare
(
Map
<
String
,
Object
>
arg0
,
Map
<
String
,
Object
>
arg1
)
{
Date
time1
=
this
.
getOrderTime
(
arg0
);
Date
time2
=
this
.
getOrderTime
(
arg1
);
return
time2
.
compareTo
(
time1
);
}
private
Date
getOrderTime
(
Map
<
String
,
Object
>
map
)
{
String
SalesOrderTypeID
=
(
String
)
map
.
get
(
"SalesOrderTypeID"
);
if
(
StringUtil
.
isNotBlank
(
SalesOrderTypeID
))
{
return
(
Date
)
map
.
get
(
"OrderDate"
);
}
else
{
return
(
Date
)
map
.
get
(
"OrderDateTime"
);
}
}
});
Integer
start
=
page
.
getFirstRowNumber
().
intValue
()
-
1
;
Integer
end
=
page
.
getLastRowNumber
().
intValue
();
Integer
size
=
sortList
.
size
();
end
=
size
<
end
?
size
:
end
;
page
.
setTotal
((
long
)
sortList
.
size
());
List
<
Map
<
String
,
Object
>>
datas
=
sortList
.
subList
(
start
,
end
);
if
(
orderList
!=
null
&&
orderList
.
size
()
>
0
)
{
List
<
String
>
orderIdList
=
orderList
.
stream
().
map
(
o
->
(
String
)
o
.
get
(
"SubOrderID"
)).
collect
(
Collectors
.
toList
());
String
detailSql
=
"select"
+
" SalesOrderID = a.sSalesOrderID,"
+
" SubOrderID = a.sSubOrderID,"
+
" Idx = a.nIdx,"
+
" GoodsID = a.nGoodsID,"
+
" GoodsNO = ag.sGoodsNO,"
+
" GoodsDesc = a.sGoodsDesc,"
+
" Spec = ag.sSpec,"
+
" Unit = a.sUnit,"
+
" SaleQty = case when b.sSalesOrderTypeID = '0' then a.nSaleQty else 0 end,"
+
" SalePrice = a.nSalePrice,"
+
" RealSalePrice = ag.nRealSalePrice,"
+
" SaleAmount = case when b.sSalesOrderTypeID = '0' then a.nSaleAmount else 0 end,"
+
" DisAmount = case when b.sSalesOrderTypeID = '0' then a.nDisAmount else 0 end,"
+
" PromoPaperNO = a.sPromoPaperNO,"
+
" PromoActionTypeID = a.sPromoActionTypeID,"
+
" ReturnQty = case when b.sSalesOrderTypeID = '0' then isnull(a.nReturnQty,0) else abs(a.nSaleQty) end,"
+
" LeftRefundQty = case when b.sSalesOrderTypeID = '0' then a.nSaleQty - isnull(a.nReturnQty,0) else 0 end,"
+
" Memo = a.sMemo,"
+
" Tag = a.nTag,"
+
" GoodsURL = gp.sURL "
+
" from tSalesOrderSubDtl a join tSalesOrderSub b on a.sSubOrderID = b.sSubOrderID left join tAgentContractGoods ag on a.nAgentID = ag.nAgentID "
+
" and a.sAgentContractNO = ag.sAgentContractNO and a.nGoodsID = ag.nGoodsID "
+
" left join V_GetminAgentGoodsPic gp on a.nAgentID = gp.nAgentID and a.nGoodsID = gp.nGoodsID "
+
" where a.sSubOrderID in (?) "
+
" order by a.nIdx"
;
List
<
Map
<
String
,
Object
>>
goodsList
=
jdbcTemplate
.
queryForList
(
detailSql
,
orderIdList
.
toArray
());
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
gmList
=
Util
.
listToML
(
goodsList
,
"SalesOrderID"
);
for
(
Map
<
String
,
Object
>
orderMap
:
orderList
)
{
orderMap
.
put
(
"SalesOrderDtl"
,
gmList
.
get
(
orderMap
.
get
(
"SalesOrderID"
)));
}
}
Map
<
String
,
Object
>
result
=
new
HashMap
<
String
,
Object
>();
result
.
put
(
"page"
,
page
);
result
.
put
(
"SalesOrderList"
,
datas
);
return
new
RespObject
(
result
);
}
}
src/main/java/com/egolm/shop/bean/RespObject.java
0 → 100644
View file @
522c4640
package
com
.
egolm
.
shop
.
bean
;
import
java.io.Serializable
;
public
class
RespObject
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
int
code
=
200
;
private
String
message
=
"OK"
;
private
Object
data
;
public
RespObject
()
{
this
.
data
=
null
;
}
public
RespObject
(
Object
data
)
{
this
.
data
=
data
;
}
public
RespObject
(
int
code
,
String
message
,
Object
data
)
{
this
.
code
=
code
;
this
.
message
=
message
;
this
.
data
=
data
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
Object
getData
()
{
return
data
;
}
public
void
setData
(
Object
data
)
{
this
.
data
=
data
;
}
public
static
long
getSerialversionuid
()
{
return
serialVersionUID
;
}
}
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