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 { ...@@ -6,6 +6,11 @@ class OrderController extends Controller {
constructor(ctx) { constructor(ctx) {
super(ctx); super(ctx);
this.fetchOrderIdRule = {
appKey: 'string',
cityId: 'string'
};
this.showRule = { this.showRule = {
sign: 'string', sign: 'string',
params: { params: {
...@@ -79,7 +84,8 @@ class OrderController extends Controller { ...@@ -79,7 +84,8 @@ class OrderController extends Controller {
async fetchOrderId() { async fetchOrderId() {
const { ctx, service } = this; const { ctx, service } = this;
try { try {
const { appKey, cityId } = ctx.params; ctx.validate(this.fetchOrderIdRule, ctx.query);
const { appKey, cityId } = ctx.query;
// const appKeyInfo = await service.partner.fetchInfo(appKey); // const appKeyInfo = await service.partner.fetchInfo(appKey);
// ctx.logger.info(appKey, ',appKeyInfo,', appKeyInfo); // ctx.logger.info(appKey, ',appKeyInfo,', appKeyInfo);
// if (!(appKeyInfo && appKeyInfo.valid === true && appKeyInfo.enableIt === true)) { // 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 => { ...@@ -8,9 +8,11 @@ module.exports = app => {
const taxRouter = router.namespace(app.config.projectRootPath); 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);// 获取验证码 taxRouter.post('/getCode', controller.task.fetchCapture);// 获取验证码
......
...@@ -16,7 +16,6 @@ module.exports = () => { ...@@ -16,7 +16,6 @@ module.exports = () => {
}; };
config.taskAPI = { config.taskAPI = {
host: 'http://tm.51gjj.com:6824', host: 'http://tm.51gjj.com:6824',
newhost: 'http://tt.51gjj.com:7001',
fetchHubsUrl: '', fetchHubsUrl: '',
createTaskUrl: '/IncomeTax/createItTask', createTaskUrl: '/IncomeTax/createItTask',
fetchCodeUrl: '/IncomeTax/getItCode', fetchCodeUrl: '/IncomeTax/getItCode',
...@@ -26,15 +25,19 @@ module.exports = () => { ...@@ -26,15 +25,19 @@ module.exports = () => {
}; };
config.partnerAPI = { config.partnerAPI = {
host: 'https://dev-nginx.jianbing.com/zeus-api/v1', host: 'https://uat-nginx.jianbing.com/zeus-api/v1',
fetchTheme: '/chaos/partners/theme', fetchTheme: '/chaos/theme',
fetchScripts: '/chaos/partners/scripts', fetchScripts: '/chaos/partners/scripts',
redisThemePrefix: 'URANUS.HF.PARNTERS.THEME', fetchAgreements: '/chaos/agreements',
redisScriptsPrefix: 'URANUS.HF.PARNTERS.SCRIPTS', 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 = { 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', fetchScriptsUrl: '/chaos/it/two_dimension_array/queries',
fetchOneScriptUrl: '/chaos/it/two_dimension_array/info', fetchOneScriptUrl: '/chaos/it/two_dimension_array/info',
fetchParamsInfoUrl: '/chaos/it/login_param_map', fetchParamsInfoUrl: '/chaos/it/login_param_map',
......
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