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
ac9e63f0
Commit
ac9e63f0
authored
Feb 23, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
2fb689d4
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
147 additions
and
6 deletions
+147
-6
xgg-deliver/app/base/db/impl/log/synlogDao.js
+9
-0
xgg-deliver/app/base/db/models/log/synlog.js
+52
-0
xgg-deliver/app/base/service/impl/common/deliverSve.js
+37
-1
xgg-deliver/app/base/service/svems.base.js
+23
-0
xgg-deliver/app/base/system.js
+1
-1
xgg-deliver/app/config/localsettings.js
+4
-4
xgg-deliver/app/config/settings.js
+21
-0
No files found.
xgg-deliver/app/base/db/impl/log/synlogDao.js
0 → 100644
View file @
ac9e63f0
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
SynlogDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
SynlogDao
));
}
}
module
.
exports
=
SynlogDao
;
\ No newline at end of file
xgg-deliver/app/base/db/models/log/synlog.js
0 → 100644
View file @
ac9e63f0
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"synlog"
,
{
apiUrl
:
DataTypes
.
STRING
,
apiName
:
DataTypes
.
STRING
,
apiReq
:
DataTypes
.
STRING
,
apiRes
:
DataTypes
.
STRING
,
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'xgg_syn_log'
,
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
xgg-deliver/app/base/service/impl/common/deliverSve.js
View file @
ac9e63f0
...
@@ -55,7 +55,43 @@ class DeliverService extends ServiceBase {
...
@@ -55,7 +55,43 @@ class DeliverService extends ServiceBase {
return
await
this
.
callms
(
"common"
,
"deliverUserById"
,
params
);
return
await
this
.
callms
(
"common"
,
"deliverUserById"
,
params
);
}
}
async
deliverUserSave
(
params
)
{
async
deliverUserSave
(
params
)
{
return
await
this
.
callms
(
"common"
,
"deliverUserSave"
,
params
);
let
rs
=
await
this
.
callms
(
"common"
,
"deliverUserSave"
,
params
);
if
(
!
params
.
id
&&
rs
.
status
===
0
)
{
this
.
synSave
(
rs
.
data
.
id
,
params
.
password
);
}
return
rs
;
}
async
synSave
(
id
,
password
)
{
let
rs
=
await
this
.
callms
(
"common"
,
"deliverUserInfo"
,
{
id
:
id
});
if
(
!
rs
||
!
rs
.
data
||
!
rs
.
data
.
user
||
!
rs
.
data
.
deliver
)
{
return
;
}
let
user
=
rs
.
data
.
user
;
let
deliver
=
rs
.
data
.
deliver
;
let
data
=
{
companyNo
:
deliver
.
id
,
companyName
:
deliver
.
name
,
path
:
user
.
org_path
,
staffNo
:
user
.
id
,
staffName
:
user
.
real_name
,
loginId
:
user
.
ucname
,
pwd
:
password
,
};
if
(
user
.
isAdmin
)
{
data
.
classType
=
"leader"
;
data
.
className
=
"主管"
;
}
else
{
data
.
classType
=
"member"
;
data
.
className
=
" 普通员工"
;
}
let
url
=
settings
.
ntapi
().
synUserDetails
;
let
res
=
await
this
.
callApi
(
url
,
data
,
"创建交付商用户"
);
if
(
res
&&
res
.
data
&&
res
.
data
.
datas
)
{
let
_d
=
res
.
data
.
datas
;
await
this
.
callms
(
"common"
,
"deliverSynUpdate"
,
{
user_id
:
id
,
nt_user_id
:
_d
.
id
,
nt_company_id
:
_d
.
companyId
});
}
}
}
async
allOrg
(
params
)
{
async
allOrg
(
params
)
{
...
...
xgg-deliver/app/base/service/svems.base.js
View file @
ac9e63f0
...
@@ -8,6 +8,7 @@ const axios = require('axios');
...
@@ -8,6 +8,7 @@ const axios = require('axios');
class
ServiceBase
{
class
ServiceBase
{
constructor
()
{
constructor
()
{
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
synlogDao
=
system
.
getObject
(
"db.log.synlogDao"
);
this
.
micro
=
system
.
microsetting
();
this
.
micro
=
system
.
microsetting
();
}
}
...
@@ -251,6 +252,28 @@ class ServiceBase {
...
@@ -251,6 +252,28 @@ class ServiceBase {
}
}
}
}
async
callApi
(
url
,
data
,
name
)
{
let
log
=
await
this
.
synlogDao
.
create
({
apiUrl
:
url
,
apiName
:
name
,
apiReq
:
JSON
.
stringify
(
data
),
apiRes
:
""
,
});
let
res
=
await
axios
({
method
:
'post'
,
url
:
url
,
data
:
data
});
console
.
log
(
res
);
console
.
log
(
res
.
data
);
log
.
apiRes
=
JSON
.
stringify
(
res
.
data
);
log
.
save
();
return
res
.
data
;
}
trim
(
o
)
{
trim
(
o
)
{
if
(
!
o
)
{
if
(
!
o
)
{
return
""
;
return
""
;
...
...
xgg-deliver/app/base/system.js
View file @
ac9e63f0
...
@@ -174,7 +174,7 @@ class System {
...
@@ -174,7 +174,7 @@ class System {
var
domain2
=
"http://39.107.234.14"
;
var
domain2
=
"http://39.107.234.14"
;
return
{
return
{
// 公共服务
// 公共服务
common
:
domain
2
+
":3102"
+
path
,
common
:
domain
+
":3102"
+
path
,
// common: "http://127.0.0.1:3102" + path,
// common: "http://127.0.0.1:3102" + path,
// 商户服务
// 商户服务
...
...
xgg-deliver/app/config/localsettings.js
View file @
ac9e63f0
...
@@ -10,10 +10,10 @@ var settings={
...
@@ -10,10 +10,10 @@ var settings={
user
:
"write"
,
user
:
"write"
,
password
:
"write"
,
password
:
"write"
,
config
:
{
config
:
{
host
:
'192.168.18.237'
,
//
host: '192.168.18.237',
port
:
3306
,
//
port: 3306,
//
host: '43.247.184.35',
host
:
'43.247.184.35'
,
//
port: 8899,
port
:
8899
,
dialect
:
'mysql'
,
dialect
:
'mysql'
,
operatorsAliases
:
false
,
operatorsAliases
:
false
,
pool
:
{
pool
:
{
...
...
xgg-deliver/app/config/settings.js
View file @
ac9e63f0
...
@@ -83,6 +83,27 @@ var settings = {
...
@@ -83,6 +83,27 @@ var settings = {
return
"https://open.gongsibao.com/web/common/metaCtl/getApiDoc"
;
return
"https://open.gongsibao.com/web/common/metaCtl/getApiDoc"
;
}
}
},
},
ntapi
:
function
()
{
let
domain
=
""
;
if
(
this
.
env
==
"dev"
)
{
domain
=
"https://nt-api.gongsibao.com"
;
}
else
{
domain
=
"https://nt-api.gongsibao.com"
;
}
return
{
// 创建交付商&管理员
synUserDetails
:
domain
+
"/nga-api/synUserDetails"
,
// 交付商启用/禁用
updateCompanyStatus
:
domain
+
"/nga-api/company/updateCompanyStatus"
,
// 建账
createCustomer
:
domain
+
"/nga-api/createCustomer"
,
// 查询账户信息
getCustomerById
:
domain
+
"/nga-api/getCustomerById"
,
// 上传发票
uploadDetail
:
domain
+
"/nga-api/uploadDetail"
,
}
},
redis
:
function
()
{
redis
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
if
(
this
.
env
==
"dev"
)
{
var
localsettings
=
require
(
"./localsettings"
);
var
localsettings
=
require
(
"./localsettings"
);
...
...
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