Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
32ee6775
Commit
32ee6775
authored
Jun 30, 2020
by
wkliang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'esign-admin' of gitlab.gongsibao.com:jiangyong/zhichan into esign-admin
parents
7b175002
0b4ba864
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
858 additions
and
42 deletions
+858
-42
esign-admin/app/base/controller/impl/merchant/merchantCtl.js
+8
-0
esign-admin/app/base/controller/impl/merchant/merchanttradeCtl.js
+17
-5
esign-admin/app/base/controller/impl/merchant/merchantuserCtl.js
+31
-19
esign-admin/app/base/controller/impl/order/orderCtl.js
+161
-0
esign-admin/app/base/controller/impl/order/orderauthlogCtl.js
+94
-0
esign-admin/app/base/controller/impl/order/orderproductCtl.js
+62
-0
esign-admin/app/base/controller/impl/order/ordersignlogCtl.js
+89
-0
esign-admin/app/base/service/impl/merchant/merchantSve.js
+10
-2
esign-admin/app/base/service/impl/merchant/merchanttradeSve.js
+10
-2
esign-admin/app/base/service/impl/order/orderSve.js
+42
-0
esign-admin/app/base/service/impl/order/orderauthlogSve.js
+29
-0
esign-admin/app/base/service/impl/order/orderproductSve.js
+31
-0
esign-admin/app/base/service/impl/order/ordersignlogSve.js
+29
-0
esign-admin/app/base/service/impl/uc/userSve.js
+18
-2
esign-admin/app/base/service/svems.base.js
+1
-1
esign-admin/app/config/routes/web.js
+1
-0
esign-admin/app/front/entry/apidoc.ejs
+1
-1
esign-admin/app/front/entry/public/apidoc/README.md
+3
-1
esign-admin/app/front/entry/public/apidoc/merchant/merchant.md
+67
-9
esign-admin/app/front/entry/public/apidoc/merchant/merchantuser.md
+153
-0
esign-admin/package.json
+1
-0
No files found.
esign-admin/app/base/controller/impl/merchant/merchantCtl.js
View file @
32ee6775
...
...
@@ -20,6 +20,14 @@ class MerchantUserCtl extends CtlBase {
}
}
async
merchantOfInfo
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
merchantSve
.
merchantOfInfo
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
addModifyMerchants
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
merchantSve
.
addModifyMerchants
(
params
);
...
...
esign-admin/app/base/controller/impl/merchant/merchanttradeCtl.js
View file @
32ee6775
...
...
@@ -8,37 +8,49 @@ const logCtl = system.getObject("web.common.oplogCtl");
class
MerchantUserCtl
extends
CtlBase
{
constructor
()
{
super
();
this
.
merchant
Sve
=
system
.
getObject
(
"service.merchant.merchant
Sve"
);
this
.
merchant
tradeSve
=
system
.
getObject
(
"service.merchant.merchanttrade
Sve"
);
}
async
merchanttradesOfList
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
merchantSve
.
merchanttradesOfList
(
params
);
return
await
this
.
merchant
trade
Sve
.
merchanttradesOfList
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
//调账添加
async
addMerchanttrades
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
merchantSve
.
addMerchanttrades
(
params
);
return
await
this
.
merchant
trade
Sve
.
addMerchanttrades
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
//充值审核
async
auditMerchanttrade
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
merchantSve
.
auditMerchanttrade
(
params
);
return
await
this
.
merchant
trade
Sve
.
auditMerchanttrade
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
//资金流水
async
merchanttradesOfListAll
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
merchantSve
.
merchanttradesOfListAll
(
params
);
return
await
this
.
merchanttradeSve
.
merchanttradesOfListAll
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
//代客下单流水
async
valetorder
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
merchanttradeSve
.
valetorder
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
...
...
esign-admin/app/base/controller/impl/merchant/merchantuserCtl.js
View file @
32ee6775
...
...
@@ -23,16 +23,43 @@ class MerchantUserCtl extends CtlBase {
if
(
!
params
.
real_name
)
{
return
system
.
getResult
(
null
,
"请选择商户"
);
}
if
(
!
params
.
ucname
)
{
return
system
.
getResult
(
null
,
"请选择商户"
);
}
if
(
!
params
.
mobile
)
{
return
system
.
getResult
(
null
,
"请选择商户"
);
}
validation
.
check
(
params
,
"real_name"
,
{
name
:
"姓名"
,
is_require
:
true
});
validation
.
check
(
params
,
"mobile"
,
{
name
:
"联系电话"
,
is_require
:
true
});
validation
.
check
(
params
,
"ucname"
,
{
name
:
"用户名"
,
is_require
:
true
});
return
await
this
.
userSve
.
saveMerchantUser
(
params
);
}
catch
(
error
)
{
let
msg
=
error
.
message
;
if
(
msg
.
startsWith
(
"bpo-validation-error:"
))
{
return
system
.
getResult
(
null
,
msg
.
replace
(
"bpo-validation-error:"
,
""
));
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
.
name
}
`
);
}
}
async
info
(
params
,
pobj2
,
req
)
{
try
{
params
.
id
=
Number
(
params
.
id
||
0
);
return
await
this
.
userSve
.
info
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
page
(
params
,
pobj2
,
req
)
{
try
{
params
.
utype
=
2
;
params
.
uctype_id
=
this
.
trim
(
params
.
merchant_id
);
let
res
=
await
this
.
userSve
.
page
(
params
);
if
(
res
.
status
===
0
&&
res
.
data
&&
res
.
data
.
rows
)
{
for
(
let
item
of
res
.
data
.
rows
)
{
item
.
merchant
=
{
id
:
"todo"
,
name
:
"todo"
};
}
}
return
res
;
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
...
...
@@ -47,7 +74,7 @@ class MerchantUserCtl extends CtlBase {
async
enabled
(
params
,
pobj2
,
req
)
{
try
{
params
.
id
=
Number
(
params
.
id
||
0
);
params
.
enabled
=
Number
(
params
.
enabled
||
0
);
params
.
is_enabled
=
Number
(
params
.
is_
enabled
||
0
);
return
await
this
.
userSve
.
enabled
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
...
...
@@ -55,20 +82,6 @@ class MerchantUserCtl extends CtlBase {
}
/**
* 根据pid查出子目录
* @param {*} params
*/
async
page
(
params
,
pobj2
,
req
)
{
try
{
params
.
uctypeId
=
params
.
deliver_id
;
return
await
this
.
userSve
.
page
(
params
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
MerchantUserCtl
;
\ No newline at end of file
esign-admin/app/base/controller/impl/order/orderCtl.js
0 → 100644
View file @
32ee6775
var
system
=
require
(
"../../../system"
)
const
settings
=
require
(
"../../../../config/settings"
)
const
CtlBase
=
require
(
"../../ctlms.base"
);
class
OrderCtl
extends
CtlBase
{
constructor
()
{
super
();
this
.
userSve
=
system
.
getObject
(
"service.uc.userSve"
);
this
.
orderSve
=
system
.
getObject
(
"service.order.orderSve"
);
// this.redisClient = system.getObject("util.redisClient");
}
/**
* fn:保存订单
* 如果是单价商品 product_type=1 product_id =xxx product_ids =[] product_unit_price=1
* 如果是组合产品 product_type=2 product_id=xxx product_ids=['xxx','xxxx'] product_unit_price=-1
* ps:需要对金额单位进行转化
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async
saveEorder
(
pobj
,
pobj2
,
req
,
res
)
{
try
{
//TODO:首先拿到商户的账号信息 (拿到合同ID 合同名称 )
// TODO:需要去调用商户钱包 扣钱
if
(
!
pobj
.
contract_url
){
return
system
.
getResult
(
null
,
`参数错误 业务合同不能为空`
);
}
if
(
!
pobj
.
live_start
){
return
system
.
getResult
(
null
,
`参数错误 生效时间不能为空`
);
}
if
(
!
pobj
.
live_end
){
return
system
.
getResult
(
null
,
`参数错误 结束时间不能为空`
);
}
//保存
let
res
=
await
this
.
orderSve
.
saveEorder
(
pobj
);
return
system
.
getResult
(
res
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
/**
* fn:审核订单
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<{msg: string, data: (*|null), bizmsg: string, status: number}>}
*/
async
auditEorder
(
pobj
,
pobj2
,
req
,
res
)
{
try
{
if
(
!
pobj
.
id
){
return
system
.
getResult
(
null
,
`订单【
${
pobj
.
id
}
】不存在`
);
}
if
(
!
pobj
.
audit_status
){
return
system
.
getResult
(
null
,
`参数错误 审核状态不能为空`
);
}
let
res
=
await
this
.
orderSve
.
auditEorder
(
pobj
);
//TODO:审核订单成功之后
if
(
res
.
status
==
0
){
pushMerchantTrade
(
pobj
);
}
return
system
.
getResult
(
res
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
/**
* fn:推送商户流水
* @param params
*/
async
pushMerchantTrade
(
params
){
let
orderBean
=
await
this
.
orderSve
.
getEorderById
({
id
:
this
.
trim
(
id
)});
if
(
!
orderBean
){
console
.
log
(
`推送流水失败 订单信息获取异常`
);
}
if
(
params
.
audit_status
==
'20'
){
//订单审核成功
}
if
(
params
.
audit_status
==
'30'
){
//订单审核失败
}
}
/**
* fn:查看订单(根据ID查询)
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<{msg: string, data: (*|null), bizmsg: string, status: number}>}
*/
async
getEorderById
(
pobj
,
pobj2
,
req
,
res
)
{
try
{
if
(
!
pobj
.
id
){
return
system
.
getResult
(
null
,
`订单【
${
pobj
.
id
}
】不存在`
);
}
let
res
=
await
this
.
orderSve
.
getEorderById
(
pobj
);
return
system
.
getResult
(
res
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
/**
* fn:查看订单列表(分页)
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<{msg: string, data: (*|null), bizmsg: string, status: number}>}
*/
async
pageEorder
(
pobj
,
pobj2
,
req
,
res
)
{
try
{
let
res
=
await
this
.
orderSve
.
pageEorder
(
pobj
);
return
system
.
getResult
(
res
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
/**
* fn:更改订单状态
* ps:可以修改的订单的状态 支付状态 审核状态 生效状态 状态code 依次 10 20 30 待xx 完成 失败
* 每次只能修改一个状态 (这里只能修改状态没有 状态标记注释 如果修改订单审核状态为失败请调用 “auditEorder” 接口)
* TODO:可能考虑修改生效状态需要加到 延迟消息队列中 用来处理过期失效的订单
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async
updEorderStatus
(
pobj
,
pobj2
,
req
,
res
){
if
(
!
pobj
.
id
){
return
system
.
getResult
(
null
,
`参数错误 订单ID不能为空`
);
}
try
{
//TODO:需要添加商户信息 (merchant_id)
return
await
this
.
orderSve
.
updEorderStatus
(
pobj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
}
module
.
exports
=
ProductCtl
;
\ No newline at end of file
esign-admin/app/base/controller/impl/order/orderauthlogCtl.js
0 → 100644
View file @
32ee6775
var
system
=
require
(
"../../../system"
)
const
settings
=
require
(
"../../../../config/settings"
)
const
CtlBase
=
require
(
"../../ctlms.base"
);
const
moment
=
require
(
'moment'
);
class
OrderCtl
extends
CtlBase
{
constructor
()
{
super
();
this
.
userSve
=
system
.
getObject
(
"service.uc.userSve"
);
this
.
orderauthlogSve
=
system
.
getObject
(
"service.order.orderauthlogSve"
);
}
/**
* fn:保存身份认证日志
* ps:测试开发中开放 ,此接口不向外暴露, 认证引擎异步回调将此次操作插入到表中
* @param pobj 1.spendedBegin消费的开始时间 2.spendedEnd消费的结束时间
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async
saveEorderAuthLog
(
pobj
,
pobj2
,
req
,
res
){
if
(
!
pobj
.
order_id
){
return
system
.
getResult
(
null
,
`参数错误 订单ID不能为空`
);
}
if
(
!
pobj
.
product_id
){
return
system
.
getResult
(
null
,
`参数错误 产品ID不能为空`
);
}
if
(
!
pobj
.
user_name
){
return
system
.
getResult
(
null
,
`参数错误 使用方不能为空`
);
}
if
(
!
pobj
.
platform_name
){
return
system
.
getResult
(
null
,
`参数错误 平台名称不能为空`
);
}
if
(
!
pobj
.
actual_spend_name
){
return
system
.
getResult
(
null
,
`参数错误 实际使用方不能为空`
);
}
pobj
.
engine_trade_id
=
this
.
trim
(
pobj
.
engine_trade_id
)
||
''
;
pobj
.
spended_num
=
Number
(
pobj
.
spended_num
||
0
);
pobj
.
spended_at
=
pobj
.
spended_at
?
pobj
.
spended_at
:
new
Date
();
pobj
.
pass
=
pobj
.
pass
?
pobj
.
pass
:
0
;
//是否通过 默认是不通过
try
{
return
await
this
.
orderauthlogSve
.
saveEorderAuthLog
(
pobj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
/**
* fn:身份认证日志列表
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async
pageEorderAuthLog
(
pobj
,
pobj2
,
req
,
res
){
//如果存在时间筛选 时间格式 2020-05
if
(
pobj
.
spendedDate
){
let
dateRes
=
formatDate
(
pobj
.
spendedDate
);
pobj
.
spendedBegin
=
dateRes
.
spendedBegin
;
pobj
.
spendedEnd
=
dateRes
.
spendedEnd
;
}
try
{
//TODO:需要获取当前商户信息 (商户ID)
pobj
.
merchant_id
=
"xxx"
;
return
await
this
.
orderauthlogSve
.
pageEorderAuthLog
(
pobj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
/**
* fn:格式化日期
* @param params
*/
formatDate
(
params
){
if
(
!
params
){
return
;}
let
date
=
moment
(
params
);
let
spendedBegin
=
date
.
format
(
"YYYY-MM-DD HH:mm:ss"
);
let
tempMonth
=
date
.
month
()
+
1
;
tempMonth
=
tempMonth
<
10
?
'0'
+
tempMonth
:
tempMonth
;
let
tempDay
=
date
.
daysInMonth
();
tempDay
=
tempDay
<
10
?
'0'
+
tempDay
:
tempDay
;
let
spendedEnd
=
date
.
year
()
+
"-"
+
tempMonth
+
'-'
+
tempDay
+
" 23:59:59"
;
return
{
spendedBegin
,
spendedEnd
};
}
}
module
.
exports
=
ProductCtl
;
\ No newline at end of file
esign-admin/app/base/controller/impl/order/orderproductCtl.js
0 → 100644
View file @
32ee6775
var
system
=
require
(
"../../../system"
)
const
settings
=
require
(
"../../../../config/settings"
)
const
CtlBase
=
require
(
"../../ctlms.base"
);
class
OrderCtl
extends
CtlBase
{
constructor
()
{
super
();
this
.
userSve
=
system
.
getObject
(
"service.uc.userSve"
);
this
.
orderproductSve
=
system
.
getObject
(
"service.order.orderproductSve"
);
}
/**
* fn:根据产品ID查询最早创建的订单
* ps:当前商户下如果存在 单个商品和组合商品 都包涵 同样的子产品 ,在实际消费的时候 应该扣除最先创建订单的子产品(订单的状态 生效中)
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async
listEorderProduct
(
pobj
,
pobj2
,
req
,
res
){
if
(
!
pobj
.
product_id
){
return
system
.
getResult
(
null
,
`参数错误 产品ID不能为空`
);
}
try
{
//TODO:需要获取当前商户信息 (商户ID)
pobj
.
merchant_id
=
"xxx"
;
return
await
this
.
orderproductSve
.
listEorderProduct
(
pobj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
/**
* fn:查看当前商户下所有的订单相关的产品(没有分页)
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<{msg: string, data: (*|null), bizmsg: string, status: number}|void|*>}
*/
async
listEorderProductByMerchantId
(
pobj
,
pobj2
,
req
,
res
){
if
(
!
pobj
.
product_id
){
return
system
.
getResult
(
null
,
`参数错误 产品ID不能为空`
);
}
try
{
if
(
!
pobj
.
merchant_id
){
return
system
.
getResult
(
null
,
`获取数据错误`
);
}
return
await
this
.
orderproductSve
.
listEorderProductByMerchantId
(
pobj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
}
module
.
exports
=
ProductCtl
;
\ No newline at end of file
esign-admin/app/base/controller/impl/order/ordersignlogCtl.js
0 → 100644
View file @
32ee6775
var
system
=
require
(
"../../../system"
)
const
settings
=
require
(
"../../../../config/settings"
)
const
CtlBase
=
require
(
"../../ctlms.base"
);
const
moment
=
require
(
'moment'
);
class
OrderCtl
extends
CtlBase
{
constructor
()
{
super
();
this
.
userSve
=
system
.
getObject
(
"service.uc.userSve"
);
this
.
ordersignlogSve
=
system
.
getObject
(
"service.order.ordersignlogSve"
);
}
/**
* fn:保存签约日志
* ps:测试开发中开放 ,此接口不向外暴露, 认证引擎异步回调将此次操作插入到表中
* @param pobj 1.spendedBegin消费的开始时间 2.spendedEnd消费的结束时间
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async
saveEorderSignLog
(
pobj
,
pobj2
,
req
,
res
){
if
(
!
params
.
order_id
){
return
system
.
getResult
(
null
,
`参数错误 订单ID不能为空`
);
}
if
(
!
params
.
product_id
){
return
system
.
getResult
(
null
,
`参数错误 产品ID不能为空`
);
}
if
(
!
params
.
engine_contract_name
){
return
system
.
getResult
(
null
,
`参数错误 签署任务名称不能为空`
);
}
if
(
!
params
.
engine_contract_id
){
return
system
.
getResult
(
null
,
`参数错误 签署ID不能为空`
);
}
if
(
!
params
.
actual_spend_name
){
return
system
.
getResult
(
null
,
`参数错误 实际使用方不能为空`
);
}
params
.
spended_num
=
Number
(
params
.
spended_num
||
0
);
params
.
spended_at
=
params
.
spended_at
?
params
.
spended_at
:
new
Date
();
params
.
platform_id
=
params
.
platform_id
?
params
.
platform_id
:
''
;
try
{
return
await
this
.
ordersignlogSve
.
saveEorderSignLog
(
pobj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
/**
* fn:签约日志列表(分页)
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async
pageEorderSignLog
(
pobj
,
pobj2
,
req
,
res
){
//如果存在时间筛选 时间格式 2020-05
if
(
pobj
.
spendedDate
){
let
dateRes
=
formatDate
(
pobj
.
spendedDate
);
pobj
.
spendedBegin
=
dateRes
.
spendedBegin
;
pobj
.
spendedEnd
=
dateRes
.
spendedEnd
;
}
try
{
return
await
this
.
ordersignlogSve
.
pageEorderSignLog
(
pobj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
/**
* fn:格式化日期
* @param params
*/
formatDate
(
params
){
if
(
!
params
){
return
;}
let
date
=
moment
(
params
);
let
spendedBegin
=
date
.
format
(
"YYYY-MM-DD HH:mm:ss"
);
let
tempMonth
=
date
.
month
()
+
1
;
tempMonth
=
tempMonth
<
10
?
'0'
+
tempMonth
:
tempMonth
;
let
tempDay
=
date
.
daysInMonth
();
tempDay
=
tempDay
<
10
?
'0'
+
tempDay
:
tempDay
;
let
spendedEnd
=
date
.
year
()
+
"-"
+
tempMonth
+
'-'
+
tempDay
+
" 23:59:59"
;
return
{
spendedBegin
,
spendedEnd
};
}
}
module
.
exports
=
ProductCtl
;
\ No newline at end of file
esign-admin/app/base/service/impl/merchant/merchantSve.js
View file @
32ee6775
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
class
User
Service
extends
ServiceBase
{
class
Merchant
Service
extends
ServiceBase
{
constructor
()
{
super
();
}
...
...
@@ -14,6 +14,14 @@ class UserService extends ServiceBase {
}
}
async
merchantOfInfo
(
params
)
{
try
{
return
await
this
.
callms
(
"sve_merchant"
,
"merchantOfInfo"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
addModifyMerchants
(
params
)
{
try
{
return
await
this
.
callms
(
"sve_merchant"
,
"addModifyMerchants"
,
params
);
...
...
@@ -39,4 +47,4 @@ class UserService extends ServiceBase {
}
}
module
.
exports
=
User
Service
;
module
.
exports
=
Merchant
Service
;
esign-admin/app/base/service/impl/merchant/merchanttradeSve.js
View file @
32ee6775
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
class
UserServic
e
extends
ServiceBase
{
class
MerchanttradeServci
e
extends
ServiceBase
{
constructor
()
{
super
();
}
...
...
@@ -37,6 +37,14 @@ class UserService extends ServiceBase {
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
valetorder
(
params
)
{
try
{
return
await
this
.
callms
(
"sve_merchant"
,
"valetorder"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
UserServic
e
;
module
.
exports
=
MerchanttradeServci
e
;
esign-admin/app/base/service/impl/order/orderSve.js
0 → 100644
View file @
32ee6775
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
class
UserService
extends
ServiceBase
{
constructor
()
{
super
();
}
/**
* fn:保存订单
* @param params
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}|any|undefined>}
*/
async
saveEorder
(
params
)
{
return
await
this
.
callms
(
"sve_order"
,
"saveEorder"
,
params
);
}
/**
* fn:审核订单
* @param params
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}|any|undefined>}
*/
async
auditEorder
(
params
)
{
return
await
this
.
callms
(
"sve_order"
,
"auditEorder"
,
params
);
}
/**
* fn:根据ID查看订单
* @param params
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}|any|undefined>}
*/
async
getEorderById
(
params
)
{
return
await
this
.
callms
(
"sve_order"
,
"getEorderById"
,
params
);
}
}
module
.
exports
=
UserService
;
\ No newline at end of file
esign-admin/app/base/service/impl/order/orderauthlogSve.js
0 → 100644
View file @
32ee6775
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
class
UserService
extends
ServiceBase
{
constructor
()
{
super
();
}
/**
* fn:保存身份认证日志
* @param params
* @returns {Promise<void>}
*/
async
saveEorderAuthLog
(
params
){
return
await
this
.
callms
(
"sve_order"
,
"saveEorderAuthLog"
,
params
);
}
/**
* fn:身份认证日志列表
* @param params
* @returns {Promise<void>}
*/
async
pageEorderAuthLog
(
params
){
return
await
this
.
callms
(
"sve_order"
,
"pageEorderAuthLog"
,
params
);
}
}
module
.
exports
=
UserService
;
\ No newline at end of file
esign-admin/app/base/service/impl/order/orderproductSve.js
0 → 100644
View file @
32ee6775
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
class
UserService
extends
ServiceBase
{
constructor
()
{
super
();
}
/**
* fn:根据产品ID查询最早创建的订单
* ps:当前商户下如果存在 单个商品和组合商品 都包涵 同样的子产品 ,在实际消费的时候 应该扣除最先创建订单的子产品(订单的状态 生效中)
* @param params
* @returns {Promise<void>}
*/
async
listEorderProduct
(
params
){
return
await
this
.
callms
(
"sve_order"
,
"listEorderProduct"
,
params
);
}
/**
* fn:fn:查看当前商户下所有的订单相关的产品(没有分页)
* @param params
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|*|undefined>}
*/
async
listEorderProductByMerchantId
(
params
){
return
await
this
.
callms
(
"sve_order"
,
"listEorderProductByMerchantId"
,
params
);
}
}
module
.
exports
=
UserService
;
\ No newline at end of file
esign-admin/app/base/service/impl/order/ordersignlogSve.js
0 → 100644
View file @
32ee6775
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
class
UserService
extends
ServiceBase
{
constructor
()
{
super
();
}
/**
* fn:保存签约日志
* @param params
* @returns {Promise<void>}
*/
async
saveEorderSignLog
(
params
){
return
await
this
.
callms
(
"sve_order"
,
"saveEorderSignLog"
,
params
);
}
/**
* fn:签约日志列表
* @param params
* @returns {Promise<void>}
*/
async
pageEorderSignLog
(
params
){
return
await
this
.
callms
(
"sve_order"
,
"pageEorderSignLog"
,
params
);
}
}
module
.
exports
=
UserService
;
\ No newline at end of file
esign-admin/app/base/service/impl/uc/userSve.js
View file @
32ee6775
...
...
@@ -24,15 +24,31 @@ class UserService extends ServiceBase {
async
login
(
params
)
{
try
{
return
await
this
.
callms
(
"sve_uc"
,
"
l
ogin"
,
params
);
return
await
this
.
callms
(
"sve_uc"
,
"
adminL
ogin"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
page
(
params
)
{
try
{
return
await
this
.
callms
(
"sve_uc"
,
"userPage"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
info
(
params
)
{
try
{
return
await
this
.
callms
(
"uc"
,
"merchantInfo"
,
params
);
return
await
this
.
callms
(
"sve_uc"
,
"userInfo"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
enabled
(
params
)
{
try
{
return
await
this
.
callms
(
"sve_uc"
,
"userEnabled"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
...
...
esign-admin/app/base/service/svems.base.js
View file @
32ee6775
...
...
@@ -220,7 +220,7 @@ class ServiceBase {
}
try
{
var
params
=
{
"action_process"
:
"
xgg-saas-merchant
"
,
"action_process"
:
"
esign-admin
"
,
"action_type"
:
apiName
,
"action_body"
:
params
||
{},
}
...
...
esign-admin/app/config/routes/web.js
View file @
32ee6775
...
...
@@ -91,6 +91,7 @@ module.exports = function (app) {
req
.
body
.
classname
=
classPath
;
if
(
req
.
loginUser
)
{
}
params
.
push
(
methodName
);
...
...
esign-admin/app/front/entry/apidoc.ejs
View file @
32ee6775
...
...
@@ -12,7 +12,7 @@
<body
>
<div
style=
"width:100%;text-align: center;font-size: 20px;"
>
薪果果个体工商户
API文档
电子签约平台
API文档
</div>
<div
class=
"markdown-body"
style=
"margin-left:40px;"
id=
"doc-page"
>
<
%
-
str
%
>
...
...
esign-admin/app/front/entry/public/apidoc/README.md
View file @
32ee6775
...
...
@@ -9,7 +9,9 @@
1
[
产品接口
](
/doc/product/product.md
)
## 商户
1
[
商户接口
](
/doc/user/login.md
)
1
[
商户接口
](
/doc/merchant/merchant.md
)
2
[
商户账号
](
/doc/merchant/merchantuser.md
)
## 订单
1
[
订单接口
](
/doc/saas/order.md
)
...
...
esign-admin/app/front/entry/public/apidoc/merchant/
user
.md
→
esign-admin/app/front/entry/public/apidoc/merchant/
merchant
.md
View file @
32ee6775
[
返回主目录
](
/doc
)
<a
name=
"menu"
>
目录
</a>
1.
[
新增/修改
](
#save
)
1.
[
激活冻结
](
#enabled
)
1.
[
列表页
](
#page
)
1.
[
新增/修改
](
#addModifyMerchants
)
1.
[
列表
](
#merchantOfList
)
1.
[
审核
](
#auditMerchant
)
1.
[
搜索商户名
](
#merchantSuggest
)
## **<a name="add
"> 添加
</a>**
## **<a name="add
ModifyMerchants"> 新增/修改
</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/
uc/userCtl/addUser
]
[
/web/
merchant/merchantCtl/addModifyMerchants
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
...
...
@@ -38,10 +39,10 @@
```
## **<a name="
upd"> 更新
</a>**
## **<a name="
merchantOfList"> 列表
</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/
uc/userCtl/updUser
]
[
/web/
merchant/merchantCtl/merchantOfList
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
...
...
@@ -68,10 +69,10 @@
```
## **<a name="
enabled"> 启用禁用
</a>**
## **<a name="
auditMerchant"> 审核
</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/
uc/userCtl/enabled
]
[
/web/
merchant/merchantCtl/auditMerchant
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
...
...
@@ -95,3 +96,60 @@
```
## **<a name="merchantSuggest"> 搜索商户名</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/merchant/merchantCtl/merchantSuggest
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
```
javascript
{
"id"
:
1
,
//记录ID 必传
"enabled"
:
0
,
// 0禁用 1启用
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:
{},
"requestid"
:
"007fd384e47641d2a71e9f3ef6292843"
}
```
## **<a name="merchantSuggest"> 搜索商户名</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/merchant/merchantCtl/merchantSuggest
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
```
javascript
{
"id"
:
1
,
//记录ID 必传
"enabled"
:
0
,
// 0禁用 1启用
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:
{},
"requestid"
:
"007fd384e47641d2a71e9f3ef6292843"
}
```
esign-admin/app/front/entry/public/apidoc/merchant/merchantuser.md
0 → 100644
View file @
32ee6775
[
返回主目录
](
/doc
)
<a
name=
"menu"
>
目录
</a>
1.
[
新增/修改
](
#save
)
1.
[
用户信息
](
#info
)
1.
[
列表
](
#page
)
1.
[
激活/冻结
](
#enabled
)
## **<a name="login"> 登录</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/merchant/merchantuserCtl/save
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
```
javascript
{
"id"
:
"48"
,
// id 新增id="", 修改id=xx
"uctype_id"
:
"1"
,
// 所选商户id
"ucname"
:
"m1"
,
// 用户名
"password"
:
"123123"
,
// 密码,新增时必填,修改时非必填
"real_name"
:
"商户测试1"
,
// 姓名
"mobile"
:
"13011112222"
,
// 手机号(联系方式)
"is_enabled"
:
1
// 1激活 0冻结
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:
{
"loginName"
:
"admin"
,
// 登录名
"mobile"
:
"13012341234"
,
// 手机号
"real_name"
:
"admin测试"
,
// 姓名
"key"
:
"xxx."
// 登录key,HEADER esignadminsid
}
}
```
## **<a name="info"> 用户信息</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/merchant/merchantuserCtl/info
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
```
javascript
{
"id"
:
"50"
// 账户id
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:
{
"id"
:
50
,
// id
"ucname"
:
"m3"
,
// 用户名
"password"
:
""
,
// 密码,服务端已经置空,前端不用管
"real_name"
:
"商户测试1"
,
// 姓名
"mobile"
:
"13011112222"
,
// 手机号(联系方式)
"uctype_id"
:
"1"
,
// 商户id
"is_enabled"
:
1
,
// 0冻结 1激活
"created_at"
:
"2020-06-30 15:14:51"
,
// 创建时间
},
"requestid"
:
"5bb8ad250832447da534926742efb353"
}
```
## **<a name="page"> 列表</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/merchant/merchantuserCtl/page
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
```
javascript
{
"currentPage"
:
"2"
,
"pageSize"
:
"5"
,
"ucname"
:
""
,
"merchant_id"
:
""
商户
id
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:
{
"count"
:
8
,
"rows"
:
[
{
"id"
:
50
,
// id
"ucname"
:
"m3"
,
// 用户名
"password"
:
""
,
// 密码,服务端已经置空,前端不用管
"real_name"
:
"商户测试1"
,
// 姓名
"mobile"
:
"13011112222"
,
// 手机号(联系方式)
"uctype_id"
:
"1"
,
// 商户id
"is_enabled"
:
1
,
// 0冻结 1激活
"created_at"
:
"2020-06-30 15:14:51"
,
// 创建时间
"merchant"
:
{
// 商户信息
"id"
:
"todo"
,
// 商户id
"name"
:
"todo"
// 商户名称
}
}
]
},
"requestid"
:
"0c2252903a3d4e6abdd0e83938f90648"
}
```
## **<a name="enabled"> 激活/冻结</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/merchant/merchantuserCtl/enabled
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
```
javascript
{
"id"
:
"55"
,
"is_enabled"
:
1
// // 0冻结 1激活
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:
null
,
"requestid"
:
"0c2252903a3d4e6abdd0e83938f90648"
}
```
\ No newline at end of file
esign-admin/package.json
View file @
32ee6775
...
...
@@ -33,6 +33,7 @@
"
gm
"
:
"^1.23.1"
,
"
marked
"
:
"^0.7.0"
,
"
method-override
"
:
"^2.3.10"
,
"
moment
"
:
"^2.27.0"
,
"
morgan
"
:
"^1.9.0"
,
"
multer
"
:
"^1.3.0"
,
"
mysql2
"
:
"^1.5.3"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment