Commit 0603b1dc by 庄冰

ic

parent 4cf33156
...@@ -20,6 +20,7 @@ module.exports = (db, DataTypes) => { ...@@ -20,6 +20,7 @@ module.exports = (db, DataTypes) => {
} }
}, },
statusName: DataTypes.STRING(50), //状态名称 statusName: DataTypes.STRING(50), //状态名称
createUserId: DataTypes.INTEGER, //创建者id
}, { }, {
paranoid: true,//假的删除 paranoid: true,//假的删除
underscored: true, underscored: true,
......
...@@ -12,6 +12,11 @@ class NeedsolutionService extends ServiceBase { ...@@ -12,6 +12,11 @@ class NeedsolutionService extends ServiceBase {
//提交方案 //提交方案
async submitProgramme(pobj){ async submitProgramme(pobj){
var ab = pobj.actionBody; var ab = pobj.actionBody;
var user = pobj.userInfo;
if(!user || !user.id){
return system.getResultFail(-100,"未知用户");
}
ab["createUserId"]=user.id;
if(!ab.needNo){ if(!ab.needNo){
return system.getResultFail(-101,"需求号不能为空"); return system.getResultFail(-101,"需求号不能为空");
} }
...@@ -70,12 +75,20 @@ class NeedsolutionService extends ServiceBase { ...@@ -70,12 +75,20 @@ class NeedsolutionService extends ServiceBase {
//根据需求查看方案列表 //根据需求查看方案列表
async getProgrammeInfoByNeedNo(pobj){ async getProgrammeInfoByNeedNo(pobj){
var ab = pobj.actionBody; var ab = pobj.actionBody;
// followManMobile: DataTypes.STRING,//跟进人手机号(合伙人)
// followManOnlyCode: DataTypes.STRING(50),//跟进者唯一码
if(!ab.needNo){ if(!ab.needNo){
return system.getResultFail(-101,"需求号不能为空"); return system.getResultFail(-101,"需求号不能为空");
} }
// if(!ab.followManMobile){
// return system.getResultFail(-102,"跟进人手机号不能为空");
// }
if(!ab.followManOnlyCode){
return system.getResultFail(-103,"跟进人唯一码不能为空");
}
//获取需求信息 //获取需求信息
var needinfo = await this.needinfoDao.model.findOne({ var needinfo = await this.needinfoDao.model.findOne({
where:{needNo:ab.needNo},raw:true where:{needNo:ab.needNo,followManOnlyCode:ab.followManOnlyCode},raw:true
}); });
if(!needinfo || !needinfo.id){ if(!needinfo || !needinfo.id){
return system.getResultFail(-102,"未知需求信息"); return system.getResultFail(-102,"未知需求信息");
...@@ -129,12 +142,16 @@ class NeedsolutionService extends ServiceBase { ...@@ -129,12 +142,16 @@ class NeedsolutionService extends ServiceBase {
//服务商方案作废 //服务商方案作废
async abolishProgramme(pobj){ async abolishProgramme(pobj){
var ab = pobj.actionBody; var ab = pobj.actionBody;
var user = pobj.userInfo;
if(!user || !user.id){
return system.getResultFail(-100,"未知用户");
}
if(!ab.solutionNo){ if(!ab.solutionNo){
return system.getResultFail(-101,"方案号不能为空"); return system.getResultFail(-101,"方案号不能为空");
} }
//获取方案信息 //获取方案信息
var ns = await this.dao.model.findOne({ var ns = await this.dao.model.findOne({
where:{solutionNo:ab.solutionNo},raw:true where:{solutionNo:ab.solutionNo,createUserId:user.id},raw:true
}); });
if(!ns || !ns.id){ if(!ns || !ns.id){
return system.getResultFail(-102,"未知方案"); return system.getResultFail(-102,"未知方案");
......
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