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
a724eb18
Commit
a724eb18
authored
May 27, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
c70ea340
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
107 additions
and
1 deletions
+107
-1
xgg-saas-admin/app/base/controller/impl/saas/channelCtl.js
+82
-1
xgg-saas-admin/app/base/service/impl/common/businessscopeSve.js
+8
-0
xgg-saas-admin/app/base/service/impl/saas/saasbusinessSve.js
+17
-0
No files found.
xgg-saas-admin/app/base/controller/impl/saas/channelCtl.js
View file @
a724eb18
...
@@ -4,6 +4,8 @@ class ChannelCtl extends CtlBase {
...
@@ -4,6 +4,8 @@ class ChannelCtl extends CtlBase {
constructor
()
{
constructor
()
{
super
();
super
();
this
.
channelSve
=
system
.
getObject
(
"service.saas.channelSve"
);
this
.
channelSve
=
system
.
getObject
(
"service.saas.channelSve"
);
this
.
saasbusinessSve
=
system
.
getObject
(
"service.saas.saasbusinessSve"
);
this
.
businessscopeSve
=
system
.
getObject
(
"service.common.businessscopeSve"
);
}
}
async
dics
(
params
,
pobj2
,
req
)
{
async
dics
(
params
,
pobj2
,
req
)
{
...
@@ -33,12 +35,90 @@ class ChannelCtl extends CtlBase {
...
@@ -33,12 +35,90 @@ class ChannelCtl extends CtlBase {
async
save
(
params
,
pobj2
,
req
)
{
async
save
(
params
,
pobj2
,
req
)
{
try
{
try
{
return
await
this
.
channelSve
.
save
(
params
);
let
check
=
this
.
checkSaveParams
(
params
);
if
(
check
.
status
!==
0
)
{
return
check
;
}
// 此操作涉及到三个微服务,没有事务!没有事务!没有事务!!!
// 1. 创建saas记录
let
saasrs
=
await
this
.
saasbusinessSve
.
openSaasBusiness
({
"companyName"
:
params
.
name
,
"domain"
:
"ss-platform"
,
"mobile"
:
"18811051022"
,
"passwd"
:
"051022"
,
"realName"
:
"张娇"
});
// 2. 经营范围创建
// 3. 渠道增加
// return await this.channelSve.save(params);
}
catch
(
error
)
{
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
}
checkSaveParams
(
params
)
{
let
term
=
Number
(
params
.
term
||
1
);
let
term_end
=
this
.
trim
(
params
.
term_end
);
let
validity
=
Number
(
params
.
validity
||
1
);
let
validity_end
=
this
.
trim
(
params
.
validity_end
);
if
(
!
this
.
trim
(
params
.
name
))
{
return
system
.
getResult
(
null
,
"请填写渠道名称"
);
}
if
(
!
this
.
trim
(
params
.
short_name
))
{
return
system
.
getResult
(
null
,
"请填写渠道简称"
);
}
if
(
!
this
.
trim
(
params
.
credit_code
))
{
return
system
.
getResult
(
null
,
"请填写统一社会信用代码"
);
}
// if(!this.trim(params.business_lincense_img)) {return system.getResult(null, ""); } // 营业执照暂不验证
if
(
!
this
.
trim
(
params
.
tax_type
))
{
return
system
.
getResult
(
null
,
"请选择纳税人类型"
);
}
if
(
!
this
.
trim
(
params
.
residence
))
{
return
system
.
getResult
(
null
,
"请填写住所"
);
}
if
(
!
this
.
trim
(
params
.
business_scope
))
{
return
system
.
getResult
(
null
,
"请填写经营范围"
);
}
if
(
term
==
2
&&
!
term_end
)
{
return
system
.
getResult
(
null
,
"请填写营业期限固定日期"
);
}
if
(
validity
==
2
&&
!
validity_end
)
{
return
system
.
getResult
(
null
,
"请填写有效期限固定日期"
);
}
if
(
!
this
.
trim
(
params
.
account_name
))
{
return
system
.
getResult
(
null
,
"请填写账户名称"
);
}
if
(
!
this
.
trim
(
params
.
account_bank_name
))
{
return
system
.
getResult
(
null
,
"请填写开户行"
);
}
if
(
!
this
.
trim
(
params
.
account_bank_no
))
{
return
system
.
getResult
(
null
,
"请填写开户账号"
);
}
if
(
!
this
.
trim
(
params
.
account_mobile
))
{
return
system
.
getResult
(
null
,
"请填写联系电话"
);
}
if
(
!
this
.
trim
(
params
.
contact_man
))
{
return
system
.
getResult
(
null
,
"请填写联系人姓名"
);
}
if
(
!
this
.
trim
(
params
.
contact_mobile
))
{
return
system
.
getResult
(
null
,
"请填写联系人电话"
);
}
if
(
!
this
.
trim
(
params
.
contact_email
))
{
return
system
.
getResult
(
null
,
"请填写联系人邮箱"
);
}
if
(
!
this
.
trim
(
params
.
contact_addr
))
{
return
system
.
getResult
(
null
,
"请填写联系人地址"
);
}
return
system
.
getResultSuccess
();
}
}
}
module
.
exports
=
ChannelCtl
;
module
.
exports
=
ChannelCtl
;
\ No newline at end of file
xgg-saas-admin/app/base/service/impl/common/businessscopeSve.js
View file @
a724eb18
...
@@ -26,5 +26,13 @@ class BusinessscopeService extends ServiceBase {
...
@@ -26,5 +26,13 @@ class BusinessscopeService extends ServiceBase {
async
byDomicile
(
params
)
{
async
byDomicile
(
params
)
{
return
await
this
.
callms
(
"common"
,
"businessscopeByDomicileId"
,
params
);
return
await
this
.
callms
(
"common"
,
"businessscopeByDomicileId"
,
params
);
}
}
async
setDefaultBusinessScope
(
params
)
{
let
saas_id
=
params
.
saas_id
;
if
(
!
params
.
saas_id
)
{
return
system
.
getResult
(
null
,
`saas_id不存在`
);
}
return
await
this
.
callms
(
"common"
,
"saveDefaultBusinessScope"
,
{
saas_id
:
saas_id
});
}
}
}
module
.
exports
=
BusinessscopeService
;
module
.
exports
=
BusinessscopeService
;
xgg-saas-admin/app/base/service/impl/saas/saasbusinessSve.js
0 → 100644
View file @
a724eb18
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
class
SaasBusinessService
extends
ServiceBase
{
constructor
()
{
super
();
}
async
openSaasBusiness
(
params
){
try
{
return
await
this
.
callms
(
"uc"
,
"openSaasBusiness"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
SaasBusinessService
;
\ No newline at end of file
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