Commit f93e5843 by 王栋源

wdy

parent 9a1f666d
......@@ -36,7 +36,7 @@ class NeedOrderAPI extends APIBase {
// }
return result;
}
async opActionProcess(action_process, action_type, action_body) {
async opActionProcess(action_process, action_type, action_body,pobj,req) {
var opResult = null;
switch (action_type) {
// sy
......@@ -44,7 +44,7 @@ class NeedOrderAPI extends APIBase {
opResult = system.getResultSuccess(null, "测试成功");
break;
case "subNeed"://提交需求
opResult = await this.needinfoSve.subNeed(action_body);
opResult = await this.needinfoSve.subNeed(action_body,req);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
......
......@@ -25,6 +25,31 @@ class BusinesschanceService extends ServiceBase {
return payUserIds;
}
async subNeed(obj){
var user = obj.user;
var app = obj.app;
if(!user){
return system.getResultFail(-100, "未知用户");
}
if(!app){
return system.getResultFail(-101, "未知渠道");
}
var needNo=await this.getBusUid("ni");
var needObj={
app_id :app.id,
needNo :needNo,
needDesc :obj.needDesc,
needUserMoblie :obj.needUserMoblie,
notes :obj.notes,
channelUserName :user.channelUserName,
auditStatus :"00",
createuser_id :user.id,
itemCode:obj.itemCode
};
var need = await this.dao.create(needObj);
return system.getResultSuccess(need);
}
async zc2channel() {
try {
var lastsql = "select id from h_business_chance order by id desc";
......
......@@ -7,12 +7,12 @@ class NeedInfoService extends ServiceBase {
super("dbneed", ServiceBase.getDaoName(NeedInfoService));
}
async subNeed(obj){
var user = obj.user;
var app = obj.app;
if(!user){
return system.getResultFail(-100, "未知用户");
}
async subNeed(obj,req){
var user = obj.channelUser;
var app = req.app;
// if(!user){
// return system.getResultFail(-100, "未知用户");
// }
if(!app){
return system.getResultFail(-101, "未知渠道");
}
......@@ -25,7 +25,7 @@ class NeedInfoService extends ServiceBase {
notes :obj.notes,
channelUserName :user.channelUserName,
auditStatus :"00",
createuser_id :user.id,
createuser_id :user.channelUserId,
itemCode:obj.itemCode
};
var need = await this.dao.create(needObj);
......
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