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
36b43aec
Commit
36b43aec
authored
Jan 20, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fi-taxctl' of gitlab.gongsibao.com:jiangyong/zhichan into fi-taxctl
parents
878e3717
ad70da8e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
23 deletions
+40
-23
fi-taxctl/app/base/api/impl/rpt/rptApi.js
+4
-2
fi-taxctl/app/base/service/impl/rpt/rpttypeSve.js
+33
-16
fi-taxctl/app/config/localsettings.js
+3
-5
No files found.
fi-taxctl/app/base/api/impl/rpt/rptApi.js
View file @
36b43aec
...
...
@@ -70,8 +70,10 @@ class RptAPI extends APIBase{
return
system
.
getResult
(
x
);
}
async
saveRptHistory
(
pobj
,
query
){
var
x
=
await
this
.
rptService
.
saveRptHistory
(
pobj
);
return
system
.
getResult
(
x
);
pobj
.
forEach
(
async
(
hs
)
=>
{
await
this
.
rptService
.
saveRptHistory
(
hs
);
});
return
system
.
getResult
({});
}
async
queryStatus
(
pobj
,
query
){
console
.
log
(
JSON
.
stringify
(
pobj
));
...
...
fi-taxctl/app/base/service/impl/rpt/rpttypeSve.js
View file @
36b43aec
...
...
@@ -5,6 +5,7 @@ class RptTypeService extends ServiceBase{
constructor
(){
super
(
"rpt"
,
ServiceBase
.
getDaoName
(
RptTypeService
));
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
this
.
cacheBatchId
=
{};
}
async
deleteUrlsCache
(){
await
this
.
redisClient
.
delete
(
"docurls"
);
...
...
@@ -16,7 +17,13 @@ class RptTypeService extends ServiceBase{
var
hisarray
=
[];
var
rptid
=
hs
.
rptid
;
var
batchid
=
hs
.
batchid
;
var
batch
=
await
this
.
db
.
models
.
uploadbatch
.
findById
(
batchid
);
var
batch
=
null
;
if
(
!
this
.
cacheBatchId
[
batchid
]){
batch
=
await
this
.
db
.
models
.
uploadbatch
.
findOne
({
where
:{
id
:
batchid
},
transaction
:
t
});
this
.
cacheBatchId
[
batchid
]
=
batch
;
}
else
{
batch
=
this
.
cacheBatchId
[
batchid
];
}
var
hisdata
=
hs
.
hisdata
;
var
rptdate
=
hs
.
rptdate
;
var
rptcode
=
hs
.
rptcode
;
...
...
@@ -52,10 +59,10 @@ class RptTypeService extends ServiceBase{
}));
console
.
log
(
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>sended..........."
);
await
self
.
redisClient
.
delete
(
"batch"
+
batchid
);
self
.
redisClient
.
delete
(
"batch"
+
batchid
);
//改变批的状态为解析完毕
batch
.
batchstatuscode
=
"calc"
;
await
batch
.
save
();
await
batch
.
save
(
{
transaction
:
t
}
);
}
return
{};
});
...
...
@@ -92,6 +99,19 @@ class RptTypeService extends ServiceBase{
}
}
buildRpt
(
rpt
,
upinfo
,
comp
,
batchtemp
){
var
rptupload
=
{
companyname
:
upinfo
.
companyName
,
companycode
:
upinfo
.
companyTaxNum
,
rpttypecode
:
rpt
.
code
,
timetypecode
:
upinfo
.
dateType
,
urlpath
:
rpt
.
url
,
rptdate
:
rpt
.
date
?
rpt
.
date
:
'toparse'
,
company_id
:
comp
.
id
,
uploadbatch_id
:
batchtemp
.
id
,
}
return
rptupload
;
}
async
saveRpt
(
upinfo
){
return
this
.
db
.
transaction
(
async
t
=>
{
//构建批量对象
...
...
@@ -113,6 +133,7 @@ class RptTypeService extends ServiceBase{
timetypecode
:
upinfo
.
dateType
,
accountstandardcode
:
upinfo
.
accountingType
,
company_id
:
comp
.
id
,
// userkey:null
}
//保存批量
var
batchtemp
=
await
this
.
db
.
models
.
uploadbatch
.
create
(
batchobj
,{
transaction
:
t
});
...
...
@@ -121,20 +142,16 @@ class RptTypeService extends ServiceBase{
{
if
(
k
.
indexOf
(
"Report"
)
>=
0
){
var
rpts
=
upinfo
[
k
];
rpts
.
forEach
(
rpt
=>
{
var
rptupload
=
{
companyname
:
upinfo
.
companyName
,
companycode
:
upinfo
.
companyTaxNum
,
rpttypecode
:
rpt
.
code
,
timetypecode
:
upinfo
.
dateType
,
urlpath
:
rpt
.
url
,
rptdate
:
rpt
.
date
,
company_id
:
comp
.
id
,
uploadbatch_id
:
batchtemp
.
id
,
}
rptresult
.
push
(
rptupload
);
var
esrpts
=
rpts
[
"essential"
];
var
unesrpts
=
rpts
[
"unessential"
];
esrpts
.
forEach
(
rpt
=>
{
var
tmprpt
=
this
.
buildRpt
(
rpt
,
upinfo
,
comp
,
batchtemp
);
rptresult
.
push
(
tmprpt
);
});
unesrpts
.
forEach
(
rpt
=>
{
var
tmprpt
=
this
.
buildRpt
(
rpt
,
upinfo
,
comp
,
batchtemp
);
rptresult
.
push
(
tmprpt
);
});
}
}
});
...
...
fi-taxctl/app/config/localsettings.js
View file @
36b43aec
...
...
@@ -3,7 +3,7 @@ var settings={
host
:
"43.247.184.32"
,
port
:
8967
,
password
:
"Gongsibao2018"
,
db
:
2
,
db
:
15
,
},
database
:
{
dbname
:
"fktaxctl"
,
...
...
@@ -21,10 +21,8 @@ var settings={
idle
:
1000000
},
debug
:
false
,
dialectOptions
:
{
requestTimeout
:
999999
,
// instanceName:'DEV'
}
//设置MSSQL超时时间
logging
:
false
}
},
reqEsDevUrl
:
"http://192.168.4.249:9200/"
,
...
...
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