Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tax_api
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data_server
tax_api
Commits
18f859c9
Commit
18f859c9
authored
Apr 12, 2019
by
何娜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不支持个税管家
parent
edc7f459
Pipeline
#5933
passed with stage
in 2 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
39 deletions
+14
-39
order.js
app/controller/order.js
+1
-4
task.js
app/controller/task.js
+1
-0
task.js
app/service/task.js
+12
-35
No files found.
app/controller/order.js
View file @
18f859c9
...
...
@@ -82,10 +82,8 @@ class OrderController extends Controller {
ctx
.
validate
(
this
.
fetchRule
);
const
{
appKey
}
=
ctx
.
request
.
body
.
signParams
.
params
;
const
{
cityId
}
=
ctx
.
request
.
body
;
const
channelType
=
await
ctx
.
app
.
redis
.
get
(
cityId
);
ctx
.
app
.
redis
.
set
(
cityId
,
channelType
,
"EX"
,
3600
);
const
orderId
=
await
service
.
signature
.
createOrderId
(
ctx
.
request
.
body
.
signParams
);
const
taskId
=
await
service
.
task
.
create
({
cityId
,
channelType
});
const
taskId
=
await
service
.
task
.
create
({
cityId
});
await
service
.
order
.
create
({
orderId
,
taskId
,
...
...
@@ -93,7 +91,6 @@ class OrderController extends Controller {
notifyUrl
:
ctx
.
app
.
notifyMap
.
get
(
appKey
)
&&
ctx
.
app
.
notifyMap
.
get
(
appKey
).
notifyUrl
||
''
,
appkey
:
appKey
,
status
:
'init'
,
text1
:
channelType
,
});
ctx
.
body
=
{
code
:
0
,
...
...
app/controller/task.js
View file @
18f859c9
...
...
@@ -143,6 +143,7 @@ class TaskController extends Controller {
//任务回调接口
async
handleCallback
()
{
const
{
ctx
,
service
}
=
this
;
ctx
.
logger
.
info
(
'-----------------handleCallback_into'
);
const
{
taskId
}
=
ctx
.
request
.
body
;
const
result
=
await
service
.
task
.
fetchTask
({
taskId
});
ctx
.
success
();
...
...
app/service/task.js
View file @
18f859c9
...
...
@@ -18,9 +18,9 @@ class TaskService extends Service {
}
_request
(
url
,
type
,
opts
)
{
const
{
ctx
,
baseURL
,
newbaseURL
}
=
this
;
url
=
(
type
===
'gsgj'
)
?
`
${
newbaseURL
}${
url
}
`
:
`
${
baseURL
}${
url
}
`
;
_request
(
url
,
opts
)
{
const
{
ctx
,
baseURL
}
=
this
;
url
=
`
${
baseURL
}${
url
}
`
;
opts
=
{
charset
:
'utf-8'
,
timeout
:
[
'30s'
,
'30s'
],
...
...
@@ -28,7 +28,7 @@ class TaskService extends Service {
contentType
:
'json'
,
...
opts
,
};
ctx
.
logger
.
info
(
'_request'
,
url
,
type
);
ctx
.
logger
.
info
(
'_request'
,
url
);
return
ctx
.
curl
(
url
,
opts
);
}
...
...
@@ -42,21 +42,20 @@ class TaskService extends Service {
}
}
async
create
({
cityId
,
channelType
})
{
async
create
({
cityId
})
{
const
{
createTaskUrl
,
ctx
}
=
this
;
const
result
=
await
this
.
_request
(
createTaskUrl
,
channelType
,
{
const
result
=
await
this
.
_request
(
createTaskUrl
,
{
method
:
'post'
,
data
:
{
cityId
},
});
ctx
.
logger
.
info
(
`【Task】create
${
createTaskUrl
}
cityId:
${
cityId
}
channelType:
${
channelType
}
result:`
,
JSON
.
stringify
(
result
.
data
));
ctx
.
logger
.
info
(
`【Task】create
${
createTaskUrl
}
cityId:
${
cityId
}
result:`
,
JSON
.
stringify
(
result
.
data
));
this
.
_checkSuccess
(
result
);
return
result
.
data
.
data
.
taskId
;
}
async
fetchCapture
({
taskId
,
type
})
{
const
{
fetchCodeUrl
,
ctx
}
=
this
;
let
channelType
=
taskId
.
length
>
20
?
'gsgj'
:
'51gs'
;
const
result
=
await
this
.
_request
(
fetchCodeUrl
,
channelType
,
{
const
result
=
await
this
.
_request
(
fetchCodeUrl
,
{
method
:
'post'
,
data
:
{
taskId
,
...
...
@@ -73,8 +72,7 @@ class TaskService extends Service {
async
submit
(
data
)
{
const
{
submitTaskUrl
,
ctx
}
=
this
;
let
channelType
=
data
.
taskId
.
length
>
20
?
'gsgj'
:
'51gs'
;
const
result
=
await
this
.
_request
(
submitTaskUrl
,
channelType
,
{
const
result
=
await
this
.
_request
(
submitTaskUrl
,
{
method
:
'post'
,
data
,
});
...
...
@@ -85,8 +83,7 @@ class TaskService extends Service {
async
fetchTask
(
data
)
{
const
{
fetchTaskUrl
,
ctx
}
=
this
;
let
channelType
=
data
.
taskId
.
length
>
20
?
'gsgj'
:
'51gs'
;
const
result
=
await
this
.
_request
(
fetchTaskUrl
,
channelType
,
{
const
result
=
await
this
.
_request
(
fetchTaskUrl
,
{
method
:
'post'
,
data
,
});
...
...
@@ -97,32 +94,13 @@ class TaskService extends Service {
async
getCityList
()
{
const
{
cityConfigUrl
,
ctx
}
=
this
;
let
cityLists
=
[];
//对外城市列表
let
newCityMap
=
new
Map
();
const
newret
=
await
this
.
_request
(
cityConfigUrl
,
'gsgj'
,
{
method
:
'get'
});
ctx
.
logger
.
info
(
`【Task】getCityList params gsgj`
,
newret
.
status
,
newret
.
data
.
data
.
length
);
this
.
_checkSuccess
(
newret
);
newret
.
data
.
data
.
map
(
Prov
=>
{
Prov
.
citys
.
map
(
city
=>
{
newCityMap
.
set
(
String
(
city
.
id
),
city
)
})
});
const
ret
=
await
this
.
_request
(
cityConfigUrl
,
'51gs'
,
{
method
:
'get'
});
// ctx.logger.info(`【Task】getCityList params 51gs`, ret.status, ret.data.data.length);
const
ret
=
await
this
.
_request
(
cityConfigUrl
,
{
method
:
'get'
});
ctx
.
logger
.
info
(
`【Task】getCityList params 51gs`
,
ret
.
status
,
ret
.
data
.
data
.
length
);
this
.
_checkSuccess
(
ret
);
ret
.
data
.
data
.
map
(
Prov
=>
{
let
newProv
=
{
provinceName
:
Prov
.
provinceName
,
citys
:
[]};
Prov
.
citys
.
map
(
city
=>
{
city
.
type
=
"51gs"
;
if
(
city
.
state
===
-
1
&&
newCityMap
.
get
(
String
(
city
.
id
))
&&
newCityMap
.
get
(
String
(
city
.
id
)).
state
===
1
)
{
city
=
newCityMap
.
get
(
String
(
city
.
id
));
city
.
type
=
"gsgj"
;
ctx
.
logger
.
info
(
'city'
,
city
)
}
if
(
city
.
state
!=
1
)
{
city
.
state
=
-
1
;
}
newProv
.
citys
.
push
({
province
:
city
.
province
,
name
:
city
.
name
,
...
...
@@ -130,7 +108,6 @@ class TaskService extends Service {
state
:
city
.
state
,
queryParam
:
city
.
queryParam
});
ctx
.
app
.
redis
.
set
(
city
.
id
,
city
.
type
,
"EX"
,
3600
)
});
cityLists
.
push
(
newProv
);
});
...
...
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