Commit 3aa9ffa3 by 王栋源

wdy

parent f93e5843
......@@ -7,6 +7,7 @@ module.exports = (db, DataTypes) => {
needNo :DataTypes.STRING(64), //需求单号
needDesc :DataTypes.STRING(255), //
needUserMoblie :DataTypes.STRING(20), //
needUserName :DataTypes.STRING(20), //
notes :DataTypes.STRING(255), //
opNotes :DataTypes.STRING(500), //
channelUserName :DataTypes.STRING(50), // 渠道用户登录名
......
......@@ -7,29 +7,30 @@ class NeedInfoService extends ServiceBase {
super("dbneed", ServiceBase.getDaoName(NeedInfoService));
}
async subNeed(obj,req){
async subNeed(obj, req) {
var user = obj.channelUser;
var app = req.app;
// if(!user){
// return system.getResultFail(-100, "未知用户");
// }
if(!app){
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.channelUserId,
itemCode:obj.itemCode
var needNo = await this.getBusUid("ni");
var needObj = {
app_id: app.id,
needNo: needNo,
needDesc: obj.needDesc,
needUserMoblie: obj.needUserMoblie,
needUserName: obj.needUserName,
notes: obj.notes,
channelUserName: user.channelUserName,
auditStatus: "00",
createuser_id: user.channelUserId,
itemCode: obj.itemCode
};
var need = await this.dao.create(needObj);
return system.getResultSuccess(need);
}
}
module.exports=NeedInfoService;
module.exports = NeedInfoService;
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