Commit 18f859c9 authored by 何娜's avatar 何娜

不支持个税管家

parent edc7f459
Pipeline #5933 passed with stage
in 2 seconds
......@@ -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,
......
......@@ -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();
......
......@@ -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);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment