Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
e6c578f5
提交
e6c578f5
authored
5月 08, 2019
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- 前端:支付单列表
- 前端:退款单列表
上级
23be2069
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
70 个修改的文件
包含
2201 行增加
和
208 行删除
+2201
-208
proxy.dev.js
admin-web/config/proxy/proxy.dev.js
+12
-0
proxy.prod.js
admin-web/config/proxy/proxy.prod.js
+10
-0
router.config.js
admin-web/config/router.config.js
+31
-0
menu.js
admin-web/src/locales/zh-CN/menu.js
+5
-0
payRefundList.js
admin-web/src/models/pay/payRefundList.js
+97
-0
payTransactionList.js
admin-web/src/models/pay/payTransactionList.js
+101
-0
fullPrivilegeList.js
admin-web/src/models/promotion/fullPrivilegeList.js
+8
-39
timeLimitedDiscountList.js
admin-web/src/models/promotion/timeLimitedDiscountList.js
+0
-36
userList.js
admin-web/src/models/user/userList.js
+89
-0
PayRefundList.js
admin-web/src/pages/Pay/PayRefundList.js
+319
-0
PayRefundList.less
admin-web/src/pages/Pay/PayRefundList.less
+15
-0
PayTransactionList.js
admin-web/src/pages/Pay/PayTransactionList.js
+328
-0
PayTransactionList.less
admin-web/src/pages/Pay/PayTransactionList.less
+15
-0
UserList.js
admin-web/src/pages/User/UserList.js
+266
-0
UserList.less
admin-web/src/pages/User/UserList.less
+15
-0
pay.js
admin-web/src/services/pay.js
+18
-0
user.js
admin-web/src/services/user.js
+9
-0
ServiceExceptionUtil.java
...n/iocoder/common/framework/util/ServiceExceptionUtil.java
+6
-2
功能列表-管理后台.md
docs/guides/功能列表/功能列表-管理后台.md
+8
-6
AdminsPayRefundController.java
...lication/controller/admins/AdminsPayRefundController.java
+68
-0
AdminsPayTransactionController.java
...ion/controller/admins/AdminsPayTransactionController.java
+50
-0
UsersPayRefundController.java
...pplication/controller/users/UsersPayRefundController.java
+3
-3
UsersPayTransactionController.java
...ation/controller/users/UsersPayTransactionController.java
+3
-2
PayRefundConvert.java
...ocoder/mall/pay/application/convert/PayRefundConvert.java
+19
-0
AdminsPayRefundDetailVO.java
...ll/pay/application/vo/admins/AdminsPayRefundDetailVO.java
+21
-0
AdminsPayRefundPageVO.java
...mall/pay/application/vo/admins/AdminsPayRefundPageVO.java
+25
-0
PayRefundService.java
...c/main/java/cn/iocoder/mall/pay/api/PayRefundService.java
+4
-0
PayTransactionService.java
...n/java/cn/iocoder/mall/pay/api/PayTransactionService.java
+9
-0
PayRefundBO.java
...src/main/java/cn/iocoder/mall/pay/api/bo/PayRefundBO.java
+102
-0
PayRefundPageBO.java
...main/java/cn/iocoder/mall/pay/api/bo/PayRefundPageBO.java
+25
-0
PayTransactionBO.java
...ain/java/cn/iocoder/mall/pay/api/bo/PayTransactionBO.java
+7
-0
PayTransactionPageBO.java
...java/cn/iocoder/mall/pay/api/bo/PayTransactionPageBO.java
+25
-0
PayChannelEnum.java
...java/cn/iocoder/mall/pay/api/constant/PayChannelEnum.java
+3
-4
PayRefundPageDTO.java
...in/java/cn/iocoder/mall/pay/api/dto/PayRefundPageDTO.java
+46
-0
PayTransactionPageDTO.java
...va/cn/iocoder/mall/pay/api/dto/PayTransactionPageDTO.java
+56
-0
PayRefundConvert.java
...ava/cn/iocoder/mall/pay/biz/convert/PayRefundConvert.java
+9
-0
PayTransactionConvert.java
...n/iocoder/mall/pay/biz/convert/PayTransactionConvert.java
+5
-0
PayRefundMapper.java
...ain/java/cn/iocoder/mall/pay/biz/dao/PayRefundMapper.java
+19
-0
PayTransactionMapper.java
...ava/cn/iocoder/mall/pay/biz/dao/PayTransactionMapper.java
+26
-0
PayRefundServiceImpl.java
...cn/iocoder/mall/pay/biz/service/PayRefundServiceImpl.java
+22
-1
PayTransactionServiceImpl.java
...coder/mall/pay/biz/service/PayTransactionServiceImpl.java
+31
-2
application.yaml
...y-service-impl/src/main/resources/config/application.yaml
+5
-0
PayRefundMapper.xml
...ervice-impl/src/main/resources/mapper/PayRefundMapper.xml
+53
-0
PayTransactionMapper.xml
...e-impl/src/main/resources/mapper/PayTransactionMapper.xml
+81
-0
AdminsCouponController.java
...application/controller/admins/AdminsCouponController.java
+8
-6
UsersCouponController.java
...n/application/controller/users/UsersCouponController.java
+8
-6
CouponCardConvert.java
...mall/promotion/application/convert/CouponCardConvert.java
+4
-3
CouponTemplateConvert.java
.../promotion/application/convert/CouponTemplateConvert.java
+19
-15
CouponService.java
...ain/java/cn/iocoder/mall/promotion/api/CouponService.java
+24
-26
CouponServiceImpl.java
...iocoder/mall/promotion/biz/service/CouponServiceImpl.java
+0
-0
AdminMapper.xml
...em-service-impl/src/main/resources/mapper/AdminMapper.xml
+2
-3
pom.xml
user/user-application/pom.xml
+6
-0
MVCConfiguration.java
...ocoder/mall/user/application/config/MVCConfiguration.java
+2
-1
AdminsUserController.java
...r/application/controller/admins/AdminsUserController.java
+5
-5
PassportController.java
...user/application/controller/users/PassportController.java
+7
-11
UserAddressController.java
...r/application/controller/users/UserAddressController.java
+1
-3
UserController.java
...all/user/application/controller/users/UserController.java
+5
-7
AdminsUserPageVO.java
...der/mall/user/application/vo/admins/AdminsUserPageVO.java
+2
-2
UserAccessLogInterceptor.java
...r/mall/user/sdk/interceptor/UserAccessLogInterceptor.java
+1
-3
UserSecurityInterceptor.java
...er/mall/user/sdk/interceptor/UserSecurityInterceptor.java
+1
-3
UserPageBO.java
...src/main/java/cn/iocoder/mall/user/api/bo/UserPageBO.java
+2
-2
UserPageDTO.java
...c/main/java/cn/iocoder/mall/user/api/dto/UserPageDTO.java
+4
-0
UserMapper.java
...rc/main/java/cn/iocoder/mall/user/biz/dao/UserMapper.java
+4
-3
MobileCodeServiceImpl.java
.../iocoder/mall/user/biz/service/MobileCodeServiceImpl.java
+1
-1
OAuth2ServiceImpl.java
...a/cn/iocoder/mall/user/biz/service/OAuth2ServiceImpl.java
+1
-1
UserAccessLogServiceImpl.java
...coder/mall/user/biz/service/UserAccessLogServiceImpl.java
+1
-1
UserAddressServiceImpl.java
...iocoder/mall/user/biz/service/UserAddressServiceImpl.java
+1
-1
UserServiceImpl.java
...ava/cn/iocoder/mall/user/biz/service/UserServiceImpl.java
+5
-4
application.yaml
...r-service-impl/src/main/resources/config/application.yaml
+11
-4
UserMapper.xml
...ser-service-impl/src/main/resources/mapper/UserMapper.xml
+7
-2
没有找到文件。
admin-web/config/proxy/proxy.dev.js
浏览文件 @
e6c578f5
...
...
@@ -25,4 +25,16 @@ export default {
changeOrigin
:
true
,
pathRewrite
:
{},
},
'/user-api/'
:
{
// target: 'http://180.167.213.26:18085/',
target
:
'http://127.0.0.1:18082/'
,
changeOrigin
:
true
,
pathRewrite
:
{},
},
'/pay-api/'
:
{
// target: 'http://180.167.213.26:18085/',
target
:
'http://127.0.0.1:18084/'
,
changeOrigin
:
true
,
pathRewrite
:
{},
},
};
admin-web/config/proxy/proxy.prod.js
浏览文件 @
e6c578f5
...
...
@@ -6,11 +6,21 @@ export default {
changeOrigin
:
true
,
pathRewrite
:
{},
},
'/product-api/'
:
{
target
:
'http://api.shop.iocoder.cn:18099/product-api'
,
changeOrigin
:
true
,
pathRewrite
:
{},
},
'/order-api/'
:
{
target
:
'http://api.shop.iocoder.cn:18099/order-api'
,
changeOrigin
:
true
,
pathRewrite
:
{},
},
'/promotion-api/'
:
{
target
:
'http://api.shop.iocoder.cn:18099/promotion-api'
,
changeOrigin
:
true
,
pathRewrite
:
{},
},
'/pay-api/'
:
{
target
:
'http://api.shop.iocoder.cn:18099/pay-api'
,
changeOrigin
:
true
,
...
...
admin-web/config/router.config.js
浏览文件 @
e6c578f5
...
...
@@ -58,6 +58,19 @@ export default [
},
],
},
// user
{
path
:
'/member'
,
// TODO 芋艿,后面调整
name
:
'user'
,
icon
:
'user'
,
routes
:
[
{
path
:
'/member/user-list'
,
name
:
'user-list'
,
component
:
'./User/UserList'
,
},
],
},
// order
{
path
:
'order'
,
...
...
@@ -142,6 +155,24 @@ export default [
}
],
},
// pay
{
path
:
'/pay'
,
name
:
'pay'
,
icon
:
'user'
,
routes
:
[
{
path
:
'/pay/transaction-list'
,
name
:
'pay-transaction-list'
,
component
:
'./Pay/PayTransactionList'
,
},
{
path
:
'/pay/refund-list'
,
name
:
'pay-refund-list'
,
component
:
'./Pay/PayRefundList'
,
},
],
},
{
path
:
'/dashboard'
,
name
:
'dashboard'
,
...
...
admin-web/src/locales/zh-CN/menu.js
浏览文件 @
e6c578f5
...
...
@@ -60,4 +60,9 @@ export default {
'menu.promotion.coupon-card-template-list'
:
'优惠劵管理'
,
'menu.promotion.time-limit-discount-list'
:
'限时折扣'
,
'menu.promotion.full-privilege-list'
:
'满减送'
,
// 会员相关
'menu.user.user-list'
:
'会员资料'
,
// 支付相关
'menu.pay.pay-transaction-list'
:
'支付单'
,
'menu.pay.pay-refund-list'
:
'退款单'
,
};
admin-web/src/models/pay/payRefundList.js
0 → 100644
浏览文件 @
e6c578f5
import
{
message
}
from
'antd'
;
import
{
productSpuPage
,
productSpuUpdateSort
}
from
'../../services/product'
;
import
{
routerRedux
}
from
"dva/router"
;
import
PaginationHelper
from
'../../../helpers/PaginationHelper'
;
import
{
getPromotionActivityPage
}
from
"../../services/promotion"
;
import
{
queryPayRefundPage
,
queryPayTransactionPage
}
from
"../../services/pay"
;
const
SEARCH_PARAMS_DEFAULT
=
{
createBeginTime
:
undefined
,
createEndTime
:
undefined
,
finishBeginTime
:
undefined
,
finishEndTime
:
undefined
,
status
:
undefined
,
payChannel
:
undefined
,
};
export
default
{
namespace
:
'payRefundList'
,
state
:
{
// 分页列表相关
list
:
[],
listLoading
:
false
,
pagination
:
PaginationHelper
.
defaultPaginationConfig
,
searchParams
:
SEARCH_PARAMS_DEFAULT
,
// 添加 or 修改表单相关
},
effects
:
{
*
page
({
payload
},
{
call
,
put
})
{
// const { queryParams } = payload;
// const response = yield call(productSpuPage, payload);
// message.info('查询成功!');
// yield put({
// type: 'treeSuccess',
// payload: {
// list: response.data,
// },
// });
// 显示加载中
yield
put
({
type
:
'changeListLoading'
,
payload
:
true
,
});
// 请求
const
response
=
yield
call
(
queryPayRefundPage
,
payload
);
// 响应
yield
put
({
type
:
'setAll'
,
payload
:
{
list
:
response
.
data
.
list
,
pagination
:
PaginationHelper
.
formatPagination
(
response
.
data
,
payload
),
searchParams
:
{
createBeginTime
:
payload
.
createBeginTime
,
createEndTime
:
payload
.
createEndTime
,
finishBeginTime
:
payload
.
finishBeginTime
,
finishEndTime
:
payload
.
finishEndTime
,
status
:
payload
.
status
,
payChannel
:
payload
.
payChannel
,
}
},
});
// 隐藏加载中
yield
put
({
type
:
'changeListLoading'
,
payload
:
false
,
});
},
},
reducers
:
{
treeSuccess
(
state
,
{
payload
})
{
return
{
...
state
,
...
payload
,
};
},
// 修改加载中的状态
changeListLoading
(
state
,
{
payload
})
{
return
{
...
state
,
listLoading
:
payload
,
};
},
// 设置所有属性
setAll
(
state
,
{
payload
})
{
return
{
...
state
,
...
payload
,
};
}
},
};
admin-web/src/models/pay/payTransactionList.js
0 → 100644
浏览文件 @
e6c578f5
import
{
message
}
from
'antd'
;
import
{
productSpuPage
,
productSpuUpdateSort
}
from
'../../services/product'
;
import
{
routerRedux
}
from
"dva/router"
;
import
PaginationHelper
from
'../../../helpers/PaginationHelper'
;
import
{
getPromotionActivityPage
}
from
"../../services/promotion"
;
import
{
queryPayTransactionPage
}
from
"../../services/pay"
;
const
SEARCH_PARAMS_DEFAULT
=
{
createBeginTime
:
undefined
,
createEndTime
:
undefined
,
paymentBeginTime
:
undefined
,
paymentEndTime
:
undefined
,
status
:
undefined
,
hasRefund
:
undefined
,
payChannel
:
undefined
,
orderSubject
:
''
,
};
export
default
{
namespace
:
'payTransactionList'
,
state
:
{
// 分页列表相关
list
:
[],
listLoading
:
false
,
pagination
:
PaginationHelper
.
defaultPaginationConfig
,
searchParams
:
SEARCH_PARAMS_DEFAULT
,
// 添加 or 修改表单相关
},
effects
:
{
*
page
({
payload
},
{
call
,
put
})
{
// const { queryParams } = payload;
// const response = yield call(productSpuPage, payload);
// message.info('查询成功!');
// yield put({
// type: 'treeSuccess',
// payload: {
// list: response.data,
// },
// });
// 显示加载中
yield
put
({
type
:
'changeListLoading'
,
payload
:
true
,
});
// 请求
const
response
=
yield
call
(
queryPayTransactionPage
,
payload
);
// 响应
yield
put
({
type
:
'setAll'
,
payload
:
{
list
:
response
.
data
.
list
,
pagination
:
PaginationHelper
.
formatPagination
(
response
.
data
,
payload
),
searchParams
:
{
createBeginTime
:
payload
.
createBeginTime
,
createEndTime
:
payload
.
createEndTime
,
paymentBeginTime
:
payload
.
paymentBeginTime
,
paymentEndTime
:
payload
.
paymentEndTime
,
status
:
payload
.
status
,
hasRefund
:
payload
.
hasRefund
,
payChannel
:
payload
.
payChannel
,
orderSubject
:
payload
.
orderSubject
,
}
},
});
// 隐藏加载中
yield
put
({
type
:
'changeListLoading'
,
payload
:
false
,
});
},
},
reducers
:
{
treeSuccess
(
state
,
{
payload
})
{
return
{
...
state
,
...
payload
,
};
},
// 修改加载中的状态
changeListLoading
(
state
,
{
payload
})
{
return
{
...
state
,
listLoading
:
payload
,
};
},
// 设置所有属性
setAll
(
state
,
{
payload
})
{
return
{
...
state
,
...
payload
,
};
}
},
};
admin-web/src/models/promotion/fullPrivilegeList.js
浏览文件 @
e6c578f5
...
...
@@ -5,9 +5,14 @@ import PaginationHelper from '../../../helpers/PaginationHelper';
import
{
getPromotionActivityPage
}
from
"../../services/promotion"
;
const
SEARCH_PARAMS_DEFAULT
=
{
title
:
''
,
activityType
:
2
,
status
:
'ALL'
,
createBeginTime
:
undefined
,
createEndTime
:
undefined
,
paymentBeginTime
:
undefined
,
paymentEndTime
:
undefined
,
status
:
undefined
,
hasRefund
:
undefined
,
payChannel
:
undefined
,
orderSubject
:
''
,
};
export
default
{
...
...
@@ -63,36 +68,6 @@ export default {
payload
:
false
,
});
},
*
updateSort
({
payload
},
{
call
,
put
})
{
// 显示加载中
yield
put
({
type
:
'changeSortModalLoading'
,
payload
:
true
,
});
// 请求
const
{
callback
,
body
}
=
payload
;
// 响应
const
response
=
yield
call
(
productSpuUpdateSort
,
body
);
if
(
response
.
code
===
0
)
{
if
(
callback
)
{
callback
(
response
);
}
yield
put
({
type
:
'page'
,
payload
:
{
...
this
.
state
.
pagination
,
...
this
.
state
.
searchParams
,
},
});
}
// 隐藏加载中
yield
put
({
type
:
'changeSortModalLoading'
,
payload
:
false
,
});
},
},
reducers
:
{
...
...
@@ -103,12 +78,6 @@ export default {
};
},
// 修改加载中的状态
changeSortModalLoading
(
state
,
{
payload
})
{
return
{
...
state
,
sortModalLoading
:
payload
,
};
},
changeListLoading
(
state
,
{
payload
})
{
return
{
...
state
,
...
...
admin-web/src/models/promotion/timeLimitedDiscountList.js
浏览文件 @
e6c578f5
...
...
@@ -63,36 +63,6 @@ export default {
payload
:
false
,
});
},
*
updateSort
({
payload
},
{
call
,
put
})
{
// 显示加载中
yield
put
({
type
:
'changeSortModalLoading'
,
payload
:
true
,
});
// 请求
const
{
callback
,
body
}
=
payload
;
// 响应
const
response
=
yield
call
(
productSpuUpdateSort
,
body
);
if
(
response
.
code
===
0
)
{
if
(
callback
)
{
callback
(
response
);
}
yield
put
({
type
:
'page'
,
payload
:
{
...
this
.
state
.
pagination
,
...
this
.
state
.
searchParams
,
},
});
}
// 隐藏加载中
yield
put
({
type
:
'changeSortModalLoading'
,
payload
:
false
,
});
},
},
reducers
:
{
...
...
@@ -103,12 +73,6 @@ export default {
};
},
// 修改加载中的状态
changeSortModalLoading
(
state
,
{
payload
})
{
return
{
...
state
,
sortModalLoading
:
payload
,
};
},
changeListLoading
(
state
,
{
payload
})
{
return
{
...
state
,
...
...
admin-web/src/models/user/userList.js
0 → 100644
浏览文件 @
e6c578f5
import
{
message
}
from
'antd'
;
import
{
productSpuPage
,
productSpuUpdateSort
}
from
'../../services/product'
;
import
{
routerRedux
}
from
"dva/router"
;
import
PaginationHelper
from
'../../../helpers/PaginationHelper'
;
import
{
getPromotionActivityPage
}
from
"../../services/promotion"
;
import
{
queryUserPage
}
from
"../../services/user"
;
const
SEARCH_PARAMS_DEFAULT
=
{
nickname
:
''
,
status
:
1
,
};
export
default
{
namespace
:
'userList'
,
state
:
{
// 分页列表相关
list
:
[],
listLoading
:
false
,
pagination
:
PaginationHelper
.
defaultPaginationConfig
,
searchParams
:
SEARCH_PARAMS_DEFAULT
,
// 添加 or 修改表单相关
},
effects
:
{
*
page
({
payload
},
{
call
,
put
})
{
// const { queryParams } = payload;
// const response = yield call(productSpuPage, payload);
// message.info('查询成功!');
// yield put({
// type: 'treeSuccess',
// payload: {
// list: response.data,
// },
// });
// 显示加载中
yield
put
({
type
:
'changeListLoading'
,
payload
:
true
,
});
// 请求
const
response
=
yield
call
(
queryUserPage
,
payload
);
// 响应
yield
put
({
type
:
'setAll'
,
payload
:
{
list
:
response
.
data
.
list
,
pagination
:
PaginationHelper
.
formatPagination
(
response
.
data
,
payload
),
searchParams
:
{
nickname
:
payload
.
nickname
,
status
:
payload
.
status
,
}
},
});
// 隐藏加载中
yield
put
({
type
:
'changeListLoading'
,
payload
:
false
,
});
},
},
reducers
:
{
treeSuccess
(
state
,
{
payload
})
{
return
{
...
state
,
...
payload
,
};
},
// 修改加载中的状态
changeListLoading
(
state
,
{
payload
})
{
return
{
...
state
,
listLoading
:
payload
,
};
},
// 设置所有属性
setAll
(
state
,
{
payload
})
{
return
{
...
state
,
...
payload
,
};
}
},
};
admin-web/src/pages/Pay/PayRefundList.js
0 → 100644
浏览文件 @
e6c578f5
/* eslint-disable */
import
React
,
{
PureComponent
,
Fragment
}
from
'react'
;
import
{
connect
}
from
'dva'
;
import
moment
from
'moment'
;
import
{
Card
,
Form
,
Input
,
Row
,
Col
,
Button
,
Modal
,
message
,
Table
,
Divider
,
Tree
,
Tabs
,
TreeSelect
,
Spin
,
InputNumber
,
DatePicker
,
Select
}
from
'antd'
;
const
TabPane
=
Tabs
.
TabPane
;
import
PageHeaderWrapper
from
'@/components/PageHeaderWrapper'
;
const
{
RangePicker
}
=
DatePicker
;
import
styles
from
'./PayRefundList.less'
;
import
PaginationHelper
from
"../../../helpers/PaginationHelper"
;
const
FormItem
=
Form
.
Item
;
const
statuses
=
{
1
:
'处理中'
,
2
:
'成功'
,
3
:
'失败'
,
};
const
payChannels
=
{
100
:
'微信 App 支付'
,
101
:
'微信 JS API 支付'
,
200
:
'支付宝 App 支付'
,
9999
:
'ping++'
,
};
// 列表
function
List
({
dataSource
,
loading
,
pagination
,
searchParams
,
dispatch
,})
{
function
onPageChange
(
page
)
{
// 翻页
dispatch
({
type
:
'payRefundList/page'
,
payload
:
{
pageNo
:
page
.
current
,
pageSize
:
page
.
pageSize
,
...
searchParams
}
})
}
const
columns
=
[
// {
// title: 'id',
// dataIndex: 'id',
// render: text => <strong>{text}</strong>,
// },
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
render
:
val
=>
<
span
>
{
moment
(
val
).
format
(
'YYYY-MM-DD HH:mm:ss'
)}
<
/span>
,
width
:
120
,
},
{
title
:
'完成时间'
,
dataIndex
:
'finishTime'
,
render
:
val
=>
val
?
<
span
>
{
moment
(
val
).
format
(
'YYYY-MM-DD HH:mm:ss'
)}
<
/span> : ''
,
width
:
120
,
},
{
title
:
'渠道流水号'
,
dataIndex
:
'tradeNo'
,
},
{
title
:
'退款金额'
,
dataIndex
:
'price'
,
render
:
val
=>
val
/
100.0
,
},
{
title
:
'退款状态'
,
dataIndex
:
'status'
,
render
:
val
=>
statuses
[
val
+
''
],
},
{
title
:
'支付时间'
,
dataIndex
:
'transaction.finishTime'
,
render
:
val
=>
val
?
<
span
>
{
moment
(
val
).
format
(
'YYYY-MM-DD HH:mm:ss'
)}
<
/span> : ''
,
width
:
120
,
},
{
title
:
'商户订单号'
,
dataIndex
:
'orderId'
,
},
{
title
:
'商品名称'
,
dataIndex
:
'transaction.orderSubject'
,
},
{
title
:
'支付金额'
,
dataIndex
:
'transaction.price'
,
},
{
title
:
'支付渠道'
,
dataIndex
:
'transaction.payChannel'
,
render
:
val
=>
payChannels
[
val
+
''
],
},
{
title
:
'操作'
,
width
:
120
,
render
:
(
text
,
record
)
=>
(
<
Fragment
>
{
/*<a onClick={() => this.handleModalVisible(true, 'update', record)}>更新</a>*/
}
<
a
onClick
=
{()
=>
alert
(
'正在开发中'
)}
>
详情
<
/a
>
<
/Fragment
>
),
},
];
// console.log(pagination);
return
(
<
div
>
<
Table
columns
=
{
columns
}
dataSource
=
{
dataSource
}
rowKey
=
"id"
pagination
=
{
pagination
}
onChange
=
{
onPageChange
}
loading
=
{
loading
}
/
>
<
/div
>
)
}
// 搜索表单
const
SearchForm
=
Form
.
create
()(
props
=>
{
const
{
form
,
form
:
{
getFieldDecorator
},
dispatch
,
searchParams
,
}
=
props
;
function
search
()
{
const
getBeginAndEndTime
=
(
key
,
beginKey
,
endKey
)
=>
{
let
val
=
form
.
getFieldsValue
()[
key
];
if
(
val
&&
val
.
length
===
2
)
{
let
res
=
{};
res
[
beginKey
]
=
val
[
0
].
format
(
'YYYY-MM-DD HH:mm:ss'
);
res
[
endKey
]
=
val
[
1
].
format
(
'YYYY-MM-DD HH:mm:ss'
);
return
res
;
}
return
{};
};
dispatch
({
type
:
'payRefundList/page'
,
payload
:
{
...
PaginationHelper
.
defaultPayload
,
...
searchParams
,
...
form
.
getFieldsValue
(),
createTime
:
undefined
,
finishTime
:
undefined
,
...
getBeginAndEndTime
(
'createTime'
,
'createBeginTime'
,
'createEndTime'
),
...
getBeginAndEndTime
(
'finishTime'
,
'finishBeginTime'
,
'finishEndTime'
),
}
})
}
// 提交搜索
function
handleSubmit
(
e
)
{
// 阻止默认事件
e
.
preventDefault
();
// 提交搜索
search
();
}
// 重置搜索
function
handleReset
()
{
// 重置表单
form
.
resetFields
();
// 执行搜索
search
();
}
return
(
<
Form
onSubmit
=
{
handleSubmit
}
layout
=
"inline"
>
<
Row
gutter
=
{{
md
:
8
,
lg
:
24
,
xl
:
48
}}
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"创建时间"
>
{
getFieldDecorator
(
'createTime'
)(
<
RangePicker
style
=
{{
width
:
'250px'
}}
/>
)
}</
FormItem
>
<
/Col
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"完成时间"
>
{
getFieldDecorator
(
'finishTime'
)(
<
RangePicker
style
=
{{
width
:
'250px'
}}
/>
)
}</
FormItem
>
<
/Col
>
<
/Row
>
<
Row
gutter
=
{{
md
:
8
,
lg
:
24
,
xl
:
48
}}
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"支付渠道"
>
{
getFieldDecorator
(
'payChannel'
)(
<
Select
placeholder
=
"请选择"
style
=
{{
width
:
'250px'
}}
>
{
Object
.
keys
(
payChannels
).
map
((
key
,
index
)
=>
<
Option
key
=
{
key
}
value
=
{
key
+
''
}
>
{
payChannels
[
key
]}
<
/Option>
)
}
<
/Select
>
)}
<
/FormItem
>
<
/Col
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"退款状态"
>
{
getFieldDecorator
(
'status'
)(
<
Select
placeholder
=
"请选择"
style
=
{{
width
:
'250px'
}}
>
{
Object
.
keys
(
statuses
).
map
((
key
,
index
)
=>
<
Option
key
=
{
key
}
value
=
{
key
+
''
}
>
{
statuses
[
key
]}
<
/Option>
)
}
<
/Select
>
)}
<
/FormItem
>
<
/Col
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
span
className
=
{
styles
.
submitButtons
}
>
<
Button
type
=
"primary"
htmlType
=
"submit"
>
查询
<
/Button
>
<
Button
style
=
{{
marginLeft
:
8
}}
onClick
=
{
handleReset
}
>
重置
<
/Button
>
<
/span
>
<
/Col
>
<
/Row
>
<
/Form
>
);
});
// payRefundList
@
connect
(({
payRefundList
})
=>
({
...
payRefundList
,
// list: payRefundList.list.spus,
// loading: loading.models.payRefundList,
}))
@
Form
.
create
()
class
PayTransactionList
extends
PureComponent
{
state
=
{
modalVisible
:
false
,
modalType
:
'add'
,
//add update
initValues
:
{},
};
componentDidMount
()
{
const
{
dispatch
,
searchParams
}
=
this
.
props
;
// 查询初始数据
dispatch
({
type
:
'payRefundList/page'
,
payload
:
{
...
searchParams
,
...
PaginationHelper
.
defaultPayload
,
},
});
}
handleSortModalVisible
=
(
sortModalVisible
,
record
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'payRefundList/setAll'
,
payload
:
{
sortModalVisible
,
formVals
:
record
||
{}
},
});
};
render
()
{
const
{
dispatch
,
list
,
listLoading
,
searchParams
,
pagination
,
categoryTree
,
formVals
,
}
=
this
.
props
;
// 列表属性
const
listProps
=
{
dataSource
:
list
,
pagination
,
searchParams
,
dispatch
,
categoryTree
,
loading
:
listLoading
,
handleSortModalVisible
:
this
.
handleSortModalVisible
,
// Func
};
// 搜索表单属性
const
searchFormProps
=
{
dispatch
,
categoryTree
,
searchParams
,
};
return
(
<
PageHeaderWrapper
title
=
""
>
<
Card
bordered
=
{
false
}
>
<
div
className
=
{
styles
.
tableList
}
>
<
div
className
=
{
styles
.
tableListOperator
}
>
{
/*<Button*/
}
{
/* icon="plus"*/
}
{
/* type="primary"*/
}
{
/* onClick={() => alert('正在开发中')}*/
}
{
/*>*/
}
{
/* 新建限时折扣*/
}
{
/*</Button>*/
}
<
/div
>
<
/div
>
<
SearchForm
{...
searchFormProps
}
/
>
<
List
{...
listProps
}
/
>
<
/Card
>
<
/PageHeaderWrapper
>
);
}
}
export
default
PayTransactionList
;
admin-web/src/pages/Pay/PayRefundList.less
0 → 100644
浏览文件 @
e6c578f5
@import '~antd/lib/style/themes/default.less';
@import '~@/utils/utils.less';
.tableList {
.tableListOperator {
margin-bottom: 16px;
button {
margin-right: 8px;
}
}
}
.tableDelete {
color: red;
}
admin-web/src/pages/Pay/PayTransactionList.js
0 → 100644
浏览文件 @
e6c578f5
/* eslint-disable */
import
React
,
{
PureComponent
,
Fragment
}
from
'react'
;
import
{
connect
}
from
'dva'
;
import
moment
from
'moment'
;
import
{
Card
,
Form
,
Input
,
Row
,
Col
,
Button
,
Modal
,
message
,
Table
,
Divider
,
Tree
,
Tabs
,
TreeSelect
,
Spin
,
InputNumber
,
DatePicker
,
Select
}
from
'antd'
;
const
TabPane
=
Tabs
.
TabPane
;
import
PageHeaderWrapper
from
'@/components/PageHeaderWrapper'
;
const
{
RangePicker
}
=
DatePicker
;
import
styles
from
'./PayTransactionList.less'
;
import
PaginationHelper
from
"../../../helpers/PaginationHelper"
;
const
FormItem
=
Form
.
Item
;
const
statuses
=
{
1
:
'等待支付'
,
2
:
'支付成功'
,
3
:
'取消支付'
,
};
const
payChannels
=
{
100
:
'微信 App 支付'
,
101
:
'微信 JS API 支付'
,
200
:
'支付宝 App 支付'
,
9999
:
'ping++'
,
};
// 列表
function
List
({
dataSource
,
loading
,
pagination
,
searchParams
,
dispatch
,})
{
function
onPageChange
(
page
)
{
// 翻页
dispatch
({
type
:
'payTransactionList/page'
,
payload
:
{
pageNo
:
page
.
current
,
pageSize
:
page
.
pageSize
,
...
searchParams
}
})
}
const
columns
=
[
// {
// title: 'id',
// dataIndex: 'id',
// render: text => <strong>{text}</strong>,
// },
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
render
:
val
=>
<
span
>
{
moment
(
val
).
format
(
'YYYY-MM-DD HH:mm:ss'
)}
<
/span>
,
width
:
120
,
},
{
title
:
'支付时间'
,
dataIndex
:
'paymentTime'
,
render
:
val
=>
val
?
<
span
>
{
moment
(
val
).
format
(
'YYYY-MM-DD HH:mm:ss'
)}
<
/span> : ''
,
width
:
120
,
},
{
title
:
'商户订单号'
,
dataIndex
:
'orderId'
,
},
{
title
:
'商品名称'
,
dataIndex
:
'orderSubject'
,
},
{
title
:
'支付金额'
,
dataIndex
:
'price'
,
render
:
val
=>
val
/
100.0
,
},
{
title
:
'支付状态'
,
dataIndex
:
'status'
,
render
:
val
=>
statuses
[
val
+
''
],
},
{
title
:
'支付渠道'
,
dataIndex
:
'payChannel'
,
render
:
val
=>
payChannels
[
val
+
''
],
},
{
title
:
'退款情况'
,
dataIndex
:
'refundTotal'
,
render
:
val
=>
val
&&
val
>
0
?
'有退款'
:
'无退款'
,
},
{
title
:
'退款金额'
,
dataIndex
:
'refundTotal'
,
render
:
val
=>
val
&&
val
>
0
?
val
/
100.0
:
undefined
,
},
{
title
:
'操作'
,
width
:
120
,
render
:
(
text
,
record
)
=>
(
<
Fragment
>
{
/*<a onClick={() => this.handleModalVisible(true, 'update', record)}>更新</a>*/
}
<
a
onClick
=
{()
=>
alert
(
'正在开发中'
)}
>
退款
<
/a
>
<
/Fragment
>
),
},
];
// console.log(pagination);
return
(
<
div
>
<
Table
columns
=
{
columns
}
dataSource
=
{
dataSource
}
rowKey
=
"id"
pagination
=
{
pagination
}
onChange
=
{
onPageChange
}
loading
=
{
loading
}
/
>
<
/div
>
)
}
// 搜索表单
const
SearchForm
=
Form
.
create
()(
props
=>
{
const
{
form
,
form
:
{
getFieldDecorator
},
dispatch
,
searchParams
,
}
=
props
;
function
search
()
{
const
getBeginAndEndTime
=
(
key
,
beginKey
,
endKey
)
=>
{
let
val
=
form
.
getFieldsValue
()[
key
];
if
(
val
&&
val
.
length
===
2
)
{
let
res
=
{};
res
[
beginKey
]
=
val
[
0
].
format
(
'YYYY-MM-DD HH:mm:ss'
);
res
[
endKey
]
=
val
[
1
].
format
(
'YYYY-MM-DD HH:mm:ss'
);
return
res
;
}
return
{};
};
dispatch
({
type
:
'payTransactionList/page'
,
payload
:
{
...
PaginationHelper
.
defaultPayload
,
...
searchParams
,
...
form
.
getFieldsValue
(),
createTime
:
undefined
,
paymentTime
:
undefined
,
...
getBeginAndEndTime
(
'createTime'
,
'createBeginTime'
,
'createEndTime'
),
...
getBeginAndEndTime
(
'paymentTime'
,
'paymentBeginTime'
,
'paymentEndTime'
),
}
})
}
// 提交搜索
function
handleSubmit
(
e
)
{
// 阻止默认事件
e
.
preventDefault
();
// 提交搜索
search
();
}
// 重置搜索
function
handleReset
()
{
// 重置表单
form
.
resetFields
();
// 执行搜索
search
();
}
return
(
<
Form
onSubmit
=
{
handleSubmit
}
layout
=
"inline"
>
<
Row
gutter
=
{{
md
:
8
,
lg
:
24
,
xl
:
48
}}
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"创建时间"
>
{
getFieldDecorator
(
'createTime'
)(
<
RangePicker
style
=
{{
width
:
'250px'
}}
/>
)
}</
FormItem
>
<
/Col
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"支付时间"
>
{
getFieldDecorator
(
'paymentTime'
)(
<
RangePicker
style
=
{{
width
:
'250px'
}}
/>
)
}</
FormItem
>
<
/Col
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"商品名称"
>
{
getFieldDecorator
(
'orderSubject'
)(
<
Input
placeholder
=
"请输入"
style
=
{{
width
:
'250px'
}}
/>
)
}</
FormItem
>
<
/Col
>
<
/Row
>
<
Row
gutter
=
{{
md
:
8
,
lg
:
24
,
xl
:
48
}}
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"支付渠道"
>
{
getFieldDecorator
(
'payChannel'
)(
<
Select
placeholder
=
"请选择"
style
=
{{
width
:
'250px'
}}
>
{
Object
.
keys
(
payChannels
).
map
((
key
,
index
)
=>
<
Option
key
=
{
key
}
value
=
{
key
+
''
}
>
{
payChannels
[
key
]}
<
/Option>
)
}
<
/Select
>
)}
<
/FormItem
>
<
/Col
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"支付状态"
>
{
getFieldDecorator
(
'status'
)(
<
Select
placeholder
=
"请选择"
style
=
{{
width
:
'250px'
}}
>
{
Object
.
keys
(
statuses
).
map
((
key
,
index
)
=>
<
Option
key
=
{
key
}
value
=
{
key
+
''
}
>
{
statuses
[
key
]}
<
/Option>
)
}
<
/Select
>
)}
<
/FormItem
>
<
/Col
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"退款状态"
>
{
getFieldDecorator
(
'hasRefund'
)(
<
Select
placeholder
=
"请选择"
style
=
{{
width
:
'250px'
}}
>
<
Option
value
=
{
true
}
>
有退款
<
/Option
>
<
Option
value
=
{
false
}
>
无退款
<
/Option
>
<
/Select
>
)}
<
/FormItem
>
<
/Col
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
span
className
=
{
styles
.
submitButtons
}
>
<
Button
type
=
"primary"
htmlType
=
"submit"
>
查询
<
/Button
>
<
Button
style
=
{{
marginLeft
:
8
}}
onClick
=
{
handleReset
}
>
重置
<
/Button
>
<
/span
>
<
/Col
>
<
/Row
>
<
/Form
>
);
});
// payTransactionList
@
connect
(({
payTransactionList
})
=>
({
...
payTransactionList
,
// list: payTransactionList.list.spus,
// loading: loading.models.payTransactionList,
}))
@
Form
.
create
()
class
PayTransactionList
extends
PureComponent
{
state
=
{
modalVisible
:
false
,
modalType
:
'add'
,
//add update
initValues
:
{},
};
componentDidMount
()
{
const
{
dispatch
,
searchParams
}
=
this
.
props
;
// 查询初始数据
dispatch
({
type
:
'payTransactionList/page'
,
payload
:
{
...
searchParams
,
...
PaginationHelper
.
defaultPayload
,
},
});
}
handleSortModalVisible
=
(
sortModalVisible
,
record
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'payTransactionList/setAll'
,
payload
:
{
sortModalVisible
,
formVals
:
record
||
{}
},
});
};
render
()
{
const
{
dispatch
,
list
,
listLoading
,
searchParams
,
pagination
,
categoryTree
,
formVals
,
}
=
this
.
props
;
// 列表属性
const
listProps
=
{
dataSource
:
list
,
pagination
,
searchParams
,
dispatch
,
categoryTree
,
loading
:
listLoading
,
handleSortModalVisible
:
this
.
handleSortModalVisible
,
// Func
};
// 搜索表单属性
const
searchFormProps
=
{
dispatch
,
categoryTree
,
searchParams
,
};
return
(
<
PageHeaderWrapper
title
=
""
>
<
Card
bordered
=
{
false
}
>
<
div
className
=
{
styles
.
tableList
}
>
<
div
className
=
{
styles
.
tableListOperator
}
>
{
/*<Button*/
}
{
/* icon="plus"*/
}
{
/* type="primary"*/
}
{
/* onClick={() => alert('正在开发中')}*/
}
{
/*>*/
}
{
/* 新建限时折扣*/
}
{
/*</Button>*/
}
<
/div
>
<
/div
>
<
SearchForm
{...
searchFormProps
}
/
>
<
List
{...
listProps
}
/
>
<
/Card
>
<
/PageHeaderWrapper
>
);
}
}
export
default
PayTransactionList
;
admin-web/src/pages/Pay/PayTransactionList.less
0 → 100644
浏览文件 @
e6c578f5
@import '~antd/lib/style/themes/default.less';
@import '~@/utils/utils.less';
.tableList {
.tableListOperator {
margin-bottom: 16px;
button {
margin-right: 8px;
}
}
}
.tableDelete {
color: red;
}
admin-web/src/pages/User/UserList.js
0 → 100644
浏览文件 @
e6c578f5
/* eslint-disable */
import
React
,
{
PureComponent
,
Fragment
}
from
'react'
;
import
{
connect
}
from
'dva'
;
import
moment
from
'moment'
;
import
{
Card
,
Form
,
Input
,
Row
,
Col
,
Button
,
Modal
,
message
,
Table
,
Divider
,
Tree
,
Tabs
,
TreeSelect
,
Spin
,
InputNumber
,
Select
}
from
'antd'
;
const
TabPane
=
Tabs
.
TabPane
;
import
PageHeaderWrapper
from
'@/components/PageHeaderWrapper'
;
import
styles
from
'./UserList.less'
;
import
PaginationHelper
from
"../../../helpers/PaginationHelper"
;
const
FormItem
=
Form
.
Item
;
const
statuses
=
{
1
:
'开启'
,
2
:
'关闭'
,
};
// 列表
function
List
({
dataSource
,
loading
,
pagination
,
searchParams
,
dispatch
,})
{
function
onPageChange
(
page
)
{
// 翻页
dispatch
({
type
:
'userList/page'
,
payload
:
{
pageNo
:
page
.
current
,
pageSize
:
page
.
pageSize
,
...
searchParams
}
})
}
const
columns
=
[
// {
// title: 'id',
// dataIndex: 'id',
// render: text => <strong>{text}</strong>,
// },
{
title
:
'昵称'
,
dataIndex
:
'nickname'
,
},
{
title
:
'手机号码'
,
dataIndex
:
'mobile'
,
},
{
title
:
'会员卡'
,
// TODO 芋艿,未来增加
},
{
title
:
'累积交易次数'
,
// TODO 芋艿,未来增加
},
{
title
:
'累计交易额'
,
// TODO 芋艿,未来增加
},
{
title
:
'积分'
,
// TODO 芋艿,未来增加
},
{
title
:
'会员标签'
,
// TODO 芋艿,未来增加
},
{
title
:
'备注'
,
// TODO 芋艿,未来增加
},
{
title
:
'状态'
,
dataIndex
:
'status'
,
render
:
val
=>
statuses
[
val
+
''
],
},
{
title
:
'操作'
,
width
:
300
,
render
:
(
text
,
record
)
=>
(
<
Fragment
>
{
/*<a onClick={() => this.handleModalVisible(true, 'update', record)}>更新</a>*/
}
<
a
onClick
=
{()
=>
alert
(
'正在开发中'
)}
>
编辑
<
/a
>
<
/Fragment
>
),
},
];
// console.log(pagination);
return
(
<
div
>
<
Table
columns
=
{
columns
}
dataSource
=
{
dataSource
}
rowKey
=
"id"
pagination
=
{
pagination
}
onChange
=
{
onPageChange
}
loading
=
{
loading
}
/
>
<
/div
>
)
}
// 搜索表单
const
SearchForm
=
Form
.
create
()(
props
=>
{
const
{
form
,
form
:
{
getFieldDecorator
},
dispatch
,
searchParams
,
}
=
props
;
function
search
()
{
dispatch
({
type
:
'userList/page'
,
payload
:
{
...
PaginationHelper
.
defaultPayload
,
...
searchParams
,
...
form
.
getFieldsValue
(),
}
})
}
// 提交搜索
function
handleSubmit
(
e
)
{
// 阻止默认事件
e
.
preventDefault
();
// 提交搜索
search
();
}
// 重置搜索
function
handleReset
()
{
// 重置表单
form
.
resetFields
();
// 执行搜索
search
();
}
return
(
<
Form
onSubmit
=
{
handleSubmit
}
layout
=
"inline"
>
<
Row
gutter
=
{{
md
:
8
,
lg
:
24
,
xl
:
48
}}
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"会员昵称"
>
{
getFieldDecorator
(
'nickname'
)(
<
Input
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
<
/Col
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"会员状态"
>
{
getFieldDecorator
(
'status'
)(
<
Select
placeholder
=
"请选择"
style
=
{{
width
:
'200px'
}}
>
<
Option
value
=
"1"
>
开启
<
/Option
>
<
Option
value
=
"2"
>
关闭
<
/Option
>
<
/Select
>
)}
<
/FormItem
>
<
/Col
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
span
className
=
{
styles
.
submitButtons
}
>
<
Button
type
=
"primary"
htmlType
=
"submit"
>
查询
<
/Button
>
<
Button
style
=
{{
marginLeft
:
8
}}
onClick
=
{
handleReset
}
>
重置
<
/Button
>
<
/span
>
<
/Col
>
<
/Row
>
<
/Form
>
);
});
// userList
@
connect
(({
userList
})
=>
({
...
userList
,
// list: userList.list.spus,
// loading: loading.models.userList,
}))
@
Form
.
create
()
class
UserList
extends
PureComponent
{
state
=
{
modalVisible
:
false
,
modalType
:
'add'
,
//add update
initValues
:
{},
};
componentDidMount
()
{
const
{
dispatch
,
searchParams
}
=
this
.
props
;
// 查询初始数据
dispatch
({
type
:
'userList/page'
,
payload
:
{
...
searchParams
,
...
PaginationHelper
.
defaultPayload
,
},
});
}
handleSortModalVisible
=
(
sortModalVisible
,
record
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'userList/setAll'
,
payload
:
{
sortModalVisible
,
formVals
:
record
||
{}
},
});
};
render
()
{
const
{
dispatch
,
list
,
listLoading
,
searchParams
,
pagination
,
categoryTree
,
formVals
,
}
=
this
.
props
;
// 列表属性
const
listProps
=
{
dataSource
:
list
,
pagination
,
searchParams
,
dispatch
,
categoryTree
,
loading
:
listLoading
,
handleSortModalVisible
:
this
.
handleSortModalVisible
,
// Func
};
// 搜索表单属性
const
searchFormProps
=
{
dispatch
,
categoryTree
,
searchParams
,
};
return
(
<
PageHeaderWrapper
title
=
""
>
<
Card
bordered
=
{
false
}
>
<
div
className
=
{
styles
.
tableList
}
>
<
div
className
=
{
styles
.
tableListOperator
}
>
{
/*<Button*/
}
{
/* icon="plus"*/
}
{
/* type="primary"*/
}
{
/* onClick={() => alert('正在开发中')}*/
}
{
/*>*/
}
{
/* 新建会员*/
}
{
/*</Button>*/
}
<
/div
>
<
/div
>
<
SearchForm
{...
searchFormProps
}
/
>
<
List
{...
listProps
}
/
>
<
/Card
>
<
/PageHeaderWrapper
>
);
}
}
export
default
UserList
;
admin-web/src/pages/User/UserList.less
0 → 100644
浏览文件 @
e6c578f5
@import '~antd/lib/style/themes/default.less';
@import '~@/utils/utils.less';
.tableList {
.tableListOperator {
margin-bottom: 16px;
button {
margin-right: 8px;
}
}
}
.tableDelete {
color: red;
}
admin-web/src/services/pay.js
0 → 100644
浏览文件 @
e6c578f5
import
{
stringify
}
from
'@/utils/request.qs'
;
import
request
from
'@/utils/request'
;
// Transaction
export
async
function
queryPayTransactionPage
(
params
)
{
return
request
(
`/pay-api/admins/transaction/page?
${
stringify
(
params
)}
`
,
{
method
:
'GET'
,
});
}
// Refund
export
async
function
queryPayRefundPage
(
params
)
{
return
request
(
`/pay-api/admins/refund/page?
${
stringify
(
params
)}
`
,
{
method
:
'GET'
,
});
}
admin-web/src/services/user.js
浏览文件 @
e6c578f5
import
{
stringify
}
from
'@/utils/request.qs'
;
import
request
from
'@/utils/request'
;
export
async
function
query
()
{
...
...
@@ -7,3 +8,11 @@ export async function query() {
export
async
function
queryCurrent
()
{
return
request
(
'/api/currentUser'
);
}
// User
export
async
function
queryUserPage
(
params
)
{
return
request
(
`/user-api/admins/user/page?
${
stringify
(
params
)}
`
,
{
method
:
'GET'
,
});
}
common/common-framework/src/main/java/cn/iocoder/common/framework/util/ServiceExceptionUtil.java
浏览文件 @
e6c578f5
...
...
@@ -71,6 +71,11 @@ public class ServiceExceptionUtil {
return
new
ServiceException
(
code
,
message
);
}
public
static
ServiceException
exception
(
Integer
code
,
String
messagePattern
,
Object
...
params
)
{
String
message
=
doFormat
(
code
,
messagePattern
,
params
);
return
new
ServiceException
(
code
,
message
);
}
/**
* 将错误编号对应的消息使用 params 进行格式化。
*
...
...
@@ -107,4 +112,4 @@ public class ServiceExceptionUtil {
return
sbuf
.
toString
();
}
}
\ No newline at end of file
}
docs/guides/功能列表/功能列表-管理后台.md
浏览文件 @
e6c578f5
...
...
@@ -7,26 +7,28 @@
-
[
]
数据分析【待认领】
-
[
]
TODO 未开始
-
[
]
店铺资产【待认领】
-
[
]
TODO 未开始
-
[
]
支付单 20% 【待认领】
-
[
]
退款单 20% 【待认领】
-
TODO 需要补充
-
[
]
商品管理
-
[
x
]
发布商品
-
[
x
]
商品列表
-
[
x
]
展示类目
-
[
]
品牌管理【待认领】
-
[
]
订单管理
-
[
]
销售单
-
[
]
售后单
-
[
]
销售单
开发中
-
[
]
售后单
开发中
-
[
]
订单评价【待认领】
-
[
]
会员管理
-
[
]
会员资料【待认领】
-
[
]
会员资料
20%
【待认领】
-
TODO 需要补充
-
[
]
营销管理
-
[
x
]
首页广告
-
[
x
]
商品推荐
-
[
x
]
优惠劵
-
[
]
优惠码【待认领】
-
[
]
满减送
-
[
]
限制折扣
-
[
]
满减送
20% 【待认领】
-
[
]
限制折扣
20% 【待认领】
-
[
]
多人拼团【待认领】
-
[
]
系统管理
-
[
]
员工管理
...
...
pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/controller/admins/AdminsPayRefundController.java
0 → 100644
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
pay
.
application
.
controller
.
admins
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.pay.api.PayRefundService
;
import
cn.iocoder.mall.pay.api.PayTransactionService
;
import
cn.iocoder.mall.pay.api.bo.PayRefundBO
;
import
cn.iocoder.mall.pay.api.bo.PayRefundPageBO
;
import
cn.iocoder.mall.pay.api.bo.PayTransactionBO
;
import
cn.iocoder.mall.pay.api.dto.PayRefundPageDTO
;
import
cn.iocoder.mall.pay.application.convert.PayRefundConvert
;
import
cn.iocoder.mall.pay.application.vo.admins.AdminsPayRefundPageVO
;
import
org.apache.dubbo.config.annotation.Reference
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
cn
.
iocoder
.
common
.
framework
.
vo
.
CommonResult
.
success
;
@RestController
@RequestMapping
(
"admins/refund"
)
public
class
AdminsPayRefundController
{
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.PayRefundService.version}"
)
private
PayRefundService
payRefundService
;
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.PayTransactionService.version}"
)
private
PayTransactionService
payTransactionService
;
@GetMapping
(
"/page"
)
public
CommonResult
<
AdminsPayRefundPageVO
>
page
(
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@RequestParam
(
value
=
"createBeginTime"
,
required
=
false
)
Date
createBeginTime
,
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@RequestParam
(
value
=
"createEndTime"
,
required
=
false
)
Date
createEndTime
,
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@RequestParam
(
value
=
"finishBeginTime"
,
required
=
false
)
Date
finishBeginTime
,
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@RequestParam
(
value
=
"finishEndTime"
,
required
=
false
)
Date
finishEndTime
,
@RequestParam
(
value
=
"status"
,
required
=
false
)
Integer
status
,
@RequestParam
(
value
=
"payChannel"
,
required
=
false
)
Integer
payChannel
,
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
PayRefundPageDTO
payRefundPageDTO
=
new
PayRefundPageDTO
()
.
setCreateBeginTime
(
createBeginTime
).
setCreateEndTime
(
createEndTime
)
.
setFinishBeginTime
(
finishBeginTime
).
setFinishEndTime
(
finishEndTime
)
.
setStatus
(
status
).
setPayChannel
(
payChannel
)
.
setPageNo
(
pageNo
).
setPageSize
(
pageSize
);
// 执行查询
PayRefundPageBO
refundBOPage
=
payRefundService
.
getRefundPage
(
payRefundPageDTO
);
AdminsPayRefundPageVO
result
=
new
AdminsPayRefundPageVO
()
.
setList
(
PayRefundConvert
.
INSTANCE
.
convertList
(
refundBOPage
.
getList
()))
.
setTotal
(
refundBOPage
.
getTotal
());
if
(
result
.
getList
().
isEmpty
())
{
return
success
(
result
);
}
// 拼接结果
Map
<
Integer
,
PayTransactionBO
>
transactionMap
=
payTransactionService
.
getTransactionList
(
result
.
getList
().
stream
().
map
(
PayRefundBO:
:
getTransactionId
).
collect
(
Collectors
.
toSet
()))
.
stream
().
collect
(
Collectors
.
toMap
(
PayTransactionBO:
:
getId
,
transaction
->
transaction
));
result
.
getList
().
forEach
(
refund
->
refund
.
setTransaction
(
transactionMap
.
get
(
refund
.
getTransactionId
())));
return
success
(
result
);
}
}
pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/controller/admins/AdminsPayTransactionController.java
0 → 100644
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
pay
.
application
.
controller
.
admins
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.pay.api.PayTransactionService
;
import
cn.iocoder.mall.pay.api.bo.PayTransactionPageBO
;
import
cn.iocoder.mall.pay.api.dto.PayTransactionPageDTO
;
import
org.apache.dubbo.config.annotation.Reference
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Date
;
import
static
cn
.
iocoder
.
common
.
framework
.
vo
.
CommonResult
.
success
;
@RestController
@RequestMapping
(
"admins/transaction"
)
public
class
AdminsPayTransactionController
{
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.PayTransactionService.version}"
)
private
PayTransactionService
payTransactionService
;
@GetMapping
(
"/page"
)
public
CommonResult
<
PayTransactionPageBO
>
page
(
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@RequestParam
(
value
=
"createBeginTime"
,
required
=
false
)
Date
createBeginTime
,
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@RequestParam
(
value
=
"createEndTime"
,
required
=
false
)
Date
createEndTime
,
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@RequestParam
(
value
=
"paymentBeginTime"
,
required
=
false
)
Date
paymentBeginTime
,
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@RequestParam
(
value
=
"paymentEndTime"
,
required
=
false
)
Date
paymentEndTime
,
@RequestParam
(
value
=
"status"
,
required
=
false
)
Integer
status
,
@RequestParam
(
value
=
"hasRefund"
,
required
=
false
)
Boolean
hasRefund
,
@RequestParam
(
value
=
"payChannel"
,
required
=
false
)
Integer
payChannel
,
@RequestParam
(
value
=
"orderSubject"
,
required
=
false
)
String
orderSubject
,
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
PayTransactionPageDTO
payTransactionPageDTO
=
new
PayTransactionPageDTO
()
.
setCreateBeginTime
(
createBeginTime
).
setCreateEndTime
(
createEndTime
)
.
setPaymentBeginTime
(
paymentBeginTime
).
setPaymentEndTime
(
paymentEndTime
)
.
setStatus
(
status
).
setHasRefund
(
hasRefund
)
.
setPayChannel
(
payChannel
).
setOrderSubject
(
orderSubject
)
.
setPageNo
(
pageNo
).
setPageSize
(
pageSize
);
// 执行查询
return
success
(
payTransactionService
.
getTransactionPage
(
payTransactionPageDTO
));
}
}
pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/controller/users/PayRefundController.java
→
pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/controller/users/
Users
PayRefundController.java
浏览文件 @
e6c578f5
...
...
@@ -3,9 +3,9 @@ package cn.iocoder.mall.pay.application.controller.users;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.pay.api.PayRefundService
;
import
cn.iocoder.mall.pay.api.constant.PayChannelEnum
;
import
org.apache.dubbo.config.annotation.Reference
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -17,11 +17,11 @@ import java.io.IOException;
@RestController
@RequestMapping
(
"users/refund"
)
// TODO 芋艿,理论来说,是用户无关的。这里先酱紫先~
public
class
PayRefundController
{
public
class
Users
PayRefundController
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
@
Autowired
@
Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.PayRefundService.version}"
)
private
PayRefundService
payRefundService
;
@PostMapping
(
value
=
"pingxx_refund_success"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
...
...
pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/controller/users/PayTransactionController.java
→
pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/controller/users/
Users
PayTransactionController.java
浏览文件 @
e6c578f5
...
...
@@ -20,14 +20,15 @@ import java.io.IOException;
@RestController
@RequestMapping
(
"users/transaction"
)
// TODO 芋艿,理论来说,是用户无关的。这里先酱紫先~
public
class
PayTransactionController
{
public
class
Users
PayTransactionController
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
@Reference
(
validation
=
"true"
)
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.PayTransactionService.version}"
)
private
PayTransactionService
payTransactionService
;
@GetMapping
(
"/get"
)
// TODO result 后面改下
public
CommonResult
<
PayTransactionBO
>
get
(
@RequestParam
(
"appId"
)
String
appId
,
@RequestParam
(
"orderId"
)
String
orderId
)
{
return
payTransactionService
.
getTransaction
(
UserSecurityContextHolder
.
getContext
().
getUserId
(),
appId
,
orderId
);
...
...
pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/convert/PayRefundConvert.java
0 → 100644
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
pay
.
application
.
convert
;
import
cn.iocoder.mall.pay.api.bo.PayRefundBO
;
import
cn.iocoder.mall.pay.application.vo.admins.AdminsPayRefundDetailVO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mappings
;
import
org.mapstruct.factory.Mappers
;
import
java.util.List
;
@Mapper
public
interface
PayRefundConvert
{
PayRefundConvert
INSTANCE
=
Mappers
.
getMapper
(
PayRefundConvert
.
class
);
@Mappings
({})
List
<
AdminsPayRefundDetailVO
>
convertList
(
List
<
PayRefundBO
>
refunds
);
}
pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/vo/admins/AdminsPayRefundDetailVO.java
0 → 100644
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
pay
.
application
.
vo
.
admins
;
import
cn.iocoder.mall.pay.api.bo.PayRefundBO
;
import
cn.iocoder.mall.pay.api.bo.PayTransactionBO
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
/**
* 支付退款详细 VO
*/
@Data
@Accessors
(
chain
=
true
)
public
class
AdminsPayRefundDetailVO
extends
PayRefundBO
{
// TODO 芋艿,暂时偷懒下
/**
* 支付交易
*/
private
PayTransactionBO
transaction
;
}
pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/vo/admins/AdminsPayRefundPageVO.java
0 → 100644
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
pay
.
application
.
vo
.
admins
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 支付退款 Page VO
*/
@Data
@Accessors
(
chain
=
true
)
public
class
AdminsPayRefundPageVO
implements
Serializable
{
/**
* 支付退款数组
*/
private
List
<
AdminsPayRefundDetailVO
>
list
;
/**
* 总量
*/
private
Integer
total
;
}
pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/PayRefundService.java
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
pay
.
api
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.pay.api.bo.PayRefundPageBO
;
import
cn.iocoder.mall.pay.api.bo.PayRefundSubmitBO
;
import
cn.iocoder.mall.pay.api.dto.PayRefundPageDTO
;
import
cn.iocoder.mall.pay.api.dto.PayRefundSubmitDTO
;
public
interface
PayRefundService
{
...
...
@@ -20,4 +22,6 @@ public interface PayRefundService {
*/
CommonResult
<
Boolean
>
updateRefundSuccess
(
Integer
payChannel
,
String
params
);
PayRefundPageBO
getRefundPage
(
PayRefundPageDTO
payRefundPageDTO
);
}
pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/PayTransactionService.java
浏览文件 @
e6c578f5
...
...
@@ -2,10 +2,15 @@ package cn.iocoder.mall.pay.api;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.pay.api.bo.PayTransactionBO
;
import
cn.iocoder.mall.pay.api.bo.PayTransactionPageBO
;
import
cn.iocoder.mall.pay.api.bo.PayTransactionSubmitBO
;
import
cn.iocoder.mall.pay.api.dto.PayTransactionCreateDTO
;
import
cn.iocoder.mall.pay.api.dto.PayTransactionPageDTO
;
import
cn.iocoder.mall.pay.api.dto.PayTransactionSubmitDTO
;
import
java.util.Collection
;
import
java.util.List
;
public
interface
PayTransactionService
{
CommonResult
<
PayTransactionBO
>
getTransaction
(
Integer
userId
,
String
appId
,
String
orderId
);
...
...
@@ -26,6 +31,10 @@ public interface PayTransactionService {
*/
CommonResult
<
Boolean
>
updateTransactionPaySuccess
(
Integer
payChannel
,
String
params
);
List
<
PayTransactionBO
>
getTransactionList
(
Collection
<
Integer
>
ids
);
PayTransactionPageBO
getTransactionPage
(
PayTransactionPageDTO
payTransactionPageDTO
);
CommonResult
cancelTransaction
();
// TODO 1. params 2. result
}
pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/bo/PayRefundBO.java
0 → 100644
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
pay
.
api
.
bo
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
* 支付退款 BO
*/
@Data
@Accessors
(
chain
=
true
)
public
class
PayRefundBO
{
/**
* 编号,自增
*/
private
Integer
id
;
/**
* 支付交易编号
*/
private
Integer
transactionId
;
/**
* 生成传输给第三方的退款号
*
* 唯一索引
*/
private
String
refundCode
;
/**
* 应用编号
*
* 不同业务线分配不同的 appId
* 举个例子,
* 1. 电商系统的订单,appId = 1024
* 2. 活动系统的订单,appId = 2048
*/
private
String
appId
;
/**
* 业务线的订单编号
*
* 1. 使用 String 的原因是,业务线可能使用 String 做为编号
* 2. 每个 appId 下,orderId 唯一
*/
private
String
orderId
;
/**
* 发起交易的 IP
*/
private
String
createIp
;
/**
* 业务退款描述
*/
private
String
orderDescription
;
/**
* 退款金额,单位:分。
*
* TODO 暂时不考虑货币类型。
*/
private
Integer
price
;
/**
* 退款状态
*
* @see cn.iocoder.mall.pay.api.constant.PayRefundStatus
*/
private
Integer
status
;
/**
* 回调业务线完成时间
*/
private
Date
finishTime
;
/**
* 异步通知地址
*/
private
String
notifyUrl
;
/**
* 扩展内容
*
* 异步通知的时候填充回调的数据
*/
private
String
extensionData
;
/**
* 退款渠道
*/
private
Integer
refundChannel
;
/**
* 第三方退款成功的时间
*/
private
Date
refundTime
;
/**
* 收到第三方系统通知的时间
*
* 一般情况下,即第三方系统的异步通知
*/
private
Date
notifyTime
;
/**
* 第三方的流水号
*/
private
String
tradeNo
;
/**
* 创建时间
*/
private
Date
createTime
;
}
pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/bo/PayRefundPageBO.java
0 → 100644
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
pay
.
api
.
bo
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 支付退款 Page BO
*/
@Data
@Accessors
(
chain
=
true
)
public
class
PayRefundPageBO
implements
Serializable
{
/**
* 支付退款数组
*/
private
List
<
PayRefundBO
>
list
;
/**
* 总量
*/
private
Integer
total
;
}
pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/bo/PayTransactionBO.java
浏览文件 @
e6c578f5
...
...
@@ -92,4 +92,11 @@ public class PayTransactionBO implements Serializable {
*/
private
Date
createTime
;
// ========== 退款相关 ==========
/**
* 退款总金额
*/
private
Integer
refundTotal
;
}
pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/bo/PayTransactionPageBO.java
0 → 100644
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
pay
.
api
.
bo
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 支付交易 Page BO
*/
@Data
@Accessors
(
chain
=
true
)
public
class
PayTransactionPageBO
implements
Serializable
{
/**
* 支付交易数组
*/
private
List
<
PayTransactionBO
>
list
;
/**
* 总量
*/
private
Integer
total
;
}
pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/constant/PayChannelEnum.java
浏览文件 @
e6c578f5
...
...
@@ -6,9 +6,9 @@ package cn.iocoder.mall.pay.api.constant;
public
enum
PayChannelEnum
{
WEIXIN_APP
(
100
,
"wx"
,
"微信 App 支付"
),
WEIXIN_PUB
(
10
0
,
"wx
"
,
"微信 JS API 支付"
),
WEIXIN_PUB
(
10
1
,
"wxjs
"
,
"微信 JS API 支付"
),
ALIPAY
(
200
,
"alipay"
,
"
微信
支付"
),
ALIPAY
(
200
,
"alipay"
,
"
支付宝 App
支付"
),
PINGXX
(
9999
,
"ping++"
,
"ping++ 支付"
),
;
...
...
@@ -44,4 +44,4 @@ public enum PayChannelEnum {
return
name
;
}
}
\ No newline at end of file
}
pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/dto/PayRefundPageDTO.java
0 → 100644
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
pay
.
api
.
dto
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
/**
* 支付退款分页 DTO
*/
@Data
@Accessors
(
chain
=
true
)
public
class
PayRefundPageDTO
{
/**
* 创建时间(开始)
*/
private
Date
createBeginTime
;
/**
* 创建时间(结束)
*/
private
Date
createEndTime
;
/**
* 完成时间(开始)
*/
private
Date
finishBeginTime
;
/**
* 完成时间(结束)
*/
private
Date
finishEndTime
;
/**
* 退款状态
*/
private
Integer
status
;
/**
* 支付渠道
*/
private
Integer
payChannel
;
@NotNull
(
message
=
"页码不能为空"
)
private
Integer
pageNo
;
@NotNull
(
message
=
"每页条数不能为空"
)
private
Integer
pageSize
;
}
pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/dto/PayTransactionPageDTO.java
0 → 100644
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
pay
.
api
.
dto
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
/**
* 支付交易分页 DTO
*/
@Data
@Accessors
(
chain
=
true
)
public
class
PayTransactionPageDTO
{
/**
* 创建时间(开始)
*/
private
Date
createBeginTime
;
/**
* 创建时间(结束)
*/
private
Date
createEndTime
;
/**
* 支付时间(开始)
*/
private
Date
paymentBeginTime
;
/**
* 支付时间(结束)
*/
private
Date
paymentEndTime
;
/**
* 支付状态
*/
private
Integer
status
;
/**
* 是否有退款
*/
private
Boolean
hasRefund
;
/**
* 支付渠道
*/
private
Integer
payChannel
;
/**
* 商品标题
*
* 模糊匹配
*/
private
String
orderSubject
;
@NotNull
(
message
=
"页码不能为空"
)
private
Integer
pageNo
;
@NotNull
(
message
=
"每页条数不能为空"
)
private
Integer
pageSize
;
}
pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/convert/PayRefundConvert.java
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
pay
.
biz
.
convert
;
import
cn.iocoder.mall.pay.api.bo.PayRefundBO
;
import
cn.iocoder.mall.pay.api.dto.PayRefundSubmitDTO
;
import
cn.iocoder.mall.pay.biz.dataobject.PayRefundDO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mappings
;
import
org.mapstruct.factory.Mappers
;
import
java.util.List
;
@Mapper
public
interface
PayRefundConvert
{
...
...
@@ -14,4 +17,10 @@ public interface PayRefundConvert {
@Mappings
({})
PayRefundDO
convert
(
PayRefundSubmitDTO
payRefundSubmitDTO
);
@Mappings
({})
PayRefundBO
convert
(
PayRefundDO
refund
);
@Mappings
({})
List
<
PayRefundBO
>
convertList
(
List
<
PayRefundDO
>
refunds
);
}
pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/convert/PayTransactionConvert.java
浏览文件 @
e6c578f5
...
...
@@ -9,6 +9,8 @@ import org.mapstruct.Mapper;
import
org.mapstruct.Mappings
;
import
org.mapstruct.factory.Mappers
;
import
java.util.List
;
@Mapper
public
interface
PayTransactionConvert
{
...
...
@@ -20,6 +22,9 @@ public interface PayTransactionConvert {
@Mappings
({})
PayTransactionBO
convert
(
PayTransactionDO
payTransactionDO
);
@Mappings
({})
List
<
PayTransactionBO
>
convertList
(
List
<
PayTransactionDO
>
list
);
@Mappings
({})
PayTransactionExtensionDO
convert
(
PayTransactionSubmitDTO
payTransactionSubmitDTO
);
...
...
pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dao/PayRefundMapper.java
浏览文件 @
e6c578f5
...
...
@@ -4,6 +4,9 @@ import cn.iocoder.mall.pay.biz.dataobject.PayRefundDO;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
java.util.List
;
@Repository
public
interface
PayRefundMapper
{
...
...
@@ -16,4 +19,20 @@ public interface PayRefundMapper {
PayRefundDO
selectByRefundCode
(
@Param
(
"refundCode"
)
String
refundCode
);
List
<
PayRefundDO
>
selectListByPage
(
@Param
(
"createBeginTime"
)
Date
createBeginTime
,
@Param
(
"createEndTime"
)
Date
createEndTime
,
@Param
(
"finishBeginTime"
)
Date
finishBeginTime
,
@Param
(
"finishEndTime"
)
Date
finishEndTime
,
@Param
(
"status"
)
Integer
status
,
@Param
(
"payChannel"
)
Integer
payChannel
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"limit"
)
Integer
limit
);
Integer
selectCountByPage
(
@Param
(
"createBeginTime"
)
Date
createBeginTime
,
@Param
(
"createEndTime"
)
Date
createEndTime
,
@Param
(
"finishBeginTime"
)
Date
finishBeginTime
,
@Param
(
"finishEndTime"
)
Date
finishEndTime
,
@Param
(
"status"
)
Integer
status
,
@Param
(
"payChannel"
)
Integer
payChannel
);
}
pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dao/PayTransactionMapper.java
浏览文件 @
e6c578f5
...
...
@@ -4,6 +4,10 @@ import cn.iocoder.mall.pay.biz.dataobject.PayTransactionDO;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.List
;
@Repository
public
interface
PayTransactionMapper
{
...
...
@@ -20,4 +24,26 @@ public interface PayTransactionMapper {
PayTransactionDO
selectById
(
@Param
(
"id"
)
Integer
id
);
List
<
PayTransactionDO
>
selectListByIds
(
@Param
(
"ids"
)
Collection
<
Integer
>
ids
);
List
<
PayTransactionDO
>
selectListByPage
(
@Param
(
"createBeginTime"
)
Date
createBeginTime
,
@Param
(
"createEndTime"
)
Date
createEndTime
,
@Param
(
"paymentBeginTime"
)
Date
paymentBeginTime
,
@Param
(
"paymentEndTime"
)
Date
paymentEndTime
,
@Param
(
"status"
)
Integer
status
,
@Param
(
"hasRefund"
)
Boolean
hasRefund
,
@Param
(
"payChannel"
)
Integer
payChannel
,
@Param
(
"orderSubject"
)
String
orderSubject
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"limit"
)
Integer
limit
);
Integer
selectCountByPage
(
@Param
(
"createBeginTime"
)
Date
createBeginTime
,
@Param
(
"createEndTime"
)
Date
createEndTime
,
@Param
(
"paymentBeginTime"
)
Date
paymentBeginTime
,
@Param
(
"paymentEndTime"
)
Date
paymentEndTime
,
@Param
(
"status"
)
Integer
status
,
@Param
(
"hasRefund"
)
Boolean
hasRefund
,
@Param
(
"payChannel"
)
Integer
payChannel
,
@Param
(
"orderSubject"
)
String
orderSubject
);
}
pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/service/PayRefundServiceImpl.java
浏览文件 @
e6c578f5
...
...
@@ -5,10 +5,12 @@ import cn.iocoder.common.framework.util.MathUtil;
import
cn.iocoder.common.framework.util.ServiceExceptionUtil
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.pay.api.PayRefundService
;
import
cn.iocoder.mall.pay.api.bo.PayRefundPageBO
;
import
cn.iocoder.mall.pay.api.bo.PayRefundSubmitBO
;
import
cn.iocoder.mall.pay.api.constant.PayErrorCodeEnum
;
import
cn.iocoder.mall.pay.api.constant.PayRefundStatus
;
import
cn.iocoder.mall.pay.api.constant.PayTransactionStatusEnum
;
import
cn.iocoder.mall.pay.api.dto.PayRefundPageDTO
;
import
cn.iocoder.mall.pay.api.dto.PayRefundSubmitDTO
;
import
cn.iocoder.mall.pay.biz.client.AbstractPaySDK
;
import
cn.iocoder.mall.pay.biz.client.PaySDKFactory
;
...
...
@@ -30,7 +32,7 @@ import javax.annotation.Resource;
import
java.util.Date
;
@Service
@org
.
apache
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
)
@org
.
apache
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
,
version
=
"${dubbo.provider.PayRefundService.version}"
)
public
class
PayRefundServiceImpl
implements
PayRefundService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
...
...
@@ -120,6 +122,7 @@ public class PayRefundServiceImpl implements PayRefundService {
PayRefundDO
updatePayRefundDO
=
new
PayRefundDO
()
.
setId
(
payRefund
.
getId
())
.
setStatus
(
status
)
.
setTradeNo
(
paySuccessResult
.
getData
().
getTradeNo
())
.
setExtensionData
(
params
);
int
updateCounts
=
payRefundMapper
.
update
(
updatePayRefundDO
,
PayRefundStatus
.
WAITING
.
getValue
());
if
(
updateCounts
==
0
)
{
// 校验状态,必须是待支付
...
...
@@ -147,6 +150,24 @@ public class PayRefundServiceImpl implements PayRefundService {
return
CommonResult
.
success
(
true
);
}
@Override
public
PayRefundPageBO
getRefundPage
(
PayRefundPageDTO
payRefundPageDTO
)
{
PayRefundPageBO
payRefundPageBO
=
new
PayRefundPageBO
();
// 查询分页数据
int
offset
=
(
payRefundPageDTO
.
getPageNo
()
-
1
)
*
payRefundPageDTO
.
getPageSize
();
payRefundPageBO
.
setList
(
PayRefundConvert
.
INSTANCE
.
convertList
(
payRefundMapper
.
selectListByPage
(
payRefundPageDTO
.
getCreateBeginTime
(),
payRefundPageDTO
.
getCreateEndTime
(),
payRefundPageDTO
.
getFinishBeginTime
(),
payRefundPageDTO
.
getFinishEndTime
(),
payRefundPageDTO
.
getStatus
(),
payRefundPageDTO
.
getPayChannel
(),
offset
,
payRefundPageDTO
.
getPageSize
())));
// 查询分页总数
payRefundPageBO
.
setTotal
(
payRefundMapper
.
selectCountByPage
(
payRefundPageDTO
.
getCreateBeginTime
(),
payRefundPageDTO
.
getCreateEndTime
(),
payRefundPageDTO
.
getFinishBeginTime
(),
payRefundPageDTO
.
getFinishEndTime
(),
payRefundPageDTO
.
getStatus
(),
payRefundPageDTO
.
getPayChannel
()));
return
payRefundPageBO
;
}
private
String
generateTransactionCode
()
{
// wx
// 2014
...
...
pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/service/PayTransactionServiceImpl.java
浏览文件 @
e6c578f5
...
...
@@ -6,18 +6,20 @@ import cn.iocoder.common.framework.util.ServiceExceptionUtil;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.pay.api.PayTransactionService
;
import
cn.iocoder.mall.pay.api.bo.PayTransactionBO
;
import
cn.iocoder.mall.pay.api.bo.PayTransactionPageBO
;
import
cn.iocoder.mall.pay.api.bo.PayTransactionSubmitBO
;
import
cn.iocoder.mall.pay.api.constant.PayErrorCodeEnum
;
import
cn.iocoder.mall.pay.api.constant.PayTransactionStatusEnum
;
import
cn.iocoder.mall.pay.api.dto.PayTransactionCreateDTO
;
import
cn.iocoder.mall.pay.api.dto.PayTransactionPageDTO
;
import
cn.iocoder.mall.pay.api.dto.PayTransactionSubmitDTO
;
import
cn.iocoder.mall.pay.biz.client.AbstractPaySDK
;
import
cn.iocoder.mall.pay.biz.client.PaySDKFactory
;
import
cn.iocoder.mall.pay.biz.client.TransactionSuccessBO
;
import
cn.iocoder.mall.pay.biz.convert.PayTransactionConvert
;
import
cn.iocoder.mall.pay.biz.dao.PayNotifyTaskMapper
;
import
cn.iocoder.mall.pay.biz.dao.PayTransactionExtensionMapper
;
import
cn.iocoder.mall.pay.biz.dao.PayTransactionMapper
;
import
cn.iocoder.mall.pay.biz.dao.PayNotifyTaskMapper
;
import
cn.iocoder.mall.pay.biz.dataobject.PayAppDO
;
import
cn.iocoder.mall.pay.biz.dataobject.PayTransactionDO
;
import
cn.iocoder.mall.pay.biz.dataobject.PayTransactionExtensionDO
;
...
...
@@ -27,10 +29,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.List
;
@Service
@org
.
apache
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
)
@org
.
apache
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
,
version
=
"${dubbo.provider.PayTransactionService.version}"
)
public
class
PayTransactionServiceImpl
implements
PayTransactionService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
...
...
@@ -193,6 +197,31 @@ public class PayTransactionServiceImpl implements PayTransactionService {
return
CommonResult
.
success
(
true
);
}
@Override
public
List
<
PayTransactionBO
>
getTransactionList
(
Collection
<
Integer
>
ids
)
{
return
PayTransactionConvert
.
INSTANCE
.
convertList
(
payTransactionMapper
.
selectListByIds
(
ids
));
}
@Override
public
PayTransactionPageBO
getTransactionPage
(
PayTransactionPageDTO
payTransactionPageDTO
)
{
PayTransactionPageBO
payTransactionPage
=
new
PayTransactionPageBO
();
// 查询分页数据
int
offset
=
(
payTransactionPageDTO
.
getPageNo
()
-
1
)
*
payTransactionPageDTO
.
getPageSize
();
payTransactionPage
.
setList
(
PayTransactionConvert
.
INSTANCE
.
convertList
(
payTransactionMapper
.
selectListByPage
(
payTransactionPageDTO
.
getCreateBeginTime
(),
payTransactionPageDTO
.
getCreateEndTime
(),
payTransactionPageDTO
.
getPaymentBeginTime
(),
payTransactionPageDTO
.
getPaymentEndTime
(),
payTransactionPageDTO
.
getStatus
(),
payTransactionPageDTO
.
getHasRefund
(),
payTransactionPageDTO
.
getPayChannel
(),
payTransactionPageDTO
.
getOrderSubject
(),
offset
,
payTransactionPageDTO
.
getPageSize
())));
// 查询分页总数
payTransactionPage
.
setTotal
(
payTransactionMapper
.
selectCountByPage
(
payTransactionPageDTO
.
getCreateBeginTime
(),
payTransactionPageDTO
.
getCreateEndTime
(),
payTransactionPageDTO
.
getPaymentBeginTime
(),
payTransactionPageDTO
.
getPaymentEndTime
(),
payTransactionPageDTO
.
getStatus
(),
payTransactionPageDTO
.
getHasRefund
(),
payTransactionPageDTO
.
getPayChannel
(),
payTransactionPageDTO
.
getOrderSubject
()));
return
payTransactionPage
;
}
@Override
// TODO 芋艿,后面去实现
public
CommonResult
cancelTransaction
()
{
return
null
;
...
...
pay/pay-service-impl/src/main/resources/config/application.yaml
浏览文件 @
e6c578f5
...
...
@@ -23,6 +23,11 @@ dubbo:
name
:
dubbo
scan
:
base-packages
:
cn.iocoder.mall.pay.biz.service
provider
:
PayTransactionService
:
version
:
1.0.0
PayRefundService
:
version
:
1.0.0
# rocketmq
rocketmq
:
...
...
pay/pay-service-impl/src/main/resources/mapper/PayRefundMapper.xml
浏览文件 @
e6c578f5
...
...
@@ -66,4 +66,57 @@
WHERE id = #{id}
</select>
<select
id=
"selectListByPage"
resultType=
"PayRefundDO"
>
SELECT
<include
refid=
"FIELDS"
/>
FROM refund
<where>
<if
test=
"createBeginTime != null"
>
AND create_time >= #{createBeginTime}
</if>
<if
test=
"createEndTime != null"
>
AND #{createEndTime} >= create_time
</if>
<if
test=
"finishBeginTime != null"
>
AND finish_time >= #{finishBeginTime}
</if>
<if
test=
"finishEndTime != null"
>
AND #{finishEndTime} >= finish_time
</if>
<if
test=
"status != null"
>
AND status = #{status}
</if>
<if
test=
"payChannel != null"
>
AND pay_channel = #{payChannel}
</if>
</where>
LIMIT #{offset}, #{limit}
</select>
<select
id=
"selectCountByPage"
resultType=
"Integer"
>
SELECT
COUNT(1)
FROM refund
<where>
<if
test=
"createBeginTime != null"
>
AND create_time >= #{createBeginTime}
</if>
<if
test=
"createEndTime != null"
>
AND #{createEndTime} >= create_time
</if>
<if
test=
"finishBeginTime != null"
>
AND finish_time >= #{finishBeginTime}
</if>
<if
test=
"finishEndTime != null"
>
AND #{finishEndTime} >= finish_time
</if>
<if
test=
"status != null"
>
AND status = #{status}
</if>
<if
test=
"payChannel != null"
>
AND pay_channel = #{payChannel}
</if>
</where>
</select>
</mapper>
pay/pay-service-impl/src/main/resources/mapper/PayTransactionMapper.xml
浏览文件 @
e6c578f5
...
...
@@ -75,4 +75,85 @@
WHERE id = #{id}
</select>
<select
id=
"selectListByIds"
resultType=
"PayTransactionDO"
>
SELECT
<include
refid=
"FIELDS"
/>
FROM transaction
WHERE id IN
<foreach
item=
"id"
collection=
"ids"
separator=
","
open=
"("
close=
")"
index=
""
>
#{id}
</foreach>
</select>
<select
id=
"selectListByPage"
resultType=
"PayTransactionDO"
>
SELECT
<include
refid=
"FIELDS"
/>
FROM transaction
<where>
<if
test=
"createBeginTime != null"
>
AND create_time >= #{createBeginTime}
</if>
<if
test=
"createEndTime != null"
>
AND #{createEndTime} >= create_time
</if>
<if
test=
"paymentBeginTime != null"
>
AND payment_time >= #{paymentBeginTime}
</if>
<if
test=
"paymentEndTime != null"
>
AND #{paymentEndTime} >= payment_time
</if>
<if
test=
"status != null"
>
AND status = #{status}
</if>
<if
test=
"hasRefund == true"
>
AND refund_total > 0
</if>
<if
test=
"hasRefund == false"
>
AND refund_total = 0
</if>
<if
test=
"payChannel != null"
>
AND pay_channel = #{payChannel}
</if>
<if
test=
"orderSubject != null"
>
order_subject LIKE "%"#{orderSubject}"%"
</if>
</where>
LIMIT #{offset}, #{limit}
</select>
<select
id=
"selectCountByPage"
resultType=
"Integer"
>
SELECT
COUNT(1)
FROM transaction
<where>
<if
test=
"createBeginTime != null"
>
AND create_time >= #{createBeginTime}
</if>
<if
test=
"createEndTime != null"
>
AND #{createEndTime} >= create_time
</if>
<if
test=
"paymentBeginTime != null"
>
AND payment_time >= #{paymentBeginTime}
</if>
<if
test=
"paymentEndTime != null"
>
AND #{paymentEndTime} >= payment_time
</if>
<if
test=
"status != null"
>
AND status = #{status}
</if>
<if
test=
"hasRefund == true"
>
AND refund_total > 0
</if>
<if
test=
"hasRefund == false"
>
AND refund_total = 0
</if>
<if
test=
"payChannel != null"
>
AND pay_channel = #{payChannel}
</if>
<if
test=
"orderSubject != null"
>
order_subject LIKE "%"#{orderSubject}"%"
</if>
</where>
</select>
</mapper>
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/controller/admins/AdminsCouponController.java
浏览文件 @
e6c578f5
...
...
@@ -22,6 +22,8 @@ import org.springframework.web.bind.annotation.*;
import
java.util.Date
;
import
static
cn
.
iocoder
.
common
.
framework
.
vo
.
CommonResult
.
success
;
@RestController
@RequestMapping
(
"admins/coupon"
)
@Api
(
"优惠劵(码)模块"
)
...
...
@@ -48,10 +50,10 @@ public class AdminsCouponController {
@RequestParam
(
value
=
"preferentialType"
,
required
=
false
)
Integer
preferentialType
,
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
Co
mmonResult
<
CouponTemplatePageBO
>
result
=
couponService
.
getCouponTemplatePage
(
new
CouponTemplatePageDTO
()
Co
uponTemplatePageBO
result
=
couponService
.
getCouponTemplatePage
(
new
CouponTemplatePageDTO
()
.
setType
(
type
).
setTitle
(
title
).
setStatus
(
status
).
setPreferentialType
(
preferentialType
)
.
setPageNo
(
pageNo
).
setPageSize
(
pageSize
));
return
CouponTemplateConvert
.
INSTANCE
.
convert
(
result
);
return
success
(
CouponTemplateConvert
.
ADMINS
.
convertPage
(
result
)
);
}
@PostMapping
(
"/template/add_card"
)
...
...
@@ -103,9 +105,9 @@ public class AdminsCouponController {
.
setFixedBeginTerm
(
fixedBeginTerm
).
setFixedEndTerm
(
fixedEndTerm
)
.
setPreferentialType
(
preferentialType
).
setPriceOff
(
priceOff
).
setPercentOff
(
percentOff
).
setDiscountPriceLimit
(
discountPriceLimit
);
// 提交请求
Co
mmonResult
<
CouponTemplateBO
>
result
=
couponService
.
addCouponCardTemplate
(
couponCardTemplateAddDTO
);
Co
uponTemplateBO
result
=
couponService
.
addCouponCardTemplate
(
couponCardTemplateAddDTO
);
// 返回结果
return
CouponTemplateConvert
.
INSTANCE
.
convert2
(
result
);
return
success
(
CouponTemplateConvert
.
ADMINS
.
convert
(
result
)
);
}
@PostMapping
(
"/template/update_card"
)
...
...
@@ -132,7 +134,7 @@ public class AdminsCouponController {
.
setTitle
(
title
).
setDescription
(
description
)
.
setQuota
(
quota
).
setTotal
(
total
)
.
setRangeType
(
rangeType
).
setRangeValues
(
rangeValues
);
return
couponService
.
updateCouponCardTemplate
(
couponCardTemplateUpdateDTO
);
return
success
(
couponService
.
updateCouponCardTemplate
(
couponCardTemplateUpdateDTO
)
);
}
@PostMapping
(
"/template/update_status"
)
...
...
@@ -143,7 +145,7 @@ public class AdminsCouponController {
})
public
CommonResult
<
Boolean
>
templateUpdateStatus
(
@RequestParam
(
"id"
)
Integer
id
,
@RequestParam
(
"status"
)
Integer
status
)
{
return
couponService
.
updateCouponTemplateStatus
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
id
,
status
);
return
success
(
couponService
.
updateCouponTemplateStatus
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
id
,
status
)
);
}
// ========== 优惠劵 ==========
...
...
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/controller/users/UsersCouponController.java
浏览文件 @
e6c578f5
...
...
@@ -20,6 +20,8 @@ import io.swagger.annotations.ApiOperation;
import
org.apache.dubbo.config.annotation.Reference
;
import
org.springframework.web.bind.annotation.*
;
import
static
cn
.
iocoder
.
common
.
framework
.
vo
.
CommonResult
.
success
;
@RestController
@RequestMapping
(
"users/coupon"
)
@Api
(
"优惠劵(码)模块"
)
...
...
@@ -35,8 +37,8 @@ public class UsersCouponController {
@ApiImplicitParam
(
name
=
"id"
,
value
=
"优惠劵(码)模板编号"
,
required
=
true
,
example
=
"10"
)
@PermitAll
public
CommonResult
<
UsersCouponTemplateVO
>
templateGet
(
@RequestParam
(
"id"
)
Integer
id
)
{
CouponTemplateBO
template
=
couponService
.
getCouponTemplate
(
id
)
.
getData
()
;
return
CommonResult
.
success
(
CouponTemplateConvert
.
INSTANCE
.
convert2
(
template
));
CouponTemplateBO
template
=
couponService
.
getCouponTemplate
(
id
);
return
success
(
CouponTemplateConvert
.
USERS
.
convert2
(
template
));
}
// ========== 优惠劵 ==========
...
...
@@ -51,18 +53,18 @@ public class UsersCouponController {
public
CommonResult
<
UsersCouponCardPageVO
>
cardPage
(
@RequestParam
(
value
=
"status"
,
required
=
false
)
Integer
status
,
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
Co
mmonResult
<
CouponCardPageBO
>
result
=
couponService
.
getCouponCardPage
(
new
CouponCardPageDTO
()
Co
uponCardPageBO
result
=
couponService
.
getCouponCardPage
(
new
CouponCardPageDTO
()
.
setStatus
(
status
).
setUserId
(
UserSecurityContextHolder
.
getContext
().
getUserId
())
.
setPageNo
(
pageNo
).
setPageSize
(
pageSize
));
return
CouponCardConvert
.
INSTANCE
.
convert2
(
result
);
return
success
(
CouponCardConvert
.
INSTANCE
.
convert2
(
result
)
);
}
@PostMapping
(
"/card/add"
)
@ApiOperation
(
value
=
"领取优惠劵"
)
@ApiImplicitParam
(
name
=
"templateId"
,
value
=
"优惠劵(码)模板编号"
,
required
=
true
,
example
=
"10"
)
public
CommonResult
<
UsersCouponCardVO
>
cardAdd
(
@RequestParam
(
"templateId"
)
Integer
templateId
)
{
Co
mmonResult
<
CouponCardBO
>
result
=
couponService
.
addCouponCard
(
UserSecurityContextHolder
.
getContext
().
getUserId
(),
templateId
);
return
CouponCardConvert
.
INSTANCE
.
convert
(
result
);
Co
uponCardBO
result
=
couponService
.
addCouponCard
(
UserSecurityContextHolder
.
getContext
().
getUserId
(),
templateId
);
return
success
(
CouponCardConvert
.
INSTANCE
.
convert
(
result
)
);
}
// ========== 优惠码 ==========
...
...
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/convert/CouponCardConvert.java
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
promotion
.
application
.
convert
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.promotion.api.bo.CouponCardBO
;
import
cn.iocoder.mall.promotion.api.bo.CouponCardPageBO
;
import
cn.iocoder.mall.promotion.application.vo.users.UsersCouponCardPageVO
;
...
...
@@ -15,13 +14,15 @@ public interface CouponCardConvert {
CouponCardConvert
INSTANCE
=
Mappers
.
getMapper
(
CouponCardConvert
.
class
);
@Mappings
({})
CommonResult
<
UsersCouponCardVO
>
convert
(
CommonResult
<
CouponCardBO
>
result
);
UsersCouponCardVO
convert
(
CouponCardBO
result
);
@Mappings
({})
CommonResult
<
UsersCouponCardPageVO
>
convert2
(
CommonResult
<
CouponCardPageBO
>
result
);
UsersCouponCardPageVO
convert2
(
CouponCardPageBO
result
);
//
// @Mappings({})
// List<UsersCouponTemplateVO> convertList2(List<CouponTemplateBO> banners);
}
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/convert/CouponTemplateConvert.java
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
promotion
.
application
.
convert
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.promotion.api.bo.CouponTemplateBO
;
import
cn.iocoder.mall.promotion.api.bo.CouponTemplatePageBO
;
import
cn.iocoder.mall.promotion.application.vo.admins.AdminsCouponTemplatePageVO
;
...
...
@@ -15,25 +14,30 @@ import java.util.List;
@Mapper
public
interface
CouponTemplateConvert
{
CouponTemplateConvert
INSTANCE
=
Mappers
.
getMapper
(
CouponTemplateConvert
.
class
);
Users
USERS
=
Mappers
.
getMapper
(
Users
.
class
);
@Mappings
({})
AdminsCouponTemplateVO
convert
(
CouponTemplateBO
template
);
Admins
ADMINS
=
Mappers
.
getMapper
(
Admins
.
class
);
@Mapp
ings
({})
CommonResult
<
AdminsCouponTemplateVO
>
convert2
(
CommonResult
<
CouponTemplateBO
>
result
);
@Mapp
er
interface
Admins
{
@Mappings
({})
CommonResult
<
AdminsCouponTemplatePageVO
>
convert
(
CommonResult
<
CouponTemplatePageBO
>
result
);
@Mappings
({})
AdminsCouponTemplateVO
convert
(
CouponTemplateBO
template
);
@Mappings
({})
List
<
AdminsCouponTemplateVO
>
convertList
(
List
<
CouponTemplateBO
>
templates
);
@Mappings
({})
AdminsCouponTemplatePageVO
convertPage
(
CouponTemplatePageBO
result
);
@Mappings
({})
UsersCouponTemplateVO
convert2
(
CouponTemplateBO
template
);
@Mappings
({})
List
<
AdminsCouponTemplateVO
>
convertList
(
List
<
CouponTemplateBO
>
templates
);
//
// @Mappings({})
// List<UsersCouponTemplateVO> convertList2(List<CouponTemplateBO> banners);
}
@Mapper
interface
Users
{
@Mappings
({})
UsersCouponTemplateVO
convert2
(
CouponTemplateBO
template
);
}
}
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/CouponService.java
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
promotion
.
api
;
import
cn.iocoder.common.framework.validator.InEnum
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.promotion.api.bo.*
;
import
cn.iocoder.mall.promotion.api.constant.CouponTemplateStatusEnum
;
import
cn.iocoder.mall.promotion.api.dto.*
;
...
...
@@ -13,9 +12,9 @@ public interface CouponService {
// ========== 优惠劵(码)模板 ==========
Co
mmonResult
<
CouponTemplateBO
>
getCouponTemplate
(
Integer
couponTemplateId
);
Co
uponTemplateBO
getCouponTemplate
(
Integer
couponTemplateId
);
Co
mmonResult
<
CouponTemplatePageBO
>
getCouponTemplatePage
(
CouponTemplatePageDTO
couponTemplatePageDTO
);
Co
uponTemplatePageBO
getCouponTemplatePage
(
CouponTemplatePageDTO
couponTemplatePageDTO
);
/**
* 创建优惠码模板
...
...
@@ -23,7 +22,7 @@ public interface CouponService {
* @param couponCodeTemplateAddDTO 优惠码模板添加 DTO
* @return 优惠码模板
*/
Co
mmonResult
<
CouponTemplateBO
>
addCouponCodeTemplate
(
CouponCodeTemplateAddDTO
couponCodeTemplateAddDTO
);
Co
uponTemplateBO
addCouponCodeTemplate
(
CouponCodeTemplateAddDTO
couponCodeTemplateAddDTO
);
/**
* 创建优惠劵模板
...
...
@@ -31,7 +30,7 @@ public interface CouponService {
* @param couponCardTemplateAddDTO 优惠码模板添加 DTO
* @return 优惠劵模板
*/
Co
mmonResult
<
CouponTemplateBO
>
addCouponCardTemplate
(
CouponCardTemplateAddDTO
couponCardTemplateAddDTO
);
Co
uponTemplateBO
addCouponCardTemplate
(
CouponCardTemplateAddDTO
couponCardTemplateAddDTO
);
/**
* 更新优惠码模板
...
...
@@ -39,7 +38,7 @@ public interface CouponService {
* @param couponCodeTemplateUpdateDTO 优惠码模板修改 DTO
* @return 是否成功
*/
CommonResult
<
Boolean
>
updateCouponCodeTemplate
(
CouponCodeTemplateUpdateDTO
couponCodeTemplateUpdateDTO
);
Boolean
updateCouponCodeTemplate
(
CouponCodeTemplateUpdateDTO
couponCodeTemplateUpdateDTO
);
/**
* 更新优惠劵模板
...
...
@@ -47,71 +46,70 @@ public interface CouponService {
* @param couponCardTemplateUpdateDTO 优惠劵模板修改 DTO
* @return 是否成功
*/
CommonResult
<
Boolean
>
updateCouponCardTemplate
(
CouponCardTemplateUpdateDTO
couponCardTemplateUpdateDTO
);
Boolean
updateCouponCardTemplate
(
CouponCardTemplateUpdateDTO
couponCardTemplateUpdateDTO
);
/**
* 更新优惠劵(码)模板的状态
*
* @param adminId 操作管理员编号
* @param adminId
操作管理员编号
* @param couponTemplateId 模板编号
* @param status 状态
* @param status
状态
* @return 是否成功
*/
CommonResult
<
Boolean
>
updateCouponTemplateStatus
(
Integer
adminId
,
Integer
couponTemplateId
,
@InEnum
(
value
=
CouponTemplateStatusEnum
.
class
,
message
=
"修改状态必须是 {value}"
)
Integer
status
);
Boolean
updateCouponTemplateStatus
(
Integer
adminId
,
Integer
couponTemplateId
,
@InEnum
(
value
=
CouponTemplateStatusEnum
.
class
,
message
=
"修改状态必须是 {value}"
)
Integer
status
);
// ========== 优惠劵 ==========
Co
mmonResult
<
CouponCardPageBO
>
getCouponCardPage
(
CouponCardPageDTO
couponCardPageDTO
);
Co
uponCardPageBO
getCouponCardPage
(
CouponCardPageDTO
couponCardPageDTO
);
/**
* 基于优惠劵模板,领取优惠劵
*
* @param userId 用户编号
* @param userId
用户编号
* @param couponTemplateId 优惠劵模板
* @return 优惠劵
*/
Co
mmonResult
<
CouponCardBO
>
addCouponCard
(
Integer
userId
,
Integer
couponTemplateId
);
Co
uponCardBO
addCouponCard
(
Integer
userId
,
Integer
couponTemplateId
);
/**
* 使用优惠劵下单
*
* @param userId 用户编号
* @param userId
用户编号
* @param couponCardId 优惠劵编号
* @return 是否成功
*/
CommonResult
<
Boolean
>
useCouponCard
(
Integer
userId
,
Boolean
useCouponCard
(
Integer
userId
,
@NotNull
(
message
=
"优惠劵编号不能为空"
)
Integer
couponCardId
);
/**
* 取消优惠劵的使用
*
* @param userId 用户编号
* @param userId
用户编号
* @param couponCardId 优惠劵编号
* @return 是否成功
*/
CommonResult
<
Boolean
>
cancelUseCouponCard
(
Integer
userId
,
Integer
couponCardId
);
Boolean
cancelUseCouponCard
(
Integer
userId
,
Integer
couponCardId
);
/**
* 获得指定优惠劵
*
* @param userId 用户编号
* @param userId
用户编号
* @param couponCardId 优惠劵编号
* @return 优惠劵
*/
Co
mmonResult
<
CouponCardDetailBO
>
getCouponCardDetail
(
Integer
userId
,
Integer
couponCardId
);
Co
uponCardDetailBO
getCouponCardDetail
(
Integer
userId
,
Integer
couponCardId
);
/**
* 获得用户所有优惠劵,并标明是否可用
*
*
<p>
* 注意,spus 是作为条件,判断优惠劵是否可用
*
* @param userId 用户编号
* @param spus 匹配的商品/分类
* @param spus
匹配的商品/分类
* @return 优惠劵列表
*/
CommonResult
<
List
<
CouponCardAvailableBO
>>
getCouponCardList
(
Integer
userId
,
List
<
CouponCardSpuDTO
>
spus
);
List
<
CouponCardAvailableBO
>
getCouponCardList
(
Integer
userId
,
List
<
CouponCardSpuDTO
>
spus
);
// ========== 优惠码 ==========
...
...
@@ -119,9 +117,9 @@ public interface CouponService {
* 使用优惠码,兑换优惠劵
*
* @param userId 用户编号
* @param code 优惠码
* @param code
优惠码
* @return 优惠劵
*/
Co
mmonResult
<
CouponCardBO
>
useCouponCode
(
Integer
userId
,
String
code
);
Co
uponCardBO
useCouponCode
(
Integer
userId
,
String
code
);
}
promotion/promotion-service-impl/src/main/java/cn/iocoder/mall/promotion/biz/service/CouponServiceImpl.java
浏览文件 @
e6c578f5
差异被折叠。
点击展开。
system/system-service-impl/src/main/resources/mapper/AdminMapper.xml
浏览文件 @
e6c578f5
...
...
@@ -52,7 +52,7 @@
<select
id=
"selectById"
parameterType=
"Integer"
resultType=
"AdminDO"
>
SELECT
<include
refid=
"FIELDS"
/>
<include
refid=
"FIELDS"
/>
FROM admin
WHERE id = #{id}
AND deleted = 0
...
...
@@ -80,4 +80,4 @@
WHERE id = #{id}
</update>
</mapper>
\ No newline at end of file
</mapper>
user/user-application/pom.xml
浏览文件 @
e6c578f5
...
...
@@ -16,6 +16,12 @@
</properties>
<dependencies>
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
common-framework
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
user-service-api
</artifactId>
...
...
user/user-application/src/main/java/cn/iocoder/mall/user/application/config/MVCConfiguration.java
浏览文件 @
e6c578f5
...
...
@@ -15,7 +15,8 @@ import org.springframework.web.servlet.config.annotation.*;
@EnableWebMvc
@Configuration
@Import
(
value
=
{
GlobalExceptionHandler
.
class
,
// 统一全局返回
UserSecurityInterceptor
.
class
,
AdminSecurityInterceptor
.
class
})
// 安全拦截器,实现认证和授权功能。
UserSecurityInterceptor
.
class
,
UserAccessLogInterceptor
.
class
,
AdminSecurityInterceptor
.
class
})
// 安全拦截器,实现认证和授权功能。
public
class
MVCConfiguration
implements
WebMvcConfigurer
{
@Autowired
...
...
user/user-application/src/main/java/cn/iocoder/mall/user/application/controller/admins/AdminsUserController.java
浏览文件 @
e6c578f5
...
...
@@ -12,7 +12,6 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.dubbo.config.annotation.Reference
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
@RestController
...
...
@@ -20,8 +19,7 @@ import org.springframework.web.bind.annotation.*;
@Api
(
"用户模块"
)
public
class
AdminsUserController
{
@Reference
(
validation
=
"true"
)
@Autowired
// TODO dubbo 2.7.2 删除,用于解决 bug
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.UserService.version}"
)
private
UserService
userService
;
// 分页
...
...
@@ -33,9 +31,11 @@ public class AdminsUserController {
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页条数"
,
required
=
true
,
example
=
"10"
),
})
public
CommonResult
<
AdminsUserPageVO
>
page
(
@RequestParam
(
value
=
"nickname"
,
required
=
false
)
String
nickname
,
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
Integer
pageNo
,
@RequestParam
(
value
=
"status"
,
required
=
false
)
Integer
status
,
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
UserPageDTO
userPageDTO
=
new
UserPageDTO
().
setNickname
(
nickname
).
setPageNo
(
pageNo
).
setPageSize
(
pageSize
);
UserPageDTO
userPageDTO
=
new
UserPageDTO
().
setNickname
(
nickname
).
setStatus
(
status
)
.
setPageNo
(
pageNo
).
setPageSize
(
pageSize
);
// 查询分页
CommonResult
<
UserPageBO
>
result
=
userService
.
getUserPage
(
userPageDTO
);
// 转换结果
...
...
user/user-application/src/main/java/cn/iocoder/mall/user/application/controller/users/PassportController.java
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
user
.
application
.
controller
.
users
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.user.application.convert.PassportConvert
;
import
cn.iocoder.mall.user.application.vo.users.UsersAccessTokenVO
;
import
cn.iocoder.mall.user.sdk.annotation.PermitAll
;
import
cn.iocoder.mall.user.api.MobileCodeService
;
import
cn.iocoder.mall.user.api.OAuth2Service
;
import
cn.iocoder.mall.user.api.UserService
;
import
cn.iocoder.mall.user.api.bo.OAuth2AccessTokenBO
;
import
cn.iocoder.mall.user.application.convert.PassportConvert
;
import
cn.iocoder.mall.user.application.vo.users.UsersAccessTokenVO
;
import
cn.iocoder.mall.user.application.vo.users.UsersMobileRegisterVO
;
import
org.apache.dubbo.config.annotation.Reference
;
import
cn.iocoder.mall.user.sdk.annotation.PermitAll
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.
springframework.beans.factory.annotation.Autowired
;
import
org.
apache.dubbo.config.annotation.Reference
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
...
@@ -25,14 +24,11 @@ import org.springframework.web.bind.annotation.RestController;
@Api
(
"Passport 模块"
)
public
class
PassportController
{
@Reference
(
validation
=
"true"
)
@Autowired
// TODO dubbo 2.7.2 删除,用于解决 bug
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.OAuth2Service.version}"
)
private
OAuth2Service
oauth2Service
;
@Reference
(
validation
=
"true"
)
@Autowired
// TODO dubbo 2.7.2 删除,用于解决 bug
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.UserService.version}"
)
private
UserService
userService
;
@Reference
(
validation
=
"true"
)
@Autowired
// TODO dubbo 2.7.2 删除,用于解决 bug
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.MobileCodeService.version}"
)
private
MobileCodeService
mobileCodeService
;
// TODO 功能:手机密码登陆
...
...
user/user-application/src/main/java/cn/iocoder/mall/user/application/controller/users/UserAddressController.java
浏览文件 @
e6c578f5
...
...
@@ -12,7 +12,6 @@ import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.dubbo.config.annotation.Reference
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -29,8 +28,7 @@ import java.util.List;
@Api
(
value
=
"用户地址API"
)
public
class
UserAddressController
{
@Reference
(
validation
=
"true"
)
@Autowired
// TODO dubbo 2.7.2 删除,用于解决 bug
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.UserAddressService.version}"
)
private
UserAddressService
userAddressService
;
@PostMapping
(
"add"
)
...
...
user/user-application/src/main/java/cn/iocoder/mall/user/application/controller/users/UserController.java
浏览文件 @
e6c578f5
package
cn
.
iocoder
.
mall
.
user
.
application
.
controller
.
users
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.user.ap
plication.convert.UserConvert
;
import
cn.iocoder.mall.user.ap
i.UserService
;
import
cn.iocoder.mall.user.api.bo.UserBO
;
import
cn.iocoder.mall.user.api.dto.UserUpdateDTO
;
import
cn.iocoder.mall.user.
sdk.context.UserSecurityContextHolder
;
import
cn.iocoder.mall.user.
application.convert.UserConvert
;
import
cn.iocoder.mall.user.application.vo.users.UsersUserVO
;
import
cn.iocoder.mall.user.api.UserService
;
import
org.apache.dubbo.config.annotation.Reference
;
import
cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.
springframework.beans.factory.annotation.Autowired
;
import
org.
apache.dubbo.config.annotation.Reference
;
import
org.springframework.web.bind.annotation.*
;
@RestController
...
...
@@ -18,8 +17,7 @@ import org.springframework.web.bind.annotation.*;
@Api
(
"用户模块"
)
public
class
UserController
{
@Reference
(
validation
=
"true"
)
@Autowired
// TODO dubbo 2.7.2 删除,用于解决 bug
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.UserService.version}"
)
private
UserService
userService
;
@GetMapping
(
"/info"
)
...
...
user/user-application/src/main/java/cn/iocoder/mall/user/application/vo/admins/AdminsUserPageVO.java
浏览文件 @
e6c578f5
...
...
@@ -13,8 +13,8 @@ import java.util.List;
public
class
AdminsUserPageVO
{
@ApiModelProperty
(
value
=
"用户数组"
)
private
List
<
AdminsUserVO
>
users
;
private
List
<
AdminsUserVO
>
list
;
@ApiModelProperty
(
value
=
"用户总数"
)
private
Integer
count
;
private
Integer
total
;
}
user/user-sdk/src/main/java/cn/iocoder/mall/user/sdk/interceptor/UserAccessLogInterceptor.java
浏览文件 @
e6c578f5
...
...
@@ -8,7 +8,6 @@ import org.apache.commons.lang3.exception.ExceptionUtils;
import
org.apache.dubbo.config.annotation.Reference
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
...
...
@@ -34,8 +33,7 @@ public class UserAccessLogInterceptor extends HandlerInterceptorAdapter {
*/
private
static
final
ThreadLocal
<
Integer
>
USER_ID
=
new
ThreadLocal
<>();
@Reference
@Autowired
(
required
=
false
)
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.UserAccessLogService.version:1.0.0}"
)
private
UserAccessLogService
userAccessLogService
;
@Override
...
...
user/user-sdk/src/main/java/cn/iocoder/mall/user/sdk/interceptor/UserSecurityInterceptor.java
浏览文件 @
e6c578f5
...
...
@@ -9,7 +9,6 @@ import cn.iocoder.mall.user.sdk.annotation.PermitAll;
import
cn.iocoder.mall.user.sdk.context.UserSecurityContext
;
import
cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder
;
import
org.apache.dubbo.config.annotation.Reference
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
...
...
@@ -23,8 +22,7 @@ import javax.servlet.http.HttpServletResponse;
@Component
public
class
UserSecurityInterceptor
extends
HandlerInterceptorAdapter
{
@Reference
@Autowired
(
required
=
false
)
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.OAuth2Service.version:1.0.0}"
)
private
OAuth2Service
oauth2Service
;
@Override
...
...
user/user-service-api/src/main/java/cn/iocoder/mall/user/api/bo/UserPageBO.java
浏览文件 @
e6c578f5
...
...
@@ -13,10 +13,10 @@ public class UserPageBO implements Serializable {
/**
* 用户数组
*/
private
List
<
UserBO
>
users
;
private
List
<
UserBO
>
list
;
/**
* 总量
*/
private
Integer
count
;
private
Integer
total
;
}
user/user-service-api/src/main/java/cn/iocoder/mall/user/api/dto/UserPageDTO.java
浏览文件 @
e6c578f5
...
...
@@ -15,6 +15,10 @@ public class UserPageDTO {
* 模糊查询
*/
private
String
nickname
;
/**
* 状态
*/
private
Integer
status
;
@NotNull
(
message
=
"页码不能为空"
)
private
Integer
pageNo
;
...
...
user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/dao/UserMapper.java
浏览文件 @
e6c578f5
...
...
@@ -18,9 +18,11 @@ public interface UserMapper {
UserDO
selectById
(
@Param
(
"id"
)
Integer
id
);
List
<
UserDO
>
selectListByNicknameLike
(
@Param
(
"nickname"
)
String
nickname
,
@Param
(
"status"
)
Integer
status
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"limit"
)
Integer
limit
);
Integer
selectCountByNicknameLike
(
@Param
(
"nickname"
)
String
nickname
);
Integer
selectCountByNicknameLike
(
@Param
(
"nickname"
)
String
nickname
,
@Param
(
"status"
)
Integer
status
);
}
\ No newline at end of file
}
user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/service/MobileCodeServiceImpl.java
浏览文件 @
e6c578f5
...
...
@@ -18,7 +18,7 @@ import java.util.Date;
* MobileCodeService ,实现用户登陆时需要的验证码
*/
@Service
@org
.
apache
.
dubbo
.
config
.
annotation
.
Service
@org
.
apache
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
,
version
=
"${dubbo.provider.MobileCodeService.version}"
)
public
class
MobileCodeServiceImpl
implements
MobileCodeService
{
/**
...
...
user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/service/OAuth2ServiceImpl.java
浏览文件 @
e6c578f5
...
...
@@ -27,7 +27,7 @@ import java.util.UUID;
* OAuth2Service ,实现用户授权相关的逻辑
*/
@Service
@org
.
apache
.
dubbo
.
config
.
annotation
.
Service
@org
.
apache
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
,
version
=
"${dubbo.provider.OAuth2Service.version}"
)
public
class
OAuth2ServiceImpl
implements
OAuth2Service
{
/**
...
...
user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/service/UserAccessLogServiceImpl.java
浏览文件 @
e6c578f5
...
...
@@ -13,7 +13,7 @@ import org.springframework.stereotype.Service;
import
java.util.Date
;
@Service
@org
.
apache
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
)
@org
.
apache
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
,
version
=
"${dubbo.provider.UserAccessLogService.version}"
)
public
class
UserAccessLogServiceImpl
implements
UserAccessLogService
{
/**
...
...
user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/service/UserAddressServiceImpl.java
浏览文件 @
e6c578f5
...
...
@@ -26,7 +26,7 @@ import java.util.List;
* @time 2019-04-06 13:26
*/
@Service
@org
.
apache
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
)
@org
.
apache
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
,
version
=
"${dubbo.provider.UserAddressService.version}"
)
public
class
UserAddressServiceImpl
implements
UserAddressService
{
@Autowired
...
...
user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/service/UserServiceImpl.java
浏览文件 @
e6c578f5
...
...
@@ -27,7 +27,7 @@ import java.util.Date;
* UserService ,实现和用户信息相关的逻辑
*/
@Service
@org
.
apache
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
)
@org
.
apache
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
,
version
=
"${dubbo.provider.UserService.version}"
)
public
class
UserServiceImpl
implements
UserService
{
@Autowired
...
...
@@ -71,11 +71,12 @@ public class UserServiceImpl implements UserService {
public
CommonResult
<
UserPageBO
>
getUserPage
(
UserPageDTO
userPageDTO
)
{
UserPageBO
userPageBO
=
new
UserPageBO
();
// 查询分页数据
int
offset
=
userPageDTO
.
getPageNo
()
*
userPageDTO
.
getPageSize
();
userPageBO
.
setUsers
(
UserConvert
.
INSTANCE
.
convert
(
userMapper
.
selectListByNicknameLike
(
userPageDTO
.
getNickname
(),
int
offset
=
(
userPageDTO
.
getPageNo
()
-
1
)
*
userPageDTO
.
getPageSize
();
userPageBO
.
setList
(
UserConvert
.
INSTANCE
.
convert
(
userMapper
.
selectListByNicknameLike
(
userPageDTO
.
getNickname
(),
userPageDTO
.
getStatus
(),
offset
,
userPageDTO
.
getPageSize
())));
// 查询分页总数
userPageBO
.
set
Count
(
userMapper
.
selectCountByNicknameLike
(
userPageDTO
.
getNickname
()));
userPageBO
.
set
Total
(
userMapper
.
selectCountByNicknameLike
(
userPageDTO
.
getNickname
(),
userPageDTO
.
getStatus
()));
return
CommonResult
.
success
(
userPageBO
);
}
...
...
user/user-service-impl/src/main/resources/config/application.yaml
浏览文件 @
e6c578f5
...
...
@@ -23,6 +23,14 @@ dubbo:
name
:
dubbo
scan
:
base-packages
:
cn.iocoder.mall.user.biz.service
demo
:
service
:
version
:
1.0.0
\ No newline at end of file
provider
:
MobileCodeService
:
version
:
1.0.0
OAuth2Service
:
version
:
1.0.0
UserAccessLogService
:
version
:
1.0.0
UserAddressService
:
version
:
1.0.0
UserService
:
version
:
1.0.0
user/user-service-impl/src/main/resources/mapper/UserMapper.xml
浏览文件 @
e6c578f5
...
...
@@ -61,6 +61,9 @@
<if
test=
"nickname != null"
>
nickname LIKE "%"#{nickname}"%"
</if>
<if
test=
"status != null"
>
status = #{status}
</if>
AND deleted = 0
</where>
LIMIT #{offset}, #{limit}
...
...
@@ -74,9 +77,12 @@
<if
test=
"nickname != null"
>
nickname LIKE "%"#{nickname}"%"
</if>
<if
test=
"status != null"
>
status = #{status}
</if>
AND deleted = 0
</where>
</select>
</mapper>
\ No newline at end of file
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论