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
e7246859
Commit
e7246859
authored
Jan 02, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
6e78db5d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
1 deletions
+92
-1
fi-taxctl/app/base/api/api.base.js
+2
-1
fi-taxctl/app/base/api/impl/rpt/rptApi.js
+12
-0
fi-taxctl/app/base/db/models/rpt/result.js
+61
-0
fi-taxctl/app/base/service/impl/rpt/rpttypeSve.js
+10
-0
fi-taxctl/app/base/service/sve.base.js
+6
-0
fi-taxctl/app/base/utils/restClient.js
+1
-0
No files found.
fi-taxctl/app/base/api/api.base.js
View file @
e7246859
...
...
@@ -14,7 +14,8 @@ class APIBase extends DocBase {
var
lst
=
[
"rpt.saveRptHistory"
,
"rpt.saveRpt"
,
"rpt.queryStatus"
"rpt.queryStatus"
,
"rpt.queryReport"
];
var
x
=
lst
.
indexOf
(
fullname
);
return
x
>=
0
;
...
...
fi-taxctl/app/base/api/impl/rpt/rptApi.js
View file @
e7246859
...
...
@@ -75,6 +75,18 @@ class RptAPI extends APIBase{
var
x
=
await
this
.
rptService
.
queryStatus
(
pobj
);
return
system
.
getResult
(
x
);
}
async
queryReport
(
pobj
,
query
){
console
.
log
(
JSON
.
stringify
(
pobj
));
if
(
pobj
){
var
x
=
await
this
.
rptService
.
queryReport
(
pobj
.
batchid
);
return
system
.
getResult
(
x
);
}
else
{
return
system
.
getResult
(
null
);
}
}
exam
(){
return
"xxx"
;
}
...
...
fi-taxctl/app/base/db/models/rpt/result.js
0 → 100644
View file @
e7246859
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"result"
,
{
BatchNo
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
},
indexName
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
},
status
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
}
},{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'result_set'
,
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}]
// }
]
});
}
fi-taxctl/app/base/service/impl/rpt/rpttypeSve.js
View file @
e7246859
...
...
@@ -55,6 +55,16 @@ class RptTypeService extends ServiceBase{
}
}});
}
async
queryReport
(
batchid
){
var
rs
=
await
this
.
db
.
models
.
result
.
findAll
({
where
:{
"BatchNo"
:
batchid
},
attributes
:[
"indexName"
,
"status"
],
raw
:
true
});
var
tmp
=
{};
rs
.
forEach
((
item
=>
{
tmp
[
item
.
indexName
]
=
Number
(
item
.
status
);
}));
var
rptdata
=
await
this
.
apiCallWithoutAk
(
"http://123.57.217.203:30001/gsb/api/report"
,
tmp
);
return
rptdata
;
}
async
saveRpt
(
upinfo
){
return
this
.
db
.
transaction
(
async
t
=>
{
//构建批量对象
...
...
fi-taxctl/app/base/service/sve.base.js
View file @
e7246859
...
...
@@ -27,6 +27,12 @@ class ServiceBase {
}
return
null
;
}
async
apiCallWithoutAk
(
url
,
params
){
var
acck
=
"noak"
;
//按照访问token
var
restResult
=
await
this
.
restS
.
execPostWithAK
(
params
,
url
,
acck
);
return
restResult
;
}
async
apiCallWithAkNoWait
(
url
,
params
){
var
acckapp
=
await
this
.
cacheManager
[
"ApiAccessKeyCache"
].
cache
(
settings
.
appKey
);
var
acck
=
acckapp
.
accessKey
;
...
...
fi-taxctl/app/base/utils/restClient.js
View file @
e7246859
...
...
@@ -105,6 +105,7 @@ class RestClient{
}
async
execPostWithAK
(
subData
,
url
,
ak
){
let
cmd
=
this
.
FetchPostCmdWithAK
(
subData
,
url
,
ak
);
console
.
log
(
cmd
);
var
result
=
await
this
.
exec
(
cmd
,{
maxBuffer
:
1024
*
1024
*
15
});
...
...
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