Commit 38770e7d authored by 何娜's avatar 何娜

tax_api 采用新接口获取城市配置+获取订单号url优化

parent 2c5e3cdc
Pipeline #7021 passed with stage
in 4 seconds
......@@ -6,6 +6,11 @@ class OrderController extends Controller {
constructor(ctx) {
super(ctx);
this.fetchOrderIdRule = {
appKey: 'string',
cityId: 'string'
};
this.showRule = {
sign: 'string',
params: {
......@@ -79,7 +84,8 @@ class OrderController extends Controller {
async fetchOrderId() {
const { ctx, service } = this;
try {
const { appKey, cityId } = ctx.params;
ctx.validate(this.fetchOrderIdRule, ctx.query);
const { appKey, cityId } = ctx.query;
// const appKeyInfo = await service.partner.fetchInfo(appKey);
// ctx.logger.info(appKey, ',appKeyInfo,', appKeyInfo);
// if (!(appKeyInfo && appKeyInfo.valid === true && appKeyInfo.enableIt === true)) {
......
'use strict';
const Controller = require('egg').Controller;
class ScriptController extends Controller {
constructor(ctx) {
super(ctx);
this.cityListRule = {
appKey: 'string',
};
}
async partnerScripts() {
const { ctx, service } = this;
try {
ctx.validate(this.cityListRule, ctx.query);
const { appKey } = ctx.query;
ctx.logger.info('partnerScripts', appKey)
let limitScriptsList = false;
const ret = await service.partner.fetchInfo(appKey);
if (ret) {
limitScriptsList = ret.itExcludeScripts;
} else {
return ctx.body = {
code: -1,
msg: '无效的appKey'
};
}
let data = await service.scripts.fetchScripts();
if (limitScriptsList) {
data = data.filter(item => {
if (item.state === 'offline' || item.state === 'online') {
return !(limitScriptsList.includes(item.id));
}
});
}
ctx.body = {
code: 0,
data,
};
} catch (err) {
ctx.logger.info(err);
}
}
}
module.exports = ScriptController;
......@@ -8,9 +8,11 @@ module.exports = app => {
const taxRouter = router.namespace(app.config.projectRootPath);
taxRouter.get('/getCity', controller.task.cityConfigs);// 获取城市基础配置项
taxRouter.get('/getCity', controller.task.cityConfigs);// 获取城市基础配置项 老接口备用
taxRouter.get('/getorderSn/:appKey/:cityId', controller.order.fetchOrderId);// 合作方获取订单号
taxRouter.get('/getCityList', controller.script.partnerScripts);// 获取城市基础配置项 新接口
taxRouter.get('/getorderSn', controller.order.fetchOrderId);// 合作方获取订单号
taxRouter.post('/getCode', controller.task.fetchCapture);// 获取验证码
......
......@@ -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',
......@@ -26,15 +25,19 @@ module.exports = () => {
};
config.partnerAPI = {
host: 'https://dev-nginx.jianbing.com/zeus-api/v1',
fetchTheme: '/chaos/partners/theme',
host: 'https://uat-nginx.jianbing.com/zeus-api/v1',
fetchTheme: '/chaos/theme',
fetchScripts: '/chaos/partners/scripts',
redisThemePrefix: 'URANUS.HF.PARNTERS.THEME',
redisScriptsPrefix: 'URANUS.HF.PARNTERS.SCRIPTS',
fetchAgreements: '/chaos/agreements',
fetchInfo: '/chaos/partner',
redisThemePrefix: 'URANUS.IT.PARNTERS.THEME',
redisScriptsPrefix: 'URANUS.IT.PARNTERS.SCRIPTS',
redisAgreementsPrefix: 'URANUS.IT.PARNTERS.Agreements',
redisInfoPrefix: 'URANUS.IT.PARNTERS.Info',
};
config.scriptsAPI = {
host: 'https://dev-nginx.jianbing.com/zeus-api/v1',
host: 'https://uat-nginx.jianbing.com/zeus-api/v1',
fetchScriptsUrl: '/chaos/it/two_dimension_array/queries',
fetchOneScriptUrl: '/chaos/it/two_dimension_array/info',
fetchParamsInfoUrl: '/chaos/it/login_param_map',
......@@ -101,4 +104,4 @@ module.exports = () => {
config.callbackUrl = 'https://dev-nginx.jianbing.com/tax_api/callback';
return config;
};
};
\ No newline at end of file
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