Commit e044b590 by 王勇飞

pp

parent f2b174cc
......@@ -124,6 +124,12 @@ class BizOptCtl extends CtlBase {
let res = await this.service.updateStatusByDemandCode(pobj);
//TODO 同步该需求关闭信息到其他系统
//添加到记录表
pobj.operator = {
id: mobj.userid ? mobj.userid : "",
name: mobj.username ? mobj.username : ""
}
let recordRes = await this.operationrecordSve.insertInfo(pobj);
return system.getResult("关闭需求成功!");
} catch (error) {
return system.getResultError("bizoptCtl/closeBizopt 关闭需求出错!");
......
......@@ -5,6 +5,7 @@ const appconfig = system.getSysConfig();
class OperationrecordCtl extends CtlBase {
constructor() {
super("bizchance", CtlBase.getServiceName(OperationrecordCtl));
this.bizoptSve = system.getObject("service.bizchance.bizoptSve");
}
/**
......@@ -34,17 +35,34 @@ class OperationrecordCtl extends CtlBase {
* @param {*} mobj
* {
demand_code: "",//需求编号
operator: { id: "", name: "" },//操作人
operation_type: "",//操作类型
operation_details: {}//操作详细记录
}
*/
async insertInfo(mobj, qobj, req) {
let pobj = mobj.d;
//取请求头中的userid和name
pobj.operator = {
id: mobj.userid ? mobj.userid : "",
name: mobj.username ? mobj.username : ""
}
try {
if (!pobj.demand_code) {
return system.getResultError("fitaxschemeCtl/insertInfo 缺少需求编号!");
}
if (pobj.operation_type == "followUp") {
if (pobj.operation_details.intention) {
let obj = { demand_code: pobj.demand_code }
if (pobj.operation_details.intention == "方案") {
//状态修改为 '待确认方案'
obj.business_status = "beforeSubmission";
} else {
//状态修改为'跟进中'
obj.business_status = "followingUp";
}
let bizoptRes = await this.bizoptSve.updateStatusByDemandCode(obj);
}
}
let insertRes = await this.service.insertInfo(pobj);
return system.getResult("添加记录信息成功!");
} catch (error) {
......
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