Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
taxh5
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
taxh5
Commits
cec2e8f7
Commit
cec2e8f7
authored
Apr 10, 2019
by
何娜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉个税管家
parent
dd29786e
Pipeline
#5818
passed with stage
in 2 seconds
Changes
5
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
40 deletions
+12
-40
task.js
app/controller/task.js
+1
-1
scripts.js
app/service/scripts.js
+0
-0
task.js
app/service/task.js
+11
-37
config.local.js
config/config.local.js
+0
-1
config.prod.js
config/config.prod.js
+0
-1
No files found.
app/controller/task.js
View file @
cec2e8f7
...
...
@@ -182,7 +182,7 @@ class TaskController extends Controller {
async
cityConfigs
()
{
const
{
ctx
,
service
}
=
this
;
ctx
.
validate
(
this
.
cityConfigRule
);
//
await service.signature.signatureCheck(ctx.request.body);
await
service
.
signature
.
signatureCheck
(
ctx
.
request
.
body
);
const
result
=
await
service
.
task
.
getCityList
();
ctx
.
success
({
code
:
0
,
...
...
app/service/scripts.js
View file @
cec2e8f7
This diff is collapsed.
Click to expand it.
app/service/task.js
View file @
cec2e8f7
...
...
@@ -8,7 +8,6 @@ class TaskService extends Service {
const
{
config
}
=
this
;
const
{
taskAPI
,
LOCK_KEY
}
=
config
;
this
.
baseURL
=
taskAPI
.
host
;
this
.
newbaseURL
=
taskAPI
.
newhost
;
this
.
createTaskUrl
=
taskAPI
.
createTaskUrl
;
this
.
submitTaskUrl
=
taskAPI
.
submitTaskUrl
;
this
.
fetchCodeUrl
=
taskAPI
.
fetchCodeUrl
;
...
...
@@ -18,9 +17,8 @@ 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
;
opts
=
{
charset
:
'utf-8'
,
timeout
:
[
'30s'
,
'30s'
],
...
...
@@ -28,8 +26,8 @@ class TaskService extends Service {
contentType
:
'json'
,
...
opts
,
};
ctx
.
logger
.
info
(
'_request'
,
url
,
type
);
return
ctx
.
curl
(
url
,
opts
);
ctx
.
logger
.
info
(
'_request'
,
`
${
baseURL
}${
url
}
`
);
return
ctx
.
curl
(
`
${
baseURL
}${
url
}
`
,
opts
);
}
_checkSuccess
(
result
)
{
...
...
@@ -42,21 +40,20 @@ class TaskService extends Service {
}
}
async
create
({
scriptId
,
channelType
})
{
async
create
({
scriptId
})
{
const
{
createTaskUrl
,
ctx
}
=
this
;
const
result
=
await
this
.
_request
(
createTaskUrl
,
channelType
,
{
const
result
=
await
this
.
_request
(
createTaskUrl
,
{
method
:
'post'
,
data
:
{
cityId
:
scriptId
},
});
ctx
.
logger
.
info
(
`【Task】create
${
createTaskUrl
}
cityId:
${
scriptId
}
channelType:
${
channelType
}
result:`
,
JSON
.
stringify
(
result
.
data
));
ctx
.
logger
.
info
(
`【Task】create
${
createTaskUrl
}
cityId:
${
scriptId
}
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 +70,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 +81,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,33 +92,13 @@ class TaskService extends Service {
async
getCityList
()
{
const
{
cityConfigUrl
,
ctx
}
=
this
;
let
cityLists
=
[];
//对外城市列表
let
cityTypeLists
=
[];
//不对外城市列表,含渠道(51/管家)
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'
});
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
,
...
...
@@ -131,7 +106,6 @@ class TaskService extends Service {
state
:
city
.
state
,
queryParam
:
city
.
queryParam
});
ctx
.
app
.
redis
.
set
(
city
.
id
,
city
.
type
,
"EX"
,
3600
)
});
cityLists
.
push
(
newProv
);
});
...
...
config/config.local.js
View file @
cec2e8f7
...
...
@@ -16,7 +16,6 @@ module.exports = () => {
};
config
.
taskAPI
=
{
host
:
'http://tm.51gjj.com:6824'
,
newhost
:
'http://tt.51gjj.com:7001'
,
fetchHubsUrl
:
''
,
createTaskUrl
:
'/IncomeTax/createItTask'
,
fetchCodeUrl
:
'/IncomeTax/getItCode'
,
...
...
config/config.prod.js
View file @
cec2e8f7
...
...
@@ -19,7 +19,6 @@ module.exports = () => {
};
config
.
taskAPI
=
{
host
:
process
.
env
.
TASKAPI_HOST
,
newhost
:
'http://tt.51gjj.com:7001'
,
fetchHubsUrl
:
''
,
createTaskUrl
:
'/IncomeTax/createItTask'
,
fetchCodeUrl
:
'/IncomeTax/getItCode'
,
...
...
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