Commit 396d21dc authored by 姜登's avatar 姜登

兼容公积金创建任务修改

parent a20ccc1f
Pipeline #4015 passed with stage
in 2 seconds
...@@ -40,9 +40,9 @@ class TaskController extends Controller { ...@@ -40,9 +40,9 @@ class TaskController extends Controller {
async create() { async create() {
const { ctx, service } = this; const { ctx, service } = this;
ctx.validate(this.createRule); ctx.validate(this.createRule);
const { scriptId, orderId } = ctx.request.body; const { scriptId, orderId, userId } = ctx.request.body;
const taskId = await service.task.create(scriptId); const taskId = await service.task.create(scriptId);
await service.order.update({ orderId, cityId: scriptId, taskId }); await service.order.update({ orderId, cityId: scriptId, taskId, userId });
await service.cache.set({ await service.cache.set({
key: taskId, key: taskId,
value: { status: 'init', note: { message: 'init' } }, value: { status: 'init', note: { message: 'init' } },
......
...@@ -40,7 +40,11 @@ class OrderService extends Service { ...@@ -40,7 +40,11 @@ class OrderService extends Service {
} }
const { appKey, taskId, notifyUrl, backUrl, userId } = order; const { appKey, taskId, notifyUrl, backUrl, userId } = order;
if (taskId) { if (taskId) {
await ctx.model.TaskStatus.create({ appKey, status: 'init', notifyUrl, backUrl, userId, ...params }) if (params.userId) {
await ctx.model.TaskStatus.create({ appKey, status: 'init', notifyUrl, backUrl, ...params })
} else {
await ctx.model.TaskStatus.create({ appKey, status: 'init', notifyUrl, backUrl, ...params, userId })
}
} else { } else {
await order.update(params); await order.update(params);
} }
......
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