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
1ffea5d7
Commit
1ffea5d7
authored
May 19, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
f19544e9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
32 deletions
+40
-32
xggsve-common/app/base/db/impl/deliver/deliverDao.js
+8
-5
xggsve-common/app/base/db/models/common/businessscope.js
+1
-0
xggsve-common/app/base/db/models/deliver/deliverorg.js
+1
-0
xggsve-common/app/base/service/impl/common/businessscopeSve.js
+16
-15
xggsve-common/app/base/service/impl/deliver/deliverSve.js
+14
-12
No files found.
xggsve-common/app/base/db/impl/deliver/deliverDao.js
View file @
1ffea5d7
...
...
@@ -5,14 +5,17 @@ class DeliverDao extends Dao {
super
(
Dao
.
getModelName
(
DeliverDao
));
}
async
getList
(
isEnabled
,
attr
s
)
{
attrs
=
attrs
||
"*"
async
getList
(
param
s
)
{
let
attrs
=
params
.
attrs
||
"*"
var
sql
=
[];
sql
.
push
(
"SELECT "
);
sql
.
push
(
attrs
);
sql
.
push
(
"FROM d_deliver"
);
if
(
isEnabled
==
1
)
{
sql
.
push
(
"WHERE isEnabled = 1"
);
sql
.
push
(
"FROM d_deliver WHERE 1 = 1 "
);
if
(
params
.
isEnabled
==
1
)
{
sql
.
push
(
"AND isEnabled = 1"
);
}
if
(
params
.
saas_id
)
{
sql
.
push
(
"AND saas_id = :saas_id"
);
}
return
await
this
.
customQuery
(
sql
.
join
(
" "
))
||
[];
}
...
...
xggsve-common/app/base/db/models/common/businessscope.js
View file @
1ffea5d7
...
...
@@ -3,6 +3,7 @@ const settings = require("../../../../config/settings");
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"businessscope"
,
{
saas_id
:
DataTypes
.
STRING
,
domicile_id
:
DataTypes
.
STRING
,
businessType
:
DataTypes
.
STRING
,
businessscope
:
DataTypes
.
STRING
,
...
...
xggsve-common/app/base/db/models/deliver/deliverorg.js
View file @
1ffea5d7
...
...
@@ -3,6 +3,7 @@ const settings = require("../../../../config/settings");
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"deliverorg"
,
{
saas_id
:
DataTypes
.
STRING
,
deliver_id
:
DataTypes
.
STRING
,
company_id
:
DataTypes
.
INTEGER
,
code
:
DataTypes
.
STRING
,
...
...
xggsve-common/app/base/service/impl/common/businessscopeSve.js
View file @
1ffea5d7
...
...
@@ -101,12 +101,10 @@ class BusinessscopeService extends ServiceBase {
}
async
save
(
params
)
{
var
domicileId
=
params
.
domicileId
;
if
(
!
domicileId
)
{
return
system
,
getResult
(
null
,
domicileId
);
}
var
id
=
params
.
id
;
var
bsc
;
let
domicileId
=
this
.
trim
(
params
.
domicileId
);
let
saas_id
=
this
.
trim
(
params
.
saas_id
);
let
id
=
this
.
trim
(
params
.
id
);
let
bsc
;
if
(
id
)
{
bsc
=
await
this
.
dao
.
findById
(
id
);
}
else
{
...
...
@@ -115,8 +113,8 @@ class BusinessscopeService extends ServiceBase {
bsc
.
businessType
=
this
.
trim
(
params
.
businesssType
);
bsc
.
businessscope
=
this
.
trim
(
params
.
businessscope
);
bsc
.
isEnabled
=
params
.
isEnabled
==
1
?
true
:
fals
e
;
bsc
.
isEnabled
=
1
;
bsc
.
isEnabled
=
tru
e
;
bsc
.
saas_id
=
saas_id
;
if
(
bsc
.
id
)
{
bsc
=
await
bsc
.
save
();
...
...
@@ -131,7 +129,9 @@ class BusinessscopeService extends ServiceBase {
var
pageSize
=
Number
(
params
.
pageSize
||
10
);
var
where
=
{};
if
(
params
.
saas_id
)
{
where
.
saas_id
=
params
.
saas_id
;
}
if
(
params
.
domicileId
)
{
where
.
domicile_id
=
params
.
domicileId
;
}
...
...
@@ -161,13 +161,14 @@ class BusinessscopeService extends ServiceBase {
return
;
}
var
ids
=
[];
for
(
var
item
of
rows
)
{
ids
.
push
(
item
.
domicile_id
);
let
ids
=
[];
for
(
var
item
of
rows
)
{
if
(
item
.
domicile_id
)
{
ids
.
push
(
item
.
domicile_id
);
}
}
var
map
=
await
this
.
domicileDao
.
findMapByIds
(
ids
);
for
(
var
item
of
rows
)
{
let
map
=
await
this
.
domicileDao
.
findMapByIds
(
ids
);
for
(
var
item
of
rows
)
{
item
.
domicile
=
map
[
item
.
domicile_id
]
||
{};
this
.
handleDate
(
item
.
domicile
,
[
"created_at"
],
null
,
-
8
);
}
...
...
xggsve-common/app/base/service/impl/deliver/deliverSve.js
View file @
1ffea5d7
...
...
@@ -11,7 +11,7 @@ class DeliverService extends ServiceBase {
async
apiAll
(
params
)
{
try
{
return
await
this
.
allList
();
return
await
this
.
allList
(
params
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
"接口异常"
);
...
...
@@ -192,8 +192,9 @@ class DeliverService extends ServiceBase {
return
system
.
getResultSuccess
();
}
async
allList
()
{
var
list
=
await
this
.
dao
.
getList
(
1
);
async
allList
(
params
)
{
params
.
isEnabled
=
1
;
var
list
=
await
this
.
dao
.
getList
(
params
);
return
system
.
getResultSuccess
(
list
);
}
...
...
@@ -210,11 +211,14 @@ class DeliverService extends ServiceBase {
let
pageSize
=
Number
(
params
.
pageSize
||
10
);
let
where
=
{};
if
(
params
.
id
)
{
where
.
id
=
this
.
trim
(
params
.
id
);
if
(
params
.
id
)
{
where
.
id
=
this
.
trim
(
params
.
id
);
}
if
(
params
.
name
){
where
.
name
=
this
.
trim
(
params
.
name
);
if
(
params
.
name
)
{
where
.
name
=
this
.
trim
(
params
.
name
);
}
if
(
params
.
saas_id
)
{
where
.
saas_id
=
this
.
trim
(
params
.
saas_id
);
}
let
orderby
=
[
[
"id"
,
'desc'
]
...
...
@@ -440,7 +444,6 @@ class DeliverService extends ServiceBase {
let
real_name
=
this
.
trim
(
params
.
real_name
);
let
ucname
=
this
.
trim
(
params
.
ucname
);
let
org_id
=
params
.
org_id
;
let
password
=
params
.
password
;
let
isAdmin
=
Number
(
params
.
isAdmin
||
0
);
let
authArr
=
[];
if
(
params
.
auth
)
{
...
...
@@ -576,13 +579,12 @@ class DeliverService extends ServiceBase {
org
.
del_flag
=
0
;
org
.
group_type
=
0
;
if
(
org
.
id
)
{
await
org
.
save
();
// TODO 修改该组织机构下用户树
org
=
await
org
.
save
();
}
else
{
org
.
saas_id
=
this
.
trim
(
params
.
saas_id
);
org
=
await
this
.
deliverorgDao
.
model
.
create
(
org
);
}
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
(
org
);
}
}
...
...
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