Commit d5263e10 authored by 姜登's avatar 姜登

yys

parent e7a260ca
...@@ -61,11 +61,11 @@ class OrderController extends Controller { ...@@ -61,11 +61,11 @@ class OrderController extends Controller {
async create() { async create() {
const { ctx, service } = this; const { ctx, service } = this;
ctx.validate(this.createRule); ctx.validate(this.createRule);
const { appKey, userId, notifyUrl, backUrl, orderId, phone } = ctx.request.body; const { appKey, userId, notifyUrl, backUrl, orderId, phone, netMark } = ctx.request.body;
// const appKeyInfo = await service.partner.fetchInfo(appKey); const appKeyInfo = await service.partner.fetchInfo(appKey);
// if (!(appKeyInfo && appKeyInfo.valid === true && appKeyInfo.enableYys === true)) { if (!(appKeyInfo && appKeyInfo.valid === true && appKeyInfo.enableYys === true)) {
// return ctx.fail('未开通此服务'); return ctx.fail('未开通此服务');
// } }
const areaInfo = await service.task.phoneArea(phone); const areaInfo = await service.task.phoneArea(phone);
const object = { const object = {
orderId, orderId,
...@@ -77,6 +77,7 @@ class OrderController extends Controller { ...@@ -77,6 +77,7 @@ class OrderController extends Controller {
phone, phone,
city: areaInfo.province, city: areaInfo.province,
operator: areaInfo.operator, operator: areaInfo.operator,
netMark,
}; };
if (orderId) { if (orderId) {
await service.order.update(object); await service.order.update(object);
......
...@@ -141,8 +141,8 @@ class TaskController extends Controller { ...@@ -141,8 +141,8 @@ class TaskController extends Controller {
if (!order) { if (!order) {
throw new Error('任务不存在'); throw new Error('任务不存在');
} }
const { orderId } = order; const { orderId, netMark } = order;
await service.washData.wash(result, orderId); await service.washData.wash(result, orderId, netMark);
await service.cache.set({ await service.cache.set({
key: taskId, key: taskId,
value: taskNote, value: taskNote,
......
...@@ -66,6 +66,12 @@ module.exports = app => { ...@@ -66,6 +66,12 @@ module.exports = app => {
allowNull: true, allowNull: true,
field: 'status', field: 'status',
}, },
netMark: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: 0,
field: 'netMark',
},
note: { note: {
type: DataTypes.STRING(8000), type: DataTypes.STRING(8000),
allowNull: true, allowNull: true,
......
...@@ -9,13 +9,13 @@ class WashDataService extends Service { ...@@ -9,13 +9,13 @@ class WashDataService extends Service {
this.washUrl = config.washAPI.host + config.washAPI.washUrl; this.washUrl = config.washAPI.host + config.washAPI.washUrl;
this.callbackUrl = config.dataCallbackUrl; this.callbackUrl = config.dataCallbackUrl;
} }
async wash(data, orderId) { async wash(data, orderId, netMark = 0) {
const { app, washUrl, ctx } = this; const { app, washUrl, ctx } = this;
const rawdata = { const rawdata = {
data, data,
callbackUrl: this.callbackUrl, callbackUrl: this.callbackUrl,
orderId, orderId,
netMark: 0, netMark,
}; };
const washData = await app.curl(washUrl, const washData = await app.curl(washUrl,
{ {
...@@ -32,17 +32,6 @@ class WashDataService extends Service { ...@@ -32,17 +32,6 @@ class WashDataService extends Service {
} }
return washData.data; return washData.data;
} }
_switchData(data) {
const tmp = data.data;
const bar = {};
bar.taskId = tmp.taskId;
bar.cityId = tmp.cityId;
bar.data = JSON.parse(tmp.data);
bar.orderID = 'ttt';
bar.appKey = '';
return bar;
}
} }
module.exports = WashDataService; module.exports = WashDataService;
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