Commit b6b4af72 authored by 高诸锋's avatar 高诸锋

[fix]

parent 8f3344e8
Pipeline #6704 passed with stage
in 4 seconds
......@@ -139,9 +139,11 @@ class TaskController extends Controller {
if (!order) {
throw new Error(`【taskId】:${taskId} 任务已经结束.`);
}
const { orderId, appKey, notifyUrl, userId } = order;
const { orderId, appKey, notifyUrl, userId, cityId } = order;
insertData.orderId = orderId;
insertData.cityName = result.data.jsName.split('.')[0];
// insertData.cityName = result.data.jsName.split('.')[0];
insertData.jsName = result.data.jsName;
insertData.cityName = ctx.app.cityNameMap.get(cityId);
// TODO insertData.cityId -> cityName
insertData.taskId = taskId;
insertData.appKey = appKey;
......
'use strict';
module.exports = {
schedule: {
interval: '5m', // 5分钟间隔
type: 'all', // 所有woker
immediate: true,
},
async task(ctx) {
try {
const result = await ctx.javaSb.query('SELECT id, name FROM shebao_city', { type: 'SELECT' });
const cityNameMap = new Map();
for (const item of result) {
cityNameMap.set(String(item.id), item.name);
}
ctx.app.cityNameMap = cityNameMap;
console.log(ctx.app.cityNameMap);
} catch (e) {
ctx.logger.error(e);
}
},
};
......@@ -11,6 +11,7 @@ module.exports = () => {
fetchCodeUrl: '/shebao/getSbCode',
submitTaskUrl: '/shebao/loginSbWeb',
fetchTaskUrl: '/shebao/getSbData', // 获取该task状态
redisTaskPrefix: 'DATA_SERVER_SHEBAO.TASK',
};
config.partnerAPI = {
......@@ -34,6 +35,8 @@ module.exports = () => {
fetchHelpUrl: '/chaos/ss/help',
fetchNoticeUrl: '/chaos/ss/notice',
fetchHubSeriptsUrl: '/chaos/ss/hubs',
centersInfoUrl: 'https://t.51gjj.com/shebao/centersInfo',
cityInfoUrl: 'https://t.51gjj.com/shebao/cityConfig',
fetchScriptByCityNameUrl: '/chaos/ss/city_scripts',
redisScriptsKey: 'DATA_SERVER_SHEBAO.SCRIPTS',
redisParamsKey: 'DATA_SERVER_SHEBAO.PARAMS',
......@@ -95,11 +98,11 @@ module.exports = () => {
}, {
// 东八时区
timezone: '+08:00',
delegate: 'cusPro',
delegate: 'javaSb',
baseDir: 'model',
dialect: 'mysql',
host: 'rm-bp1272001633qc0x9o.mysql.rds.aliyuncs.com',
database: 'java_open_platform',
database: 'java_sb',
username: 'hexin',
password: 'gYUHszn9#q',
port: 3306,
......
......@@ -20,6 +20,10 @@ module.exports = () => {
fetchScripts: '/chaos/partners/scripts',
redisThemePrefix: 'DATA_SERVER_SHEBAO.PARNTERS.THEME',
redisScriptsPrefix: 'DATA_SERVER_SHEBAO.PARNTERS.SCRIPTS',
fetchAgreements: '/chaos/agreements',
redisAgreementsPrefix: 'DATA_SERVER_SHEBAO.AGREEMENTS',
fetchInfo: '/chaos/partner',
redisInfoPrefix: 'DATA_SERVER_SHEBAO.PARTNERINFO',
};
config.scriptsAPI = {
......@@ -36,6 +40,7 @@ module.exports = () => {
fetchScriptByCityNameUrl: '/chaos/ss/city_scripts',
redisScriptsKey: 'DATA_SERVER_SHEBAO.SCRIPTS',
redisParamsKey: 'DATA_SERVER_SHEBAO.PARAMS',
redisScriptListKey: 'DATA_SERVER_SHEBAO.SCRIPTLIST',
};
config.storageAPI = {
......@@ -66,6 +71,7 @@ module.exports = () => {
fecteToken: 'NEWSB.SS.TOKEN.LOCK',
token: 'NEWSB.SS.TOKEN',
fecthParnters: 'NEWSB.PARNTERS.LOCK',
taskPrefix: 'NEWSB.TASK',
};
config.sequelize = {
......@@ -83,7 +89,7 @@ module.exports = () => {
}, {
// 东八时区
timezone: '+08:00',
delegate: 'cusPro',
delegate: 'javaSb',
baseDir: 'model',
dialect: 'mysql',
host: process.env.MYSQL_PACHONG_HOST,
......
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