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
4be04550
Commit
4be04550
authored
Mar 17, 2020
by
zhaoxiqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
a0d524fa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
6 deletions
+106
-6
bpo-admin/app/base/api/impl/testApi.js
+12
-6
bpo-admin/app/base/db/impl/offlinecompanyDao.js
+8
-0
bpo-admin/app/base/db/models/offlinecompany.js
+54
-0
bpo-admin/app/base/service/impl/offlinecompanySve.js
+32
-0
No files found.
bpo-admin/app/base/api/impl/testApi.js
View file @
4be04550
...
...
@@ -11,9 +11,10 @@ class TestApi {
constructor
()
{
this
.
utilesignbaoSve
=
System
.
getObject
(
"service.utilesignbaoSve"
);
this
.
dkcontractSve
=
System
.
getObject
(
"service.dkcontractSve"
);
this
.
offlinecompanySve
=
System
.
getObject
(
"service.offlinecompanySve"
)
}
async
testaes
(
obj
)
{
let
str
=
'{"channel_id": "11111", "platform_channel_id": "1asdqqwdwqdwqdwqddqdwq", "channel_merchant_id": "9", "origin_merchant_id": "xxxx", "data_id": "1209403539471060994"}'
;
console
.
log
(
`字符串:
${
str
}
`
);
...
...
@@ -93,14 +94,14 @@ class TestApi {
if
(
!
sheets
||
sheets
.
length
==
0
)
{
return
result
;
}
var
sheet
=
sheets
[
0
];
if
(
!
sheet
||
!
sheet
.
data
||
sheet
.
data
.
length
==
0
)
{
return
result
;
}
var
rows
=
sheet
.
data
;
for
(
var
idx
in
rows
)
{
var
cells
=
rows
[
idx
];
if
(
!
cells
||
cells
.
length
<
3
)
{
...
...
@@ -140,5 +141,11 @@ class TestApi {
}
return
uuid
.
join
(
''
);
}
async
updatecreate
(
obj
){
var
ss
=
await
this
.
offlinecompanySve
.
updateCreate
(
obj
);
return
ss
;
}
}
module
.
exports
=
TestApi
;
\ No newline at end of file
module
.
exports
=
TestApi
;
bpo-admin/app/base/db/impl/offlinecompanyDao.js
0 → 100644
View file @
4be04550
const
system
=
require
(
"../../system"
);
const
Dao
=
require
(
"../dao.base"
);
class
OfflinecompanyDao
extends
Dao
{
constructor
(){
super
(
Dao
.
getModelName
(
OfflinecompanyDao
));
}
}
module
.
exports
=
OfflinecompanyDao
;
bpo-admin/app/base/db/models/offlinecompany.js
0 → 100644
View file @
4be04550
const
system
=
require
(
"../../system"
);
const
settings
=
require
(
"../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
wxconfig
.
appId
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"offlinecompany"
,
{
company_name
:
DataTypes
.
STRING
,
contact_man
:
DataTypes
.
STRING
,
contact_mobile
:
DataTypes
.
STRING
,
contact_email
:
DataTypes
.
STRING
,
contact_addr
:
DataTypes
.
STRING
,
},{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'c_offline_company'
,
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}]
// }
]
});
}
bpo-admin/app/base/service/impl/offlinecompanySve.js
0 → 100644
View file @
4be04550
const
system
=
require
(
"../../system"
);
const
ServiceBase
=
require
(
"../sve.base"
);
var
settings
=
require
(
"../../../config/settings"
);
class
OfflinecompanyService
extends
ServiceBase
{
constructor
(){
super
(
ServiceBase
.
getDaoName
(
OfflinecompanyService
));
}
async
updateCreate
(
params
){
var
offlinecompany
=
await
this
.
dao
.
findOne
({
company_name
:
params
.
company_name
});
if
(
null
!=
offlinecompany
){
// params.id = offlinecompany.id;
// var saveId = await this.dao.update(params);
offlinecompany
.
contact_man
=
params
.
contact_man
;
offlinecompany
.
contact_mobile
=
params
.
contact_mobile
;
offlinecompany
.
contact_email
=
params
.
contact_email
;
offlinecompany
.
contact_addr
=
params
.
contact_addr
;
var
updates
=
await
offlinecompany
.
save
();
if
(
updates
.
id
>
0
){
return
updates
;
}
return
system
.
getErrResult2
(
"修改失败"
);
}
var
saves
=
await
this
.
dao
.
create
(
params
);
if
(
saves
.
id
>
0
){
return
saves
;
}
return
system
.
getErrResult2
(
"保存失败"
);
}
}
module
.
exports
=
OfflinecompanyService
;
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