Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
ddf2f0ea
提交
ddf2f0ea
authored
5月 09, 2019
作者:
sin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- 退款流程基本走完
上级
3677aab9
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
333 行增加
和
59 行删除
+333
-59
orderRefunds.js
admin-web/src/models/orderRefunds/orderRefunds.js
+50
-1
OrderRefundsList.js
admin-web/src/pages/OrderRefunds/OrderRefundsList.js
+160
-16
TableSearch.js
admin-web/src/pages/OrderRefunds/TableSearch.js
+8
-2
orderRefunds.js
admin-web/src/services/orderRefunds.js
+21
-3
common.css
mobile-web/src/assets/style/common.css
+18
-10
AdminOrderReturnController.java
...ication/controller/admins/AdminOrderReturnController.java
+4
-4
OrderReturnQueryPO.java
...r/mall/order/application/po/admin/OrderReturnQueryPO.java
+11
-0
OrderReturnQueryDTO.java
...va/cn/iocoder/mall/order/api/dto/OrderReturnQueryDTO.java
+8
-0
OrderReturnMapper.java
...java/cn/iocoder/mall/order/biz/dao/OrderReturnMapper.java
+1
-1
OrderReturnDO.java
...a/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java
+5
-2
OrderReturnServiceImpl.java
...ocoder/mall/order/biz/service/OrderReturnServiceImpl.java
+30
-10
OrderReturnMapper.xml
...vice-impl/src/main/resources/mapper/OrderReturnMapper.xml
+16
-9
AdminSecurityInterceptor.java
.../mall/admin/sdk/interceptor/AdminSecurityInterceptor.java
+1
-1
没有找到文件。
admin-web/src/models/orderRefunds/orderRefunds.js
浏览文件 @
ddf2f0ea
import
{
list
}
from
'../../services/orderRefunds'
;
import
{
message
}
from
'antd'
;
import
{
list
,
agree
,
refuse
,
confirmReceipt
,
confirmRefund
}
from
'../../services/orderRefunds'
;
export
default
{
export
default
{
namespace
:
'orderRefunds'
,
namespace
:
'orderRefunds'
,
...
@@ -18,6 +19,54 @@ export default {
...
@@ -18,6 +19,54 @@ export default {
payload
:
response
.
data
,
payload
:
response
.
data
,
});
});
},
},
*
agree
({
payload
},
{
call
})
{
const
{
callback
,
params
}
=
payload
;
const
response
=
yield
call
(
agree
,
params
);
if
(
response
.
code
!==
0
)
{
message
.
error
(
'操作失败!'
);
}
else
{
message
.
success
(
'操作成功!'
);
if
(
callback
)
{
callback
(
response
);
}
}
},
*
refuse
({
payload
},
{
call
})
{
const
{
callback
,
params
}
=
payload
;
const
response
=
yield
call
(
refuse
,
params
);
if
(
response
.
code
!==
0
)
{
message
.
error
(
'操作失败!'
);
}
else
{
message
.
success
(
'操作成功!'
);
if
(
callback
)
{
callback
(
response
);
}
}
},
*
confirmReceipt
({
payload
},
{
call
})
{
const
{
callback
,
params
}
=
payload
;
const
response
=
yield
call
(
confirmReceipt
,
params
);
if
(
response
.
code
!==
0
)
{
message
.
error
(
'操作失败!'
);
}
else
{
message
.
success
(
'操作成功!'
);
if
(
callback
)
{
callback
(
response
);
}
}
},
*
confirmRefund
({
payload
},
{
call
})
{
const
{
callback
,
params
}
=
payload
;
const
response
=
yield
call
(
confirmRefund
,
params
);
if
(
response
.
code
!==
0
)
{
message
.
error
(
'操作失败!'
);
}
else
{
message
.
success
(
'操作成功!'
);
if
(
callback
)
{
callback
(
response
);
}
}
},
},
},
reducers
:
{
reducers
:
{
...
...
admin-web/src/pages/OrderRefunds/OrderRefundsList.js
浏览文件 @
ddf2f0ea
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
{
connect
}
from
'dva'
;
import
{
connect
}
from
'dva'
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
{
Card
,
Tabs
,
Table
}
from
'antd'
;
import
{
Card
,
Tabs
,
Modal
,
Table
,
Divider
}
from
'antd'
;
import
PageHeaderWrapper
from
'../../components/PageHeaderWrapper'
;
import
PageHeaderWrapper
from
'../../components/PageHeaderWrapper'
;
import
DictionaryText
from
'../../components/Dictionary/DictionaryText'
;
import
DictionaryText
from
'../../components/Dictionary/DictionaryText'
;
import
TableSearch
from
'./TableSearch'
;
import
TableSearch
from
'./TableSearch'
;
...
@@ -19,29 +19,46 @@ import dictionary from '../../utils/dictionary';
...
@@ -19,29 +19,46 @@ import dictionary from '../../utils/dictionary';
class
OrderRefundsList
extends
PureComponent
{
class
OrderRefundsList
extends
PureComponent
{
componentDidMount
()
{
componentDidMount
()
{
// 查询 list
// 查询 list
this
.
queryList
({
index
:
1
},
{});
this
.
queryList
({
index
:
1
,
pageSize
:
10
},
{});
}
}
handleSearch
=
searchParams
=>
{
handleSearch
=
searchParams
=>
{
const
{
orderRefunds
}
=
this
.
props
;
const
{
orderRefunds
}
=
this
.
props
;
const
{
index
,
pageSize
}
=
orderRefunds
;
const
{
index
,
pageSize
}
=
orderRefunds
;
this
.
queryList
({
index
,
pageSize
},
searchParams
);
this
.
queryList
(
{
index
,
pageSize
},
{
...
searchParams
,
...
this
.
tabsValue
,
}
);
};
};
queryList
=
(
{
index
=
0
,
pageSize
=
10
}
,
searchParams
)
=>
{
queryList
=
(
pageParams
,
searchParams
)
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
dispatch
}
=
this
.
props
;
this
.
pageParams
=
pageParams
;
this
.
searchParams
=
searchParams
;
dispatch
({
dispatch
({
type
:
'orderRefunds/list'
,
type
:
'orderRefunds/list'
,
payload
:
{
payload
:
{
index
,
...
pageParams
,
pageSize
,
...
searchParams
,
...
searchParams
,
},
},
});
});
};
};
handleTabsChange
=
value
=>
{
handleTabsChange
=
value
=>
{
console
.
log
(
value
);
this
.
tabsValue
=
{
status
:
value
,
};
this
.
queryList
(
{
index
:
1
,
pageSize
:
10
},
{
...
this
.
searchParams
,
status
:
value
,
}
);
};
};
handleTableChange
=
pagination
=>
{
handleTableChange
=
pagination
=>
{
...
@@ -49,11 +66,116 @@ class OrderRefundsList extends PureComponent {
...
@@ -49,11 +66,116 @@ class OrderRefundsList extends PureComponent {
this
.
queryList
({
pageSize
,
index
:
current
},
{});
this
.
queryList
({
pageSize
,
index
:
current
},
{});
};
};
handleAgreeClick
=
({
id
})
=>
{
const
{
dispatch
}
=
this
.
props
;
const
self
=
this
;
Modal
.
confirm
({
title
:
'提示消息'
,
content
:
'确认同意!'
,
onOk
()
{
dispatch
({
type
:
'orderRefunds/agree'
,
payload
:
{
params
:
{
id
,
},
callback
:
()
=>
{
self
.
queryList
(
self
.
pageParams
,
self
.
searchParams
);
},
},
});
},
onCancel
()
{
console
.
log
(
'Cancel'
);
},
});
};
handleRefuse
=
({
id
})
=>
{
const
{
dispatch
}
=
this
.
props
;
const
self
=
this
;
Modal
.
confirm
({
title
:
'提示消息'
,
content
:
'确认拒绝!'
,
onOk
()
{
dispatch
({
type
:
'orderRefunds/refuse'
,
payload
:
{
params
:
{
id
,
},
callback
:
()
=>
{
self
.
queryList
(
self
.
pageParams
,
self
.
searchParams
);
},
},
});
},
onCancel
()
{
console
.
log
(
'Cancel'
);
},
});
};
handleConfirmReceipt
=
({
id
})
=>
{
const
{
dispatch
}
=
this
.
props
;
const
self
=
this
;
Modal
.
confirm
({
title
:
'提示消息'
,
content
:
'确认收货!'
,
onOk
()
{
dispatch
({
type
:
'orderRefunds/confirmReceipt'
,
payload
:
{
params
:
{
id
,
},
callback
:
()
=>
{
self
.
queryList
(
self
.
pageParams
,
self
.
searchParams
);
},
},
});
},
onCancel
()
{
console
.
log
(
'Cancel'
);
},
});
};
handleConfirmRefund
=
({
id
})
=>
{
const
{
dispatch
}
=
this
.
props
;
const
self
=
this
;
Modal
.
confirm
({
title
:
'提示消息'
,
content
:
'确认退款!'
,
onOk
()
{
dispatch
({
type
:
'orderRefunds/confirmRefund'
,
payload
:
{
params
:
{
id
,
},
callback
:
()
=>
{
self
.
queryList
(
self
.
pageParams
,
self
.
searchParams
);
},
},
});
},
onCancel
()
{
console
.
log
(
'Cancel'
);
},
});
};
render
()
{
render
()
{
const
{
orderRefunds
}
=
this
.
props
;
const
{
orderRefunds
,
loading
}
=
this
.
props
;
const
{
list
,
totalCount
,
index
,
pageSize
}
=
orderRefunds
;
const
{
list
,
totalCount
,
index
,
pageSize
}
=
orderRefunds
;
const
columns
=
[
const
columns
=
[
{
title
:
'订单号'
,
dataIndex
:
'orderId'
,
key
:
'orderId'
,
},
{
{
title
:
'服务编号'
,
title
:
'服务编号'
,
dataIndex
:
'serviceNumber'
,
dataIndex
:
'serviceNumber'
,
...
@@ -111,12 +233,31 @@ class OrderRefundsList extends PureComponent {
...
@@ -111,12 +233,31 @@ class OrderRefundsList extends PureComponent {
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
render
()
{
render
:
row
=>
{
return
(
const
{
status
}
=
row
;
<
div
>
let
buttons
;
<
a
>
同意
<
/a
>
if
(
status
===
1
)
{
<
/div
>
buttons
=
(
);
<
div
>
<
a
onClick
=
{
this
.
handleAgreeClick
.
bind
(
this
,
row
)}
>
同意
<
/a
>
<
Divider
type
=
"vertical"
/>
<
a
onClick
=
{
this
.
handleRefuse
.
bind
(
this
,
row
)}
>
拒绝
<
/a
>
<
/div
>
);
}
else
if
(
status
===
2
)
{
buttons
=
(
<
div
>
<
a
onClick
=
{
this
.
handleConfirmReceipt
.
bind
(
this
,
row
)}
>
确认收货
<
/a
>
<
/div
>
);
}
else
if
(
status
===
5
)
{
buttons
=
(
<
div
>
<
a
onClick
=
{
this
.
handleConfirmRefund
.
bind
(
this
,
row
)}
>
退款
<
/a
>
<
/div
>
);
}
return
buttons
;
},
},
},
},
];
];
...
@@ -137,11 +278,14 @@ class OrderRefundsList extends PureComponent {
...
@@ -137,11 +278,14 @@ class OrderRefundsList extends PureComponent {
<
Tabs
defaultActiveKey
=
{
null
}
onChange
=
{
this
.
handleTabsChange
}
>
<
Tabs
defaultActiveKey
=
{
null
}
onChange
=
{
this
.
handleTabsChange
}
>
<
Tabs
.
TabPane
tab
=
"全部"
key
=
{
null
}
/
>
<
Tabs
.
TabPane
tab
=
"全部"
key
=
{
null
}
/
>
<
Tabs
.
TabPane
tab
=
"待处理"
key
=
{
1
}
/
>
<
Tabs
.
TabPane
tab
=
"待处理"
key
=
{
1
}
/
>
<
Tabs
.
TabPane
tab
=
"已处理"
key
=
{
2
}
/
>
<
Tabs
.
TabPane
tab
=
"待收货"
key
=
{
2
}
/
>
<
Tabs
.
TabPane
tab
=
"已完成"
key
=
{
4
}
/
>
<
Tabs
.
TabPane
tab
=
"已收货"
key
=
{
5
}
/
>
<
Tabs
.
TabPane
tab
=
"已完成"
key
=
{
6
}
/
>
<
Tabs
.
TabPane
tab
=
"已拒绝"
key
=
{
3
}
/
>
<
/Tabs
>
<
/Tabs
>
<
Table
<
Table
loading
=
{
loading
}
rowKey
=
"id"
rowKey
=
"id"
dataSource
=
{
list
}
dataSource
=
{
list
}
columns
=
{
columns
}
columns
=
{
columns
}
...
...
admin-web/src/pages/OrderRefunds/TableSearch.js
浏览文件 @
ddf2f0ea
...
@@ -9,12 +9,13 @@ const FormItem = Form.Item;
...
@@ -9,12 +9,13 @@ const FormItem = Form.Item;
* @type {React.ComponentClass<RcBaseFormProps & Omit<FormComponentProps, keyof FormComponentProps>>}
* @type {React.ComponentClass<RcBaseFormProps & Omit<FormComponentProps, keyof FormComponentProps>>}
*/
*/
const
TableSearch
=
Form
.
create
()(
props
=>
{
const
TableSearch
=
Form
.
create
()(
props
=>
{
const
{
getFieldDecorator
,
form
,
handleSearch
}
=
props
.
form
;
const
{
handleSearch
}
=
props
;
const
{
getFieldDecorator
,
validateFields
,
form
}
=
props
.
form
;
function
onSubmit
(
e
)
{
function
onSubmit
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
form
.
validateFields
((
err
,
fields
)
=>
{
validateFields
((
err
,
fields
)
=>
{
const
buildTime
=
(
fieldValue
,
key
)
=>
{
const
buildTime
=
(
fieldValue
,
key
)
=>
{
const
res
=
{};
const
res
=
{};
if
(
fieldValue
&&
fieldValue
.
length
>=
2
)
{
if
(
fieldValue
&&
fieldValue
.
length
>=
2
)
{
...
@@ -68,6 +69,11 @@ const TableSearch = Form.create()(props => {
...
@@ -68,6 +69,11 @@ const TableSearch = Form.create()(props => {
{
getFieldDecorator
(
'orderNo'
)(
<
Input
placeholder
=
"请输入订单号"
/>
)}
{
getFieldDecorator
(
'orderNo'
)(
<
Input
placeholder
=
"请输入订单号"
/>
)}
<
/FormItem
>
<
/FormItem
>
<
/Col
>
<
/Col
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"服务号"
>
{
getFieldDecorator
(
'serviceNumber'
)(
<
Input
placeholder
=
"请输入服务号"
/>
)}
<
/FormItem
>
<
/Col
>
<
/Row
>
<
/Row
>
<
Row
gutter
=
{{
md
:
8
,
lg
:
24
,
xl
:
48
}}
>
<
Row
gutter
=
{{
md
:
8
,
lg
:
24
,
xl
:
48
}}
>
...
...
admin-web/src/services/orderRefunds.js
浏览文件 @
ddf2f0ea
...
@@ -8,8 +8,26 @@ export async function list(params) {
...
@@ -8,8 +8,26 @@ export async function list(params) {
});
});
}
}
export
async
function
orderPage
(
params
)
{
export
async
function
agree
(
params
)
{
return
request
(
`/order-api/admins/order/page?
${
stringify
(
params
)}
`
,
{
return
request
(
`/order-api/admins/order_return/agree?
${
stringify
(
params
)}
`
,
{
method
:
'GET'
,
method
:
'POST'
,
});
}
export
async
function
refuse
(
params
)
{
return
request
(
`/order-api/admins/order_return/refuse?
${
stringify
(
params
)}
`
,
{
method
:
'POST'
,
});
}
export
async
function
confirmReceipt
(
params
)
{
return
request
(
`/order-api/admins/order_return/confirm_receipt?
${
stringify
(
params
)}
`
,
{
method
:
'POST'
,
});
}
export
async
function
confirmRefund
(
params
)
{
return
request
(
`/order-api/admins/order_return/confirm_refund?
${
stringify
(
params
)}
`
,
{
method
:
'POST'
,
});
});
}
}
mobile-web/src/assets/style/common.css
浏览文件 @
ddf2f0ea
...
@@ -14,20 +14,28 @@ body {
...
@@ -14,20 +14,28 @@ body {
border-right
:
1px
solid
#ccc2bf
;
border-right
:
1px
solid
#ccc2bf
;
}
}
#app
,
.van-goods-action
,
.van-overflow-hidden
{
@media
screen
and
(
min-width
:
769px
)
{
max-width
:
600px
!important
;
#app
,
.van-goods-action
,
.van-overflow-hidden
{
margin
:
0
auto
;
max-width
:
600px
!important
;
}
margin
:
0
auto
;
}
.van-tabbar
,
.van-submit-bar
{
.van-tabbar
,
.van-submit-bar
{
max-width
:
600px
!important
;
max-width
:
600px
!important
;
position
:
fixed
;
position
:
fixed
;
margin
:
auto
;
margin
:
auto
;
left
:
0
;
left
:
0
;
right
:
0
;
right
:
0
;
}
}
.wap-wrap
{
font-size
:
0.32rem
;
width
:
100%
;
}
}
#maxWidth
{
#maxWidth
{
display
:
flex
;
display
:
flex
;
flex
:
1
;
flex
:
1
;
...
...
order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/admins/AdminOrderReturnController.java
浏览文件 @
ddf2f0ea
...
@@ -46,13 +46,13 @@ public class AdminOrderReturnController {
...
@@ -46,13 +46,13 @@ public class AdminOrderReturnController {
return
orderReturnService
.
orderReturnRefuse
(
id
);
return
orderReturnService
.
orderReturnRefuse
(
id
);
}
}
@PostMapping
(
"confirm_
commodity
"
)
@PostMapping
(
"confirm_
receipt
"
)
public
CommonResult
confirm
Commodity
(
@RequestParam
(
"id"
)
Integer
id
)
{
public
CommonResult
confirm
Receipt
(
@RequestParam
(
"id"
)
Integer
id
)
{
return
orderReturnService
.
confirmReceipt
(
id
);
return
orderReturnService
.
confirmReceipt
(
id
);
}
}
@PostMapping
(
"confirm_
order
"
)
@PostMapping
(
"confirm_
refund
"
)
public
CommonResult
confirm
Order
(
HttpServletRequest
request
,
@RequestParam
(
"id"
)
Integer
id
)
{
public
CommonResult
confirm
Refund
(
HttpServletRequest
request
,
@RequestParam
(
"id"
)
Integer
id
)
{
String
ip
=
HttpUtil
.
getIp
(
request
);
String
ip
=
HttpUtil
.
getIp
(
request
);
return
orderReturnService
.
refund
(
id
,
ip
);
return
orderReturnService
.
refund
(
id
,
ip
);
}
}
...
...
order/order-application/src/main/java/cn/iocoder/mall/order/application/po/admin/OrderReturnQueryPO.java
浏览文件 @
ddf2f0ea
...
@@ -2,6 +2,7 @@ package cn.iocoder.mall.order.application.po.admin;
...
@@ -2,6 +2,7 @@ package cn.iocoder.mall.order.application.po.admin;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -26,14 +27,24 @@ public class OrderReturnQueryPO implements Serializable {
...
@@ -26,14 +27,24 @@ public class OrderReturnQueryPO implements Serializable {
* 订单编号
* 订单编号
*/
*/
private
Integer
orderNo
;
private
Integer
orderNo
;
/**
* 服务号
*/
private
String
serviceNumber
;
/**
/**
* 创建时间 - 开始
* 创建时间 - 开始
*/
*/
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
startCreateTime
;
private
Date
startCreateTime
;
/**
/**
* 创建时间 - 结束
* 创建时间 - 结束
*/
*/
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
endCreateTime
;
private
Date
endCreateTime
;
/**
* 状态
*/
private
Integer
status
;
///
///
/// 分页信息
/// 分页信息
...
...
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderReturnQueryDTO.java
浏览文件 @
ddf2f0ea
...
@@ -25,6 +25,10 @@ public class OrderReturnQueryDTO implements Serializable {
...
@@ -25,6 +25,10 @@ public class OrderReturnQueryDTO implements Serializable {
* 订单编号
* 订单编号
*/
*/
private
Integer
orderNo
;
private
Integer
orderNo
;
/**
* 服务号
*/
private
String
serviceNumber
;
/**
/**
* 创建时间 - 开始
* 创建时间 - 开始
*/
*/
...
@@ -33,6 +37,10 @@ public class OrderReturnQueryDTO implements Serializable {
...
@@ -33,6 +37,10 @@ public class OrderReturnQueryDTO implements Serializable {
* 创建时间 - 结束
* 创建时间 - 结束
*/
*/
private
Date
endCreateTime
;
private
Date
endCreateTime
;
/**
* 状态
*/
private
Integer
status
;
///
///
/// 分页信息
/// 分页信息
...
...
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderReturnMapper.java
浏览文件 @
ddf2f0ea
...
@@ -30,7 +30,7 @@ public interface OrderReturnMapper {
...
@@ -30,7 +30,7 @@ public interface OrderReturnMapper {
* @param orderReturnDO
* @param orderReturnDO
* @return
* @return
*/
*/
int
updateBy
Order
Id
(
OrderReturnDO
orderReturnDO
);
int
updateById
(
OrderReturnDO
orderReturnDO
);
/**
/**
* 查询 - 根据 orderId
* 查询 - 根据 orderId
...
...
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java
浏览文件 @
ddf2f0ea
...
@@ -63,6 +63,10 @@ public class OrderReturnDO extends BaseDO {
...
@@ -63,6 +63,10 @@ public class OrderReturnDO extends BaseDO {
* 同意时间
* 同意时间
*/
*/
private
Date
approvalTime
;
private
Date
approvalTime
;
/**
* 拒绝时间
*/
private
Date
refuseTime
;
/**
/**
* 物流时间(填写物流单号时间)
* 物流时间(填写物流单号时间)
*/
*/
...
@@ -90,8 +94,7 @@ public class OrderReturnDO extends BaseDO {
...
@@ -90,8 +94,7 @@ public class OrderReturnDO extends BaseDO {
* - 3、申请失败
* - 3、申请失败
* - 4、退货中
* - 4、退货中
* - 5、已收货
* - 5、已收货
* - 6、拒绝退款
* - 6、退货成功
* - 7、退货成功
*/
*/
private
Integer
status
;
private
Integer
status
;
}
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnServiceImpl.java
浏览文件 @
ddf2f0ea
...
@@ -3,15 +3,14 @@ package cn.iocoder.mall.order.biz.service;
...
@@ -3,15 +3,14 @@ package cn.iocoder.mall.order.biz.service;
import
cn.iocoder.common.framework.constant.DeletedStatusEnum
;
import
cn.iocoder.common.framework.constant.DeletedStatusEnum
;
import
cn.iocoder.common.framework.util.ServiceExceptionUtil
;
import
cn.iocoder.common.framework.util.ServiceExceptionUtil
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.admin.api.DataDictService
;
import
cn.iocoder.mall.admin.api.bo.DataDictBO
;
import
cn.iocoder.mall.order.api.OrderLogisticsService
;
import
cn.iocoder.mall.order.api.OrderLogisticsService
;
import
cn.iocoder.mall.order.api.OrderReturnService
;
import
cn.iocoder.mall.order.api.OrderReturnService
;
import
cn.iocoder.mall.order.api.bo.OrderLastLogisticsInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderLastLogisticsInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderReturnInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderReturnInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderReturnListBO
;
import
cn.iocoder.mall.order.api.bo.OrderReturnListBO
;
import
cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum
;
import
cn.iocoder.mall.order.api.constant.*
;
import
cn.iocoder.mall.order.api.constant.OrderReturnStatusEnum
;
import
cn.iocoder.mall.order.api.constant.OrderStatusEnum
;
import
cn.iocoder.mall.order.api.constant.PayAppId
;
import
cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO
;
import
cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO
;
import
cn.iocoder.mall.order.api.dto.OrderReturnQueryDTO
;
import
cn.iocoder.mall.order.api.dto.OrderReturnQueryDTO
;
import
cn.iocoder.mall.order.biz.convert.OrderReturnConvert
;
import
cn.iocoder.mall.order.biz.convert.OrderReturnConvert
;
...
@@ -55,6 +54,9 @@ public class OrderReturnServiceImpl implements OrderReturnService {
...
@@ -55,6 +54,9 @@ public class OrderReturnServiceImpl implements OrderReturnService {
private
OrderLogisticsService
orderLogisticsService
;
private
OrderLogisticsService
orderLogisticsService
;
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.consumer.PayRefundService.version}"
)
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.consumer.PayRefundService.version}"
)
private
PayRefundService
payRefundService
;
private
PayRefundService
payRefundService
;
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.consumer.DataDictService.version}"
)
private
DataDictService
dataDictService
;
@Override
@Override
public
CommonResult
orderReturnApply
(
OrderReturnApplyDTO
orderReturnDTO
)
{
public
CommonResult
orderReturnApply
(
OrderReturnApplyDTO
orderReturnDTO
)
{
...
@@ -156,9 +158,10 @@ public class OrderReturnServiceImpl implements OrderReturnService {
...
@@ -156,9 +158,10 @@ public class OrderReturnServiceImpl implements OrderReturnService {
.
error
(
OrderErrorCodeEnum
.
ORDER_RETURN_NOT_EXISTENT
.
getCode
());
.
error
(
OrderErrorCodeEnum
.
ORDER_RETURN_NOT_EXISTENT
.
getCode
());
}
}
orderReturnMapper
.
updateBy
Order
Id
(
orderReturnMapper
.
updateById
(
new
OrderReturnDO
()
new
OrderReturnDO
()
.
setId
(
id
)
.
setId
(
id
)
.
setApprovalTime
(
new
Date
())
.
setStatus
(
OrderReturnStatusEnum
.
APPLICATION_SUCCESSFUL
.
getValue
())
.
setStatus
(
OrderReturnStatusEnum
.
APPLICATION_SUCCESSFUL
.
getValue
())
);
);
return
CommonResult
.
success
(
null
);
return
CommonResult
.
success
(
null
);
...
@@ -171,9 +174,10 @@ public class OrderReturnServiceImpl implements OrderReturnService {
...
@@ -171,9 +174,10 @@ public class OrderReturnServiceImpl implements OrderReturnService {
return
ServiceExceptionUtil
.
error
(
OrderErrorCodeEnum
.
ORDER_RETURN_NOT_EXISTENT
.
getCode
());
return
ServiceExceptionUtil
.
error
(
OrderErrorCodeEnum
.
ORDER_RETURN_NOT_EXISTENT
.
getCode
());
}
}
orderReturnMapper
.
updateBy
Order
Id
(
orderReturnMapper
.
updateById
(
new
OrderReturnDO
()
new
OrderReturnDO
()
.
setId
(
id
)
.
setId
(
id
)
.
setRefuseTime
(
new
Date
())
.
setStatus
(
OrderReturnStatusEnum
.
APPLICATION_FAIL
.
getValue
())
.
setStatus
(
OrderReturnStatusEnum
.
APPLICATION_FAIL
.
getValue
())
);
);
return
CommonResult
.
success
(
null
);
return
CommonResult
.
success
(
null
);
...
@@ -186,9 +190,10 @@ public class OrderReturnServiceImpl implements OrderReturnService {
...
@@ -186,9 +190,10 @@ public class OrderReturnServiceImpl implements OrderReturnService {
return
ServiceExceptionUtil
.
error
(
OrderErrorCodeEnum
.
ORDER_RETURN_NOT_EXISTENT
.
getCode
());
return
ServiceExceptionUtil
.
error
(
OrderErrorCodeEnum
.
ORDER_RETURN_NOT_EXISTENT
.
getCode
());
}
}
orderReturnMapper
.
updateBy
Order
Id
(
orderReturnMapper
.
updateById
(
new
OrderReturnDO
()
new
OrderReturnDO
()
.
setId
(
id
)
.
setId
(
id
)
.
setReceiverTime
(
new
Date
())
.
setStatus
(
OrderReturnStatusEnum
.
ORDER_RECEIPT
.
getValue
())
.
setStatus
(
OrderReturnStatusEnum
.
ORDER_RECEIPT
.
getValue
())
);
);
return
CommonResult
.
success
(
null
);
return
CommonResult
.
success
(
null
);
...
@@ -207,13 +212,24 @@ public class OrderReturnServiceImpl implements OrderReturnService {
...
@@ -207,13 +212,24 @@ public class OrderReturnServiceImpl implements OrderReturnService {
// TODO: 2019/5/8 sin 退货+退款:退回商品签收后,支付系统退款
// TODO: 2019/5/8 sin 退货+退款:退回商品签收后,支付系统退款
// TODO: 2019/5/8 sin 事务一致性 [重要]
// TODO: 2019/5/8 sin 事务一致性 [重要]
CommonResult
<
DataDictBO
>
dataDictResult
=
dataDictService
.
getDataDict
(
DictKeyConstants
.
ORDER_RETURN_REASON
,
orderReturnDO
.
getReason
());
if
(
dataDictResult
.
isError
())
{
return
ServiceExceptionUtil
.
error
(
OrderErrorCodeEnum
.
DICT_SERVER_INVOKING_FAIL
.
getCode
());
}
// 支付退款
// 支付退款
String
orderDescription
=
dataDictResult
.
getData
()
.
getDisplayName
()
+
"("
+
orderReturnDO
.
getDescribe
()
+
")"
;
CommonResult
payResult
=
payRefundService
.
submitRefund
(
CommonResult
payResult
=
payRefundService
.
submitRefund
(
new
PayRefundSubmitDTO
()
new
PayRefundSubmitDTO
()
.
setAppId
(
PayAppId
.
APP_ID_SHOP_ORDER
)
.
setAppId
(
PayAppId
.
APP_ID_SHOP_ORDER
)
.
setOrderId
(
String
.
valueOf
(
orderReturnDO
.
getOrderId
()))
.
setOrderId
(
String
.
valueOf
(
orderReturnDO
.
getOrderId
()))
.
setPrice
(
orderReturnDO
.
getRefundPrice
())
.
setPrice
(
orderReturnDO
.
getRefundPrice
())
.
setOrderDescription
(
""
)
.
setOrderDescription
(
orderDescription
)
.
setCreateIp
(
ip
)
.
setCreateIp
(
ip
)
);
);
...
@@ -222,9 +238,10 @@ public class OrderReturnServiceImpl implements OrderReturnService {
...
@@ -222,9 +238,10 @@ public class OrderReturnServiceImpl implements OrderReturnService {
}
}
// 更新 订单退货 信息
// 更新 订单退货 信息
orderReturnMapper
.
updateBy
Order
Id
(
orderReturnMapper
.
updateById
(
new
OrderReturnDO
()
new
OrderReturnDO
()
.
setId
(
id
)
.
setId
(
id
)
.
setClosingTime
(
new
Date
())
.
setStatus
(
OrderReturnStatusEnum
.
RETURN_SUCCESS
.
getValue
())
.
setStatus
(
OrderReturnStatusEnum
.
RETURN_SUCCESS
.
getValue
())
);
);
...
@@ -232,13 +249,16 @@ public class OrderReturnServiceImpl implements OrderReturnService {
...
@@ -232,13 +249,16 @@ public class OrderReturnServiceImpl implements OrderReturnService {
orderMapper
.
updateById
(
orderMapper
.
updateById
(
new
OrderDO
()
new
OrderDO
()
.
setId
(
orderReturnDO
.
getOrderId
())
.
setId
(
orderReturnDO
.
getOrderId
())
.
setClosingTime
(
new
Date
())
.
setStatus
(
OrderStatusEnum
.
COMPLETED
.
getValue
())
.
setStatus
(
OrderStatusEnum
.
COMPLETED
.
getValue
())
);
);
// 更新订单
// 更新订单
orderItemMapper
.
updateByOrderId
(
orderItemMapper
.
updateByOrderId
(
orderReturnDO
.
getOrderId
(),
orderReturnDO
.
getOrderId
(),
new
OrderItemDO
().
setStatus
(
OrderStatusEnum
.
COMPLETED
.
getValue
())
new
OrderItemDO
()
.
setClosingTime
(
new
Date
())
.
setStatus
(
OrderStatusEnum
.
COMPLETED
.
getValue
())
);
);
return
CommonResult
.
success
(
null
);
return
CommonResult
.
success
(
null
);
}
}
...
...
order/order-service-impl/src/main/resources/mapper/OrderReturnMapper.xml
浏览文件 @
ddf2f0ea
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
reason,
reason,
`describe`,
`describe`,
approval_time,
approval_time,
refuse_time,
logistics_time,
logistics_time,
receiver_time,
receiver_time,
closing_time,
closing_time,
...
@@ -28,13 +29,13 @@
...
@@ -28,13 +29,13 @@
INSERT INTO `order_return` (
INSERT INTO `order_return` (
service_number, order_id, order_no, order_logistics_id,
service_number, order_id, order_no, order_logistics_id,
refund_price, reason, `describe`,
refund_price, reason, `describe`,
approval_time, logistics_time, receiver_time, closing_time,
approval_time,
refuse_time,
logistics_time, receiver_time, closing_time,
service_type, status,
service_type, status,
create_time, update_time)
create_time, update_time)
VALUES (
VALUES (
#{serviceNumber}, #{orderId}, #{orderNo}, #{orderLogisticsId},
#{serviceNumber}, #{orderId}, #{orderNo}, #{orderLogisticsId},
${refundPrice}, #{reason}, #{describe},
${refundPrice}, #{reason}, #{describe},
#{approvalTime}, #{logisticsTime}, #{receiverTime}, #{closingTime},
#{approvalTime}, #{
refuse_time}, #{
logisticsTime}, #{receiverTime}, #{closingTime},
#{serviceType}, #{status}, #{createTime}, #{updateTime})
#{serviceType}, #{status}, #{createTime}, #{updateTime})
</insert>
</insert>
...
@@ -58,20 +59,20 @@
...
@@ -58,20 +59,20 @@
<if
test=
"approvalTime != null"
>
<if
test=
"approvalTime != null"
>
, approval_time = #{approvalTime}
, approval_time = #{approvalTime}
</if>
</if>
<if
test=
"refuseTime != null"
>
, refuse_time = #{refuseTime}
</if>
<if
test=
"logisticsTime != null"
>
<if
test=
"logisticsTime != null"
>
, logistics_time = #{logisticsTime}
, logistics_time = #{logisticsTime}
</if>
</if>
<if
test=
"receiverTime != null"
>
<if
test=
"receiverTime != null"
>
, receiver_time = #{receiverTime}
, receiver_time = #{receiverTime}
</if>
</if>
<if
test=
"deliveryTime != null"
>
, delivery_time = #{deliveryTime}
</if>
<if
test=
"closingTime != null"
>
<if
test=
"closingTime != null"
>
, closing_time = #{closingTime}
, closing_time = #{closingTime}
</if>
</if>
<if
test=
"
return
Type != null"
>
<if
test=
"
service
Type != null"
>
,
return_type = #{return
Type}
,
service_type = #{service
Type}
</if>
</if>
<if
test=
"status != null"
>
<if
test=
"status != null"
>
, status = #{status}
, status = #{status}
...
@@ -88,10 +89,10 @@
...
@@ -88,10 +89,10 @@
<!--
<!--
更新 - 根据 id 更新
更新 - 根据 id 更新
-->
-->
<update
id=
"updateBy
Order
Id"
parameterType=
"OrderReturnDO"
>
<update
id=
"updateById"
parameterType=
"OrderReturnDO"
>
UPDATE `order_return`
UPDATE `order_return`
<include
refid=
"updateFieldSql"
/>
<include
refid=
"updateFieldSql"
/>
WHERE
order_id = #{orderI
d}
WHERE
id = #{i
d}
</update>
</update>
<!--
<!--
...
@@ -109,6 +110,12 @@
...
@@ -109,6 +110,12 @@
列表查询 - where
列表查询 - where
-->
-->
<sql
id=
"selectListWhere"
>
<sql
id=
"selectListWhere"
>
<if
test=
"status != null"
>
AND status = #{status}
</if>
<if
test=
"serviceNumber != null"
>
AND service_number = #{serviceNumber}
</if>
<if
test=
"orderId != null"
>
<if
test=
"orderId != null"
>
AND order_id = #{orderId}
AND order_id = #{orderId}
</if>
</if>
...
...
system/system-sdk/src/main/java/cn/iocoder/mall/admin/sdk/interceptor/AdminSecurityInterceptor.java
浏览文件 @
ddf2f0ea
...
@@ -67,7 +67,7 @@ public class AdminSecurityInterceptor extends HandlerInterceptorAdapter {
...
@@ -67,7 +67,7 @@ public class AdminSecurityInterceptor extends HandlerInterceptorAdapter {
}
}
// 校验是否需要已授权
// 校验是否需要已授权
// TODO sin 暂时不校验
// TODO sin 暂时不校验
//
checkPermission(request, authentication);
checkPermission
(
request
,
authentication
);
// 返回成功
// 返回成功
return
super
.
preHandle
(
request
,
response
,
handler
);
return
super
.
preHandle
(
request
,
response
,
handler
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论