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
930d5b87
Commit
930d5b87
authored
Jun 01, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
955eb394
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
0 deletions
+119
-0
xggsve-common/app/base/db/impl/deliver/deliverschemeDao.js
+59
-0
xggsve-common/app/base/db/models/deliver/deliverscheme.js
+60
-0
xggsve-common/app/base/service/impl/deliver/deliverschemeSve.js
+0
-0
No files found.
xggsve-common/app/base/db/impl/deliver/deliverschemeDao.js
0 → 100644
View file @
930d5b87
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
DeliveruserDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
DeliveruserDao
));
}
async
findByUcname
(
ucname
)
{
let
sql
=
"SELECT * FROM d_deliver_user WHERE ucname = :ucname"
;
let
list
=
await
this
.
customQuery
(
sql
,
{
ucname
:
ucname
});
if
(
!
list
)
{
return
null
;
}
return
list
[
0
];
}
async
findListByIds
(
ids
)
{
if
(
!
ids
||
ids
.
length
==
0
)
{
return
[];
}
var
sql
=
[];
sql
.
push
(
"SELECT"
);
sql
.
push
(
"*"
);
sql
.
push
(
"FROM d_deliver_user"
);
sql
.
push
(
"WHERE id IN (:ids)"
);
return
await
this
.
customQuery
(
sql
.
join
(
" "
),
{
ids
:
ids
})
||
[];
}
async
findMapByIds
(
ids
)
{
var
result
=
{};
if
(
!
ids
||
ids
.
length
==
0
)
{
return
result
;
}
var
list
=
await
this
.
findListByIds
(
ids
);
if
(
!
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
var
item
of
list
)
{
result
[
item
.
id
]
=
item
;
}
return
result
;
}
}
module
.
exports
=
DeliveruserDao
;
// var u=new UserDao();
// var roledao=system.getObject("db.roleDao");
// (async ()=>{
// var users=await u.model.findAll({where:{app_id:1}});
// var role=await roledao.model.findOne({where:{code:"guest"}});
// console.log(role);
// for(var i=0;i<users.length;i++){
// await users[i].setRoles([role]);
// console.log(i);
// }
//
// })();
\ No newline at end of file
xggsve-common/app/base/db/models/deliver/deliverscheme.js
0 → 100644
View file @
930d5b87
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"deliver"
,
{
name
:
DataTypes
.
STRING
,
businessmenDivide
:
DataTypes
.
INTEGER
,
invoiceDivide
:
DataTypes
.
INTEGER
,
admin_id
:
DataTypes
.
STRING
,
remark
:
DataTypes
.
STRING
,
isEnabled
:
{
type
:
DataTypes
.
BOOLEAN
,
allowNull
:
true
,
},
nt_company_id
:
DataTypes
.
STRING
,
saas_id
:
DataTypes
.
STRING
,
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'd_deliver'
,
validate
:
{},
indexes
:
[
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
\ No newline at end of file
xggsve-common/app/base/service/impl/deliver/deliverschemeSve.js
0 → 100644
View file @
930d5b87
This diff is collapsed.
Click to expand it.
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