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
b757fcc4
Commit
b757fcc4
authored
Feb 23, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
584a7038
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
172 additions
and
5 deletions
+172
-5
xgg-admin/app/base/db/impl/log/synlogDao.js
+9
-0
xgg-admin/app/base/db/models/log/synlog.js
+52
-0
xgg-admin/app/base/service/impl/business/businessmenSve.js
+1
-0
xgg-admin/app/base/service/impl/common/deliverSve.js
+62
-0
xgg-admin/app/base/service/svems.base.js
+22
-0
xgg-admin/app/base/system.js
+3
-3
xgg-admin/app/config/settings.js
+23
-2
No files found.
xgg-admin/app/base/db/impl/log/synlogDao.js
0 → 100644
View file @
b757fcc4
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-admin/app/base/db/models/log/synlog.js
0 → 100644
View file @
b757fcc4
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-admin/app/base/service/impl/business/businessmenSve.js
View file @
b757fcc4
...
...
@@ -34,6 +34,7 @@ class BusinessmenService extends ServiceBase {
async
createAccount
(
params
){
try
{
//todo somthing ...
if
(
1
==
1
){
return
await
this
.
callms
(
"order"
,
"createAccount"
,
params
);
}
...
...
xgg-admin/app/base/service/impl/common/deliverSve.js
View file @
b757fcc4
...
...
@@ -2,9 +2,12 @@ const system = require("../../../system");
const
ServiceBase
=
require
(
"../../svems.base"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
axios
=
require
(
"axios"
);
class
DeliverService
extends
ServiceBase
{
constructor
()
{
super
();
this
.
synlogDao
=
system
.
getObject
(
"db.log.synlogDao"
);
}
async
all
(
params
)
{
...
...
@@ -27,8 +30,27 @@ class DeliverService extends ServiceBase {
async
enabled
(
params
)
{
var
rs
=
await
this
.
callms
(
"common"
,
"deliverEnable"
,
params
);
this
.
synEnabled
(
params
);
return
rs
;
}
async
synEnabled
(
params
)
{
var
rs
=
await
this
.
callms
(
"common"
,
"deliverInfo"
,
params
);
let
deliver
=
rs
.
data
;
if
(
!
deliver
)
{
return
;
}
let
data
=
{
companyNo
:
deliver
.
id
,
name
:
deliver
.
name
,
serviceStatus
:
deliver
.
isEnabled
?
1
:
0
,
}
let
url
=
settings
.
ntapi
().
updateCompanyStatus
;
this
.
callApi
(
url
,
data
,
"启用/禁用"
);
}
async
resetPassword
(
params
)
{
var
rs
=
await
this
.
callms
(
"common"
,
"deliverResetPassword"
,
params
);
return
rs
;
...
...
@@ -39,9 +61,49 @@ class DeliverService extends ServiceBase {
params
.
businessmenDivide
=
0
;
var
rs
=
await
this
.
callms
(
"common"
,
"deliverSave"
,
params
);
await
this
.
doPercent
([
rs
.
data
]);
if
(
!
params
.
id
&&
rs
&&
rs
.
data
&&
rs
.
data
.
id
)
{
this
.
synSave
(
rs
.
data
.
admin_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
.
id
=
deliver
.
admin_id
)
{
data
.
classType
=
"manager"
;
data
.
className
=
"管理员"
;
}
else
{
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
del
(
params
)
{
return
await
this
.
callms
(
"common"
,
"deliverDelete"
,
params
);
}
...
...
xgg-admin/app/base/service/svems.base.js
View file @
b757fcc4
...
...
@@ -8,6 +8,7 @@ const axios = require('axios');
class
ServiceBase
{
constructor
()
{
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
synlogDao
=
system
.
getObject
(
"db.log.synlogDao"
);
this
.
micro
=
system
.
microsetting
();
}
...
...
@@ -250,6 +251,27 @@ 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
)
{
if
(
!
o
)
{
return
""
;
...
...
xgg-admin/app/base/system.js
View file @
b757fcc4
...
...
@@ -170,11 +170,11 @@ class System {
var
path
=
"/api/op/action/springboard"
;
if
(
settings
.
env
==
"dev"
)
{
// var domain = "http://192.168.18.237";
var
domain
=
"http://127.0.0.1"
;
var
domain
2
=
"http://39.107.234.14"
;
var
domain
2
=
"http://127.0.0.1"
;
var
domain
=
"http://39.107.234.14"
;
return
{
// 公共服务
common
:
domain
+
":3102"
+
path
,
common
:
domain
2
+
":3102"
+
path
,
// common: "http://127.0.0.1:3102" + path,
// 商户服务
...
...
xgg-admin/app/config/settings.js
View file @
b757fcc4
...
...
@@ -51,8 +51,8 @@ var settings = {
return
1
;
},
},
indexPage
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
indexPage
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
// return "http://localhost:8080";
return
"https://xggadmin.gongsibao.com"
;
}
else
{
...
...
@@ -83,6 +83,27 @@ var settings = {
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
()
{
if
(
this
.
env
==
"dev"
)
{
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