Commit 9be6d4ad authored by 何娜's avatar 何娜

fix通知

parent 04d6d96b
Pipeline #6179 passed with stage
in 2 seconds
...@@ -80,6 +80,7 @@ class OrderController extends Controller { ...@@ -80,6 +80,7 @@ class OrderController extends Controller {
const result = await service.signature.partnerOrderId(ctx.request.body); const result = await service.signature.partnerOrderId(ctx.request.body);
await service.order.create({ await service.order.create({
orderId: result.data.orderSn, orderId: result.data.orderSn,
notifyUrl: ctx.app.notifyMap.get(appKey) && ctx.app.notifyMap.get(appKey).notifyUrl || '',
taskId: '', taskId: '',
userId: '', userId: '',
cityId: '', cityId: '',
......
...@@ -87,7 +87,6 @@ class TaskController extends Controller { ...@@ -87,7 +87,6 @@ class TaskController extends Controller {
async handleCallback() { async handleCallback() {
const {ctx, service} = this; const {ctx, service} = this;
ctx.logger.info('【handleCallback】', ctx.request.body);
const {taskId} = ctx.request.body; const {taskId} = ctx.request.body;
const result = await service.task.fetchTask({taskId}); const result = await service.task.fetchTask({taskId});
ctx.success(); ctx.success();
...@@ -133,15 +132,9 @@ class TaskController extends Controller { ...@@ -133,15 +132,9 @@ class TaskController extends Controller {
if (!order) { if (!order) {
throw new Error('任务已经结束了'); throw new Error('任务已经结束了');
} }
const {orderId, appkey} = order; const {orderId} = order;
const script = await service.scripts.fetchOneScripts(result.data.cityId);
result.cityId = Number(result.data.cityId);
result.cityName = script.hub_name || 'unknown';
result.taskId = taskId;
result.data = JSON.parse(result.data.data); result.data = JSON.parse(result.data.data);
result.orderSn = orderId;
result.orderId = orderId; result.orderId = orderId;
result.appKey = appkey;
delete result.code; delete result.code;
delete result.msg; delete result.msg;
await service.storage.write(result); await service.storage.write(result);
......
...@@ -103,6 +103,12 @@ module.exports = app => { ...@@ -103,6 +103,12 @@ module.exports = app => {
defaultValue: '', defaultValue: '',
field: 'text3', field: 'text3',
}, },
notice: {
type: DataTypes.STRING(2),
allowNull: true,
defaultValue: '',
field: 'notice',
},
}, { }, {
tableName: 'xuexin_status', tableName: 'xuexin_status',
// timestamps: false, // timestamps: false,
......
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